@xyo-network/react-embed 2.60.11 → 2.61.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/components/embed-card/card/EmbedCardHeader.js +4 -2
- package/dist/cjs/components/embed-card/card/EmbedCardHeader.js.map +1 -1
- package/dist/esm/components/embed-card/card/EmbedCardHeader.js +4 -2
- package/dist/esm/components/embed-card/card/EmbedCardHeader.js.map +1 -1
- package/dist/types/components/embed-card/card/EmbedCardHeader.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/components/embed-card/card/EmbedCardHeader.tsx +5 -3
- package/dist/docs.json +0 -4991
@@ -10,10 +10,12 @@ const contexts_1 = require("../../../contexts");
|
|
10
10
|
const menu_1 = require("../menu");
|
11
11
|
const EmbedCardHeader = () => {
|
12
12
|
var _a;
|
13
|
-
const {
|
13
|
+
const { refreshHuri, huri } = (0, contexts_1.useResolvePayload)();
|
14
14
|
const { activePlugin, timestampLabel, hideElementsConfig } = (0, contexts_1.useEmbedPluginState)();
|
15
15
|
const { hideAvatar, hideTitle, hideRefreshButton, hideTimestamp, hideCardActions } = hideElementsConfig !== null && hideElementsConfig !== void 0 ? hideElementsConfig : {};
|
16
|
-
|
16
|
+
//this is temporary so that we can add the ability to get a timestamp via diviner later
|
17
|
+
const timestamp = Date.now();
|
18
|
+
return ((0, jsx_runtime_1.jsx)(material_1.CardHeader, { sx: { flexWrap: 'wrap', rowGap: 1 }, avatar: hideAvatar ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) : ((0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ sx: { bgcolor: (theme) => theme.palette.primary.main }, "aria-label": activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.name }, { children: (_a = activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.name) === null || _a === void 0 ? void 0 : _a.charAt(0) }))), action: (0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexRow, Object.assign({ flexWrap: "wrap", columnGap: 0.5 }, { children: [timestamp ? (hideTimestamp && hideRefreshButton ? ('') : ((0, jsx_runtime_1.jsx)(material_1.Chip, { avatar: hideRefreshButton ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}) : (0, jsx_runtime_1.jsx)(Refresh_1.default, {}), clickable: hideRefreshButton ? false : true, onClick: refreshHuri, label: hideTimestamp ? '' : `${timestampLabel} ${new Date(timestamp).toLocaleString()}` }))) : null, hideCardActions || huri === undefined ? null : (0, jsx_runtime_1.jsx)(menu_1.EmbedMenu, {})] })), title: hideTitle ? '' : activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.name }));
|
17
19
|
};
|
18
20
|
exports.EmbedCardHeader = EmbedCardHeader;
|
19
21
|
//# sourceMappingURL=EmbedCardHeader.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EmbedCardHeader.js","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedCardHeader.tsx"],"names":[],"mappings":";;;;;AAAA,kFAAqD;AACrD,4CAAgF;AAChF,yDAA+C;AAE/C,gDAA0E;AAC1E,kCAAmC;AAE5B,MAAM,eAAe,GAA8B,GAAG,EAAE;;IAC7D,MAAM,EAAE,
|
1
|
+
{"version":3,"file":"EmbedCardHeader.js","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedCardHeader.tsx"],"names":[],"mappings":";;;;;AAAA,kFAAqD;AACrD,4CAAgF;AAChF,yDAA+C;AAE/C,gDAA0E;AAC1E,kCAAmC;AAE5B,MAAM,eAAe,GAA8B,GAAG,EAAE;;IAC7D,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,IAAA,4BAAiB,GAAE,CAAA;IACjD,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,IAAA,8BAAmB,GAAE,CAAA;IAClF,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,kBAAkB,aAAlB,kBAAkB,cAAlB,kBAAkB,GAAI,EAAE,CA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,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,GAC1C,CACH,CAAA;AACH,CAAC,CAAA;AAvCY,QAAA,eAAe,mBAuC3B"}
|
@@ -5,9 +5,11 @@ import { FlexRow } from '@xylabs/react-flexbox';
|
|
5
5
|
import { useEmbedPluginState, useResolvePayload } from '../../../contexts';
|
6
6
|
import { EmbedMenu } from '../menu';
|
7
7
|
export const EmbedCardHeader = () => {
|
8
|
-
const {
|
8
|
+
const { refreshHuri, huri } = useResolvePayload();
|
9
9
|
const { activePlugin, timestampLabel, hideElementsConfig } = useEmbedPluginState();
|
10
10
|
const { hideAvatar, hideTitle, hideRefreshButton, hideTimestamp, hideCardActions } = hideElementsConfig ?? {};
|
11
|
-
|
11
|
+
//this is temporary so that we can add the ability to get a timestamp via diviner later
|
12
|
+
const timestamp = Date.now();
|
13
|
+
return (_jsx(CardHeader, { sx: { flexWrap: 'wrap', rowGap: 1 }, avatar: hideAvatar ? (_jsx(_Fragment, {})) : (_jsx(Avatar, { sx: { bgcolor: (theme) => theme.palette.primary.main }, "aria-label": activePlugin?.name, children: activePlugin?.name?.charAt(0) })), action: _jsxs(FlexRow, { flexWrap: "wrap", columnGap: 0.5, children: [timestamp ? (hideTimestamp && hideRefreshButton ? ('') : (_jsx(Chip, { avatar: hideRefreshButton ? _jsx(_Fragment, {}) : _jsx(RefreshIcon, {}), clickable: hideRefreshButton ? false : true, onClick: refreshHuri, label: hideTimestamp ? '' : `${timestampLabel} ${new Date(timestamp).toLocaleString()}` }))) : null, hideCardActions || huri === undefined ? null : _jsx(EmbedMenu, {})] }), title: hideTitle ? '' : activePlugin?.name }));
|
12
14
|
};
|
13
15
|
//# sourceMappingURL=EmbedCardHeader.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EmbedCardHeader.js","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedCardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAmB,IAAI,EAAS,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,MAAM,CAAC,MAAM,eAAe,GAA8B,GAAG,EAAE;IAC7D,MAAM,EAAE,
|
1
|
+
{"version":3,"file":"EmbedCardHeader.js","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedCardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAmB,IAAI,EAAS,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,MAAM,CAAC,MAAM,eAAe,GAA8B,GAAG,EAAE;IAC7D,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,iBAAiB,EAAE,CAAA;IACjD,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,mBAAmB,EAAE,CAAA;IAClF,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,kBAAkB,IAAI,EAAE,CAAA;IAC7G,uFAAuF;IACvF,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IAC5B,OAAO,CACL,KAAC,UAAU,IACT,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,EACnC,MAAM,EACJ,UAAU,CAAC,CAAC,CAAC,CACX,mBAAK,CACN,CAAC,CAAC,CAAC,CACF,KAAC,MAAM,IAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,gBAAc,YAAY,EAAE,IAAI,YAClG,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,GACvB,CACV,EAEH,MAAM,EACJ,MAAC,OAAO,IAAC,QAAQ,EAAC,MAAM,EAAC,SAAS,EAAE,GAAG,aACpC,SAAS,CAAC,CAAC,CAAC,CACX,aAAa,IAAI,iBAAiB,CAAC,CAAC,CAAC,CACnC,EAAE,CACH,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IACH,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,mBAAK,CAAC,CAAC,CAAC,KAAC,WAAW,KAAG,EACnD,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAC3C,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,cAAc,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,cAAc,EAAE,EAAE,GACvF,CACH,CACF,CAAC,CAAC,CAAC,IAAI,EAEP,eAAe,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,SAAS,KAAG,IACrD,EAEZ,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,IAAI,GAC1C,CACH,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EmbedCardHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedCardHeader.tsx"],"names":[],"mappings":";AACA,OAAO,EAAsB,eAAe,EAAe,MAAM,eAAe,CAAA;AAMhF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
1
|
+
{"version":3,"file":"EmbedCardHeader.d.ts","sourceRoot":"","sources":["../../../../../src/components/embed-card/card/EmbedCardHeader.tsx"],"names":[],"mappings":";AACA,OAAO,EAAsB,eAAe,EAAe,MAAM,eAAe,CAAA;AAMhF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAuCrD,CAAA"}
|
package/package.json
CHANGED
@@ -10,26 +10,26 @@
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
11
11
|
},
|
12
12
|
"dependencies": {
|
13
|
-
"@xylabs/delay": "^2.
|
13
|
+
"@xylabs/delay": "^2.10.11",
|
14
14
|
"@xylabs/react-async-effect": "~2.17.15",
|
15
15
|
"@xylabs/react-flexbox": "~2.17.15",
|
16
16
|
"@xylabs/react-shared": "~2.17.15",
|
17
|
-
"@xyo-network/huri": "^2.
|
18
|
-
"@xyo-network/payload-model": "^2.
|
19
|
-
"@xyo-network/react-error": "~2.
|
20
|
-
"@xyo-network/react-payload-plugin": "~2.
|
21
|
-
"@xyo-network/react-shared": "~2.
|
22
|
-
"@xyo-network/schema-cache": "^2.
|
17
|
+
"@xyo-network/huri": "^2.73.3",
|
18
|
+
"@xyo-network/payload-model": "^2.73.3",
|
19
|
+
"@xyo-network/react-error": "~2.61.0",
|
20
|
+
"@xyo-network/react-payload-plugin": "~2.61.0",
|
21
|
+
"@xyo-network/react-shared": "~2.61.0",
|
22
|
+
"@xyo-network/schema-cache": "^2.73.3"
|
23
23
|
},
|
24
24
|
"devDependencies": {
|
25
25
|
"@storybook/react": "^7.4.0",
|
26
26
|
"@uniswap/sdk": "^3.0.3",
|
27
|
-
"@uniswap/sdk-core": "^4.0.
|
27
|
+
"@uniswap/sdk-core": "^4.0.7",
|
28
28
|
"@uniswap/v3-sdk": "^3.10.0",
|
29
|
-
"@xylabs/ts-scripts-yarn3": "^2.19.
|
30
|
-
"@xylabs/tsconfig-react": "^2.19.
|
31
|
-
"@xyo-network/react-aggregate-price-plugin": "~2.
|
32
|
-
"@xyo-network/react-crypto-market-uniswap-plugin": "~2.
|
29
|
+
"@xylabs/ts-scripts-yarn3": "^2.19.5",
|
30
|
+
"@xylabs/tsconfig-react": "^2.19.5",
|
31
|
+
"@xyo-network/react-aggregate-price-plugin": "~2.61.0",
|
32
|
+
"@xyo-network/react-crypto-market-uniswap-plugin": "~2.61.0",
|
33
33
|
"typescript": "^5.2.2"
|
34
34
|
},
|
35
35
|
"peerDependencies": {
|
@@ -84,5 +84,5 @@
|
|
84
84
|
},
|
85
85
|
"sideEffects": false,
|
86
86
|
"types": "dist/types/index.d.ts",
|
87
|
-
"version": "2.
|
87
|
+
"version": "2.61.0"
|
88
88
|
}
|
@@ -6,9 +6,11 @@ import { useEmbedPluginState, useResolvePayload } from '../../../contexts'
|
|
6
6
|
import { EmbedMenu } from '../menu'
|
7
7
|
|
8
8
|
export const EmbedCardHeader: React.FC<CardHeaderProps> = () => {
|
9
|
-
const {
|
9
|
+
const { refreshHuri, huri } = useResolvePayload()
|
10
10
|
const { activePlugin, timestampLabel, hideElementsConfig } = useEmbedPluginState()
|
11
11
|
const { hideAvatar, hideTitle, hideRefreshButton, hideTimestamp, hideCardActions } = hideElementsConfig ?? {}
|
12
|
+
//this is temporary so that we can add the ability to get a timestamp via diviner later
|
13
|
+
const timestamp = Date.now()
|
12
14
|
return (
|
13
15
|
<CardHeader
|
14
16
|
sx={{ flexWrap: 'wrap', rowGap: 1 }}
|
@@ -23,7 +25,7 @@ export const EmbedCardHeader: React.FC<CardHeaderProps> = () => {
|
|
23
25
|
}
|
24
26
|
action={
|
25
27
|
<FlexRow flexWrap="wrap" columnGap={0.5}>
|
26
|
-
{
|
28
|
+
{timestamp ? (
|
27
29
|
hideTimestamp && hideRefreshButton ? (
|
28
30
|
''
|
29
31
|
) : (
|
@@ -31,7 +33,7 @@ export const EmbedCardHeader: React.FC<CardHeaderProps> = () => {
|
|
31
33
|
avatar={hideRefreshButton ? <></> : <RefreshIcon />}
|
32
34
|
clickable={hideRefreshButton ? false : true}
|
33
35
|
onClick={refreshHuri}
|
34
|
-
label={hideTimestamp ? '' : `${timestampLabel} ${new Date(
|
36
|
+
label={hideTimestamp ? '' : `${timestampLabel} ${new Date(timestamp).toLocaleString()}`}
|
35
37
|
/>
|
36
38
|
)
|
37
39
|
) : null}
|