@xyo-network/react-share 3.0.2 → 3.0.4
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 +197 -46
- 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/CopyIconButton.d.ts +8 -0
- package/dist/browser/out/CopyIconButton.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/CopyLinkTypography.d.ts +7 -0
- package/dist/browser/out/CopyLinkTypography.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 +8 -0
- package/dist/browser/out/index.d.ts.map +1 -0
- package/dist/browser/out/lib/AnimatedGradientTypography.d.ts +4 -0
- package/dist/browser/out/lib/AnimatedGradientTypography.d.ts.map +1 -0
- package/dist/browser/out/lib/ShareLinkProps.d.ts +6 -0
- package/dist/browser/out/lib/ShareLinkProps.d.ts.map +1 -0
- package/dist/browser/out/lib/index.d.ts +4 -0
- package/dist/browser/out/lib/index.d.ts.map +1 -0
- package/dist/browser/out/lib/splitAroundSubstring.d.ts +2 -0
- package/dist/browser/out/lib/splitAroundSubstring.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/CopyIconButton.tsx +46 -0
- package/src/out/CopyLinkTextField.stories.tsx +2 -6
- package/src/out/CopyLinkTextField.tsx +11 -21
- package/src/out/CopyLinkTypography.stories.tsx +30 -0
- package/src/out/CopyLinkTypography.tsx +56 -0
- 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/src/out/index.ts +1 -0
- package/src/out/lib/AnimatedGradientTypography.tsx +50 -0
- package/src/out/lib/ShareLinkProps.ts +5 -0
- package/src/out/lib/index.ts +3 -0
- package/src/out/lib/splitAroundSubstring.ts +19 -0
- 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"}
|
package/dist/browser/index.mjs
CHANGED
|
@@ -137,26 +137,51 @@ var HideParentsFlexbox = /* @__PURE__ */ __name(({ children, ...props }) => {
|
|
|
137
137
|
}, "HideParentsFlexbox");
|
|
138
138
|
|
|
139
139
|
// src/out/CopyLinkTextField.tsx
|
|
140
|
+
import { InputAdornment, TextField } from "@mui/material";
|
|
141
|
+
import React7, { useCallback, useState as useState3 } from "react";
|
|
142
|
+
|
|
143
|
+
// src/out/CopyIconButton.tsx
|
|
140
144
|
import { CopyAllRounded } from "@mui/icons-material";
|
|
141
|
-
import { IconButton,
|
|
145
|
+
import { IconButton, Tooltip } from "@mui/material";
|
|
142
146
|
import { forget } from "@xylabs/forget";
|
|
143
147
|
import React6, { useState as useState2 } from "react";
|
|
144
|
-
var
|
|
145
|
-
|
|
148
|
+
var CopyLink = "Copy Link";
|
|
149
|
+
var Copied = "Copied!";
|
|
150
|
+
var CopyIconButton = /* @__PURE__ */ __name(({ onCopyToClipboard, shareLinkName, shareUrl, ...props }) => {
|
|
151
|
+
const [copyTooltipTitle, setCopyToolTipTitle] = useState2(CopyLink);
|
|
146
152
|
const copyToClipboard = /* @__PURE__ */ __name(async (link) => {
|
|
147
153
|
if (link) {
|
|
148
154
|
try {
|
|
149
155
|
await navigator.clipboard.writeText(link);
|
|
156
|
+
onCopyToClipboard?.();
|
|
157
|
+
setCopyToolTipTitle(Copied);
|
|
158
|
+
setTimeout(() => setCopyToolTipTitle(CopyLink), 2e3);
|
|
150
159
|
} catch (e) {
|
|
151
160
|
const message = "Error copying shareUrl to clipboard";
|
|
152
161
|
console.error(message, e, link);
|
|
153
|
-
|
|
162
|
+
onCopyToClipboard?.(new Error(message));
|
|
154
163
|
}
|
|
155
164
|
} else {
|
|
156
165
|
console.warn("tried to copy shareUrl before it was generated");
|
|
157
166
|
}
|
|
158
167
|
}, "copyToClipboard");
|
|
159
|
-
return /* @__PURE__ */ React6.createElement(
|
|
168
|
+
return /* @__PURE__ */ React6.createElement(Tooltip, {
|
|
169
|
+
title: copyTooltipTitle
|
|
170
|
+
}, /* @__PURE__ */ React6.createElement(IconButton, {
|
|
171
|
+
"aria-label": `copy ${shareLinkName} link`,
|
|
172
|
+
onClick: /* @__PURE__ */ __name(() => forget(copyToClipboard(shareUrl)), "onClick"),
|
|
173
|
+
edge: "end",
|
|
174
|
+
...props
|
|
175
|
+
}, /* @__PURE__ */ React6.createElement(CopyAllRounded, null)));
|
|
176
|
+
}, "CopyIconButton");
|
|
177
|
+
|
|
178
|
+
// src/out/CopyLinkTextField.tsx
|
|
179
|
+
var CopyLinkTextField = /* @__PURE__ */ __name(({ shareLinkName, shareUrl, ...props }) => {
|
|
180
|
+
const [error, setError] = useState3();
|
|
181
|
+
const onCopyToClipboard = useCallback((error2) => {
|
|
182
|
+
setError(error2);
|
|
183
|
+
}, []);
|
|
184
|
+
return /* @__PURE__ */ React7.createElement(TextField, {
|
|
160
185
|
disabled: true,
|
|
161
186
|
error: !!error,
|
|
162
187
|
helperText: error?.message,
|
|
@@ -167,68 +192,193 @@ var CopyLinkTextField = /* @__PURE__ */ __name(({ shareLinkName, shareUrl, ...pr
|
|
|
167
192
|
}
|
|
168
193
|
},
|
|
169
194
|
InputProps: {
|
|
170
|
-
endAdornment: /* @__PURE__ */
|
|
195
|
+
endAdornment: /* @__PURE__ */ React7.createElement(InputAdornment, {
|
|
171
196
|
position: "end"
|
|
172
|
-
}, /* @__PURE__ */
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
197
|
+
}, /* @__PURE__ */ React7.createElement(CopyIconButton, {
|
|
198
|
+
shareLinkName,
|
|
199
|
+
shareUrl,
|
|
200
|
+
onCopyToClipboard
|
|
201
|
+
}))
|
|
177
202
|
},
|
|
178
203
|
value: shareUrl,
|
|
179
204
|
...props
|
|
180
205
|
});
|
|
181
206
|
}, "CopyLinkTextField");
|
|
182
207
|
|
|
208
|
+
// src/out/CopyLinkTypography.tsx
|
|
209
|
+
import { Cancel } from "@mui/icons-material";
|
|
210
|
+
import { Stack, Tooltip as Tooltip2, Typography as Typography2 } from "@mui/material";
|
|
211
|
+
import React8, { useCallback as useCallback2, useMemo, useState as useState4 } from "react";
|
|
212
|
+
|
|
213
|
+
// src/out/lib/AnimatedGradientTypography.tsx
|
|
214
|
+
import { keyframes, styled, Typography } from "@mui/material";
|
|
215
|
+
var moveBg = keyframes(`
|
|
216
|
+
0% {
|
|
217
|
+
background-position: 100% 0%;
|
|
218
|
+
}
|
|
219
|
+
100% {
|
|
220
|
+
background-position: 0% 0%;
|
|
221
|
+
}
|
|
222
|
+
`);
|
|
223
|
+
var AnimatedGradientTypography = styled(Typography, {
|
|
224
|
+
name: "AnimatedGradientTypography"
|
|
225
|
+
})(({ theme }) => ({
|
|
226
|
+
// Set the color variables for the gradient
|
|
227
|
+
"--color-one": theme.palette.secondary.dark,
|
|
228
|
+
"--color-two": theme.palette.primary.light,
|
|
229
|
+
// set the gradient so it has the same start and end color for looping effect
|
|
230
|
+
"background": `linear-gradient(
|
|
231
|
+
.25turn,
|
|
232
|
+
var(--color-one),
|
|
233
|
+
var(--color-two),
|
|
234
|
+
var(--color-one)
|
|
235
|
+
)`,
|
|
236
|
+
// Set the text color to transparent so the gradient shows through
|
|
237
|
+
"color": "transparent",
|
|
238
|
+
// Clip the background to the text shape
|
|
239
|
+
"backgroundClip": "text",
|
|
240
|
+
// Set the background size to 800% so we don't see the third color initially creating the looping effect
|
|
241
|
+
"backgroundSize": "800%",
|
|
242
|
+
// Set the text to bold so the gradient is more visible
|
|
243
|
+
"fontWeight": "bold",
|
|
244
|
+
// Set the animation
|
|
245
|
+
"@media (prefers-reduced-motion: no-preference)": {
|
|
246
|
+
animationName: moveBg,
|
|
247
|
+
animationDuration: "2s",
|
|
248
|
+
animationIterationCount: "infinite"
|
|
249
|
+
},
|
|
250
|
+
// reset for users that prefer reduced motion
|
|
251
|
+
"@media (prefers-reduced-motion)": {
|
|
252
|
+
background: "none",
|
|
253
|
+
color: theme.palette.text.primary
|
|
254
|
+
}
|
|
255
|
+
}));
|
|
256
|
+
|
|
257
|
+
// src/out/lib/splitAroundSubstring.ts
|
|
258
|
+
var splitAroundSubstring = /* @__PURE__ */ __name((path, substring) => {
|
|
259
|
+
const index = path.indexOf(substring);
|
|
260
|
+
if (index === -1) {
|
|
261
|
+
throw new Error(`XNS name "${substring}" not found in path.`);
|
|
262
|
+
}
|
|
263
|
+
const part1 = path.slice(0, index);
|
|
264
|
+
const part2 = substring;
|
|
265
|
+
const part3 = path.slice(index + substring.length);
|
|
266
|
+
return [
|
|
267
|
+
part1,
|
|
268
|
+
part2,
|
|
269
|
+
part3
|
|
270
|
+
];
|
|
271
|
+
}, "splitAroundSubstring");
|
|
272
|
+
|
|
273
|
+
// src/out/CopyLinkTypography.tsx
|
|
274
|
+
var CopyLinkTypography = /* @__PURE__ */ __name(({ shareLinkName, shareUrl, xnsName: xnsNameProp, ...props }) => {
|
|
275
|
+
const [error, setError] = useState4();
|
|
276
|
+
const onCopyToClipboard = useCallback2((error2) => {
|
|
277
|
+
setError(error2);
|
|
278
|
+
}, []);
|
|
279
|
+
const parsedXnsName = useMemo(() => {
|
|
280
|
+
if (shareUrl && xnsNameProp) {
|
|
281
|
+
try {
|
|
282
|
+
const parts = splitAroundSubstring(shareUrl, xnsNameProp);
|
|
283
|
+
return parts;
|
|
284
|
+
} catch (e) {
|
|
285
|
+
setError(e);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}, []);
|
|
289
|
+
const [part1, xnsName, part3] = parsedXnsName || [];
|
|
290
|
+
return /* @__PURE__ */ React8.createElement(Stack, {
|
|
291
|
+
direction: "row",
|
|
292
|
+
alignItems: "center",
|
|
293
|
+
gap: 0.25
|
|
294
|
+
}, xnsName ? /* @__PURE__ */ React8.createElement(Stack, {
|
|
295
|
+
direction: "row"
|
|
296
|
+
}, /* @__PURE__ */ React8.createElement(Typography2, {
|
|
297
|
+
sx: {
|
|
298
|
+
display: "inline-flex"
|
|
299
|
+
},
|
|
300
|
+
...props
|
|
301
|
+
}, part1), /* @__PURE__ */ React8.createElement(AnimatedGradientTypography, {
|
|
302
|
+
sx: {
|
|
303
|
+
display: "inline-flex"
|
|
304
|
+
},
|
|
305
|
+
...props
|
|
306
|
+
}, xnsName), /* @__PURE__ */ React8.createElement(Typography2, {
|
|
307
|
+
sx: {
|
|
308
|
+
display: "inline-flex"
|
|
309
|
+
},
|
|
310
|
+
...props
|
|
311
|
+
}, part3)) : /* @__PURE__ */ React8.createElement(Typography2, {
|
|
312
|
+
sx: {
|
|
313
|
+
display: "inline-flex"
|
|
314
|
+
},
|
|
315
|
+
...props
|
|
316
|
+
}, shareUrl), /* @__PURE__ */ React8.createElement(CopyIconButton, {
|
|
317
|
+
onCopyToClipboard,
|
|
318
|
+
shareLinkName,
|
|
319
|
+
shareUrl,
|
|
320
|
+
sx: {
|
|
321
|
+
display: "inline-flex"
|
|
322
|
+
}
|
|
323
|
+
}), error ? /* @__PURE__ */ React8.createElement(Tooltip2, {
|
|
324
|
+
title: error.message
|
|
325
|
+
}, /* @__PURE__ */ React8.createElement(Cancel, {
|
|
326
|
+
color: "error",
|
|
327
|
+
sx: {
|
|
328
|
+
display: "inline-flex"
|
|
329
|
+
}
|
|
330
|
+
})) : null);
|
|
331
|
+
}, "CopyLinkTypography");
|
|
332
|
+
|
|
183
333
|
// src/out/Dialog.tsx
|
|
184
|
-
import { Dialog, DialogActions, DialogContent, DialogTitle, Stack, Typography } from "@mui/material";
|
|
334
|
+
import { Dialog, DialogActions, DialogContent, DialogTitle, Stack as Stack2, Typography as Typography3 } from "@mui/material";
|
|
185
335
|
import { FlexCol, FlexGrowCol } from "@xylabs/react-flexbox";
|
|
186
|
-
import
|
|
336
|
+
import React9 from "react";
|
|
187
337
|
var ShareOutDialog = /* @__PURE__ */ __name(({ ShareOutDialogActions, cardImg, open, onClose, shareOutDialogContent, subtitle, title, ...props }) => {
|
|
188
338
|
const handleClose = /* @__PURE__ */ __name(() => {
|
|
189
339
|
onClose?.("", "backdropClick");
|
|
190
340
|
}, "handleClose");
|
|
191
|
-
return /* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ React9.createElement(Dialog, {
|
|
192
342
|
onClose,
|
|
193
343
|
open,
|
|
194
344
|
...props
|
|
195
|
-
}, /* @__PURE__ */
|
|
345
|
+
}, /* @__PURE__ */ React9.createElement(DialogTitle, null, /* @__PURE__ */ React9.createElement(Stack2, {
|
|
196
346
|
direction: "row",
|
|
197
347
|
spacing: 2
|
|
198
|
-
}, /* @__PURE__ */
|
|
348
|
+
}, /* @__PURE__ */ React9.createElement(FlexGrowCol, {
|
|
199
349
|
alignItems: "flex-start",
|
|
200
350
|
width: "60%"
|
|
201
|
-
}, /* @__PURE__ */
|
|
351
|
+
}, /* @__PURE__ */ React9.createElement(Typography3, {
|
|
202
352
|
variant: "h5"
|
|
203
|
-
}, title), /* @__PURE__ */
|
|
353
|
+
}, title), /* @__PURE__ */ React9.createElement(Typography3, {
|
|
204
354
|
variant: "body1"
|
|
205
|
-
}, " ", subtitle)), /* @__PURE__ */
|
|
355
|
+
}, " ", subtitle)), /* @__PURE__ */ React9.createElement(FlexGrowCol, {
|
|
206
356
|
alignItems: "flex-end",
|
|
207
357
|
width: "40%"
|
|
208
|
-
}, cardImg))), /* @__PURE__ */
|
|
358
|
+
}, cardImg))), /* @__PURE__ */ React9.createElement(DialogContent, null, shareOutDialogContent, /* @__PURE__ */ React9.createElement(FlexCol, {
|
|
209
359
|
alignItems: "stretch"
|
|
210
|
-
})), ShareOutDialogActions ? /* @__PURE__ */
|
|
360
|
+
})), ShareOutDialogActions ? /* @__PURE__ */ React9.createElement(DialogActions, null, /* @__PURE__ */ React9.createElement(ShareOutDialogActions, {
|
|
211
361
|
onClose: handleClose
|
|
212
362
|
})) : null);
|
|
213
363
|
}, "ShareOutDialog");
|
|
214
364
|
|
|
215
365
|
// src/out/Explanation.tsx
|
|
216
366
|
import { InfoOutlined } from "@mui/icons-material";
|
|
217
|
-
import { Tooltip, Typography as
|
|
367
|
+
import { Tooltip as Tooltip3, Typography as Typography4, useTheme } from "@mui/material";
|
|
218
368
|
import { FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
|
|
219
|
-
import
|
|
369
|
+
import React10 from "react";
|
|
220
370
|
var ShareOutExplanation = /* @__PURE__ */ __name(({ toolTipTitle }) => {
|
|
221
371
|
const theme = useTheme();
|
|
222
372
|
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.";
|
|
223
|
-
return /* @__PURE__ */
|
|
373
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(FlexGrowRow2, {
|
|
224
374
|
alignItems: "center"
|
|
225
|
-
}, /* @__PURE__ */
|
|
375
|
+
}, /* @__PURE__ */ React10.createElement(Typography4, {
|
|
226
376
|
variant: "body2",
|
|
227
377
|
paddingRight: 0.5
|
|
228
|
-
}, "What am I sharing?"), /* @__PURE__ */
|
|
378
|
+
}, "What am I sharing?"), /* @__PURE__ */ React10.createElement(Tooltip3, {
|
|
229
379
|
title,
|
|
230
380
|
placement: "bottom"
|
|
231
|
-
}, /* @__PURE__ */
|
|
381
|
+
}, /* @__PURE__ */ React10.createElement(InfoOutlined, {
|
|
232
382
|
fontSize: "small",
|
|
233
383
|
sx: {
|
|
234
384
|
fontSize: theme.typography.caption.fontSize
|
|
@@ -237,18 +387,18 @@ var ShareOutExplanation = /* @__PURE__ */ __name(({ toolTipTitle }) => {
|
|
|
237
387
|
}, "ShareOutExplanation");
|
|
238
388
|
|
|
239
389
|
// src/out/GenerateShareLinkButton.tsx
|
|
240
|
-
import { Button, CircularProgress, styled } from "@mui/material";
|
|
241
|
-
import
|
|
390
|
+
import { Button, CircularProgress, styled as styled2 } from "@mui/material";
|
|
391
|
+
import React11 from "react";
|
|
242
392
|
var GenerateShareLinkButton = /* @__PURE__ */ __name(({ children = "Generate My Share Link", loading, ...props }) => {
|
|
243
|
-
return /* @__PURE__ */
|
|
393
|
+
return /* @__PURE__ */ React11.createElement(Button, {
|
|
244
394
|
variant: "contained",
|
|
245
|
-
startIcon: loading ? /* @__PURE__ */
|
|
395
|
+
startIcon: loading ? /* @__PURE__ */ React11.createElement(StyledCircularProgress, {
|
|
246
396
|
size: "small"
|
|
247
397
|
}) : null,
|
|
248
398
|
...props
|
|
249
399
|
}, children);
|
|
250
400
|
}, "GenerateShareLinkButton");
|
|
251
|
-
var StyledCircularProgress =
|
|
401
|
+
var StyledCircularProgress = styled2(CircularProgress, {
|
|
252
402
|
name: "StyledCircularProgress"
|
|
253
403
|
})(({ theme }) => ({
|
|
254
404
|
// ensure the color of the spinner is the same as the button color
|
|
@@ -259,37 +409,37 @@ var StyledCircularProgress = styled(CircularProgress, {
|
|
|
259
409
|
}));
|
|
260
410
|
|
|
261
411
|
// src/out/HeadingFlexbox.tsx
|
|
262
|
-
import { Typography as
|
|
412
|
+
import { Typography as Typography5 } from "@mui/material";
|
|
263
413
|
import { FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
|
|
264
|
-
import
|
|
414
|
+
import React12 from "react";
|
|
265
415
|
var ShareOutHeadingFlexbox = /* @__PURE__ */ __name(({ children, shareLinkName, shareUrl, ...props }) => {
|
|
266
416
|
const GenerateShareLinkExplanation = "When you generate your share link, we'll make a small amount of your data public so friends can check it out!";
|
|
267
|
-
return /* @__PURE__ */
|
|
417
|
+
return /* @__PURE__ */ React12.createElement(FlexGrowCol2, {
|
|
268
418
|
alignItems: "flex-start",
|
|
269
419
|
paddingBottom: 1,
|
|
270
420
|
...props
|
|
271
|
-
}, /* @__PURE__ */
|
|
421
|
+
}, /* @__PURE__ */ React12.createElement(Typography5, {
|
|
272
422
|
variant: "body1",
|
|
273
423
|
gutterBottom: true
|
|
274
|
-
}, /* @__PURE__ */
|
|
424
|
+
}, /* @__PURE__ */ React12.createElement("strong", null, "Your Share Link")), /* @__PURE__ */ React12.createElement(Typography5, {
|
|
275
425
|
variant: "body1"
|
|
276
426
|
}, shareUrl ? `Use this link or the buttons below to share ${shareLinkName}` : GenerateShareLinkExplanation), children);
|
|
277
427
|
}, "ShareOutHeadingFlexbox");
|
|
278
428
|
|
|
279
429
|
// src/out/SocialButtonsFlexbox.tsx
|
|
280
|
-
import { Typography as
|
|
430
|
+
import { Typography as Typography6 } from "@mui/material";
|
|
281
431
|
import { ButtonEx as ButtonEx2 } from "@xylabs/react-button";
|
|
282
432
|
import { FlexGrowCol as FlexGrowCol3, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
283
|
-
import
|
|
433
|
+
import React13 from "react";
|
|
284
434
|
var SocialButtonsFlexbox = /* @__PURE__ */ __name(({ shareUrl, ...props }) => {
|
|
285
|
-
return /* @__PURE__ */
|
|
435
|
+
return /* @__PURE__ */ React13.createElement(FlexGrowCol3, {
|
|
286
436
|
alignItems: "stretch",
|
|
287
437
|
paddingTop: 2,
|
|
288
438
|
...props
|
|
289
|
-
}, /* @__PURE__ */
|
|
439
|
+
}, /* @__PURE__ */ React13.createElement(Typography6, {
|
|
290
440
|
variant: "body1",
|
|
291
441
|
gutterBottom: true
|
|
292
|
-
}, /* @__PURE__ */
|
|
442
|
+
}, /* @__PURE__ */ React13.createElement("strong", null, "Share on Social Media")), /* @__PURE__ */ React13.createElement(FlexRow2, {
|
|
293
443
|
gap: 0.5,
|
|
294
444
|
sx: {
|
|
295
445
|
flexDirection: {
|
|
@@ -297,7 +447,7 @@ var SocialButtonsFlexbox = /* @__PURE__ */ __name(({ shareUrl, ...props }) => {
|
|
|
297
447
|
xs: "column"
|
|
298
448
|
}
|
|
299
449
|
}
|
|
300
|
-
}, shareUrl ? /* @__PURE__ */
|
|
450
|
+
}, shareUrl ? /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(ButtonEx2, {
|
|
301
451
|
variant: "contained",
|
|
302
452
|
style: {
|
|
303
453
|
backgroundColor: "#000",
|
|
@@ -306,10 +456,10 @@ var SocialButtonsFlexbox = /* @__PURE__ */ __name(({ shareUrl, ...props }) => {
|
|
|
306
456
|
onClick: /* @__PURE__ */ __name(() => {
|
|
307
457
|
window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(shareUrl)}`);
|
|
308
458
|
}, "onClick"),
|
|
309
|
-
startIcon: /* @__PURE__ */
|
|
459
|
+
startIcon: /* @__PURE__ */ React13.createElement(XTwitterSvgIcon, {
|
|
310
460
|
width: "20px"
|
|
311
461
|
})
|
|
312
|
-
}, "Share on X (Twitter)"), /* @__PURE__ */
|
|
462
|
+
}, "Share on X (Twitter)"), /* @__PURE__ */ React13.createElement(ButtonEx2, {
|
|
313
463
|
variant: "contained",
|
|
314
464
|
style: {
|
|
315
465
|
backgroundColor: "#4267b2",
|
|
@@ -318,11 +468,12 @@ var SocialButtonsFlexbox = /* @__PURE__ */ __name(({ shareUrl, ...props }) => {
|
|
|
318
468
|
onClick: /* @__PURE__ */ __name(() => {
|
|
319
469
|
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`);
|
|
320
470
|
}, "onClick"),
|
|
321
|
-
startIcon: /* @__PURE__ */
|
|
471
|
+
startIcon: /* @__PURE__ */ React13.createElement(FacebookSvgIcon, null)
|
|
322
472
|
}, "Share on Facebook")) : null));
|
|
323
473
|
}, "SocialButtonsFlexbox");
|
|
324
474
|
export {
|
|
325
475
|
CopyLinkTextField,
|
|
476
|
+
CopyLinkTypography,
|
|
326
477
|
DynamicShareImage,
|
|
327
478
|
FacebookSvgIcon,
|
|
328
479
|
GenerateShareLinkButton,
|