@xyo-network/react-share 7.5.8 → 7.5.11
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.map +1 -1
- package/dist/browser/index.mjs +361 -338
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/out/CopyLinkStack.d.ts.map +1 -1
- package/dist/browser/out/lib/AnimatedGradientTypography.d.ts +4 -2
- package/dist/browser/out/lib/AnimatedGradientTypography.d.ts.map +1 -1
- package/package.json +70 -29
- package/src/button/ShareButton.stories.tsx +0 -23
- package/src/button/ShareButton.tsx +0 -75
- package/src/button/index.ts +0 -1
- package/src/global.d.ts +0 -1
- package/src/icons/index.ts +0 -1
- package/src/icons/social/Facebook.tsx +0 -11
- package/src/icons/social/XTwitter.tsx +0 -10
- package/src/icons/social/index.ts +0 -2
- package/src/index.ts +0 -4
- package/src/meta-server/dynamic-share/DynamicShareImage.tsx +0 -23
- package/src/meta-server/dynamic-share/index.ts +0 -1
- package/src/meta-server/index.ts +0 -2
- package/src/meta-server/live-share/HideParentsFlexbox.tsx +0 -40
- package/src/meta-server/live-share/index.ts +0 -1
- package/src/out/CopyIconButton.tsx +0 -58
- package/src/out/CopyLinkStack.stories.tsx +0 -69
- package/src/out/CopyLinkStack.tsx +0 -77
- package/src/out/CopyLinkTextField.stories.tsx +0 -18
- package/src/out/CopyLinkTextField.tsx +0 -41
- package/src/out/Dialog.stories.tsx +0 -78
- package/src/out/Dialog.tsx +0 -48
- package/src/out/Explanation.tsx +0 -29
- package/src/out/GenerateShareLinkButton.stories.tsx +0 -18
- package/src/out/GenerateShareLinkButton.tsx +0 -31
- package/src/out/HeadingFlexbox.tsx +0 -27
- package/src/out/SocialButtonsFlexbox.stories.tsx +0 -41
- package/src/out/SocialButtonsFlexbox.tsx +0 -79
- package/src/out/index.ts +0 -7
- package/src/out/lib/AnimatedGradientTypography.tsx +0 -54
- package/src/out/lib/ShareLinkProps.ts +0 -8
- package/src/out/lib/index.ts +0 -3
- package/src/out/lib/splitAroundSubstring.ts +0 -19
|
@@ -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/CopyLinkStack.tsx","../../src/out/CopyIconButton.tsx","../../src/out/lib/AnimatedGradientTypography.tsx","../../src/out/lib/splitAroundSubstring.ts","../../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,\n X as XIcon,\n} from '@mui/icons-material'\nimport type { PopoverProps } from '@mui/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 type ShareButtonProps = ButtonExProps & {\n prepared?: boolean\n shareLink?: string\n slot?: { popover?: PopoverProps }\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({\n prepared = true, shareLink, slot, ...props\n}) => {\n const [expanded, setExpanded] = useState(false)\n const anchorRef = useRef(null)\n const link = shareLink ?? globalThis.location.href\n\n return (\n <FlexRow gap={1}>\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\" ref={anchorRef} />\n </ButtonEx>\n <Popover\n open={prepared ? expanded : false}\n anchorEl={anchorRef.current}\n anchorOrigin={{ vertical: 'top', horizontal: 'right' }}\n onClose={() => setExpanded(false)}\n transitionDuration={500}\n sx={{\n ml: 1, top: -4, ...slot?.popover?.sx,\n }}\n {...slot?.popover}\n >\n <FlexRow gap={0.5} padding={0.5}>\n <LinkEx\n lineHeight={0}\n onClick={() => {\n window.open(`https://x.com/intent/tweet?url=${encodeURIComponent(link)}`)\n setExpanded(false)\n }}\n >\n <XIcon 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 { PropsWithChildren } from 'react'\nimport React, { useEffect } from 'react'\n\nexport const HideParentsFlexbox: React.FC<PropsWithChildren & 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 { Cancel } from '@mui/icons-material'\nimport type { StackProps } from '@mui/material'\nimport {\n Stack,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport React, {\n useCallback, useMemo, useState,\n} from 'react'\n\nimport { CopyIconButton } from './CopyIconButton.tsx'\nimport {\n AnimatedGradientTypography, type ShareLinkProps, splitAroundSubstring,\n} from './lib/index.ts'\n\nexport interface CopyLinkStackProps extends ShareLinkProps, StackProps {\n addToXnsName?: boolean\n copiedLinkText?: string\n copyLinkText?: string\n xnsEndColor?: string\n xnsStartColor?: string\n}\n\nexport const CopyLinkStack: React.FC<CopyLinkStackProps> = ({\n addToXnsName, copiedLinkText, copyLinkText, shareLinkName, shareUrl, xnsName: xnsNameProp, xnsEndColor, uploadPayloads, xnsStartColor, ...props\n}) => {\n const [error, setError] = useState<Error>()\n\n const onClickError = useCallback((error: Error) => {\n setError(error)\n }, [])\n\n const parsedXnsName = useMemo(() => {\n if (shareUrl && xnsNameProp && addToXnsName) {\n try {\n const parts = splitAroundSubstring(shareUrl, xnsNameProp)\n return parts\n } catch (e) {\n setError(e as Error)\n }\n }\n }, [addToXnsName, shareUrl, xnsNameProp])\n\n const [part1, xnsName, part3] = parsedXnsName || []\n\n return (\n <Stack direction=\"row\" alignItems=\"center\" gap={0.25} {...props}>\n {xnsName && addToXnsName\n ? (\n <Stack direction=\"row\" maxWidth=\"100%\" sx={{ overflowX: 'auto' }}>\n <Typography sx={{ display: 'inline-flex' }}>{part1}</Typography>\n <AnimatedGradientTypography color1={xnsStartColor} color2={xnsEndColor} sx={{ display: 'inline-flex' }}>{xnsName}</AnimatedGradientTypography>\n <Typography sx={{ display: 'inline-flex' }}>{part3}</Typography>\n </Stack>\n )\n : (\n <Typography sx={{\n display: 'inline-flex', maxWidth: '100%', overflow: 'auto',\n }}\n >\n {shareUrl}\n </Typography>\n )}\n <CopyIconButton\n copiedLinkText={copiedLinkText}\n copyLinkText={copyLinkText}\n onClickError={onClickError}\n shareLinkName={shareLinkName}\n shareUrl={shareUrl}\n sx={{ display: 'inline-flex' }}\n uploadPayloads={uploadPayloads}\n />\n {error ? <Tooltip title={error.message}><Cancel color=\"error\" sx={{ display: 'inline-flex' }} /></Tooltip> : null}\n </Stack>\n )\n}\n","import { CopyAllRounded } from '@mui/icons-material'\nimport {\n type ButtonProps, CircularProgress, IconButton, Tooltip,\n} from '@mui/material'\nimport { forget } from '@xylabs/sdk-js'\nimport React, { useState } from 'react'\n\nimport type { ShareLinkProps } from './lib/index.ts'\n\nexport interface CopyIconButtonProps extends ButtonProps, ShareLinkProps {\n onClickError?: (error: Error) => void\n}\n\nexport const CopyIconButton: React.FC<CopyIconButtonProps> = ({\n copyLinkText, copiedLinkText, onClickError, shareLinkName, shareUrl, uploadPayloads, ...props\n}) => {\n const CopyLink = copyLinkText ?? 'Copy Link'\n const Copied = copiedLinkText ?? 'Copied!'\n\n const [copyTooltipTitle, setCopyToolTipTitle] = useState(CopyLink)\n const [loading, setLoading] = useState(false)\n\n const copyToClipboard = async (link?: string) => {\n if (link) {\n try {\n setLoading(true)\n await uploadPayloads?.()\n await navigator.clipboard.writeText(link)\n setCopyToolTipTitle(Copied)\n setTimeout(() => setCopyToolTipTitle(CopyLink), 2000)\n setLoading(false)\n } catch (e) {\n setLoading(false)\n const message = 'Error copying shareUrl to clipboard'\n console.error(message, e, link)\n onClickError?.(new Error(message))\n }\n } else {\n console.warn('tried to copy shareUrl before it was generated')\n }\n }\n\n return (\n <Tooltip title={copyTooltipTitle}>\n {loading\n ? (\n <IconButton>\n <CircularProgress size=\"24px\" />\n </IconButton>\n )\n : (\n <IconButton aria-label={`copy ${shareLinkName} link`} onClick={() => forget(copyToClipboard(shareUrl))} edge=\"end\" {...props}>\n <CopyAllRounded />\n </IconButton>\n )}\n </Tooltip>\n )\n}\n","import {\n keyframes, styled, Typography,\n} from '@mui/material'\n\n/**\n * Start the animation at 100% to give the gradient a left to right effect\n */\nconst moveBg = keyframes(`\n 0% {\n background-position: 100% 0%;\n }\n 100% {\n background-position: 0% 0%;\n }\n`)\n\n/**\n * Adapted from - https://codepen.io/web-dot-dev/pen/vYrGPNE\n */\nexport const AnimatedGradientTypography = styled(Typography, { name: 'AnimatedGradientTypography' })<{ color1?: string; color2?: string }>(({\n theme, color1, color2,\n}) => {\n return {\n // Set the color variables for the gradient\n '--color-one': color1 ?? theme.vars.palette.secondary.dark,\n '--color-two': color2 ?? theme.vars.palette.primary.light,\n // set the gradient so it has the same start and end color for looping effect\n 'background': `linear-gradient(\n .25turn,\n var(--color-one),\n var(--color-two),\n var(--color-one)\n )`,\n // Set the text color to transparent so the gradient shows through\n 'color': 'transparent',\n // Clip the background to the text shape\n 'backgroundClip': 'text',\n // Set the background size to 800% so we don't see the third color initially creating the looping effect\n 'backgroundSize': '800%',\n // Set the text to bold so the gradient is more visible\n 'fontWeight': 'bold',\n // Set the animation\n '@media (prefers-reduced-motion: no-preference)': {\n animationName: moveBg,\n animationDuration: '2s',\n animationIterationCount: 'infinite',\n },\n // reset for users that prefer reduced motion\n '@media (prefers-reduced-motion)': {\n background: 'none',\n color: theme.vars.palette.text.primary,\n },\n }\n})\n","export const splitAroundSubstring = (path: string, substring: string): [string, string, string] => {\n // Find the index of the substring\n const index = path.indexOf(substring)\n\n if (index === -1) {\n throw new Error(`XNS name \"${substring}\" not found in path.`)\n }\n\n // Extract the part before the substring\n const part1 = path.slice(0, index)\n\n // The substring itself is part2\n const part2 = substring\n\n // Extract the part after the substring\n const part3 = path.slice(index + substring.length)\n\n return [part1, part2, part3]\n}\n","import type { StandardTextFieldProps } from '@mui/material'\nimport { InputAdornment, TextField } from '@mui/material'\nimport React, { useCallback, useState } from 'react'\n\nimport { CopyIconButton } from './CopyIconButton.tsx'\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 onClickError = useCallback((error?: Error) => {\n setError(error)\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 value={shareUrl}\n {...props}\n slotProps={{\n input: {\n endAdornment: (\n <InputAdornment position=\"end\">\n <CopyIconButton shareLinkName={shareLinkName} shareUrl={shareUrl} onClickError={onClickError} />\n </InputAdornment>\n ),\n },\n }}\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 <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","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.vars.palette.primary.contrastText,\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 { ErrorRender } from '@xylabs/react-error'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'\nimport React, { useState } from 'react'\n\nimport { FacebookSvgIcon, XTwitterSvgIcon } from '../icons/index.ts'\n\nexport interface SocialButtonsFlexboxProps extends FlexBoxProps {\n shareUrl?: string\n uploadPayloads?: () => Promise<void>\n}\n\nexport const SocialButtonsFlexbox: React.FC<SocialButtonsFlexboxProps> = ({\n shareUrl, uploadPayloads, ...props\n}) => {\n const [error, setError] = useState<Error>()\n const [xLoading, setXLoading] = useState(false)\n const [fbLoading, setFbLoading] = useState(false)\n\n const handleClick = async (openUrl: () => void, buttonName: 'x' | 'fb') => {\n const setLoading = buttonName === 'x' ? setXLoading : setFbLoading\n try {\n setLoading(true)\n await uploadPayloads?.()\n setLoading(false)\n openUrl()\n } catch (e) {\n setLoading(false)\n console.error('Error uploading payloads', e)\n setError(e as Error)\n }\n }\n\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 busy={xLoading}\n onClick={async () => {\n const openUrl = () => window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`)\n await handleClick(openUrl, 'x')\n }}\n startIcon={<XTwitterSvgIcon width=\"20px\" />}\n >\n Share on X (Twitter)\n </ButtonEx>\n <ButtonEx\n busy={fbLoading}\n variant=\"contained\"\n style={{ backgroundColor: '#4267b2', color: '#fff' }}\n onClick={async () => {\n const openUrl = () => window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`)\n await handleClick(openUrl, 'fb')\n }}\n startIcon={<FacebookSvgIcon />}\n >\n Share on Facebook\n </ButtonEx>\n </>\n )\n : null}\n </FlexRow>\n <ErrorRender error={error} scope=\"SocialButtonsFlexbox\" />\n </FlexGrowCol>\n )\n}\n"],"mappings":";;;;AAAA,SACEA,YAAYC,cAAcC,SAASC,WACnCC,KAAKC,aACA;AAEP,SAASC,eAAe;AAExB,SAASC,gBAAgB;AACzB,SAASC,eAAe;AACxB,SAASC,cAAc;AACvB,OAAOC,SAASC,QAAQC,gBAAgB;AAQjC,IAAMC,cAA0C,wBAAC,EACtDC,WAAW,MAAMC,WAAWC,MAAM,GAAGC,MAAAA,MACtC;AACC,QAAM,CAACC,UAAUC,WAAAA,IAAeC,SAAS,KAAA;AACzC,QAAMC,YAAYC,OAAO,IAAA;AACzB,QAAMC,OAAOR,aAAaS,WAAWC,SAASC;AAE9C,SACE,sBAAA,cAACC,SAAAA;IAAQC,KAAK;KACZ,sBAAA,cAACC,UAAAA;IACCC,SAAQ;IACRC,UAAU;IACVC,MAAK;IACLC,UAAU,CAACnB;IACXoB,SAAS,6BAAA;AACPf,kBAAY,IAAA;IACd,GAFS;IAGR,GAAGF;KAEJ,sBAAA,cAACkB,WAAAA;IAAUC,WAAU;IAAOC,UAAS;IAAQC,KAAKjB;OAEpD,sBAAA,cAACkB,SAAAA;IACCC,MAAM1B,WAAWI,WAAW;IAC5BuB,UAAUpB,UAAUqB;IACpBC,cAAc;MAAEC,UAAU;MAAOC,YAAY;IAAQ;IACrDC,SAAS,6BAAM3B,YAAY,KAAA,GAAlB;IACT4B,oBAAoB;IACpBC,IAAI;MACFC,IAAI;MAAGC,KAAK;MAAI,GAAGlC,MAAMmC,SAASH;IACpC;IACC,GAAGhC,MAAMmC;KAEV,sBAAA,cAACxB,SAAAA;IAAQC,KAA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AAO;MAAEC,iBAAiB;MAAWC,OAAO;IAAO;IACnDE,SAAS,mCAAA;AACP,YAAMxB,UAAU,6BAAMyB,OAAOC,KAAK,gDAAgDC,mBAAmBtC,QAAAA,CAAAA,EAAW,GAAhG;AAChB,YAAMU,YAAYC,SAAS,IAAA;IAC7B,GAHS;IAIT4B,WAAW,gBAAAvB,QAAA,cAAC0B,iBAAAA,IAAAA;KACb,mBAAA,CAAA,IAKL,IAAA,GAEN,gBAAA1B,QAAA,cAAC2B,aAAAA;IAAYxC;IAAcyC,OAAM;;AAGvC,GAhEyE;","names":["Facebook","FacebookIcon","Share","ShareIcon","X","XIcon","Popover","ButtonEx","FlexRow","LinkEx","React","useRef","useState","ShareButton","prepared","shareLink","slot","props","expanded","setExpanded","useState","anchorRef","useRef","link","globalThis","location","href","FlexRow","gap","ButtonEx","variant","minWidth","size","disabled","onClick","ShareIcon","htmlColor","fontSize","ref","Popover","open","anchorEl","current","anchorOrigin","vertical","horizontal","onClose","transitionDuration","sx","ml","top","popover","padding","LinkEx","lineHeight","window","encodeURIComponent","XIcon","style","color","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","Cancel","Stack","Tooltip","Typography","React","useCallback","useMemo","useState","CopyAllRounded","CircularProgress","IconButton","Tooltip","forget","React","useState","CopyIconButton","copyLinkText","copiedLinkText","onClickError","shareLinkName","shareUrl","uploadPayloads","props","CopyLink","Copied","copyTooltipTitle","setCopyToolTipTitle","useState","loading","setLoading","copyToClipboard","link","navigator","clipboard","writeText","setTimeout","e","message","console","error","Error","warn","React","Tooltip","title","IconButton","CircularProgress","size","aria-label","onClick","forget","edge","CopyAllRounded","keyframes","styled","Typography","moveBg","AnimatedGradientTypography","name","theme","color1","color2","vars","palette","secondary","dark","primary","light","animationName","animationDuration","animationIterationCount","background","color","text","splitAroundSubstring","path","substring","index","indexOf","Error","part1","slice","part2","part3","length","CopyLinkStack","addToXnsName","copiedLinkText","copyLinkText","shareLinkName","shareUrl","xnsName","xnsNameProp","xnsEndColor","uploadPayloads","xnsStartColor","props","error","setError","useState","onClickError","useCallback","parsedXnsName","useMemo","parts","splitAroundSubstring","e","part1","part3","React","Stack","direction","alignItems","gap","maxWidth","sx","overflowX","Typography","display","AnimatedGradientTypography","color1","color2","overflow","CopyIconButton","Tooltip","title","message","Cancel","color","InputAdornment","TextField","React","useCallback","useState","CopyLinkTextField","shareLinkName","shareUrl","props","error","setError","useState","onClickError","useCallback","React","TextField","disabled","helperText","message","sx","input","WebkitTextFillColor","value","slotProps","endAdornment","InputAdornment","position","CopyIconButton","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","vars","palette","primary","contrastText","height","opacity","width","Typography","FlexGrowCol","React","ShareOutHeadingFlexbox","children","shareLinkName","shareUrl","props","GenerateShareLinkExplanation","React","FlexGrowCol","alignItems","paddingBottom","Typography","variant","gutterBottom","strong","Typography","ButtonEx","ErrorRender","FlexGrowCol","FlexRow","React","useState","SocialButtonsFlexbox","shareUrl","uploadPayloads","props","error","setError","useState","xLoading","setXLoading","fbLoading","setFbLoading","handleClick","openUrl","buttonName","setLoading","e","console","React","FlexGrowCol","alignItems","paddingTop","Typography","variant","gutterBottom","strong","FlexRow","gap","sx","flexDirection","md","xs","ButtonEx","style","backgroundColor","color","busy","onClick","window","open","encodeURIComponent","startIcon","XTwitterSvgIcon","width","FacebookSvgIcon","ErrorRender","scope"]}
|
|
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/CopyLinkStack.tsx","../../src/out/CopyIconButton.tsx","../../src/out/lib/AnimatedGradientTypography.tsx","../../src/out/lib/splitAroundSubstring.ts","../../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,\n X as XIcon,\n} from '@mui/icons-material'\nimport type { PopoverProps } from '@mui/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, {\n useEffect, useRef, useState,\n} from 'react'\n\nexport type ShareButtonProps = ButtonExProps & {\n prepared?: boolean\n shareLink?: string\n slot?: { popover?: PopoverProps }\n}\n\nexport const ShareButton: React.FC<ShareButtonProps> = ({\n prepared = true, shareLink, slot, ...props\n}) => {\n const [expanded, setExpanded] = useState(false)\n const anchorRef = useRef(null)\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null)\n const link = shareLink ?? globalThis.location.href\n\n useEffect(() => {\n setAnchorEl(anchorRef.current)\n }, [])\n\n return (\n <FlexRow gap={1}>\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\" ref={anchorRef} />\n </ButtonEx>\n <Popover\n open={prepared ? expanded : false}\n anchorEl={anchorEl}\n anchorOrigin={{ vertical: 'top', horizontal: 'right' }}\n onClose={() => setExpanded(false)}\n transitionDuration={500}\n sx={{\n ml: 1, top: -4, ...slot?.popover?.sx,\n }}\n {...slot?.popover}\n >\n <FlexRow gap={0.5} padding={0.5}>\n <LinkEx\n lineHeight={0}\n onClick={() => {\n window.open(`https://x.com/intent/tweet?url=${encodeURIComponent(link)}`)\n setExpanded(false)\n }}\n >\n <XIcon 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 { PropsWithChildren } from 'react'\nimport React, { useEffect } from 'react'\n\nexport const HideParentsFlexbox: React.FC<PropsWithChildren & 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 { Cancel } from '@mui/icons-material'\nimport type { StackProps } from '@mui/material'\nimport {\n Stack,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport React, {\n useCallback, useMemo, useState,\n} from 'react'\n\nimport { CopyIconButton } from './CopyIconButton.tsx'\nimport {\n AnimatedGradientTypography, type ShareLinkProps, splitAroundSubstring,\n} from './lib/index.ts'\n\nexport interface CopyLinkStackProps extends ShareLinkProps, StackProps {\n addToXnsName?: boolean\n copiedLinkText?: string\n copyLinkText?: string\n xnsEndColor?: string\n xnsStartColor?: string\n}\n\nexport const CopyLinkStack: React.FC<CopyLinkStackProps> = ({\n addToXnsName, copiedLinkText, copyLinkText, shareLinkName, shareUrl, xnsName: xnsNameProp, xnsEndColor, uploadPayloads, xnsStartColor, ...props\n}) => {\n const [error, setError] = useState<Error>()\n\n const onClickError = useCallback((error: Error) => {\n setError(error)\n }, [])\n\n const parsedXnsName = useMemo(() => {\n if (shareUrl && xnsNameProp && addToXnsName) {\n try {\n return splitAroundSubstring(shareUrl, xnsNameProp)\n } catch {\n return\n }\n }\n }, [addToXnsName, shareUrl, xnsNameProp])\n\n const [part1, xnsName, part3] = parsedXnsName || []\n\n return (\n <Stack direction=\"row\" alignItems=\"center\" gap={0.25} {...props}>\n {xnsName && addToXnsName\n ? (\n <Stack direction=\"row\" maxWidth=\"100%\" sx={{ overflowX: 'auto' }}>\n <Typography sx={{ display: 'inline-flex' }}>{part1}</Typography>\n <AnimatedGradientTypography color1={xnsStartColor} color2={xnsEndColor} sx={{ display: 'inline-flex' }}>{xnsName}</AnimatedGradientTypography>\n <Typography sx={{ display: 'inline-flex' }}>{part3}</Typography>\n </Stack>\n )\n : (\n <Typography sx={{\n display: 'inline-flex', maxWidth: '100%', overflow: 'auto',\n }}\n >\n {shareUrl}\n </Typography>\n )}\n <CopyIconButton\n copiedLinkText={copiedLinkText}\n copyLinkText={copyLinkText}\n onClickError={onClickError}\n shareLinkName={shareLinkName}\n shareUrl={shareUrl}\n sx={{ display: 'inline-flex' }}\n uploadPayloads={uploadPayloads}\n />\n {error ? <Tooltip title={error.message}><Cancel color=\"error\" sx={{ display: 'inline-flex' }} /></Tooltip> : null}\n </Stack>\n )\n}\n","import { CopyAllRounded } from '@mui/icons-material'\nimport {\n type ButtonProps, CircularProgress, IconButton, Tooltip,\n} from '@mui/material'\nimport { forget } from '@xylabs/sdk-js'\nimport React, { useState } from 'react'\n\nimport type { ShareLinkProps } from './lib/index.ts'\n\nexport interface CopyIconButtonProps extends ButtonProps, ShareLinkProps {\n onClickError?: (error: Error) => void\n}\n\nexport const CopyIconButton: React.FC<CopyIconButtonProps> = ({\n copyLinkText, copiedLinkText, onClickError, shareLinkName, shareUrl, uploadPayloads, ...props\n}) => {\n const CopyLink = copyLinkText ?? 'Copy Link'\n const Copied = copiedLinkText ?? 'Copied!'\n\n const [copyTooltipTitle, setCopyTooltipTitle] = useState(CopyLink)\n const [loading, setLoading] = useState(false)\n\n const copyToClipboard = async (link?: string) => {\n if (link) {\n try {\n setLoading(true)\n await uploadPayloads?.()\n await navigator.clipboard.writeText(link)\n setCopyTooltipTitle(Copied)\n setTimeout(() => setCopyTooltipTitle(CopyLink), 2000)\n setLoading(false)\n } catch (e) {\n setLoading(false)\n const message = 'Error copying shareUrl to clipboard'\n console.error(message, e, link)\n onClickError?.(new Error(message))\n }\n } else {\n console.warn('tried to copy shareUrl before it was generated')\n }\n }\n\n return (\n <Tooltip title={copyTooltipTitle}>\n {loading\n ? (\n <IconButton>\n <CircularProgress size=\"24px\" />\n </IconButton>\n )\n : (\n <IconButton aria-label={`copy ${shareLinkName} link`} onClick={() => forget(copyToClipboard(shareUrl))} edge=\"end\" {...props}>\n <CopyAllRounded />\n </IconButton>\n )}\n </Tooltip>\n )\n}\n","import {\n keyframes, styled, Typography,\n} from '@mui/material'\nimport type React from 'react'\n\n/**\n * Start the animation at 100% to give the gradient a left to right effect\n */\nconst moveBg = keyframes(`\n 0% {\n background-position: 100% 0%;\n }\n 100% {\n background-position: 0% 0%;\n }\n`)\n\n/**\n * Adapted from - https://codepen.io/web-dot-dev/pen/vYrGPNE\n */\nexport const AnimatedGradientTypography: React.FC<\n React.ComponentProps<typeof Typography> & { color1?: string; color2?: string }\n> = styled(Typography, { name: 'AnimatedGradientTypography' })<{ color1?: string; color2?: string }>(({\n theme, color1, color2,\n}) => {\n return {\n // Set the color variables for the gradient\n '--color-one': color1 ?? theme.vars.palette.secondary.dark,\n '--color-two': color2 ?? theme.vars.palette.primary.light,\n // set the gradient so it has the same start and end color for looping effect\n 'background': `linear-gradient(\n .25turn,\n var(--color-one),\n var(--color-two),\n var(--color-one)\n )`,\n // Set the text color to transparent so the gradient shows through\n 'color': 'transparent',\n // Clip the background to the text shape\n 'backgroundClip': 'text',\n // Set the background size to 800% so we don't see the third color initially creating the looping effect\n 'backgroundSize': '800%',\n // Set the text to bold so the gradient is more visible\n 'fontWeight': 'bold',\n // Set the animation\n '@media (prefers-reduced-motion: no-preference)': {\n animationName: moveBg,\n animationDuration: '2s',\n animationIterationCount: 'infinite',\n },\n // reset for users that prefer reduced motion\n '@media (prefers-reduced-motion)': {\n background: 'none',\n color: theme.vars.palette.text.primary,\n },\n }\n})\n","export const splitAroundSubstring = (path: string, substring: string): [string, string, string] => {\n // Find the index of the substring\n const index = path.indexOf(substring)\n\n if (index === -1) {\n throw new Error(`XNS name \"${substring}\" not found in path.`)\n }\n\n // Extract the part before the substring\n const part1 = path.slice(0, index)\n\n // The substring itself is part2\n const part2 = substring\n\n // Extract the part after the substring\n const part3 = path.slice(index + substring.length)\n\n return [part1, part2, part3]\n}\n","import type { StandardTextFieldProps } from '@mui/material'\nimport { InputAdornment, TextField } from '@mui/material'\nimport React, { useCallback, useState } from 'react'\n\nimport { CopyIconButton } from './CopyIconButton.tsx'\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 onClickError = useCallback((error?: Error) => {\n setError(error)\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 value={shareUrl}\n {...props}\n slotProps={{\n input: {\n endAdornment: (\n <InputAdornment position=\"end\">\n <CopyIconButton shareLinkName={shareLinkName} shareUrl={shareUrl} onClickError={onClickError} />\n </InputAdornment>\n ),\n },\n }}\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 <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","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.vars.palette.primary.contrastText,\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 { ErrorRender } from '@xylabs/react-error'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'\nimport React, { useState } from 'react'\n\nimport { FacebookSvgIcon, XTwitterSvgIcon } from '../icons/index.ts'\n\nexport interface SocialButtonsFlexboxProps extends FlexBoxProps {\n shareUrl?: string\n uploadPayloads?: () => Promise<void>\n}\n\nexport const SocialButtonsFlexbox: React.FC<SocialButtonsFlexboxProps> = ({\n shareUrl, uploadPayloads, ...props\n}) => {\n const [error, setError] = useState<Error>()\n const [xLoading, setXLoading] = useState(false)\n const [fbLoading, setFbLoading] = useState(false)\n\n const handleClick = async (openUrl: () => void, buttonName: 'x' | 'fb') => {\n const setLoading = buttonName === 'x' ? setXLoading : setFbLoading\n try {\n setLoading(true)\n await uploadPayloads?.()\n setLoading(false)\n openUrl()\n } catch (e) {\n setLoading(false)\n console.error('Error uploading payloads', e)\n setError(e as Error)\n }\n }\n\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 busy={xLoading}\n onClick={async () => {\n const openUrl = () => window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`)\n await handleClick(openUrl, 'x')\n }}\n startIcon={<XTwitterSvgIcon width=\"20px\" />}\n >\n Share on X (Twitter)\n </ButtonEx>\n <ButtonEx\n busy={fbLoading}\n variant=\"contained\"\n style={{ backgroundColor: '#4267b2', color: '#fff' }}\n onClick={async () => {\n const openUrl = () => window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`)\n await handleClick(openUrl, 'fb')\n }}\n startIcon={<FacebookSvgIcon />}\n >\n Share on Facebook\n </ButtonEx>\n </>\n )\n : null}\n </FlexRow>\n <ErrorRender error={error} scope=\"SocialButtonsFlexbox\" />\n </FlexGrowCol>\n )\n}\n"],"mappings":";AAAA;AAAA,EACE,YAAY;AAAA,EAAc,SAAS;AAAA,EACnC,KAAK;AAAA,OACA;AAEP,SAAS,eAAe;AAExB,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EAAW;AAAA,EAAQ;AAAA,OACd;AAgCC,cAaA,YAbA;AAxBD,IAAM,cAA0C,CAAC;AAAA,EACtD,WAAW;AAAA,EAAM;AAAA,EAAW;AAAA,EAAM,GAAG;AACvC,MAAM;AACJ,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,YAAY,OAAO,IAAI;AAC7B,QAAM,CAAC,UAAU,WAAW,IAAI,SAA6B,IAAI;AACjE,QAAM,OAAO,aAAa,WAAW,SAAS;AAE9C,YAAU,MAAM;AACd,gBAAY,UAAU,OAAO;AAAA,EAC/B,GAAG,CAAC,CAAC;AAEL,SACE,qBAAC,WAAQ,KAAK,GACZ;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,UAAU;AAAA,QACV,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Y,SAAS,IAAI;AAAA,cACjC;AAAA,cACA,WAAW,gBAAAN,MAAC,mBAAgB;AAAA,cAC7B;AAAA;AAAA,UAED;AAAA,WACF,IAEF;AAAA;AAAA,IACN;AAAA,IACA,gBAAAA,MAAC,eAAY,OAAc,OAAM,wBAAuB;AAAA,KAC1D;AAEJ;","names":["jsx","jsxs","createSvgIcon","jsx","jsx","useEffect","jsx","Tooltip","Typography","useState","useState","jsx","jsx","jsxs","useState","error","Typography","Tooltip","useCallback","useState","jsx","useState","useCallback","error","Stack","Typography","jsx","jsxs","Tooltip","Typography","FlexGrowRow","jsx","jsxs","CircularProgress","styled","jsx","Typography","FlexGrowCol","jsx","jsxs","Typography","ButtonEx","FlexGrowCol","FlexRow","useState","jsx","jsxs","useState","FlexGrowCol","Typography","FlexRow","ButtonEx"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyLinkStack.d.ts","sourceRoot":"","sources":["../../../src/out/CopyLinkStack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAEN,MAAM,OAAO,CAAA;AAGd,OAAO,EACuB,KAAK,cAAc,EAChD,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,kBAAmB,SAAQ,cAAc,EAAE,UAAU;IACpE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"CopyLinkStack.d.ts","sourceRoot":"","sources":["../../../src/out/CopyLinkStack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAEN,MAAM,OAAO,CAAA;AAGd,OAAO,EACuB,KAAK,cAAc,EAChD,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,kBAAmB,SAAQ,cAAc,EAAE,UAAU;IACpE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmDtD,CAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { Typography } from '@mui/material';
|
|
2
|
+
import type React from 'react';
|
|
1
3
|
/**
|
|
2
4
|
* Adapted from - https://codepen.io/web-dot-dev/pen/vYrGPNE
|
|
3
5
|
*/
|
|
4
|
-
export declare const AnimatedGradientTypography:
|
|
6
|
+
export declare const AnimatedGradientTypography: React.FC<React.ComponentProps<typeof Typography> & {
|
|
5
7
|
color1?: string;
|
|
6
8
|
color2?: string;
|
|
7
|
-
}
|
|
9
|
+
}>;
|
|
8
10
|
//# sourceMappingURL=AnimatedGradientTypography.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedGradientTypography.d.ts","sourceRoot":"","sources":["../../../../src/out/lib/AnimatedGradientTypography.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimatedGradientTypography.d.ts","sourceRoot":"","sources":["../../../../src/out/lib/AnimatedGradientTypography.tsx"],"names":[],"mappings":"AAAA,OAAO,EACc,UAAU,EAC9B,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAc9B;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAC/C,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAmC9E,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-share",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.11",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -36,46 +36,87 @@
|
|
|
36
36
|
},
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
|
-
"module": "dist/browser/index.mjs",
|
|
40
|
-
"types": "dist/browser/index.d.ts",
|
|
41
39
|
"files": [
|
|
42
40
|
"dist",
|
|
43
|
-
"
|
|
41
|
+
"README.md"
|
|
44
42
|
],
|
|
45
|
-
"dependencies": {
|
|
46
|
-
"@xylabs/react-button": "~7.1.17",
|
|
47
|
-
"@xylabs/react-error": "~7.1.17",
|
|
48
|
-
"@xylabs/react-flexbox": "~7.1.17",
|
|
49
|
-
"@xylabs/react-link": "~7.1.17",
|
|
50
|
-
"@xylabs/sdk-js": "~5.0.90",
|
|
51
|
-
"react-helmet": "~6.1.0"
|
|
52
|
-
},
|
|
53
43
|
"devDependencies": {
|
|
54
|
-
"@mui/icons-material": "
|
|
55
|
-
"@mui/material": "
|
|
56
|
-
"@
|
|
44
|
+
"@mui/icons-material": "^7.3.10",
|
|
45
|
+
"@mui/material": "^7.3.10",
|
|
46
|
+
"@opentelemetry/api": "^1.9.1",
|
|
47
|
+
"@opentelemetry/sdk-trace-base": "^2.7.0",
|
|
48
|
+
"@storybook/react-vite": "~10.3.5",
|
|
49
|
+
"@types/node": "~25.6.0",
|
|
57
50
|
"@types/react": "^19.2.14",
|
|
58
51
|
"@types/react-helmet": "~6.1.11",
|
|
59
|
-
"@xylabs/
|
|
60
|
-
"@xylabs/
|
|
61
|
-
"react": "
|
|
62
|
-
"react-
|
|
63
|
-
"react-
|
|
64
|
-
"
|
|
52
|
+
"@xylabs/react-async-effect": "~7.1.20",
|
|
53
|
+
"@xylabs/react-button": "~7.1.20",
|
|
54
|
+
"@xylabs/react-dialogs": "~7.1.20",
|
|
55
|
+
"@xylabs/react-error": "~7.1.20",
|
|
56
|
+
"@xylabs/react-flexbox": "~7.1.20",
|
|
57
|
+
"@xylabs/react-link": "~7.1.20",
|
|
58
|
+
"@xylabs/react-promise": "~7.1.20",
|
|
59
|
+
"@xylabs/react-quick-tip-button": "~7.1.20",
|
|
60
|
+
"@xylabs/sdk-js": "^5.0.100",
|
|
61
|
+
"@xylabs/toolchain": "~7.11.9",
|
|
62
|
+
"@xylabs/tsconfig": "^7.11.9",
|
|
63
|
+
"@xylabs/tsconfig-dom": "^7.11.9",
|
|
64
|
+
"@xylabs/tsconfig-react": "~7.11.9",
|
|
65
|
+
"@xylabs/zod": "~5.0.100",
|
|
66
|
+
"async-mutex": "^0.5.0",
|
|
67
|
+
"axios": "^1.15.2",
|
|
68
|
+
"bn.js": "^5.2.3",
|
|
69
|
+
"bowser": "^2.14.1",
|
|
70
|
+
"buffer": "^6.0.3",
|
|
71
|
+
"chalk": "^5.6.2",
|
|
72
|
+
"esbuild": "~0.28.0",
|
|
73
|
+
"eslint": "^10.2.1",
|
|
74
|
+
"ethers": "^6.16.0",
|
|
75
|
+
"fast-deep-equal": "~3.1.3",
|
|
76
|
+
"js-cookie": "~3.0.5",
|
|
77
|
+
"pako": "^2.1.0",
|
|
78
|
+
"react": "^19.2.5",
|
|
79
|
+
"react-dom": "^19.2.5",
|
|
80
|
+
"react-helmet": "~6.1.0",
|
|
81
|
+
"spark-md5": "~3.0.2",
|
|
82
|
+
"storybook": "^10.3.5",
|
|
65
83
|
"typescript": "^5.9.3",
|
|
66
|
-
"vite": "
|
|
84
|
+
"vite": "^8.0.10",
|
|
67
85
|
"zod": "^4.3.6"
|
|
68
86
|
},
|
|
69
87
|
"peerDependencies": {
|
|
70
|
-
"@mui/icons-material": "
|
|
71
|
-
"@mui/material": "
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"react-
|
|
75
|
-
"
|
|
88
|
+
"@mui/icons-material": "^7.3.10",
|
|
89
|
+
"@mui/material": "^7.3.10",
|
|
90
|
+
"@opentelemetry/api": "^1.9.1",
|
|
91
|
+
"@opentelemetry/sdk-trace-base": "^2.7.0",
|
|
92
|
+
"@xylabs/react-async-effect": "~7.1.20",
|
|
93
|
+
"@xylabs/react-button": "~7.1.20",
|
|
94
|
+
"@xylabs/react-error": "~7.1.20",
|
|
95
|
+
"@xylabs/react-flexbox": "~7.1.20",
|
|
96
|
+
"@xylabs/react-link": "~7.1.20",
|
|
97
|
+
"@xylabs/react-quick-tip-button": "~7.1.20",
|
|
98
|
+
"@xylabs/sdk-js": "^5.0.100",
|
|
99
|
+
"@xylabs/tsconfig": "^7.11.9",
|
|
100
|
+
"@xylabs/tsconfig-dom": "^7.11.9",
|
|
101
|
+
"@xylabs/zod": "~5.0.100",
|
|
102
|
+
"async-mutex": "^0.5.0",
|
|
103
|
+
"axios": "^1.15.2",
|
|
104
|
+
"bn.js": "^5.2.3",
|
|
105
|
+
"bowser": "^2.14.1",
|
|
106
|
+
"buffer": "^6.0.3",
|
|
107
|
+
"chalk": "^5.6.2",
|
|
108
|
+
"ethers": "^6.16.0",
|
|
109
|
+
"fast-deep-equal": "~3.1.3",
|
|
110
|
+
"js-cookie": "~3.0.5",
|
|
111
|
+
"pako": "^2.1.0",
|
|
112
|
+
"react": "^19.2.5",
|
|
113
|
+
"react-dom": "^19.2.5",
|
|
114
|
+
"react-helmet": "~6.1.0",
|
|
115
|
+
"spark-md5": "~3.0.2",
|
|
116
|
+
"zod": "^4.3.6"
|
|
76
117
|
},
|
|
77
118
|
"publishConfig": {
|
|
78
119
|
"access": "public"
|
|
79
120
|
},
|
|
80
121
|
"docs": "dist/docs.json"
|
|
81
|
-
}
|
|
122
|
+
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@storybook/react-vite'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import { ShareButton } from './ShareButton.tsx'
|
|
5
|
-
|
|
6
|
-
export default { title: 'modules/ShareButton' } as Meta<typeof ShareButton>
|
|
7
|
-
|
|
8
|
-
const Template: StoryFn<typeof ShareButton> = (props) => {
|
|
9
|
-
return <ShareButton {...props} />
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const Default = Template.bind({})
|
|
13
|
-
Default.args = {}
|
|
14
|
-
|
|
15
|
-
const WithUnPrepared = Template.bind({})
|
|
16
|
-
WithUnPrepared.args = { prepared: false }
|
|
17
|
-
|
|
18
|
-
const WithCustomShareLink = Template.bind({})
|
|
19
|
-
WithCustomShareLink.args = { shareLink: 'https://explore.xyo.network' }
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
Default, WithCustomShareLink, WithUnPrepared,
|
|
23
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Facebook as FacebookIcon, Share as ShareIcon,
|
|
3
|
-
X as XIcon,
|
|
4
|
-
} from '@mui/icons-material'
|
|
5
|
-
import type { PopoverProps } from '@mui/material'
|
|
6
|
-
import { Popover } from '@mui/material'
|
|
7
|
-
import type { ButtonExProps } from '@xylabs/react-button'
|
|
8
|
-
import { ButtonEx } from '@xylabs/react-button'
|
|
9
|
-
import { FlexRow } from '@xylabs/react-flexbox'
|
|
10
|
-
import { LinkEx } from '@xylabs/react-link'
|
|
11
|
-
import React, { useRef, useState } from 'react'
|
|
12
|
-
|
|
13
|
-
export type ShareButtonProps = ButtonExProps & {
|
|
14
|
-
prepared?: boolean
|
|
15
|
-
shareLink?: string
|
|
16
|
-
slot?: { popover?: PopoverProps }
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const ShareButton: React.FC<ShareButtonProps> = ({
|
|
20
|
-
prepared = true, shareLink, slot, ...props
|
|
21
|
-
}) => {
|
|
22
|
-
const [expanded, setExpanded] = useState(false)
|
|
23
|
-
const anchorRef = useRef(null)
|
|
24
|
-
const link = shareLink ?? globalThis.location.href
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<FlexRow gap={1}>
|
|
28
|
-
<ButtonEx
|
|
29
|
-
variant="text"
|
|
30
|
-
minWidth={32}
|
|
31
|
-
size="small"
|
|
32
|
-
disabled={!prepared}
|
|
33
|
-
onClick={() => {
|
|
34
|
-
setExpanded(true)
|
|
35
|
-
}}
|
|
36
|
-
{...props}
|
|
37
|
-
>
|
|
38
|
-
<ShareIcon htmlColor="gray" fontSize="small" ref={anchorRef} />
|
|
39
|
-
</ButtonEx>
|
|
40
|
-
<Popover
|
|
41
|
-
open={prepared ? expanded : false}
|
|
42
|
-
anchorEl={anchorRef.current}
|
|
43
|
-
anchorOrigin={{ vertical: 'top', horizontal: 'right' }}
|
|
44
|
-
onClose={() => setExpanded(false)}
|
|
45
|
-
transitionDuration={500}
|
|
46
|
-
sx={{
|
|
47
|
-
ml: 1, top: -4, ...slot?.popover?.sx,
|
|
48
|
-
}}
|
|
49
|
-
{...slot?.popover}
|
|
50
|
-
>
|
|
51
|
-
<FlexRow gap={0.5} padding={0.5}>
|
|
52
|
-
<LinkEx
|
|
53
|
-
lineHeight={0}
|
|
54
|
-
onClick={() => {
|
|
55
|
-
window.open(`https://x.com/intent/tweet?url=${encodeURIComponent(link)}`)
|
|
56
|
-
setExpanded(false)
|
|
57
|
-
}}
|
|
58
|
-
>
|
|
59
|
-
<XIcon fontSize="small" />
|
|
60
|
-
</LinkEx>
|
|
61
|
-
<LinkEx
|
|
62
|
-
lineHeight={0}
|
|
63
|
-
style={{ color: '#4267b2' }}
|
|
64
|
-
onClick={() => {
|
|
65
|
-
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(link)}`)
|
|
66
|
-
setExpanded(false)
|
|
67
|
-
}}
|
|
68
|
-
>
|
|
69
|
-
<FacebookIcon fontSize="small" />
|
|
70
|
-
</LinkEx>
|
|
71
|
-
</FlexRow>
|
|
72
|
-
</Popover>
|
|
73
|
-
</FlexRow>
|
|
74
|
-
)
|
|
75
|
-
}
|
package/src/button/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ShareButton.tsx'
|
package/src/global.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@mui/material/themeCssVarsAugmentation'
|
package/src/icons/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './social/index.ts'
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @stylistic/max-len */
|
|
2
|
-
import { createSvgIcon } from '@mui/material'
|
|
3
|
-
import React from 'react'
|
|
4
|
-
|
|
5
|
-
export const FacebookSvgIcon = createSvgIcon(
|
|
6
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="800" width="1200" viewBox="-204.79995 -341.33325 1774.9329 2047.9995">
|
|
7
|
-
<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" />
|
|
8
|
-
<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" />
|
|
9
|
-
</svg>,
|
|
10
|
-
'Facebook',
|
|
11
|
-
)
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @stylistic/max-len */
|
|
2
|
-
import { createSvgIcon } from '@mui/material'
|
|
3
|
-
import React from 'react'
|
|
4
|
-
|
|
5
|
-
export const XTwitterSvgIcon = createSvgIcon(
|
|
6
|
-
<svg viewBox="0 0 1200 1227" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
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" />
|
|
8
|
-
</svg>,
|
|
9
|
-
'XTwitterSvgIcon',
|
|
10
|
-
)
|
package/src/index.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Helmet } from 'react-helmet'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The props for the DynamicShareImage component.
|
|
6
|
-
*/
|
|
7
|
-
export interface DynamicShareImageProps {
|
|
8
|
-
/**
|
|
9
|
-
* The URL of the share image for the page.
|
|
10
|
-
*/
|
|
11
|
-
image: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Used in conjunction with the XY Meta Server to dynamically set the share image for a page.
|
|
16
|
-
*/
|
|
17
|
-
export const DynamicShareImage: React.FC<DynamicShareImageProps> = ({ image }) => {
|
|
18
|
-
return (
|
|
19
|
-
<Helmet>
|
|
20
|
-
<meta property="xyo:og:image" content={image} />
|
|
21
|
-
</Helmet>
|
|
22
|
-
)
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './DynamicShareImage.tsx'
|
package/src/meta-server/index.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
2
|
-
import { FlexGrowRow } from '@xylabs/react-flexbox'
|
|
3
|
-
import type { PropsWithChildren } from 'react'
|
|
4
|
-
import React, { useEffect } from 'react'
|
|
5
|
-
|
|
6
|
-
export const HideParentsFlexbox: React.FC<PropsWithChildren & FlexBoxProps> = ({ children, ...props }) => {
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
const style = document.createElement('style')
|
|
9
|
-
document.head.append(style)
|
|
10
|
-
style.innerHTML = `
|
|
11
|
-
/** make all elements hidden */
|
|
12
|
-
* {
|
|
13
|
-
visibility: hidden;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** move the preview area to the top of the page */
|
|
17
|
-
#preview-area {
|
|
18
|
-
position: fixed;
|
|
19
|
-
top: 0;
|
|
20
|
-
left: 0;
|
|
21
|
-
width: 100%;
|
|
22
|
-
z-index: 9999;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** make the preview area and all its children visible */
|
|
26
|
-
#preview-area * {
|
|
27
|
-
visibility: visible;
|
|
28
|
-
}`
|
|
29
|
-
|
|
30
|
-
return () => {
|
|
31
|
-
style.remove()
|
|
32
|
-
}
|
|
33
|
-
}, [])
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<FlexGrowRow alignItems="stretch" id="preview-area" justifyContent="start" {...props}>
|
|
37
|
-
{children}
|
|
38
|
-
</FlexGrowRow>
|
|
39
|
-
)
|
|
40
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './HideParentsFlexbox.tsx'
|