@xyo-network/react-share 3.0.2 → 3.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/browser/button/ShareButton.d.ts +8 -0
- package/dist/browser/button/ShareButton.d.ts.map +1 -0
- package/dist/browser/button/index.d.ts +2 -0
- package/dist/browser/button/index.d.ts.map +1 -0
- package/dist/browser/icons/index.d.ts +2 -0
- package/dist/browser/icons/index.d.ts.map +1 -0
- package/dist/browser/icons/social/Facebook.d.ts +4 -0
- package/dist/browser/icons/social/Facebook.d.ts.map +1 -0
- package/dist/browser/icons/social/XTwitter.d.ts +4 -0
- package/dist/browser/icons/social/XTwitter.d.ts.map +1 -0
- package/dist/browser/icons/social/index.d.ts +3 -0
- package/dist/browser/icons/social/index.d.ts.map +1 -0
- package/dist/browser/index.d.ts +5 -68
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/meta-server/dynamic-share/DynamicShareImage.d.ts +6 -0
- package/dist/browser/meta-server/dynamic-share/DynamicShareImage.d.ts.map +1 -0
- package/dist/browser/meta-server/dynamic-share/index.d.ts +2 -0
- package/dist/browser/meta-server/dynamic-share/index.d.ts.map +1 -0
- package/dist/browser/meta-server/index.d.ts +3 -0
- package/dist/browser/meta-server/index.d.ts.map +1 -0
- package/dist/browser/meta-server/live-share/HideParentsFlexbox.d.ts +5 -0
- package/dist/browser/meta-server/live-share/HideParentsFlexbox.d.ts.map +1 -0
- package/dist/browser/meta-server/live-share/index.d.ts +2 -0
- package/dist/browser/meta-server/live-share/index.d.ts.map +1 -0
- package/dist/browser/out/CopyLinkTextField.d.ts +8 -0
- package/dist/browser/out/CopyLinkTextField.d.ts.map +1 -0
- package/dist/browser/out/Dialog.d.ts +14 -0
- package/dist/browser/out/Dialog.d.ts.map +1 -0
- package/dist/browser/out/Explanation.d.ts +6 -0
- package/dist/browser/out/Explanation.d.ts.map +1 -0
- package/dist/browser/out/GenerateShareLinkButton.d.ts +7 -0
- package/dist/browser/out/GenerateShareLinkButton.d.ts.map +1 -0
- package/dist/browser/out/HeadingFlexbox.d.ts +8 -0
- package/dist/browser/out/HeadingFlexbox.d.ts.map +1 -0
- package/dist/browser/out/SocialButtonsFlexbox.d.ts +7 -0
- package/dist/browser/out/SocialButtonsFlexbox.d.ts.map +1 -0
- package/dist/browser/out/index.d.ts +7 -0
- package/dist/browser/out/index.d.ts.map +1 -0
- package/package.json +52 -47
- package/src/button/ShareButton.stories.tsx +4 -4
- package/src/button/ShareButton.tsx +6 -2
- package/src/icons/social/Facebook.tsx +1 -0
- package/src/icons/social/XTwitter.tsx +3 -1
- package/src/out/CopyLinkTextField.stories.tsx +2 -6
- package/src/out/CopyLinkTextField.tsx +6 -2
- package/src/out/Dialog.stories.tsx +15 -6
- package/src/out/Dialog.tsx +6 -2
- package/src/out/Explanation.tsx +4 -1
- package/src/out/GenerateShareLinkButton.stories.tsx +2 -6
- package/src/out/GenerateShareLinkButton.tsx +6 -2
- package/src/out/HeadingFlexbox.tsx +3 -1
- package/src/out/SocialButtonsFlexbox.stories.tsx +2 -6
- package/src/out/SocialButtonsFlexbox.tsx +4 -1
- package/xy.config.ts +1 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ButtonExProps } from '@xylabs/react-button';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ShareButtonProps extends ButtonExProps {
|
|
4
|
+
prepared?: boolean;
|
|
5
|
+
shareLink?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ShareButton: React.FC<ShareButtonProps>;
|
|
8
|
+
//# sourceMappingURL=ShareButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShareButton.d.ts","sourceRoot":"","sources":["../../../src/button/ShareButton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAIzD,OAAO,KAA2B,MAAM,OAAO,CAAA;AAE/C,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA+ClD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Facebook.d.ts","sourceRoot":"","sources":["../../../../src/icons/social/Facebook.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;;CAM3B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XTwitter.d.ts","sourceRoot":"","sources":["../../../../src/icons/social/XTwitter.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;;CAK3B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/icons/social/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,68 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
7
|
-
import { WithChildren } from '@xylabs/react-shared';
|
|
8
|
-
|
|
9
|
-
interface ShareButtonProps extends ButtonExProps {
|
|
10
|
-
prepared?: boolean;
|
|
11
|
-
shareLink?: string;
|
|
12
|
-
}
|
|
13
|
-
declare const ShareButton: React.FC<ShareButtonProps>;
|
|
14
|
-
|
|
15
|
-
declare const FacebookSvgIcon: _mui_material_OverridableComponent_js.OverridableComponent<_mui_material.SvgIconTypeMap<{}, "svg">> & {
|
|
16
|
-
muiName: string;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
declare const XTwitterSvgIcon: _mui_material_OverridableComponent_js.OverridableComponent<_mui_material.SvgIconTypeMap<{}, "svg">> & {
|
|
20
|
-
muiName: string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
interface DynamicShareImageProps {
|
|
24
|
-
image: string;
|
|
25
|
-
}
|
|
26
|
-
declare const DynamicShareImage: React.FC<DynamicShareImageProps>;
|
|
27
|
-
|
|
28
|
-
declare const HideParentsFlexbox: React.FC<WithChildren & FlexBoxProps>;
|
|
29
|
-
|
|
30
|
-
interface CopyLinkTextFieldProps extends StandardTextFieldProps {
|
|
31
|
-
shareLinkName?: string;
|
|
32
|
-
shareUrl?: string;
|
|
33
|
-
}
|
|
34
|
-
declare const CopyLinkTextField: React.FC<CopyLinkTextFieldProps>;
|
|
35
|
-
|
|
36
|
-
interface ShareOutDialogProps extends DialogProps {
|
|
37
|
-
ShareOutDialogActions?: ComponentType<{
|
|
38
|
-
onClose?: () => void;
|
|
39
|
-
}>;
|
|
40
|
-
cardImg?: ReactNode;
|
|
41
|
-
shareOutDialogContent?: ReactNode;
|
|
42
|
-
subtitle?: string;
|
|
43
|
-
title?: string;
|
|
44
|
-
}
|
|
45
|
-
declare const ShareOutDialog: React.FC<ShareOutDialogProps>;
|
|
46
|
-
|
|
47
|
-
interface ShareOutExplanationProps {
|
|
48
|
-
toolTipTitle?: string;
|
|
49
|
-
}
|
|
50
|
-
declare const ShareOutExplanation: React.FC<ShareOutExplanationProps>;
|
|
51
|
-
|
|
52
|
-
interface GenerateShareLinkButtonProps extends ButtonProps {
|
|
53
|
-
loading?: boolean;
|
|
54
|
-
}
|
|
55
|
-
declare const GenerateShareLinkButton: React.FC<GenerateShareLinkButtonProps>;
|
|
56
|
-
|
|
57
|
-
interface ShareOutHeadingFlexboxProps extends FlexBoxProps {
|
|
58
|
-
shareLinkName?: string;
|
|
59
|
-
shareUrl?: string;
|
|
60
|
-
}
|
|
61
|
-
declare const ShareOutHeadingFlexbox: React.FC<ShareOutHeadingFlexboxProps>;
|
|
62
|
-
|
|
63
|
-
interface SocialButtonsFlexboxProps extends FlexBoxProps {
|
|
64
|
-
shareUrl?: string;
|
|
65
|
-
}
|
|
66
|
-
declare const SocialButtonsFlexbox: React.FC<SocialButtonsFlexboxProps>;
|
|
67
|
-
|
|
68
|
-
export { CopyLinkTextField, type CopyLinkTextFieldProps, DynamicShareImage, type DynamicShareImageProps, FacebookSvgIcon, GenerateShareLinkButton, type GenerateShareLinkButtonProps, HideParentsFlexbox, ShareButton, type ShareButtonProps, ShareOutDialog, type ShareOutDialogProps, ShareOutExplanation, type ShareOutExplanationProps, ShareOutHeadingFlexbox, type ShareOutHeadingFlexboxProps, SocialButtonsFlexbox, type SocialButtonsFlexboxProps, XTwitterSvgIcon };
|
|
1
|
+
export * from './button/index.ts';
|
|
2
|
+
export * from './icons/index.ts';
|
|
3
|
+
export * from './meta-server/index.ts';
|
|
4
|
+
export * from './out/index.ts';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gBAAgB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/button/ShareButton.tsx","../../src/icons/social/Facebook.tsx","../../src/icons/social/XTwitter.tsx","../../src/meta-server/dynamic-share/DynamicShareImage.tsx","../../src/meta-server/live-share/HideParentsFlexbox.tsx","../../src/out/CopyLinkTextField.tsx","../../src/out/Dialog.tsx","../../src/out/Explanation.tsx","../../src/out/GenerateShareLinkButton.tsx","../../src/out/HeadingFlexbox.tsx","../../src/out/SocialButtonsFlexbox.tsx"],"sourcesContent":["import { Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon } from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport type { ButtonExProps } from '@xylabs/react-button'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport React, { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({ prepared = true, shareLink, ...props }) => {\n const [expanded, setExpanded] = useState(false)\n const anchorRef = useRef(null)\n const link = shareLink ?? window.location.href\n\n return (\n <FlexRow gap={1} ref={anchorRef}>\n <ButtonEx\n variant=\"text\"\n minWidth={32}\n size=\"small\"\n disabled={!prepared}\n onClick={() => {\n setExpanded(true)\n }}\n {...props}\n >\n <ShareIcon htmlColor=\"gray\" fontSize=\"small\" />\n </ButtonEx>\n <Popover open={prepared ? expanded : false} anchorEl={anchorRef.current} onClose={() => setExpanded(false)} transitionDuration={500}>\n <FlexRow gap={0.5} padding={0.5}>\n <LinkEx\n lineHeight={0}\n style={{ color: '#1da1f2' }}\n onClick={() => {\n window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(link)}`)\n setExpanded(false)\n }}\n >\n <TwitterIcon fontSize=\"small\" />\n </LinkEx>\n <LinkEx\n lineHeight={0}\n style={{ color: '#4267b2' }}\n onClick={() => {\n window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`)\n setExpanded(false)\n }}\n >\n <FacebookIcon fontSize=\"small\" />\n </LinkEx>\n </FlexRow>\n </Popover>\n </FlexRow>\n )\n}\n","import { createSvgIcon } from '@mui/material'\nimport React from 'react'\n\nexport const FacebookSvgIcon = createSvgIcon(\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"800\" width=\"1200\" viewBox=\"-204.79995 -341.33325 1774.9329 2047.9995\">\n <path d=\"M1365.333 682.667C1365.333 305.64 1059.693 0 682.667 0 305.64 0 0 305.64 0 682.667c0 340.738 249.641 623.16 576 674.373V880H402.667V682.667H576v-150.4c0-171.094 101.917-265.6 257.853-265.6 74.69 0 152.814 13.333 152.814 13.333v168h-86.083c-84.804 0-111.25 52.623-111.25 106.61v128.057h189.333L948.4 880H789.333v477.04c326.359-51.213 576-333.635 576-674.373\" fill=\"#1877f2\" />\n <path d=\"M948.4 880l30.267-197.333H789.333V554.609C789.333 500.623 815.78 448 900.584 448h86.083V280s-78.124-13.333-152.814-13.333c-155.936 0-257.853 94.506-257.853 265.6v150.4H402.667V880H576v477.04a687.805 687.805 0 00106.667 8.293c36.288 0 71.91-2.84 106.666-8.293V880H948.4\" fill=\"#fff\" />\n </svg>\n , 'Facebook',\n)\n","import { createSvgIcon } from '@mui/material'\nimport React from 'react'\n\nexport const XTwitterSvgIcon = createSvgIcon(\n <svg viewBox=\"0 0 1200 1227\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z\" fill=\"white\" />\n </svg>\n , 'XTwitterSvgIcon')\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\n\n/**\n * The props for the DynamicShareImage component.\n */\nexport interface DynamicShareImageProps {\n /**\n * The URL of the share image for the page.\n */\n image: string\n}\n\n/**\n * Used in conjunction with the XY Meta Server to dynamically set the share image for a page.\n */\nexport const DynamicShareImage: React.FC<DynamicShareImageProps> = ({ image }) => {\n return (\n <Helmet>\n <meta property=\"xyo:og:image\" content={image} />\n </Helmet>\n )\n}\n","import type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport type { WithChildren } from '@xylabs/react-shared'\nimport React, { useEffect } from 'react'\n\nexport const HideParentsFlexbox: React.FC<WithChildren & FlexBoxProps> = ({ children, ...props }) => {\n useEffect(() => {\n const style = document.createElement('style')\n document.head.append(style)\n style.innerHTML = `\n /** make all elements hidden */\n * {\n visibility: hidden;\n }\n\n /** move the preview area to the top of the page */\n #preview-area {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 9999;\n }\n\n /** make the preview area and all its children visible */\n #preview-area * {\n visibility: visible;\n }`\n\n return () => {\n style.remove()\n }\n }, [])\n\n return (\n <FlexGrowRow alignItems=\"stretch\" id=\"preview-area\" justifyContent=\"start\" {...props}>\n {children}\n </FlexGrowRow>\n )\n}\n","import { CopyAllRounded } from '@mui/icons-material'\nimport type { StandardTextFieldProps } from '@mui/material'\nimport { IconButton, InputAdornment, TextField } from '@mui/material'\nimport { forget } from '@xylabs/forget'\nimport React, { useState } from 'react'\n\nexport interface CopyLinkTextFieldProps extends StandardTextFieldProps {\n shareLinkName?: string\n shareUrl?: string\n}\n\nexport const CopyLinkTextField: React.FC<CopyLinkTextFieldProps> = ({ shareLinkName, shareUrl, ...props }) => {\n const [error, setError] = useState<Error>()\n\n const copyToClipboard = async (link?: string) => {\n if (link) {\n try {\n await navigator.clipboard.writeText(link)\n } catch (e) {\n const message = 'Error copying shareUrl to clipboard'\n console.error(message, e, link)\n setError(new Error(message))\n }\n } else {\n console.warn('tried to copy shareUrl before it was generated')\n }\n }\n\n return (\n <TextField\n disabled\n error={!!error}\n helperText={error?.message}\n // to override the color that appears when it's a text field, only on dark mode\n sx={{ input: { WebkitTextFillColor: 'lightgray !important' } }}\n InputProps={{\n endAdornment: (\n <InputAdornment position=\"end\">\n <IconButton aria-label={`copy ${shareLinkName} link`} onClick={() => forget(copyToClipboard(shareUrl))} edge=\"end\">\n <CopyAllRounded />\n </IconButton>\n </InputAdornment>\n ),\n }}\n value={shareUrl}\n {...props}\n />\n )\n}\n","import type { DialogProps } from '@mui/material'\nimport { Dialog, DialogActions, DialogContent, DialogTitle, Stack, Typography } from '@mui/material'\nimport { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'\nimport type { ComponentType, ReactNode } from 'react'\nimport React from 'react'\n\nexport interface ShareOutDialogProps extends DialogProps {\n ShareOutDialogActions?: ComponentType<{ onClose?: () => void }>\n cardImg?: ReactNode\n shareOutDialogContent?: ReactNode\n subtitle?: string\n title?: string\n}\n\nexport const ShareOutDialog: React.FC<ShareOutDialogProps> = ({ ShareOutDialogActions, cardImg, open, onClose, shareOutDialogContent, subtitle, title, ...props }) => {\n const handleClose = () => {\n onClose?.('', 'backdropClick')\n }\n\n return (\n <Dialog onClose={onClose} open={open} {...props}>\n <DialogTitle>\n <Stack direction=\"row\" spacing={2}>\n <FlexGrowCol alignItems=\"flex-start\" width=\"60%\">\n <Typography variant=\"h5\">{title}</Typography>\n <Typography variant=\"body1\">\n {' '}\n {subtitle}\n </Typography>\n </FlexGrowCol>\n <FlexGrowCol alignItems=\"flex-end\" width=\"40%\">\n {cardImg}\n </FlexGrowCol>\n </Stack>\n </DialogTitle>\n <DialogContent>\n {shareOutDialogContent}\n <FlexCol alignItems=\"stretch\">\n </FlexCol>\n </DialogContent>\n {ShareOutDialogActions ? <DialogActions><ShareOutDialogActions onClose={handleClose} /></DialogActions> : null}\n </Dialog>\n )\n}\n","import { InfoOutlined } from '@mui/icons-material'\nimport { Tooltip, Typography, useTheme } from '@mui/material'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface ShareOutExplanationProps {\n toolTipTitle?: string\n}\n\nexport const ShareOutExplanation: React.FC<ShareOutExplanationProps> = ({ toolTipTitle }) => {\n const theme = useTheme()\n const title = toolTipTitle ?? 'In order for your data to be publicly viewable, it needs to be saved to the XYO Network Public Archivist. Public data can be seen by your friends, and XYO can generate preview images for easier sharing on social media.'\n return (\n <>\n <FlexGrowRow alignItems=\"center\">\n <Typography variant=\"body2\" paddingRight={0.5}>\n What am I sharing?\n </Typography>\n <Tooltip\n title={title}\n placement=\"bottom\"\n >\n <InfoOutlined fontSize=\"small\" sx={{ fontSize: theme.typography.caption.fontSize }} />\n </Tooltip>\n </FlexGrowRow>\n </>\n )\n}\n","import type { ButtonProps } from '@mui/material'\nimport { Button, CircularProgress, styled } from '@mui/material'\nimport React from 'react'\n\nexport interface GenerateShareLinkButtonProps extends ButtonProps {\n loading?: boolean\n}\n\nexport const GenerateShareLinkButton: React.FC<GenerateShareLinkButtonProps> = ({ children = 'Generate My Share Link', loading, ...props }) => {\n return (\n <Button\n variant=\"contained\"\n startIcon={loading ? <StyledCircularProgress size=\"small\" /> : null}\n {...props}\n >\n {children}\n </Button>\n )\n}\n\nconst StyledCircularProgress = styled(CircularProgress, { name: 'StyledCircularProgress' })(({ theme }) => ({\n // ensure the color of the spinner is the same as the button color\n color: theme.palette.getContrastText(theme.palette.primary.main),\n height: '20px',\n opacity: '.87',\n width: '20px',\n}))\n","import { Typography } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface ShareOutHeadingFlexboxProps extends FlexBoxProps {\n shareLinkName?: string\n shareUrl?: string\n}\n\nexport const ShareOutHeadingFlexbox: React.FC<ShareOutHeadingFlexboxProps> = ({ children, shareLinkName, shareUrl, ...props }) => {\n const GenerateShareLinkExplanation = \"When you generate your share link, we'll make a small amount of your data public so friends can check it out!\"\n\n return (\n <FlexGrowCol alignItems=\"flex-start\" paddingBottom={1} {...props}>\n <Typography variant=\"body1\" gutterBottom>\n <strong>Your Share Link</strong>\n </Typography>\n <Typography variant=\"body1\">\n {shareUrl ? `Use this link or the buttons below to share ${shareLinkName}` : GenerateShareLinkExplanation}\n </Typography>\n {children}\n </FlexGrowCol>\n )\n}\n","import { Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { FacebookSvgIcon, XTwitterSvgIcon } from '../icons/index.ts'\n\nexport interface SocialButtonsFlexboxProps extends FlexBoxProps {\n shareUrl?: string\n}\n\nexport const SocialButtonsFlexbox: React.FC<SocialButtonsFlexboxProps> = ({ shareUrl, ...props }) => {\n return (\n <FlexGrowCol alignItems=\"stretch\" paddingTop={2} {...props}>\n <Typography variant=\"body1\" gutterBottom>\n <strong>Share on Social Media</strong>\n </Typography>\n <FlexRow gap={0.5} sx={{ flexDirection: { md: 'row', xs: 'column' } }}>\n {shareUrl\n ? (\n <>\n <ButtonEx\n variant=\"contained\"\n style={{ backgroundColor: '#000', color: '#fff' }}\n onClick={() => {\n window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`)\n }}\n startIcon={<XTwitterSvgIcon width=\"20px\" />}\n >\n Share on X (Twitter)\n </ButtonEx>\n <ButtonEx\n variant=\"contained\"\n style={{ backgroundColor: '#4267b2', color: '#fff' }}\n onClick={() => {\n window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`)\n }}\n startIcon={<FacebookSvgIcon />}\n >\n Share on Facebook\n </ButtonEx>\n </>\n )\n : null}\n </FlexRow>\n </FlexGrowCol>\n )\n}\n"],"mappings":";;;;AAAA,SAASA,YAAYC,cAAcC,SAASC,WAAWC,WAAWC,mBAAmB;AACrF,SAASC,eAAe;AAExB,SAASC,gBAAgB;AACzB,SAASC,eAAe;AACxB,SAASC,cAAc;AACvB,OAAOC,SAASC,QAAQC,gBAAgB;AAOjC,IAAMC,cAA0C,wBAAC,EAAEC,WAAW,MAAMC,WAAW,GAAGC,MAAAA,MAAO;AAC9F,QAAM,CAACC,UAAUC,WAAAA,IAAeC,SAAS,KAAA;AACzC,QAAMC,YAAYC,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;MAAS;IAAE;KACjEf,WAEK,gBAAAE,QAAA,cAAAA,QAAA,UAAA,MACE,gBAAAA,QAAA,cAACc,WAAAA;IACCT,SAAQ;IACRU,OAAO;MAAEC,iBAAiB;MAAQC,OAAO;IAAO;IAChDC,SAAS,6BAAA;AACPC,aAAOC,KAAK,wCAAwCC,mBAAmBvB,QAAAA,CAAAA,EAAW;IACpF,GAFS;IAGTwB,WAAW,gBAAAtB,QAAA,cAACuB,iBAAAA;MAAgBC,OAAM;;KACnC,sBAAA,GAGD,gBAAAxB,QAAA,cAACc,WAAAA;IACCT,SAAQ;IACRU,OAAO;MAAEC,iBAAiB;MAAWC,OAAO;IAAO;IACnDC,SAAS,6BAAA;AACPC,aAAOC,KAAK,gDAAgDC,mBAAmBvB,QAAAA,CAAAA,EAAW;IAC5F,GAFS;IAGTwB,WAAW,gBAAAtB,QAAA,cAACyB,iBAAAA,IAAAA;KACb,mBAAA,CAAA,IAKL,IAAA,CAAA;AAIZ,GApCyE;","names":["Facebook","FacebookIcon","Share","ShareIcon","Twitter","TwitterIcon","Popover","ButtonEx","FlexRow","LinkEx","React","useRef","useState","ShareButton","prepared","shareLink","props","expanded","setExpanded","useState","anchorRef","useRef","link","window","location","href","FlexRow","gap","ref","ButtonEx","variant","minWidth","size","disabled","onClick","ShareIcon","htmlColor","fontSize","Popover","open","anchorEl","current","onClose","transitionDuration","padding","LinkEx","lineHeight","style","color","encodeURIComponent","TwitterIcon","FacebookIcon","createSvgIcon","React","FacebookSvgIcon","svg","xmlns","height","width","viewBox","path","d","fill","createSvgIcon","React","XTwitterSvgIcon","svg","viewBox","fill","xmlns","path","d","React","Helmet","DynamicShareImage","image","React","Helmet","meta","property","content","FlexGrowRow","React","useEffect","HideParentsFlexbox","children","props","useEffect","style","document","createElement","head","append","innerHTML","remove","React","FlexGrowRow","alignItems","id","justifyContent","CopyAllRounded","IconButton","InputAdornment","TextField","forget","React","useState","CopyLinkTextField","shareLinkName","shareUrl","props","error","setError","useState","copyToClipboard","link","navigator","clipboard","writeText","e","message","console","Error","warn","React","TextField","disabled","helperText","sx","input","WebkitTextFillColor","InputProps","endAdornment","InputAdornment","position","IconButton","aria-label","onClick","forget","edge","CopyAllRounded","value","Dialog","DialogActions","DialogContent","DialogTitle","Stack","Typography","FlexCol","FlexGrowCol","React","ShareOutDialog","ShareOutDialogActions","cardImg","open","onClose","shareOutDialogContent","subtitle","title","props","handleClose","React","Dialog","DialogTitle","Stack","direction","spacing","FlexGrowCol","alignItems","width","Typography","variant","DialogContent","FlexCol","DialogActions","InfoOutlined","Tooltip","Typography","useTheme","FlexGrowRow","React","ShareOutExplanation","toolTipTitle","theme","useTheme","title","React","FlexGrowRow","alignItems","Typography","variant","paddingRight","Tooltip","placement","InfoOutlined","fontSize","sx","typography","caption","Button","CircularProgress","styled","React","GenerateShareLinkButton","children","loading","props","React","Button","variant","startIcon","StyledCircularProgress","size","styled","CircularProgress","name","theme","color","palette","getContrastText","primary","main","height","opacity","width","Typography","FlexGrowCol","React","ShareOutHeadingFlexbox","children","shareLinkName","shareUrl","props","GenerateShareLinkExplanation","React","FlexGrowCol","alignItems","paddingBottom","Typography","variant","gutterBottom","strong","Typography","ButtonEx","FlexGrowCol","FlexRow","React","SocialButtonsFlexbox","shareUrl","props","React","FlexGrowCol","alignItems","paddingTop","Typography","variant","gutterBottom","strong","FlexRow","gap","sx","flexDirection","md","xs","ButtonEx","style","backgroundColor","color","onClick","window","open","encodeURIComponent","startIcon","XTwitterSvgIcon","width","FacebookSvgIcon"]}
|
|
1
|
+
{"version":3,"sources":["../../src/button/ShareButton.tsx","../../src/icons/social/Facebook.tsx","../../src/icons/social/XTwitter.tsx","../../src/meta-server/dynamic-share/DynamicShareImage.tsx","../../src/meta-server/live-share/HideParentsFlexbox.tsx","../../src/out/CopyLinkTextField.tsx","../../src/out/Dialog.tsx","../../src/out/Explanation.tsx","../../src/out/GenerateShareLinkButton.tsx","../../src/out/HeadingFlexbox.tsx","../../src/out/SocialButtonsFlexbox.tsx"],"sourcesContent":["import {\n Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon,\n} from '@mui/icons-material'\nimport { Popover } from '@mui/material'\nimport type { ButtonExProps } from '@xylabs/react-button'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport React, { useRef, useState } from 'react'\n\nexport interface ShareButtonProps extends ButtonExProps {\n prepared?: boolean\n shareLink?: string\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({\n prepared = true, shareLink, ...props\n}) => {\n const [expanded, setExpanded] = useState(false)\n const anchorRef = useRef(null)\n const link = shareLink ?? window.location.href\n\n return (\n <FlexRow gap={1} ref={anchorRef}>\n <ButtonEx\n variant=\"text\"\n minWidth={32}\n size=\"small\"\n disabled={!prepared}\n onClick={() => {\n setExpanded(true)\n }}\n {...props}\n >\n <ShareIcon htmlColor=\"gray\" fontSize=\"small\" />\n </ButtonEx>\n <Popover open={prepared ? expanded : false} anchorEl={anchorRef.current} onClose={() => setExpanded(false)} transitionDuration={500}>\n <FlexRow gap={0.5} padding={0.5}>\n <LinkEx\n lineHeight={0}\n style={{ color: '#1da1f2' }}\n onClick={() => {\n window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(link)}`)\n setExpanded(false)\n }}\n >\n <TwitterIcon fontSize=\"small\" />\n </LinkEx>\n <LinkEx\n lineHeight={0}\n style={{ color: '#4267b2' }}\n onClick={() => {\n window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`)\n setExpanded(false)\n }}\n >\n <FacebookIcon fontSize=\"small\" />\n </LinkEx>\n </FlexRow>\n </Popover>\n </FlexRow>\n )\n}\n","/* eslint-disable @stylistic/max-len */\nimport { createSvgIcon } from '@mui/material'\nimport React from 'react'\n\nexport const FacebookSvgIcon = createSvgIcon(\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"800\" width=\"1200\" viewBox=\"-204.79995 -341.33325 1774.9329 2047.9995\">\n <path d=\"M1365.333 682.667C1365.333 305.64 1059.693 0 682.667 0 305.64 0 0 305.64 0 682.667c0 340.738 249.641 623.16 576 674.373V880H402.667V682.667H576v-150.4c0-171.094 101.917-265.6 257.853-265.6 74.69 0 152.814 13.333 152.814 13.333v168h-86.083c-84.804 0-111.25 52.623-111.25 106.61v128.057h189.333L948.4 880H789.333v477.04c326.359-51.213 576-333.635 576-674.373\" fill=\"#1877f2\" />\n <path d=\"M948.4 880l30.267-197.333H789.333V554.609C789.333 500.623 815.78 448 900.584 448h86.083V280s-78.124-13.333-152.814-13.333c-155.936 0-257.853 94.506-257.853 265.6v150.4H402.667V880H576v477.04a687.805 687.805 0 00106.667 8.293c36.288 0 71.91-2.84 106.666-8.293V880H948.4\" fill=\"#fff\" />\n </svg>\n , 'Facebook',\n)\n","/* eslint-disable @stylistic/max-len */\nimport { createSvgIcon } from '@mui/material'\nimport React from 'react'\n\nexport const XTwitterSvgIcon = createSvgIcon(\n <svg viewBox=\"0 0 1200 1227\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z\" fill=\"white\" />\n </svg>\n , 'XTwitterSvgIcon',\n)\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\n\n/**\n * The props for the DynamicShareImage component.\n */\nexport interface DynamicShareImageProps {\n /**\n * The URL of the share image for the page.\n */\n image: string\n}\n\n/**\n * Used in conjunction with the XY Meta Server to dynamically set the share image for a page.\n */\nexport const DynamicShareImage: React.FC<DynamicShareImageProps> = ({ image }) => {\n return (\n <Helmet>\n <meta property=\"xyo:og:image\" content={image} />\n </Helmet>\n )\n}\n","import type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport type { WithChildren } from '@xylabs/react-shared'\nimport React, { useEffect } from 'react'\n\nexport const HideParentsFlexbox: React.FC<WithChildren & FlexBoxProps> = ({ children, ...props }) => {\n useEffect(() => {\n const style = document.createElement('style')\n document.head.append(style)\n style.innerHTML = `\n /** make all elements hidden */\n * {\n visibility: hidden;\n }\n\n /** move the preview area to the top of the page */\n #preview-area {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 9999;\n }\n\n /** make the preview area and all its children visible */\n #preview-area * {\n visibility: visible;\n }`\n\n return () => {\n style.remove()\n }\n }, [])\n\n return (\n <FlexGrowRow alignItems=\"stretch\" id=\"preview-area\" justifyContent=\"start\" {...props}>\n {children}\n </FlexGrowRow>\n )\n}\n","import { CopyAllRounded } from '@mui/icons-material'\nimport type { StandardTextFieldProps } from '@mui/material'\nimport {\n IconButton, InputAdornment, TextField,\n} from '@mui/material'\nimport { forget } from '@xylabs/forget'\nimport React, { useState } from 'react'\n\nexport interface CopyLinkTextFieldProps extends StandardTextFieldProps {\n shareLinkName?: string\n shareUrl?: string\n}\n\nexport const CopyLinkTextField: React.FC<CopyLinkTextFieldProps> = ({\n shareLinkName, shareUrl, ...props\n}) => {\n const [error, setError] = useState<Error>()\n\n const copyToClipboard = async (link?: string) => {\n if (link) {\n try {\n await navigator.clipboard.writeText(link)\n } catch (e) {\n const message = 'Error copying shareUrl to clipboard'\n console.error(message, e, link)\n setError(new Error(message))\n }\n } else {\n console.warn('tried to copy shareUrl before it was generated')\n }\n }\n\n return (\n <TextField\n disabled\n error={!!error}\n helperText={error?.message}\n // to override the color that appears when it's a text field, only on dark mode\n sx={{ input: { WebkitTextFillColor: 'lightgray !important' } }}\n InputProps={{\n endAdornment: (\n <InputAdornment position=\"end\">\n <IconButton aria-label={`copy ${shareLinkName} link`} onClick={() => forget(copyToClipboard(shareUrl))} edge=\"end\">\n <CopyAllRounded />\n </IconButton>\n </InputAdornment>\n ),\n }}\n value={shareUrl}\n {...props}\n />\n )\n}\n","import type { DialogProps } from '@mui/material'\nimport {\n Dialog, DialogActions, DialogContent, DialogTitle, Stack, Typography,\n} from '@mui/material'\nimport { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'\nimport type { ComponentType, ReactNode } from 'react'\nimport React from 'react'\n\nexport interface ShareOutDialogProps extends DialogProps {\n ShareOutDialogActions?: ComponentType<{ onClose?: () => void }>\n cardImg?: ReactNode\n shareOutDialogContent?: ReactNode\n subtitle?: string\n title?: string\n}\n\nexport const ShareOutDialog: React.FC<ShareOutDialogProps> = ({\n ShareOutDialogActions, cardImg, open, onClose, shareOutDialogContent, subtitle, title, ...props\n}) => {\n const handleClose = () => {\n onClose?.('', 'backdropClick')\n }\n\n return (\n <Dialog onClose={onClose} open={open} {...props}>\n <DialogTitle>\n <Stack direction=\"row\" spacing={2}>\n <FlexGrowCol alignItems=\"flex-start\" width=\"60%\">\n <Typography variant=\"h5\">{title}</Typography>\n <Typography variant=\"body1\">\n {' '}\n {subtitle}\n </Typography>\n </FlexGrowCol>\n <FlexGrowCol alignItems=\"flex-end\" width=\"40%\">\n {cardImg}\n </FlexGrowCol>\n </Stack>\n </DialogTitle>\n <DialogContent>\n {shareOutDialogContent}\n <FlexCol alignItems=\"stretch\">\n </FlexCol>\n </DialogContent>\n {ShareOutDialogActions ? <DialogActions><ShareOutDialogActions onClose={handleClose} /></DialogActions> : null}\n </Dialog>\n )\n}\n","import { InfoOutlined } from '@mui/icons-material'\nimport {\n Tooltip, Typography, useTheme,\n} from '@mui/material'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface ShareOutExplanationProps {\n toolTipTitle?: string\n}\n\nexport const ShareOutExplanation: React.FC<ShareOutExplanationProps> = ({ toolTipTitle }) => {\n const theme = useTheme()\n // eslint-disable-next-line @stylistic/max-len\n const title = toolTipTitle ?? 'In order for your data to be publicly viewable, it needs to be saved to the XYO Network Public Archivist. Public data can be seen by your friends, and XYO can generate preview images for easier sharing on social media.'\n return (\n <>\n <FlexGrowRow alignItems=\"center\">\n <Typography variant=\"body2\" paddingRight={0.5}>\n What am I sharing?\n </Typography>\n <Tooltip\n title={title}\n placement=\"bottom\"\n >\n <InfoOutlined fontSize=\"small\" sx={{ fontSize: theme.typography.caption.fontSize }} />\n </Tooltip>\n </FlexGrowRow>\n </>\n )\n}\n","import type { ButtonProps } from '@mui/material'\nimport {\n Button, CircularProgress, styled,\n} from '@mui/material'\nimport React from 'react'\n\nexport interface GenerateShareLinkButtonProps extends ButtonProps {\n loading?: boolean\n}\n\nexport const GenerateShareLinkButton: React.FC<GenerateShareLinkButtonProps> = ({\n children = 'Generate My Share Link', loading, ...props\n}) => {\n return (\n <Button\n variant=\"contained\"\n startIcon={loading ? <StyledCircularProgress size=\"small\" /> : null}\n {...props}\n >\n {children}\n </Button>\n )\n}\n\nconst StyledCircularProgress = styled(CircularProgress, { name: 'StyledCircularProgress' })(({ theme }) => ({\n // ensure the color of the spinner is the same as the button color\n color: theme.palette.getContrastText(theme.palette.primary.main),\n height: '20px',\n opacity: '.87',\n width: '20px',\n}))\n","import { Typography } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nexport interface ShareOutHeadingFlexboxProps extends FlexBoxProps {\n shareLinkName?: string\n shareUrl?: string\n}\n\nexport const ShareOutHeadingFlexbox: React.FC<ShareOutHeadingFlexboxProps> = ({\n children, shareLinkName, shareUrl, ...props\n}) => {\n const GenerateShareLinkExplanation = \"When you generate your share link, we'll make a small amount of your data public so friends can check it out!\"\n\n return (\n <FlexGrowCol alignItems=\"flex-start\" paddingBottom={1} {...props}>\n <Typography variant=\"body1\" gutterBottom>\n <strong>Your Share Link</strong>\n </Typography>\n <Typography variant=\"body1\">\n {shareUrl ? `Use this link or the buttons below to share ${shareLinkName}` : GenerateShareLinkExplanation}\n </Typography>\n {children}\n </FlexGrowCol>\n )\n}\n","import { Typography } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'\nimport React from 'react'\n\nimport { FacebookSvgIcon, XTwitterSvgIcon } from '../icons/index.ts'\n\nexport interface SocialButtonsFlexboxProps extends FlexBoxProps {\n shareUrl?: string\n}\n\nexport const SocialButtonsFlexbox: React.FC<SocialButtonsFlexboxProps> = ({ shareUrl, ...props }) => {\n return (\n <FlexGrowCol alignItems=\"stretch\" paddingTop={2} {...props}>\n <Typography variant=\"body1\" gutterBottom>\n <strong>Share on Social Media</strong>\n </Typography>\n <FlexRow\n gap={0.5}\n sx={{ flexDirection: { md: 'row', xs: 'column' } }}\n >\n {shareUrl\n ? (\n <>\n <ButtonEx\n variant=\"contained\"\n style={{ backgroundColor: '#000', color: '#fff' }}\n onClick={() => {\n window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`)\n }}\n startIcon={<XTwitterSvgIcon width=\"20px\" />}\n >\n Share on X (Twitter)\n </ButtonEx>\n <ButtonEx\n variant=\"contained\"\n style={{ backgroundColor: '#4267b2', color: '#fff' }}\n onClick={() => {\n window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`)\n }}\n startIcon={<FacebookSvgIcon />}\n >\n Share on Facebook\n </ButtonEx>\n </>\n )\n : null}\n </FlexRow>\n </FlexGrowCol>\n )\n}\n"],"mappings":";;;;AAAA,SACEA,YAAYC,cAAcC,SAASC,WAAWC,WAAWC,mBACpD;AACP,SAASC,eAAe;AAExB,SAASC,gBAAgB;AACzB,SAASC,eAAe;AACxB,SAASC,cAAc;AACvB,OAAOC,SAASC,QAAQC,gBAAgB;AAOjC,IAAMC,cAA0C,wBAAC,EACtDC,WAAW,MAAMC,WAAW,GAAGC,MAAAA,MAChC;AACC,QAAM,CAACC,UAAUC,WAAAA,IAAeC,SAAS,KAAA;AAC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AOC,IAAI;MAAS;IAAE;KAEhDf,WAEK,gBAAAE,QAAA,cAAAA,QAAA,UAAA,MACE,gBAAAA,QAAA,cAACc,WAAAA;IACCT,SAAQ;IACRU,OAAO;MAAEC,iBAAiB;MAAQC,OAAO;IAAO;IAChDC,SAAS,6BAAA;AACPC,aAAOC,KAAK,wCAAwCC,mBAAmBvB,QAAAA,CAAAA,EAAW;IACpF,GAFS;IAGTwB,WAAW,gBAAAtB,QAAA,cAACuB,iBAAAA;MAAgBC,OAAM;;KACnC,sBAAA,GAGD,gBAAAxB,QAAA,cAACc,WAAAA;IACCT,SAAQ;IACRU,OAAO;MAAEC,iBAAiB;MAAWC,OAAO;IAAO;IACnDC,SAAS,6BAAA;AACPC,aAAOC,KAAK,gDAAgDC,mBAAmBvB,QAAAA,CAAAA,EAAW;IAC5F,GAFS;IAGTwB,WAAW,gBAAAtB,QAAA,cAACyB,iBAAAA,IAAAA;KACb,mBAAA,CAAA,IAKL,IAAA,CAAA;AAIZ,GAvCyE;","names":["Facebook","FacebookIcon","Share","ShareIcon","Twitter","TwitterIcon","Popover","ButtonEx","FlexRow","LinkEx","React","useRef","useState","ShareButton","prepared","shareLink","props","expanded","setExpanded","useState","anchorRef","useRef","link","window","location","href","FlexRow","gap","ref","ButtonEx","variant","minWidth","size","disabled","onClick","ShareIcon","htmlColor","fontSize","Popover","open","anchorEl","current","onClose","transitionDuration","padding","LinkEx","lineHeight","style","color","encodeURIComponent","TwitterIcon","FacebookIcon","createSvgIcon","React","FacebookSvgIcon","svg","xmlns","height","width","viewBox","path","d","fill","createSvgIcon","React","XTwitterSvgIcon","svg","viewBox","fill","xmlns","path","d","React","Helmet","DynamicShareImage","image","React","Helmet","meta","property","content","FlexGrowRow","React","useEffect","HideParentsFlexbox","children","props","useEffect","style","document","createElement","head","append","innerHTML","remove","React","FlexGrowRow","alignItems","id","justifyContent","CopyAllRounded","IconButton","InputAdornment","TextField","forget","React","useState","CopyLinkTextField","shareLinkName","shareUrl","props","error","setError","useState","copyToClipboard","link","navigator","clipboard","writeText","e","message","console","Error","warn","React","TextField","disabled","helperText","sx","input","WebkitTextFillColor","InputProps","endAdornment","InputAdornment","position","IconButton","aria-label","onClick","forget","edge","CopyAllRounded","value","Dialog","DialogActions","DialogContent","DialogTitle","Stack","Typography","FlexCol","FlexGrowCol","React","ShareOutDialog","ShareOutDialogActions","cardImg","open","onClose","shareOutDialogContent","subtitle","title","props","handleClose","React","Dialog","DialogTitle","Stack","direction","spacing","FlexGrowCol","alignItems","width","Typography","variant","DialogContent","FlexCol","DialogActions","InfoOutlined","Tooltip","Typography","useTheme","FlexGrowRow","React","ShareOutExplanation","toolTipTitle","theme","useTheme","title","React","FlexGrowRow","alignItems","Typography","variant","paddingRight","Tooltip","placement","InfoOutlined","fontSize","sx","typography","caption","Button","CircularProgress","styled","React","GenerateShareLinkButton","children","loading","props","React","Button","variant","startIcon","StyledCircularProgress","size","styled","CircularProgress","name","theme","color","palette","getContrastText","primary","main","height","opacity","width","Typography","FlexGrowCol","React","ShareOutHeadingFlexbox","children","shareLinkName","shareUrl","props","GenerateShareLinkExplanation","React","FlexGrowCol","alignItems","paddingBottom","Typography","variant","gutterBottom","strong","Typography","ButtonEx","FlexGrowCol","FlexRow","React","SocialButtonsFlexbox","shareUrl","props","React","FlexGrowCol","alignItems","paddingTop","Typography","variant","gutterBottom","strong","FlexRow","gap","sx","flexDirection","md","xs","ButtonEx","style","backgroundColor","color","onClick","window","open","encodeURIComponent","startIcon","XTwitterSvgIcon","width","FacebookSvgIcon"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicShareImage.d.ts","sourceRoot":"","sources":["../../../../src/meta-server/dynamic-share/DynamicShareImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,MAAM,WAAW,sBAAsB;IAIrC,KAAK,EAAE,MAAM,CAAA;CACd;AAKD,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAM9D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/meta-server/dynamic-share/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/meta-server/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
2
|
+
import type { WithChildren } from '@xylabs/react-shared';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export declare const HideParentsFlexbox: React.FC<WithChildren & FlexBoxProps>;
|
|
5
|
+
//# sourceMappingURL=HideParentsFlexbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HideParentsFlexbox.d.ts","sourceRoot":"","sources":["../../../../src/meta-server/live-share/HideParentsFlexbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAoB,MAAM,OAAO,CAAA;AAExC,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,GAAG,YAAY,CAkCpE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/meta-server/live-share/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StandardTextFieldProps } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface CopyLinkTextFieldProps extends StandardTextFieldProps {
|
|
4
|
+
shareLinkName?: string;
|
|
5
|
+
shareUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const CopyLinkTextField: React.FC<CopyLinkTextFieldProps>;
|
|
8
|
+
//# sourceMappingURL=CopyLinkTextField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyLinkTextField.d.ts","sourceRoot":"","sources":["../../../src/out/CopyLinkTextField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAK3D,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACpE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAuC9D,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DialogProps } from '@mui/material';
|
|
2
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export interface ShareOutDialogProps extends DialogProps {
|
|
5
|
+
ShareOutDialogActions?: ComponentType<{
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
}>;
|
|
8
|
+
cardImg?: ReactNode;
|
|
9
|
+
shareOutDialogContent?: ReactNode;
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const ShareOutDialog: React.FC<ShareOutDialogProps>;
|
|
14
|
+
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/out/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAKhD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,qBAAqB,CAAC,EAAE,aAAa,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAA;IAC/D,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,qBAAqB,CAAC,EAAE,SAAS,CAAA;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+BxD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Explanation.d.ts","sourceRoot":"","sources":["../../../src/out/Explanation.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,wBAAwB;IACvC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAmBlE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ButtonProps } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface GenerateShareLinkButtonProps extends ButtonProps {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const GenerateShareLinkButton: React.FC<GenerateShareLinkButtonProps>;
|
|
7
|
+
//# sourceMappingURL=GenerateShareLinkButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenerateShareLinkButton.d.ts","sourceRoot":"","sources":["../../../src/out/GenerateShareLinkButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAIhD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,4BAA6B,SAAQ,WAAW;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAY1E,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ShareOutHeadingFlexboxProps extends FlexBoxProps {
|
|
4
|
+
shareLinkName?: string;
|
|
5
|
+
shareUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ShareOutHeadingFlexbox: React.FC<ShareOutHeadingFlexboxProps>;
|
|
8
|
+
//# sourceMappingURL=HeadingFlexbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeadingFlexbox.d.ts","sourceRoot":"","sources":["../../../src/out/HeadingFlexbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,2BAA4B,SAAQ,YAAY;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAgBxE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface SocialButtonsFlexboxProps extends FlexBoxProps {
|
|
4
|
+
shareUrl?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const SocialButtonsFlexbox: React.FC<SocialButtonsFlexboxProps>;
|
|
7
|
+
//# sourceMappingURL=SocialButtonsFlexbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocialButtonsFlexbox.d.ts","sourceRoot":"","sources":["../../../src/out/SocialButtonsFlexbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,yBAA0B,SAAQ,YAAY;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAuCpE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './CopyLinkTextField.tsx';
|
|
2
|
+
export * from './Dialog.tsx';
|
|
3
|
+
export * from './Explanation.tsx';
|
|
4
|
+
export * from './GenerateShareLinkButton.tsx';
|
|
5
|
+
export * from './HeadingFlexbox.tsx';
|
|
6
|
+
export * from './SocialButtonsFlexbox.tsx';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/out/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,71 +1,76 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-share",
|
|
3
|
+
"version": "3.0.3",
|
|
4
|
+
"description": "Common React library for all XYO projects that use React",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"xyo",
|
|
7
|
+
"utility",
|
|
8
|
+
"typescript",
|
|
9
|
+
"react"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://xyo.network",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues",
|
|
14
|
+
"email": "support@xyo.network"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
|
|
19
|
+
},
|
|
20
|
+
"license": "LGPL-3.0-only",
|
|
3
21
|
"author": {
|
|
4
|
-
"email": "support@xyo.network",
|
|
5
22
|
"name": "XYO Development Team",
|
|
23
|
+
"email": "support@xyo.network",
|
|
6
24
|
"url": "https://xyo.network"
|
|
7
25
|
},
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"type": "module",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./dist/browser/index.d.ts",
|
|
32
|
+
"default": "./dist/browser/index.mjs"
|
|
33
|
+
},
|
|
34
|
+
"types": "./dist/browser/index.d.ts",
|
|
35
|
+
"default": "./dist/browser/index.mjs"
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
"module": "dist/browser/index.mjs",
|
|
40
|
+
"types": "dist/browser/index.d.ts",
|
|
41
|
+
"scripts": {
|
|
42
|
+
"license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\"",
|
|
43
|
+
"lint-pkg": "npmPkgJsonLint ."
|
|
11
44
|
},
|
|
12
45
|
"dependencies": {
|
|
13
|
-
"@xylabs/forget": "^4.0.
|
|
46
|
+
"@xylabs/forget": "^4.0.5",
|
|
14
47
|
"@xylabs/react-button": "^4.0.3",
|
|
15
48
|
"@xylabs/react-flexbox": "^4.0.3",
|
|
16
49
|
"@xylabs/react-link": "^4.0.3",
|
|
17
50
|
"@xylabs/react-shared": "^4.0.3",
|
|
18
51
|
"react-helmet": "^6.1.0"
|
|
19
52
|
},
|
|
20
|
-
"peerDependencies": {
|
|
21
|
-
"@mui/icons-material": "^5",
|
|
22
|
-
"@mui/material": "^5",
|
|
23
|
-
"@mui/styles": "^5",
|
|
24
|
-
"react": "^18",
|
|
25
|
-
"react-dom": "^18",
|
|
26
|
-
"react-icons": "^4"
|
|
27
|
-
},
|
|
28
53
|
"devDependencies": {
|
|
54
|
+
"@mui/icons-material": "^5.16.7",
|
|
55
|
+
"@mui/material": "^5.16.7",
|
|
56
|
+
"@mui/styles": "^5.16.7",
|
|
29
57
|
"@storybook/react": "^8.2.9",
|
|
30
58
|
"@types/react-helmet": "^6.1.11",
|
|
31
|
-
"@xylabs/ts-scripts-yarn3": "^4.0.
|
|
59
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.7",
|
|
60
|
+
"react": "^18.3.1",
|
|
61
|
+
"react-dom": "^18.3.1",
|
|
62
|
+
"storybook": "^8.2.9",
|
|
32
63
|
"typescript": "^5.5.4"
|
|
33
64
|
},
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"default": "./dist/browser/index.mjs"
|
|
41
|
-
},
|
|
42
|
-
"types": "./dist/browser/index.d.ts",
|
|
43
|
-
"default": "./dist/browser/index.mjs"
|
|
44
|
-
},
|
|
45
|
-
"./package.json": "./package.json"
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"@mui/icons-material": "^5",
|
|
67
|
+
"@mui/material": "^5",
|
|
68
|
+
"@mui/styles": "^5",
|
|
69
|
+
"react": "^18",
|
|
70
|
+
"react-dom": "^18"
|
|
46
71
|
},
|
|
47
|
-
"module": "dist/browser/index.mjs",
|
|
48
|
-
"homepage": "https://xyo.network",
|
|
49
|
-
"keywords": [
|
|
50
|
-
"xyo",
|
|
51
|
-
"utility",
|
|
52
|
-
"typescript",
|
|
53
|
-
"react"
|
|
54
|
-
],
|
|
55
|
-
"license": "LGPL-3.0-only",
|
|
56
72
|
"publishConfig": {
|
|
57
73
|
"access": "public"
|
|
58
74
|
},
|
|
59
|
-
"
|
|
60
|
-
"type": "git",
|
|
61
|
-
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
|
|
62
|
-
},
|
|
63
|
-
"scripts": {
|
|
64
|
-
"lint-pkg": "npmPkgJsonLint .",
|
|
65
|
-
"license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\""
|
|
66
|
-
},
|
|
67
|
-
"sideEffects": false,
|
|
68
|
-
"types": "dist/browser/index.d.ts",
|
|
69
|
-
"version": "3.0.2",
|
|
70
|
-
"type": "module"
|
|
75
|
+
"docs": "dist/docs.json"
|
|
71
76
|
}
|
|
@@ -3,9 +3,7 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { ShareButton } from './ShareButton.tsx'
|
|
5
5
|
|
|
6
|
-
export default {
|
|
7
|
-
title: 'modules/ShareButton',
|
|
8
|
-
} as Meta<typeof ShareButton>
|
|
6
|
+
export default { title: 'modules/ShareButton' } as Meta<typeof ShareButton>
|
|
9
7
|
|
|
10
8
|
const Template: StoryFn<typeof ShareButton> = (props) => {
|
|
11
9
|
return <ShareButton {...props} />
|
|
@@ -20,4 +18,6 @@ WithUnPrepared.args = { prepared: false }
|
|
|
20
18
|
const WithCustomShareLink = Template.bind({})
|
|
21
19
|
WithCustomShareLink.args = { shareLink: 'http://explore.xyo.network' }
|
|
22
20
|
|
|
23
|
-
export {
|
|
21
|
+
export {
|
|
22
|
+
Default, WithCustomShareLink, WithUnPrepared,
|
|
23
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Facebook as FacebookIcon, Share as ShareIcon, Twitter as TwitterIcon,
|
|
3
|
+
} from '@mui/icons-material'
|
|
2
4
|
import { Popover } from '@mui/material'
|
|
3
5
|
import type { ButtonExProps } from '@xylabs/react-button'
|
|
4
6
|
import { ButtonEx } from '@xylabs/react-button'
|
|
@@ -11,7 +13,9 @@ export interface ShareButtonProps extends ButtonExProps {
|
|
|
11
13
|
shareLink?: string
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
export const ShareButton: React.FC<ShareButtonProps> = ({
|
|
16
|
+
export const ShareButton: React.FC<ShareButtonProps> = ({
|
|
17
|
+
prepared = true, shareLink, ...props
|
|
18
|
+
}) => {
|
|
15
19
|
const [expanded, setExpanded] = useState(false)
|
|
16
20
|
const anchorRef = useRef(null)
|
|
17
21
|
const link = shareLink ?? window.location.href
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @stylistic/max-len */
|
|
1
2
|
import { createSvgIcon } from '@mui/material'
|
|
2
3
|
import React from 'react'
|
|
3
4
|
|
|
@@ -5,4 +6,5 @@ export const XTwitterSvgIcon = createSvgIcon(
|
|
|
5
6
|
<svg viewBox="0 0 1200 1227" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
7
|
<path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z" fill="white" />
|
|
7
8
|
</svg>
|
|
8
|
-
, 'XTwitterSvgIcon'
|
|
9
|
+
, 'XTwitterSvgIcon',
|
|
10
|
+
)
|
|
@@ -3,9 +3,7 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { CopyLinkTextField } from './CopyLinkTextField.tsx'
|
|
5
5
|
|
|
6
|
-
export default {
|
|
7
|
-
title: 'modules/ShareOut/CopyLinkTextField',
|
|
8
|
-
} as Meta<typeof CopyLinkTextField>
|
|
6
|
+
export default { title: 'modules/ShareOut/CopyLinkTextField' } as Meta<typeof CopyLinkTextField>
|
|
9
7
|
|
|
10
8
|
const Template: StoryFn<typeof CopyLinkTextField> = (props) => {
|
|
11
9
|
return <CopyLinkTextField {...props} />
|
|
@@ -15,8 +13,6 @@ const Default = Template.bind({})
|
|
|
15
13
|
Default.args = {}
|
|
16
14
|
|
|
17
15
|
const WithShareUrl = Template.bind({})
|
|
18
|
-
WithShareUrl.args = {
|
|
19
|
-
shareUrl: 'https://google.com',
|
|
20
|
-
}
|
|
16
|
+
WithShareUrl.args = { shareUrl: 'https://google.com' }
|
|
21
17
|
|
|
22
18
|
export { Default, WithShareUrl }
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { CopyAllRounded } from '@mui/icons-material'
|
|
2
2
|
import type { StandardTextFieldProps } from '@mui/material'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
IconButton, InputAdornment, TextField,
|
|
5
|
+
} from '@mui/material'
|
|
4
6
|
import { forget } from '@xylabs/forget'
|
|
5
7
|
import React, { useState } from 'react'
|
|
6
8
|
|
|
@@ -9,7 +11,9 @@ export interface CopyLinkTextFieldProps extends StandardTextFieldProps {
|
|
|
9
11
|
shareUrl?: string
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
export const CopyLinkTextField: React.FC<CopyLinkTextFieldProps> = ({
|
|
14
|
+
export const CopyLinkTextField: React.FC<CopyLinkTextFieldProps> = ({
|
|
15
|
+
shareLinkName, shareUrl, ...props
|
|
16
|
+
}) => {
|
|
13
17
|
const [error, setError] = useState<Error>()
|
|
14
18
|
|
|
15
19
|
const copyToClipboard = async (link?: string) => {
|
|
@@ -10,9 +10,7 @@ import { GenerateShareLinkButton } from './GenerateShareLinkButton.tsx'
|
|
|
10
10
|
import { ShareOutHeadingFlexbox } from './HeadingFlexbox.tsx'
|
|
11
11
|
import { SocialButtonsFlexbox } from './SocialButtonsFlexbox.tsx'
|
|
12
12
|
|
|
13
|
-
export default {
|
|
14
|
-
title: 'modules/ShareOut/Dialog',
|
|
15
|
-
} as Meta<typeof ShareOutDialog>
|
|
13
|
+
export default { title: 'modules/ShareOut/Dialog' } as Meta<typeof ShareOutDialog>
|
|
16
14
|
|
|
17
15
|
const Template: StoryFn<typeof ShareOutDialog> = (props) => {
|
|
18
16
|
return <ShareOutDialog {...props} />
|
|
@@ -24,8 +22,10 @@ const TemplateWithContent: StoryFn<typeof ShareOutDialog> = (props) => {
|
|
|
24
22
|
const [shareUrl, setShareUrl] = useState('')
|
|
25
23
|
const [loading, setLoading] = useState(false)
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const {
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
27
|
+
open: unused, ...restProps
|
|
28
|
+
} = props
|
|
29
29
|
|
|
30
30
|
const cardImg = <img src="https://picsum.photos/100/100" height="100px" width="100px" />
|
|
31
31
|
const shareLinkName = 'My Share Link'
|
|
@@ -59,7 +59,16 @@ const TemplateWithContent: StoryFn<typeof ShareOutDialog> = (props) => {
|
|
|
59
59
|
return (
|
|
60
60
|
<>
|
|
61
61
|
<Button onClick={() => setOpen(true)} variant="contained">Open</Button>
|
|
62
|
-
<ShareOutDialog
|
|
62
|
+
<ShareOutDialog
|
|
63
|
+
cardImg={cardImg}
|
|
64
|
+
onClose={onClose}
|
|
65
|
+
ShareOutDialogActions={shareOutDialogActions}
|
|
66
|
+
shareOutDialogContent={shareOutDialogContent}
|
|
67
|
+
open={open}
|
|
68
|
+
title="Share Out Dialog"
|
|
69
|
+
subtitle="With a subtitle"
|
|
70
|
+
{...restProps}
|
|
71
|
+
/>
|
|
63
72
|
</>
|
|
64
73
|
)
|
|
65
74
|
}
|
package/src/out/Dialog.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { DialogProps } from '@mui/material'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Dialog, DialogActions, DialogContent, DialogTitle, Stack, Typography,
|
|
4
|
+
} from '@mui/material'
|
|
3
5
|
import { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'
|
|
4
6
|
import type { ComponentType, ReactNode } from 'react'
|
|
5
7
|
import React from 'react'
|
|
@@ -12,7 +14,9 @@ export interface ShareOutDialogProps extends DialogProps {
|
|
|
12
14
|
title?: string
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
export const ShareOutDialog: React.FC<ShareOutDialogProps> = ({
|
|
17
|
+
export const ShareOutDialog: React.FC<ShareOutDialogProps> = ({
|
|
18
|
+
ShareOutDialogActions, cardImg, open, onClose, shareOutDialogContent, subtitle, title, ...props
|
|
19
|
+
}) => {
|
|
16
20
|
const handleClose = () => {
|
|
17
21
|
onClose?.('', 'backdropClick')
|
|
18
22
|
}
|
package/src/out/Explanation.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { InfoOutlined } from '@mui/icons-material'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Tooltip, Typography, useTheme,
|
|
4
|
+
} from '@mui/material'
|
|
3
5
|
import { FlexGrowRow } from '@xylabs/react-flexbox'
|
|
4
6
|
import React from 'react'
|
|
5
7
|
|
|
@@ -9,6 +11,7 @@ export interface ShareOutExplanationProps {
|
|
|
9
11
|
|
|
10
12
|
export const ShareOutExplanation: React.FC<ShareOutExplanationProps> = ({ toolTipTitle }) => {
|
|
11
13
|
const theme = useTheme()
|
|
14
|
+
// eslint-disable-next-line @stylistic/max-len
|
|
12
15
|
const title = toolTipTitle ?? 'In order for your data to be publicly viewable, it needs to be saved to the XYO Network Public Archivist. Public data can be seen by your friends, and XYO can generate preview images for easier sharing on social media.'
|
|
13
16
|
return (
|
|
14
17
|
<>
|
|
@@ -3,9 +3,7 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { GenerateShareLinkButton } from './GenerateShareLinkButton.tsx'
|
|
5
5
|
|
|
6
|
-
export default {
|
|
7
|
-
title: 'modules/ShareOut/GenerateShareLinkButton',
|
|
8
|
-
} as Meta<typeof GenerateShareLinkButton>
|
|
6
|
+
export default { title: 'modules/ShareOut/GenerateShareLinkButton' } as Meta<typeof GenerateShareLinkButton>
|
|
9
7
|
|
|
10
8
|
const Template: StoryFn<typeof GenerateShareLinkButton> = (props) => {
|
|
11
9
|
return <GenerateShareLinkButton {...props} />
|
|
@@ -15,8 +13,6 @@ const Default = Template.bind({})
|
|
|
15
13
|
Default.args = {}
|
|
16
14
|
|
|
17
15
|
const WithLoading = Template.bind({})
|
|
18
|
-
WithLoading.args = {
|
|
19
|
-
loading: true,
|
|
20
|
-
}
|
|
16
|
+
WithLoading.args = { loading: true }
|
|
21
17
|
|
|
22
18
|
export { Default, WithLoading }
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { ButtonProps } from '@mui/material'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Button, CircularProgress, styled,
|
|
4
|
+
} from '@mui/material'
|
|
3
5
|
import React from 'react'
|
|
4
6
|
|
|
5
7
|
export interface GenerateShareLinkButtonProps extends ButtonProps {
|
|
6
8
|
loading?: boolean
|
|
7
9
|
}
|
|
8
10
|
|
|
9
|
-
export const GenerateShareLinkButton: React.FC<GenerateShareLinkButtonProps> = ({
|
|
11
|
+
export const GenerateShareLinkButton: React.FC<GenerateShareLinkButtonProps> = ({
|
|
12
|
+
children = 'Generate My Share Link', loading, ...props
|
|
13
|
+
}) => {
|
|
10
14
|
return (
|
|
11
15
|
<Button
|
|
12
16
|
variant="contained"
|
|
@@ -8,7 +8,9 @@ export interface ShareOutHeadingFlexboxProps extends FlexBoxProps {
|
|
|
8
8
|
shareUrl?: string
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const ShareOutHeadingFlexbox: React.FC<ShareOutHeadingFlexboxProps> = ({
|
|
11
|
+
export const ShareOutHeadingFlexbox: React.FC<ShareOutHeadingFlexboxProps> = ({
|
|
12
|
+
children, shareLinkName, shareUrl, ...props
|
|
13
|
+
}) => {
|
|
12
14
|
const GenerateShareLinkExplanation = "When you generate your share link, we'll make a small amount of your data public so friends can check it out!"
|
|
13
15
|
|
|
14
16
|
return (
|
|
@@ -3,9 +3,7 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { SocialButtonsFlexbox } from './SocialButtonsFlexbox.tsx'
|
|
5
5
|
|
|
6
|
-
export default {
|
|
7
|
-
title: 'modules/ShareOut/SocialButtonsFlexbox',
|
|
8
|
-
} as Meta<typeof SocialButtonsFlexbox>
|
|
6
|
+
export default { title: 'modules/ShareOut/SocialButtonsFlexbox' } as Meta<typeof SocialButtonsFlexbox>
|
|
9
7
|
|
|
10
8
|
const Template: StoryFn<typeof SocialButtonsFlexbox> = (props) => {
|
|
11
9
|
return <SocialButtonsFlexbox {...props} />
|
|
@@ -15,8 +13,6 @@ const Default = Template.bind({})
|
|
|
15
13
|
Default.args = {}
|
|
16
14
|
|
|
17
15
|
const WithShareUrl = Template.bind({})
|
|
18
|
-
WithShareUrl.args = {
|
|
19
|
-
shareUrl: 'https://google.com',
|
|
20
|
-
}
|
|
16
|
+
WithShareUrl.args = { shareUrl: 'https://google.com' }
|
|
21
17
|
|
|
22
18
|
export { Default, WithShareUrl }
|
|
@@ -16,7 +16,10 @@ export const SocialButtonsFlexbox: React.FC<SocialButtonsFlexboxProps> = ({ shar
|
|
|
16
16
|
<Typography variant="body1" gutterBottom>
|
|
17
17
|
<strong>Share on Social Media</strong>
|
|
18
18
|
</Typography>
|
|
19
|
-
<FlexRow
|
|
19
|
+
<FlexRow
|
|
20
|
+
gap={0.5}
|
|
21
|
+
sx={{ flexDirection: { md: 'row', xs: 'column' } }}
|
|
22
|
+
>
|
|
20
23
|
{shareUrl
|
|
21
24
|
? (
|
|
22
25
|
<>
|