@postrun/react 2.3.0 → 2.5.0
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/index.cjs +1159 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +194 -5
- package/dist/index.d.ts +194 -5
- package/dist/index.js +1145 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createContext, memo, useMemo, useState, useEffect, Fragment as Fragment$1,
|
|
2
|
+
import { createContext, memo, useMemo, useState, useEffect, useRef, useLayoutEffect, Fragment as Fragment$1, useCallback, createElement, useContext, useId } from 'react';
|
|
3
3
|
import { useInfiniteQuery, useQuery, useMutation, QueryClient } from '@tanstack/react-query';
|
|
4
|
-
import { createPostrunClient, profilesList, profilesGet, profilesCreate, profilesUpdate, profilesDelete, connectionsConnect, connectionsListByProfile, connectionsGet, connectionsListAccounts, connectionsSelect, connectionsDelete, mediaGet, mediaList, mediaUpdate, mediaDelete, postsList, postsGet, postsCreate, buildCreatePost, isPostPlatform, failedVariants, isPublished, postsValidate, postsUpdate, postsDelete, tiktokCreatorInfo, mediaCreate, PostrunError } from '@postrun/js';
|
|
4
|
+
import { linkedinPollDurationLabel, createPostrunClient, profilesList, profilesGet, profilesCreate, profilesUpdate, profilesDelete, connectionsConnect, connectionsListByProfile, connectionsGet, connectionsListAccounts, connectionsSelect, connectionsDelete, mediaGet, mediaList, mediaUpdate, mediaDelete, postsList, postsGet, postsCreate, buildCreatePost, isPostPlatform, failedVariants, isPublished, postsValidate, postsUpdate, postsDelete, tiktokCreatorInfo, audiencePrivacyOptions, audienceUnselected, tiktokPrivacyLabel, parsePrivacyLevel, TIKTOK_AUDIENCE_REQUIRED_HINT, captionMaxFor, commercialLabelNotice, commercialDisclosureIncomplete, setCommercialDisclosure, setBrandKind, TIKTOK_DISCLOSURE_REQUIRED_HINT, TIKTOK_BRANDED_CONTENT_POLICY_URL, TIKTOK_MUSIC_CONFIRMATION_URL, interactionRows, interactionValueKey, toggleInteraction, tiktokOptionsReady, TIKTOK_PROCESSING_NOTICE, brandedContentDeclared, mediaCreate, PostrunError } from '@postrun/js';
|
|
5
|
+
export { TIKTOK_CAPTION_MAX, captionMaxFor } from '@postrun/js';
|
|
5
6
|
import Nango, { AuthError } from '@nangohq/frontend';
|
|
6
7
|
import pWaitFor, { TimeoutError } from 'p-wait-for';
|
|
7
8
|
import pLimit from 'p-limit';
|
|
8
9
|
import pRetry, { AbortError } from 'p-retry';
|
|
9
10
|
import axios, { isAxiosError } from 'axios';
|
|
10
11
|
import { enrichTweet, TweetContainer, TweetHeader, TweetInReplyTo, TweetBody, TweetMedia, QuotedTweet } from 'react-tweet';
|
|
11
|
-
import { FiMessageCircle, FiRepeat, FiHeart, FiBarChart2, FiShare, FiGlobe, FiUsers, FiThumbsUp, FiMessageSquare, FiSend } from 'react-icons/fi';
|
|
12
|
+
import { FiMessageCircle, FiRepeat, FiHeart, FiBarChart2, FiShare, FiGlobe, FiUsers, FiThumbsUp, FiMessageSquare, FiSend, FiFileText } from 'react-icons/fi';
|
|
12
13
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
14
|
import twitterText from 'twitter-text';
|
|
14
15
|
import { LuBadgeCheck } from 'react-icons/lu';
|
|
16
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
17
|
+
import { IoMusicalNotes } from 'react-icons/io5';
|
|
15
18
|
|
|
16
19
|
// src/context.tsx
|
|
17
20
|
function createDefaultQueryClient() {
|
|
@@ -1041,7 +1044,7 @@ var ACTIONS = [
|
|
|
1041
1044
|
{ label: "Share", Icon: FiShare }
|
|
1042
1045
|
];
|
|
1043
1046
|
function XPreviewActions() {
|
|
1044
|
-
return /* @__PURE__ */ jsx("div", { style: ROW, children: ACTIONS.map(({ label, Icon }) => /* @__PURE__ */ jsx(
|
|
1047
|
+
return /* @__PURE__ */ jsx("div", { style: ROW, children: ACTIONS.map(({ label, Icon: Icon2 }) => /* @__PURE__ */ jsx(Icon2, { size: 18, "aria-label": label, role: "img" }, label)) });
|
|
1045
1048
|
}
|
|
1046
1049
|
var {
|
|
1047
1050
|
extractCashtagsWithIndices,
|
|
@@ -1328,6 +1331,111 @@ function useIsDark(theme) {
|
|
|
1328
1331
|
}
|
|
1329
1332
|
return theme === "dark";
|
|
1330
1333
|
}
|
|
1334
|
+
function domainOf(source) {
|
|
1335
|
+
try {
|
|
1336
|
+
return new URL(source).hostname.replace(/^www\./, "");
|
|
1337
|
+
} catch {
|
|
1338
|
+
return source;
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
function ArticleCard({ article, thumbnail }) {
|
|
1342
|
+
return /* @__PURE__ */ jsxs("div", { style: cardStyle, children: [
|
|
1343
|
+
thumbnail ? /* @__PURE__ */ jsx("img", { src: thumbnail.src, alt: thumbnail.alt ?? "", style: thumbStyle }) : null,
|
|
1344
|
+
/* @__PURE__ */ jsxs("div", { style: metaStyle, children: [
|
|
1345
|
+
/* @__PURE__ */ jsx("div", { style: domainStyle, children: domainOf(article.source) }),
|
|
1346
|
+
article.title ? /* @__PURE__ */ jsx("div", { style: titleStyle, children: article.title }) : null,
|
|
1347
|
+
article.description ? /* @__PURE__ */ jsx("div", { style: descStyle, children: article.description }) : null
|
|
1348
|
+
] })
|
|
1349
|
+
] });
|
|
1350
|
+
}
|
|
1351
|
+
var cardStyle = {
|
|
1352
|
+
border: `1px solid ${varRef(LI_VAR.border)}`,
|
|
1353
|
+
borderRadius: 8,
|
|
1354
|
+
overflow: "hidden"
|
|
1355
|
+
};
|
|
1356
|
+
var thumbStyle = {
|
|
1357
|
+
width: "100%",
|
|
1358
|
+
display: "block",
|
|
1359
|
+
aspectRatio: "1.91 / 1",
|
|
1360
|
+
objectFit: "cover"
|
|
1361
|
+
};
|
|
1362
|
+
var metaStyle = {
|
|
1363
|
+
padding: "8px 12px",
|
|
1364
|
+
display: "flex",
|
|
1365
|
+
flexDirection: "column",
|
|
1366
|
+
gap: 2
|
|
1367
|
+
};
|
|
1368
|
+
var domainStyle = {
|
|
1369
|
+
fontSize: 12,
|
|
1370
|
+
color: varRef(LI_VAR.muted)
|
|
1371
|
+
};
|
|
1372
|
+
var titleStyle = {
|
|
1373
|
+
fontSize: 14,
|
|
1374
|
+
fontWeight: 600,
|
|
1375
|
+
color: varRef(LI_VAR.text),
|
|
1376
|
+
lineHeight: 1.3,
|
|
1377
|
+
display: "-webkit-box",
|
|
1378
|
+
WebkitLineClamp: 2,
|
|
1379
|
+
WebkitBoxOrient: "vertical",
|
|
1380
|
+
overflow: "hidden"
|
|
1381
|
+
};
|
|
1382
|
+
var descStyle = {
|
|
1383
|
+
fontSize: 12,
|
|
1384
|
+
color: varRef(LI_VAR.muted),
|
|
1385
|
+
lineHeight: 1.3,
|
|
1386
|
+
display: "-webkit-box",
|
|
1387
|
+
WebkitLineClamp: 1,
|
|
1388
|
+
WebkitBoxOrient: "vertical",
|
|
1389
|
+
overflow: "hidden"
|
|
1390
|
+
};
|
|
1391
|
+
function DocumentCard({ document, cover }) {
|
|
1392
|
+
return /* @__PURE__ */ jsxs("div", { style: cardStyle2, children: [
|
|
1393
|
+
/* @__PURE__ */ jsx("div", { style: pageStyle, children: cover ? /* @__PURE__ */ jsx("img", { src: cover.src, alt: cover.alt ?? "", style: coverStyle }) : /* @__PURE__ */ jsx(FiFileText, { size: 56, "aria-hidden": true, style: { opacity: 0.5 } }) }),
|
|
1394
|
+
/* @__PURE__ */ jsxs("div", { style: barStyle, children: [
|
|
1395
|
+
/* @__PURE__ */ jsx("div", { style: titleStyle2, children: document.title }),
|
|
1396
|
+
/* @__PURE__ */ jsx("div", { style: kindStyle, children: "Document" })
|
|
1397
|
+
] })
|
|
1398
|
+
] });
|
|
1399
|
+
}
|
|
1400
|
+
var cardStyle2 = {
|
|
1401
|
+
border: `1px solid ${varRef(LI_VAR.border)}`,
|
|
1402
|
+
borderRadius: 8,
|
|
1403
|
+
overflow: "hidden"
|
|
1404
|
+
};
|
|
1405
|
+
var pageStyle = {
|
|
1406
|
+
position: "relative",
|
|
1407
|
+
aspectRatio: "4 / 3",
|
|
1408
|
+
background: "rgba(127,127,127,0.12)",
|
|
1409
|
+
display: "grid",
|
|
1410
|
+
placeItems: "center",
|
|
1411
|
+
color: varRef(LI_VAR.muted)
|
|
1412
|
+
};
|
|
1413
|
+
var coverStyle = {
|
|
1414
|
+
width: "100%",
|
|
1415
|
+
height: "100%",
|
|
1416
|
+
objectFit: "cover"
|
|
1417
|
+
};
|
|
1418
|
+
var barStyle = {
|
|
1419
|
+
background: "rgba(0,0,0,0.85)",
|
|
1420
|
+
color: "#fff",
|
|
1421
|
+
padding: "10px 14px",
|
|
1422
|
+
display: "flex",
|
|
1423
|
+
flexDirection: "column",
|
|
1424
|
+
gap: 1
|
|
1425
|
+
};
|
|
1426
|
+
var titleStyle2 = {
|
|
1427
|
+
fontSize: 14,
|
|
1428
|
+
fontWeight: 600,
|
|
1429
|
+
lineHeight: 1.3,
|
|
1430
|
+
display: "-webkit-box",
|
|
1431
|
+
WebkitLineClamp: 2,
|
|
1432
|
+
WebkitBoxOrient: "vertical",
|
|
1433
|
+
overflow: "hidden"
|
|
1434
|
+
};
|
|
1435
|
+
var kindStyle = {
|
|
1436
|
+
fontSize: 12,
|
|
1437
|
+
color: "rgba(255,255,255,0.7)"
|
|
1438
|
+
};
|
|
1331
1439
|
var ROW2 = {
|
|
1332
1440
|
display: "flex",
|
|
1333
1441
|
justifyContent: "space-around",
|
|
@@ -1351,8 +1459,8 @@ var ACTIONS2 = [
|
|
|
1351
1459
|
{ label: "Send", Icon: FiSend }
|
|
1352
1460
|
];
|
|
1353
1461
|
function EngagementBar() {
|
|
1354
|
-
return /* @__PURE__ */ jsx("div", { style: ROW2, children: ACTIONS2.map(({ label, Icon }) => /* @__PURE__ */ jsxs("span", { style: ITEM, children: [
|
|
1355
|
-
/* @__PURE__ */ jsx(
|
|
1462
|
+
return /* @__PURE__ */ jsx("div", { style: ROW2, children: ACTIONS2.map(({ label, Icon: Icon2 }) => /* @__PURE__ */ jsxs("span", { style: ITEM, children: [
|
|
1463
|
+
/* @__PURE__ */ jsx(Icon2, { size: 20, "aria-hidden": true }),
|
|
1356
1464
|
label
|
|
1357
1465
|
] }, label)) });
|
|
1358
1466
|
}
|
|
@@ -1481,11 +1589,11 @@ function Tile({
|
|
|
1481
1589
|
] });
|
|
1482
1590
|
}
|
|
1483
1591
|
function ImageMosaic({ media }) {
|
|
1484
|
-
|
|
1592
|
+
const [only] = media;
|
|
1593
|
+
if (!only) {
|
|
1485
1594
|
return null;
|
|
1486
1595
|
}
|
|
1487
1596
|
if (media.length === 1) {
|
|
1488
|
-
const only = media[0];
|
|
1489
1597
|
return /* @__PURE__ */ jsx(
|
|
1490
1598
|
"img",
|
|
1491
1599
|
{
|
|
@@ -1531,6 +1639,48 @@ function Media({ media }) {
|
|
|
1531
1639
|
const images = media.filter((item) => item.kind === "image");
|
|
1532
1640
|
return /* @__PURE__ */ jsx(ImageMosaic, { media: images });
|
|
1533
1641
|
}
|
|
1642
|
+
function Poll({ poll }) {
|
|
1643
|
+
return /* @__PURE__ */ jsxs("div", { style: wrapStyle, children: [
|
|
1644
|
+
/* @__PURE__ */ jsx("div", { style: questionStyle, children: poll.question }),
|
|
1645
|
+
/* @__PURE__ */ jsx("div", { style: optionsStyle, children: poll.options.map((option, i) => /* @__PURE__ */ jsx("div", { style: optionStyle, children: option }, `${option}-${i}`)) }),
|
|
1646
|
+
/* @__PURE__ */ jsxs("div", { style: footerStyle, children: [
|
|
1647
|
+
"0 votes \u2022 ",
|
|
1648
|
+
linkedinPollDurationLabel(poll.duration)
|
|
1649
|
+
] })
|
|
1650
|
+
] });
|
|
1651
|
+
}
|
|
1652
|
+
var wrapStyle = {
|
|
1653
|
+
border: `1px solid ${varRef(LI_VAR.border)}`,
|
|
1654
|
+
borderRadius: 8,
|
|
1655
|
+
padding: 12,
|
|
1656
|
+
display: "flex",
|
|
1657
|
+
flexDirection: "column",
|
|
1658
|
+
gap: 10
|
|
1659
|
+
};
|
|
1660
|
+
var questionStyle = {
|
|
1661
|
+
fontSize: 14,
|
|
1662
|
+
fontWeight: 600,
|
|
1663
|
+
color: varRef(LI_VAR.text),
|
|
1664
|
+
lineHeight: 1.35
|
|
1665
|
+
};
|
|
1666
|
+
var optionsStyle = {
|
|
1667
|
+
display: "flex",
|
|
1668
|
+
flexDirection: "column",
|
|
1669
|
+
gap: 8
|
|
1670
|
+
};
|
|
1671
|
+
var optionStyle = {
|
|
1672
|
+
border: `1px solid ${varRef(LI_VAR.accent)}`,
|
|
1673
|
+
borderRadius: 999,
|
|
1674
|
+
padding: "8px 16px",
|
|
1675
|
+
textAlign: "center",
|
|
1676
|
+
fontSize: 14,
|
|
1677
|
+
fontWeight: 600,
|
|
1678
|
+
color: varRef(LI_VAR.accent)
|
|
1679
|
+
};
|
|
1680
|
+
var footerStyle = {
|
|
1681
|
+
fontSize: 12,
|
|
1682
|
+
color: varRef(LI_VAR.muted)
|
|
1683
|
+
};
|
|
1534
1684
|
var FOLD_CHARS = 200;
|
|
1535
1685
|
var BODY_STYLE = {
|
|
1536
1686
|
whiteSpace: "pre-wrap",
|
|
@@ -1658,7 +1808,7 @@ function LinkedInPostPreviewImpl({
|
|
|
1658
1808
|
accent: varRef(LI_VAR.accent),
|
|
1659
1809
|
muted: varRef(LI_VAR.muted)
|
|
1660
1810
|
};
|
|
1661
|
-
const
|
|
1811
|
+
const cardStyle4 = {
|
|
1662
1812
|
...paletteVars(dark),
|
|
1663
1813
|
background: varRef(LI_VAR.bg),
|
|
1664
1814
|
color: varRef(LI_VAR.text),
|
|
@@ -1669,7 +1819,7 @@ function LinkedInPostPreviewImpl({
|
|
|
1669
1819
|
fontFamily: FONT_STACK,
|
|
1670
1820
|
...style
|
|
1671
1821
|
};
|
|
1672
|
-
return /* @__PURE__ */ jsxs("div", { className, style:
|
|
1822
|
+
return /* @__PURE__ */ jsxs("div", { className, style: cardStyle4, children: [
|
|
1673
1823
|
/* @__PURE__ */ jsx(Header, { author, visibility, time }),
|
|
1674
1824
|
variant.body ? /* @__PURE__ */ jsx("div", { style: { padding: "8px 16px 0" }, children: /* @__PURE__ */ jsx(
|
|
1675
1825
|
PostBody,
|
|
@@ -1679,12 +1829,995 @@ function LinkedInPostPreviewImpl({
|
|
|
1679
1829
|
colors: bodyColors
|
|
1680
1830
|
}
|
|
1681
1831
|
) }) : null,
|
|
1682
|
-
|
|
1832
|
+
renderContent(variant, resolvedMedia),
|
|
1683
1833
|
showActions ? /* @__PURE__ */ jsx(EngagementBar, {}) : null
|
|
1684
1834
|
] });
|
|
1685
1835
|
}
|
|
1836
|
+
function renderContent(variant, media) {
|
|
1837
|
+
const settings = variant.settings;
|
|
1838
|
+
const kind = settings?.content_kind;
|
|
1839
|
+
const [firstMedia] = media;
|
|
1840
|
+
if (kind === "article" && settings?.article) {
|
|
1841
|
+
return /* @__PURE__ */ jsx("div", { style: INSET, children: /* @__PURE__ */ jsx(ArticleCard, { article: settings.article, thumbnail: firstMedia }) });
|
|
1842
|
+
}
|
|
1843
|
+
if (kind === "poll" && settings?.poll) {
|
|
1844
|
+
return /* @__PURE__ */ jsx("div", { style: INSET, children: /* @__PURE__ */ jsx(Poll, { poll: settings.poll }) });
|
|
1845
|
+
}
|
|
1846
|
+
if (kind === "document" && settings?.document) {
|
|
1847
|
+
return /* @__PURE__ */ jsx("div", { style: INSET, children: /* @__PURE__ */ jsx(DocumentCard, { document: settings.document, cover: firstMedia }) });
|
|
1848
|
+
}
|
|
1849
|
+
return media.length > 0 ? /* @__PURE__ */ jsx("div", { style: { marginTop: 12 }, children: /* @__PURE__ */ jsx(Media, { media }) }) : null;
|
|
1850
|
+
}
|
|
1851
|
+
var INSET = { padding: "12px 16px 0" };
|
|
1686
1852
|
var LinkedInPostPreview = memo(LinkedInPostPreviewImpl);
|
|
1853
|
+
var LINK_COLOR = "#8ab4ff";
|
|
1854
|
+
var TOKEN = /([#@][\p{L}\p{N}_.]+)/gu;
|
|
1855
|
+
var IS_TOKEN = /^[#@][\p{L}\p{N}_.]+$/u;
|
|
1856
|
+
function Caption({ body }) {
|
|
1857
|
+
const [expanded, setExpanded] = useState(false);
|
|
1858
|
+
const [overflowing, setOverflowing] = useState(false);
|
|
1859
|
+
const ref = useRef(null);
|
|
1860
|
+
useLayoutEffect(() => {
|
|
1861
|
+
const el = ref.current;
|
|
1862
|
+
if (!el || expanded) {
|
|
1863
|
+
return;
|
|
1864
|
+
}
|
|
1865
|
+
setOverflowing(el.scrollHeight > el.clientHeight + 1);
|
|
1866
|
+
}, [body, expanded]);
|
|
1867
|
+
const parts = body.split(TOKEN);
|
|
1868
|
+
return /* @__PURE__ */ jsxs("div", { style: wrapStyle2, children: [
|
|
1869
|
+
/* @__PURE__ */ jsx("div", { ref, style: expanded ? expandedTextStyle : clampedTextStyle, children: parts.map(
|
|
1870
|
+
(part, i) => IS_TOKEN.test(part) ? /* @__PURE__ */ jsx("span", { style: { color: LINK_COLOR }, children: part }, i) : /* @__PURE__ */ jsx("span", { children: part }, i)
|
|
1871
|
+
) }),
|
|
1872
|
+
overflowing || expanded ? /* @__PURE__ */ jsx(
|
|
1873
|
+
"button",
|
|
1874
|
+
{
|
|
1875
|
+
type: "button",
|
|
1876
|
+
"aria-expanded": expanded,
|
|
1877
|
+
"aria-label": expanded ? "Collapse caption" : "Expand caption",
|
|
1878
|
+
onClick: () => setExpanded((v) => !v),
|
|
1879
|
+
style: moreStyle,
|
|
1880
|
+
children: expanded ? "less" : "more"
|
|
1881
|
+
}
|
|
1882
|
+
) : null
|
|
1883
|
+
] });
|
|
1884
|
+
}
|
|
1885
|
+
var wrapStyle2 = {
|
|
1886
|
+
fontSize: 14,
|
|
1887
|
+
lineHeight: 1.35
|
|
1888
|
+
};
|
|
1889
|
+
var clampedTextStyle = {
|
|
1890
|
+
display: "-webkit-box",
|
|
1891
|
+
WebkitLineClamp: 2,
|
|
1892
|
+
WebkitBoxOrient: "vertical",
|
|
1893
|
+
overflow: "hidden",
|
|
1894
|
+
whiteSpace: "pre-wrap",
|
|
1895
|
+
wordBreak: "break-word"
|
|
1896
|
+
};
|
|
1897
|
+
var expandedTextStyle = {
|
|
1898
|
+
maxHeight: 180,
|
|
1899
|
+
overflowY: "auto",
|
|
1900
|
+
whiteSpace: "pre-wrap",
|
|
1901
|
+
wordBreak: "break-word",
|
|
1902
|
+
overscrollBehavior: "contain"
|
|
1903
|
+
};
|
|
1904
|
+
var moreStyle = {
|
|
1905
|
+
display: "inline-block",
|
|
1906
|
+
marginTop: 2,
|
|
1907
|
+
padding: 0,
|
|
1908
|
+
border: 0,
|
|
1909
|
+
background: "transparent",
|
|
1910
|
+
color: "rgba(255,255,255,0.82)",
|
|
1911
|
+
fontSize: 13,
|
|
1912
|
+
fontWeight: 600,
|
|
1913
|
+
cursor: "pointer",
|
|
1914
|
+
fontFamily: "inherit"
|
|
1915
|
+
};
|
|
1916
|
+
function Media2({
|
|
1917
|
+
media,
|
|
1918
|
+
pending = false
|
|
1919
|
+
}) {
|
|
1920
|
+
const [first] = media;
|
|
1921
|
+
if (!first) {
|
|
1922
|
+
return pending ? /* @__PURE__ */ jsx(ProcessingMedia, {}) : /* @__PURE__ */ jsx(EmptyMedia, {});
|
|
1923
|
+
}
|
|
1924
|
+
if (first.kind === "video") {
|
|
1925
|
+
return /* @__PURE__ */ jsx(
|
|
1926
|
+
"video",
|
|
1927
|
+
{
|
|
1928
|
+
src: first.src,
|
|
1929
|
+
poster: first.posterSrc,
|
|
1930
|
+
autoPlay: true,
|
|
1931
|
+
muted: true,
|
|
1932
|
+
loop: true,
|
|
1933
|
+
playsInline: true,
|
|
1934
|
+
style: coverStyle2
|
|
1935
|
+
}
|
|
1936
|
+
);
|
|
1937
|
+
}
|
|
1938
|
+
return /* @__PURE__ */ jsx(PhotoCarousel, { media });
|
|
1939
|
+
}
|
|
1940
|
+
function PhotoCarousel({ media }) {
|
|
1941
|
+
const [emblaRef, emblaApi] = useEmblaCarousel({
|
|
1942
|
+
loop: false,
|
|
1943
|
+
align: "start",
|
|
1944
|
+
containScroll: "trimSnaps"
|
|
1945
|
+
});
|
|
1946
|
+
const [selected, setSelected] = useState(0);
|
|
1947
|
+
const sync = useCallback((api) => {
|
|
1948
|
+
setSelected(api.selectedScrollSnap());
|
|
1949
|
+
}, []);
|
|
1950
|
+
useEffect(() => {
|
|
1951
|
+
if (!emblaApi) {
|
|
1952
|
+
return;
|
|
1953
|
+
}
|
|
1954
|
+
sync(emblaApi);
|
|
1955
|
+
emblaApi.on("select", sync).on("reInit", sync);
|
|
1956
|
+
return () => {
|
|
1957
|
+
emblaApi.off("select", sync).off("reInit", sync);
|
|
1958
|
+
};
|
|
1959
|
+
}, [emblaApi, sync]);
|
|
1960
|
+
return /* @__PURE__ */ jsxs("div", { style: { position: "absolute", inset: 0 }, children: [
|
|
1961
|
+
/* @__PURE__ */ jsx("div", { ref: emblaRef, style: viewportStyle, children: /* @__PURE__ */ jsx("div", { style: containerStyle, children: media.map((m, i) => /* @__PURE__ */ jsx("div", { style: slideStyle, children: /* @__PURE__ */ jsx("img", { src: m.src, alt: m.alt ?? "", style: coverStyle2 }) }, `${m.src}-${i}`)) }) }),
|
|
1962
|
+
media.length > 1 ? /* @__PURE__ */ jsx("div", { style: dotsStyle, children: media.map((m, i) => /* @__PURE__ */ jsx(
|
|
1963
|
+
"span",
|
|
1964
|
+
{
|
|
1965
|
+
style: { ...dotStyle, opacity: i === selected ? 1 : 0.4 }
|
|
1966
|
+
},
|
|
1967
|
+
`dot-${m.src}-${i}`
|
|
1968
|
+
)) }) : null
|
|
1969
|
+
] });
|
|
1970
|
+
}
|
|
1971
|
+
function EmptyMedia() {
|
|
1972
|
+
return /* @__PURE__ */ jsx("div", { style: emptyStyle, children: "No media yet" });
|
|
1973
|
+
}
|
|
1974
|
+
function ProcessingMedia() {
|
|
1975
|
+
return /* @__PURE__ */ jsxs("div", { style: emptyStyle, children: [
|
|
1976
|
+
/* @__PURE__ */ jsx("div", { style: shimmerStyle }),
|
|
1977
|
+
/* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children: "Processing media\u2026" })
|
|
1978
|
+
] });
|
|
1979
|
+
}
|
|
1980
|
+
var coverStyle2 = {
|
|
1981
|
+
position: "absolute",
|
|
1982
|
+
inset: 0,
|
|
1983
|
+
width: "100%",
|
|
1984
|
+
height: "100%",
|
|
1985
|
+
objectFit: "cover"
|
|
1986
|
+
};
|
|
1987
|
+
var viewportStyle = {
|
|
1988
|
+
position: "absolute",
|
|
1989
|
+
inset: 0,
|
|
1990
|
+
overflow: "hidden"
|
|
1991
|
+
};
|
|
1992
|
+
var containerStyle = {
|
|
1993
|
+
display: "flex",
|
|
1994
|
+
height: "100%"
|
|
1995
|
+
};
|
|
1996
|
+
var slideStyle = {
|
|
1997
|
+
position: "relative",
|
|
1998
|
+
flex: "0 0 100%",
|
|
1999
|
+
minWidth: 0,
|
|
2000
|
+
height: "100%"
|
|
2001
|
+
};
|
|
2002
|
+
var dotsStyle = {
|
|
2003
|
+
position: "absolute",
|
|
2004
|
+
bottom: 124,
|
|
2005
|
+
left: "50%",
|
|
2006
|
+
transform: "translateX(-50%)",
|
|
2007
|
+
display: "flex",
|
|
2008
|
+
gap: 5,
|
|
2009
|
+
alignItems: "center"
|
|
2010
|
+
};
|
|
2011
|
+
var dotStyle = {
|
|
2012
|
+
width: 6,
|
|
2013
|
+
height: 6,
|
|
2014
|
+
borderRadius: "50%",
|
|
2015
|
+
background: "#fff",
|
|
2016
|
+
transition: "opacity 160ms ease"
|
|
2017
|
+
};
|
|
2018
|
+
var emptyStyle = {
|
|
2019
|
+
position: "absolute",
|
|
2020
|
+
inset: 0,
|
|
2021
|
+
display: "flex",
|
|
2022
|
+
alignItems: "center",
|
|
2023
|
+
justifyContent: "center",
|
|
2024
|
+
color: "rgba(255,255,255,0.55)",
|
|
2025
|
+
fontSize: 13,
|
|
2026
|
+
background: "linear-gradient(180deg,#1c1c20,#101013)",
|
|
2027
|
+
overflow: "hidden"
|
|
2028
|
+
};
|
|
2029
|
+
var shimmerStyle = {
|
|
2030
|
+
position: "absolute",
|
|
2031
|
+
inset: 0,
|
|
2032
|
+
background: "linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0) 100%)",
|
|
2033
|
+
backgroundSize: "200% 100%",
|
|
2034
|
+
animation: "pr-tt-shimmer 1.4s ease-in-out infinite"
|
|
2035
|
+
};
|
|
2036
|
+
var Icon = ({
|
|
2037
|
+
size = 24,
|
|
2038
|
+
viewBox,
|
|
2039
|
+
children,
|
|
2040
|
+
...rest
|
|
2041
|
+
}) => /* @__PURE__ */ jsx(
|
|
2042
|
+
"svg",
|
|
2043
|
+
{
|
|
2044
|
+
width: size,
|
|
2045
|
+
height: size,
|
|
2046
|
+
viewBox,
|
|
2047
|
+
fill: "currentColor",
|
|
2048
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2049
|
+
...rest,
|
|
2050
|
+
children
|
|
2051
|
+
}
|
|
2052
|
+
);
|
|
2053
|
+
var HeartIcon = (p) => /* @__PURE__ */ jsx(Icon, { viewBox: "0 0 24 24", ...p, children: /* @__PURE__ */ jsx(
|
|
2054
|
+
"path",
|
|
2055
|
+
{
|
|
2056
|
+
fillRule: "evenodd",
|
|
2057
|
+
clipRule: "evenodd",
|
|
2058
|
+
d: "M7.5 2.25C10.5 2.25 12 4.25 12 4.25C12 4.25 13.5 2.25 16.5 2.25C20 2.25 22.5 4.99999 22.5 8.5C22.5 12.5 19.2311 16.0657 16.25 18.75C14.4095 20.4072 13 21.5 12 21.5C11 21.5 9.55051 20.3989 7.75 18.75C4.81949 16.0662 1.5 12.5 1.5 8.5C1.5 4.99999 4 2.25 7.5 2.25Z"
|
|
2059
|
+
}
|
|
2060
|
+
) });
|
|
2061
|
+
var CommentIcon = (p) => /* @__PURE__ */ jsx(Icon, { viewBox: "0 0 48 48", ...p, children: /* @__PURE__ */ jsx(
|
|
2062
|
+
"path",
|
|
2063
|
+
{
|
|
2064
|
+
fillRule: "evenodd",
|
|
2065
|
+
clipRule: "evenodd",
|
|
2066
|
+
d: "M2 21.5c0-10.22 9.88-18 22-18s22 7.78 22 18c0 5.63-3.19 10.74-7.32 14.8a43.6 43.6 0 0 1-14.14 9.1A1.5 1.5 0 0 1 22.5 44v-5.04C11.13 38.4 2 31.34 2 21.5M14 25a3 3 0 1 0 0-6 3 3 0 0 0 0 6m10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6m13-3a3 3 0 1 1-6 0 3 3 0 0 1 6 0"
|
|
2067
|
+
}
|
|
2068
|
+
) });
|
|
2069
|
+
var BookmarkIcon = (p) => /* @__PURE__ */ jsx(Icon, { viewBox: "0 0 24 24", ...p, children: /* @__PURE__ */ jsx("path", { d: "M4 4.5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v15.13a1 1 0 0 1-1.555.831l-6.167-4.12a.5.5 0 0 0-.556 0l-6.167 4.12A1 1 0 0 1 4 19.63z" }) });
|
|
2070
|
+
var ShareIcon = (p) => /* @__PURE__ */ jsx(Icon, { viewBox: "0 0 20 20", ...p, children: /* @__PURE__ */ jsx(
|
|
2071
|
+
"path",
|
|
2072
|
+
{
|
|
2073
|
+
fillRule: "evenodd",
|
|
2074
|
+
clipRule: "evenodd",
|
|
2075
|
+
d: "M10.938 3.175a.674.674 0 0 1 1.138-.488l6.526 6.215c.574.547.554 1.47-.043 1.991l-6.505 5.676a.674.674 0 0 1-1.116-.508V13.49s-6.985-1.258-9.225 2.854c-.209.384-1.023.518-.857-1.395.692-3.52 2.106-9.017 10.082-9.017z"
|
|
2076
|
+
}
|
|
2077
|
+
) });
|
|
2078
|
+
var PlusIcon = (p) => /* @__PURE__ */ jsx(Icon, { viewBox: "0 0 48 48", ...p, children: /* @__PURE__ */ jsx("path", { d: "M26 7a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v15H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h15v15a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V26h15a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1H26V7Z" }) });
|
|
2079
|
+
var DASH = "\u2011\u2011\u2011";
|
|
2080
|
+
function commercialLabel(settings) {
|
|
2081
|
+
if (settings?.brand_content_toggle) {
|
|
2082
|
+
return "Paid partnership";
|
|
2083
|
+
}
|
|
2084
|
+
if (settings?.brand_organic_toggle) {
|
|
2085
|
+
return "Promotional content";
|
|
2086
|
+
}
|
|
2087
|
+
return null;
|
|
2088
|
+
}
|
|
2089
|
+
function TikTokPostPreviewImpl({
|
|
2090
|
+
variant,
|
|
2091
|
+
creatorInfo,
|
|
2092
|
+
media,
|
|
2093
|
+
className,
|
|
2094
|
+
style
|
|
2095
|
+
}) {
|
|
2096
|
+
const resolvedMedia = useResolvedMedia(
|
|
2097
|
+
media,
|
|
2098
|
+
variant.media,
|
|
2099
|
+
altSignatureOf(variant.media)
|
|
2100
|
+
);
|
|
2101
|
+
const { creator } = creatorInfo;
|
|
2102
|
+
const handle = creator.username || creator.nickname;
|
|
2103
|
+
const label = commercialLabel(variant.settings);
|
|
2104
|
+
const isAigc = Boolean(variant.settings?.is_aigc);
|
|
2105
|
+
const pending = (media?.length ?? 0) > 0 && resolvedMedia.length === 0;
|
|
2106
|
+
return /* @__PURE__ */ jsxs("div", { className, style: { ...cardStyle3, ...style }, children: [
|
|
2107
|
+
/* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
|
|
2108
|
+
/* @__PURE__ */ jsx(Media2, { media: resolvedMedia, pending }),
|
|
2109
|
+
/* @__PURE__ */ jsx("div", { style: scrimStyle }),
|
|
2110
|
+
/* @__PURE__ */ jsxs("div", { style: infoStyle, children: [
|
|
2111
|
+
/* @__PURE__ */ jsx("div", { style: usernameStyle, children: handle }),
|
|
2112
|
+
variant.body ? /* @__PURE__ */ jsx(Caption, { body: variant.body }) : null,
|
|
2113
|
+
label || isAigc ? /* @__PURE__ */ jsxs("div", { style: labelsStyle, children: [
|
|
2114
|
+
label ? /* @__PURE__ */ jsx("span", { style: pillStyle, children: label }) : null,
|
|
2115
|
+
isAigc ? /* @__PURE__ */ jsx("span", { style: pillStyle, children: "Creator labeled as AI-generated" }) : null
|
|
2116
|
+
] }) : null,
|
|
2117
|
+
/* @__PURE__ */ jsxs("div", { style: musicRowStyle, children: [
|
|
2118
|
+
/* @__PURE__ */ jsx(IoMusicalNotes, { size: 13 }),
|
|
2119
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
2120
|
+
"Original sound - ",
|
|
2121
|
+
creator.nickname
|
|
2122
|
+
] })
|
|
2123
|
+
] })
|
|
2124
|
+
] }),
|
|
2125
|
+
/* @__PURE__ */ jsxs("div", { style: railStyle, children: [
|
|
2126
|
+
/* @__PURE__ */ jsxs("div", { style: avatarWrapStyle, children: [
|
|
2127
|
+
/* @__PURE__ */ jsx(Avatar, { url: creator.avatar_url, name: creator.nickname }),
|
|
2128
|
+
/* @__PURE__ */ jsx("span", { style: followBadgeStyle, children: /* @__PURE__ */ jsx(PlusIcon, { size: 14 }) })
|
|
2129
|
+
] }),
|
|
2130
|
+
/* @__PURE__ */ jsx(RailAction, { icon: /* @__PURE__ */ jsx(HeartIcon, { size: 30 }), count: DASH }),
|
|
2131
|
+
/* @__PURE__ */ jsx(RailAction, { icon: /* @__PURE__ */ jsx(CommentIcon, { size: 30 }), count: DASH }),
|
|
2132
|
+
/* @__PURE__ */ jsx(RailAction, { icon: /* @__PURE__ */ jsx(BookmarkIcon, { size: 28 }), count: DASH }),
|
|
2133
|
+
/* @__PURE__ */ jsx(RailAction, { icon: /* @__PURE__ */ jsx(ShareIcon, { size: 28 }), count: DASH }),
|
|
2134
|
+
/* @__PURE__ */ jsx(Disc, { url: creator.avatar_url })
|
|
2135
|
+
] })
|
|
2136
|
+
] });
|
|
2137
|
+
}
|
|
2138
|
+
function RailAction({ icon, count }) {
|
|
2139
|
+
return /* @__PURE__ */ jsxs("div", { style: railActionStyle, children: [
|
|
2140
|
+
/* @__PURE__ */ jsx("span", { style: railIconStyle, children: icon }),
|
|
2141
|
+
/* @__PURE__ */ jsx("span", { style: railCountStyle, children: count })
|
|
2142
|
+
] });
|
|
2143
|
+
}
|
|
2144
|
+
function Avatar({ url, name }) {
|
|
2145
|
+
if (url) {
|
|
2146
|
+
return /* @__PURE__ */ jsx("img", { src: url, alt: name, style: avatarStyle });
|
|
2147
|
+
}
|
|
2148
|
+
return /* @__PURE__ */ jsx("div", { style: { ...avatarStyle, ...avatarFallbackStyle }, children: name.slice(0, 1).toUpperCase() });
|
|
2149
|
+
}
|
|
2150
|
+
function Disc({ url }) {
|
|
2151
|
+
return /* @__PURE__ */ jsx("div", { style: discStyle, children: url ? /* @__PURE__ */ jsx("img", { src: url, alt: "", style: discImgStyle }) : null });
|
|
2152
|
+
}
|
|
2153
|
+
var cardStyle3 = {
|
|
2154
|
+
position: "relative",
|
|
2155
|
+
width: "100%",
|
|
2156
|
+
maxWidth: 320,
|
|
2157
|
+
aspectRatio: "9 / 16",
|
|
2158
|
+
borderRadius: 16,
|
|
2159
|
+
overflow: "hidden",
|
|
2160
|
+
background: "#000",
|
|
2161
|
+
color: "#fff",
|
|
2162
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'
|
|
2163
|
+
};
|
|
2164
|
+
var scrimStyle = {
|
|
2165
|
+
position: "absolute",
|
|
2166
|
+
inset: 0,
|
|
2167
|
+
background: "linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%)",
|
|
2168
|
+
pointerEvents: "none"
|
|
2169
|
+
};
|
|
2170
|
+
var infoStyle = {
|
|
2171
|
+
position: "absolute",
|
|
2172
|
+
left: 14,
|
|
2173
|
+
right: 70,
|
|
2174
|
+
bottom: 14,
|
|
2175
|
+
display: "flex",
|
|
2176
|
+
flexDirection: "column",
|
|
2177
|
+
gap: 6,
|
|
2178
|
+
textShadow: "0 1px 3px rgba(0,0,0,0.5)"
|
|
2179
|
+
};
|
|
2180
|
+
var usernameStyle = {
|
|
2181
|
+
fontWeight: 600,
|
|
2182
|
+
fontSize: 16
|
|
2183
|
+
};
|
|
2184
|
+
var labelsStyle = {
|
|
2185
|
+
display: "flex",
|
|
2186
|
+
flexDirection: "column",
|
|
2187
|
+
alignItems: "flex-start",
|
|
2188
|
+
gap: 4,
|
|
2189
|
+
marginTop: 2
|
|
2190
|
+
};
|
|
2191
|
+
var pillStyle = {
|
|
2192
|
+
display: "inline-flex",
|
|
2193
|
+
alignItems: "center",
|
|
2194
|
+
background: "rgba(255,255,255,0.18)",
|
|
2195
|
+
color: "#fff",
|
|
2196
|
+
fontSize: 11,
|
|
2197
|
+
fontWeight: 500,
|
|
2198
|
+
padding: "2px 7px",
|
|
2199
|
+
borderRadius: 4
|
|
2200
|
+
};
|
|
2201
|
+
var musicRowStyle = {
|
|
2202
|
+
display: "flex",
|
|
2203
|
+
alignItems: "center",
|
|
2204
|
+
gap: 6,
|
|
2205
|
+
fontSize: 13,
|
|
2206
|
+
marginTop: 4
|
|
2207
|
+
};
|
|
2208
|
+
var railStyle = {
|
|
2209
|
+
position: "absolute",
|
|
2210
|
+
right: 8,
|
|
2211
|
+
bottom: 14,
|
|
2212
|
+
display: "flex",
|
|
2213
|
+
flexDirection: "column",
|
|
2214
|
+
alignItems: "center",
|
|
2215
|
+
gap: 16,
|
|
2216
|
+
color: "#fff"
|
|
2217
|
+
};
|
|
2218
|
+
var avatarWrapStyle = {
|
|
2219
|
+
position: "relative",
|
|
2220
|
+
marginBottom: 8
|
|
2221
|
+
};
|
|
2222
|
+
var avatarStyle = {
|
|
2223
|
+
width: 46,
|
|
2224
|
+
height: 46,
|
|
2225
|
+
borderRadius: "50%",
|
|
2226
|
+
objectFit: "cover",
|
|
2227
|
+
display: "block",
|
|
2228
|
+
border: "1px solid rgba(255,255,255,0.2)"
|
|
2229
|
+
};
|
|
2230
|
+
var avatarFallbackStyle = {
|
|
2231
|
+
display: "grid",
|
|
2232
|
+
placeItems: "center",
|
|
2233
|
+
background: "#3a3a40",
|
|
2234
|
+
color: "#fff",
|
|
2235
|
+
fontSize: 18,
|
|
2236
|
+
fontWeight: 700
|
|
2237
|
+
};
|
|
2238
|
+
var followBadgeStyle = {
|
|
2239
|
+
position: "absolute",
|
|
2240
|
+
bottom: -9,
|
|
2241
|
+
left: "50%",
|
|
2242
|
+
transform: "translateX(-50%)",
|
|
2243
|
+
width: 19,
|
|
2244
|
+
height: 19,
|
|
2245
|
+
borderRadius: "50%",
|
|
2246
|
+
background: "#fe2c55",
|
|
2247
|
+
color: "#fff",
|
|
2248
|
+
display: "grid",
|
|
2249
|
+
placeItems: "center"
|
|
2250
|
+
};
|
|
2251
|
+
var railActionStyle = {
|
|
2252
|
+
display: "flex",
|
|
2253
|
+
flexDirection: "column",
|
|
2254
|
+
alignItems: "center",
|
|
2255
|
+
gap: 3
|
|
2256
|
+
};
|
|
2257
|
+
var railIconStyle = {
|
|
2258
|
+
display: "grid",
|
|
2259
|
+
placeItems: "center",
|
|
2260
|
+
filter: "drop-shadow(0 1px 2px rgba(0,0,0,0.4))"
|
|
2261
|
+
};
|
|
2262
|
+
var railCountStyle = {
|
|
2263
|
+
fontSize: 12,
|
|
2264
|
+
fontWeight: 600,
|
|
2265
|
+
textShadow: "0 1px 2px rgba(0,0,0,0.4)"
|
|
2266
|
+
};
|
|
2267
|
+
var discStyle = {
|
|
2268
|
+
width: 44,
|
|
2269
|
+
height: 44,
|
|
2270
|
+
borderRadius: "50%",
|
|
2271
|
+
background: "radial-gradient(circle, #555 0 36%, #111 37% 100%)",
|
|
2272
|
+
display: "grid",
|
|
2273
|
+
placeItems: "center",
|
|
2274
|
+
marginTop: 2,
|
|
2275
|
+
animation: "pr-tt-spin 4s linear infinite"
|
|
2276
|
+
};
|
|
2277
|
+
var discImgStyle = {
|
|
2278
|
+
width: 22,
|
|
2279
|
+
height: 22,
|
|
2280
|
+
borderRadius: "50%",
|
|
2281
|
+
objectFit: "cover"
|
|
2282
|
+
};
|
|
2283
|
+
var KEYFRAMES = `@keyframes pr-tt-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes pr-tt-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}`;
|
|
2284
|
+
var TikTokPostPreview = memo(TikTokPostPreviewImpl);
|
|
2285
|
+
var TT_VAR = {
|
|
2286
|
+
text: "--pr-tt-text",
|
|
2287
|
+
muted: "--pr-tt-muted",
|
|
2288
|
+
border: "--pr-tt-border",
|
|
2289
|
+
accent: "--pr-tt-accent",
|
|
2290
|
+
switchOff: "--pr-tt-switch-off"
|
|
2291
|
+
};
|
|
2292
|
+
var LIGHT2 = {
|
|
2293
|
+
text: "rgba(0,0,0,0.9)",
|
|
2294
|
+
muted: "rgba(0,0,0,0.55)",
|
|
2295
|
+
border: "rgba(0,0,0,0.12)",
|
|
2296
|
+
accent: "#fe2c55",
|
|
2297
|
+
switchOff: "rgba(0,0,0,0.18)"
|
|
2298
|
+
};
|
|
2299
|
+
var DARK2 = {
|
|
2300
|
+
text: "rgba(255,255,255,0.92)",
|
|
2301
|
+
muted: "#8a8a92",
|
|
2302
|
+
border: "rgba(255,255,255,0.14)",
|
|
2303
|
+
accent: "#fe2c55",
|
|
2304
|
+
switchOff: "rgba(255,255,255,0.22)"
|
|
2305
|
+
};
|
|
2306
|
+
function varRef2(name) {
|
|
2307
|
+
return `var(${name})`;
|
|
2308
|
+
}
|
|
2309
|
+
function paletteVars2(dark) {
|
|
2310
|
+
const p = dark ? DARK2 : LIGHT2;
|
|
2311
|
+
return {
|
|
2312
|
+
[TT_VAR.text]: p.text,
|
|
2313
|
+
[TT_VAR.muted]: p.muted,
|
|
2314
|
+
[TT_VAR.border]: p.border,
|
|
2315
|
+
[TT_VAR.accent]: p.accent,
|
|
2316
|
+
[TT_VAR.switchOff]: p.switchOff
|
|
2317
|
+
};
|
|
2318
|
+
}
|
|
2319
|
+
function usePrefersDark2() {
|
|
2320
|
+
const [dark, setDark] = useState(false);
|
|
2321
|
+
useEffect(() => {
|
|
2322
|
+
if (typeof window === "undefined" || !window.matchMedia) {
|
|
2323
|
+
return;
|
|
2324
|
+
}
|
|
2325
|
+
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2326
|
+
setDark(mq.matches);
|
|
2327
|
+
const onChange = (event) => setDark(event.matches);
|
|
2328
|
+
mq.addEventListener("change", onChange);
|
|
2329
|
+
return () => mq.removeEventListener("change", onChange);
|
|
2330
|
+
}, []);
|
|
2331
|
+
return dark;
|
|
2332
|
+
}
|
|
2333
|
+
function useIsDark2(theme) {
|
|
2334
|
+
const prefersDark = usePrefersDark2();
|
|
2335
|
+
if (theme === "auto") {
|
|
2336
|
+
return prefersDark;
|
|
2337
|
+
}
|
|
2338
|
+
return theme === "dark";
|
|
2339
|
+
}
|
|
2340
|
+
var MUTED = varRef2(TT_VAR.muted);
|
|
2341
|
+
var BORDER = varRef2(TT_VAR.border);
|
|
2342
|
+
var ACCENT = varRef2(TT_VAR.accent);
|
|
2343
|
+
var SWITCH_OFF = varRef2(TT_VAR.switchOff);
|
|
2344
|
+
var ON = "#34c759";
|
|
2345
|
+
function Row({
|
|
2346
|
+
label,
|
|
2347
|
+
sublabel,
|
|
2348
|
+
control,
|
|
2349
|
+
htmlFor
|
|
2350
|
+
}) {
|
|
2351
|
+
return /* @__PURE__ */ jsxs("div", { style: rowStyle, children: [
|
|
2352
|
+
/* @__PURE__ */ jsxs("label", { htmlFor, style: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
2353
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 14 }, children: label }),
|
|
2354
|
+
sublabel ? /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: MUTED }, children: sublabel }) : null
|
|
2355
|
+
] }),
|
|
2356
|
+
control
|
|
2357
|
+
] });
|
|
2358
|
+
}
|
|
2359
|
+
function Switch({
|
|
2360
|
+
checked,
|
|
2361
|
+
onChange,
|
|
2362
|
+
disabled,
|
|
2363
|
+
id,
|
|
2364
|
+
ariaLabel
|
|
2365
|
+
}) {
|
|
2366
|
+
return /* @__PURE__ */ jsx(
|
|
2367
|
+
"button",
|
|
2368
|
+
{
|
|
2369
|
+
type: "button",
|
|
2370
|
+
role: "switch",
|
|
2371
|
+
id,
|
|
2372
|
+
"aria-label": ariaLabel,
|
|
2373
|
+
"aria-checked": checked,
|
|
2374
|
+
disabled,
|
|
2375
|
+
onClick: () => onChange(!checked),
|
|
2376
|
+
style: {
|
|
2377
|
+
...switchTrackStyle,
|
|
2378
|
+
background: checked ? ON : SWITCH_OFF,
|
|
2379
|
+
opacity: disabled ? 0.4 : 1,
|
|
2380
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
2381
|
+
},
|
|
2382
|
+
children: /* @__PURE__ */ jsx(
|
|
2383
|
+
"span",
|
|
2384
|
+
{
|
|
2385
|
+
style: {
|
|
2386
|
+
...switchKnobStyle,
|
|
2387
|
+
transform: checked ? "translateX(16px)" : "translateX(0)"
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
)
|
|
2391
|
+
}
|
|
2392
|
+
);
|
|
2393
|
+
}
|
|
2394
|
+
function SectionLabel({ children }) {
|
|
2395
|
+
return /* @__PURE__ */ jsx("div", { style: sectionLabelStyle, children });
|
|
2396
|
+
}
|
|
2397
|
+
function Hint({ children }) {
|
|
2398
|
+
return /* @__PURE__ */ jsx("p", { style: hintStyle, children });
|
|
2399
|
+
}
|
|
2400
|
+
function Notice({ children }) {
|
|
2401
|
+
return /* @__PURE__ */ jsx("p", { style: noticeStyle, children });
|
|
2402
|
+
}
|
|
2403
|
+
function CheckRow({
|
|
2404
|
+
label,
|
|
2405
|
+
checked,
|
|
2406
|
+
onChange
|
|
2407
|
+
}) {
|
|
2408
|
+
const id = useId();
|
|
2409
|
+
return /* @__PURE__ */ jsxs("label", { htmlFor: id, style: checkRowStyle, children: [
|
|
2410
|
+
/* @__PURE__ */ jsx(
|
|
2411
|
+
"input",
|
|
2412
|
+
{
|
|
2413
|
+
id,
|
|
2414
|
+
type: "checkbox",
|
|
2415
|
+
checked,
|
|
2416
|
+
onChange: (e) => onChange(e.target.checked),
|
|
2417
|
+
style: { accentColor: ACCENT, width: 16, height: 16 }
|
|
2418
|
+
}
|
|
2419
|
+
),
|
|
2420
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 14 }, children: label })
|
|
2421
|
+
] });
|
|
2422
|
+
}
|
|
2423
|
+
var rowStyle = {
|
|
2424
|
+
display: "flex",
|
|
2425
|
+
alignItems: "center",
|
|
2426
|
+
justifyContent: "space-between",
|
|
2427
|
+
gap: 12,
|
|
2428
|
+
minHeight: 36
|
|
2429
|
+
};
|
|
2430
|
+
var switchTrackStyle = {
|
|
2431
|
+
position: "relative",
|
|
2432
|
+
width: 40,
|
|
2433
|
+
height: 24,
|
|
2434
|
+
borderRadius: 999,
|
|
2435
|
+
border: 0,
|
|
2436
|
+
padding: 2,
|
|
2437
|
+
flex: "0 0 auto",
|
|
2438
|
+
transition: "background 160ms ease"
|
|
2439
|
+
};
|
|
2440
|
+
var switchKnobStyle = {
|
|
2441
|
+
display: "block",
|
|
2442
|
+
width: 20,
|
|
2443
|
+
height: 20,
|
|
2444
|
+
borderRadius: "50%",
|
|
2445
|
+
background: "#fff",
|
|
2446
|
+
boxShadow: "0 1px 2px rgba(0,0,0,0.3)",
|
|
2447
|
+
transition: "transform 160ms ease"
|
|
2448
|
+
};
|
|
2449
|
+
var sectionLabelStyle = {
|
|
2450
|
+
fontSize: 13,
|
|
2451
|
+
fontWeight: 600
|
|
2452
|
+
};
|
|
2453
|
+
var hintStyle = {
|
|
2454
|
+
margin: 0,
|
|
2455
|
+
fontSize: 12,
|
|
2456
|
+
color: ACCENT,
|
|
2457
|
+
lineHeight: 1.4
|
|
2458
|
+
};
|
|
2459
|
+
var noticeStyle = {
|
|
2460
|
+
margin: 0,
|
|
2461
|
+
fontSize: 12,
|
|
2462
|
+
color: MUTED,
|
|
2463
|
+
lineHeight: 1.4
|
|
2464
|
+
};
|
|
2465
|
+
var checkRowStyle = {
|
|
2466
|
+
display: "flex",
|
|
2467
|
+
alignItems: "center",
|
|
2468
|
+
gap: 10,
|
|
2469
|
+
cursor: "pointer"
|
|
2470
|
+
};
|
|
2471
|
+
var TOKENS = { MUTED, BORDER, ACCENT};
|
|
2472
|
+
function AudienceSelect({
|
|
2473
|
+
creatorInfo,
|
|
2474
|
+
value,
|
|
2475
|
+
onChange
|
|
2476
|
+
}) {
|
|
2477
|
+
const id = useId();
|
|
2478
|
+
const options = audiencePrivacyOptions(creatorInfo.privacy_options, value);
|
|
2479
|
+
const unselected = audienceUnselected(value);
|
|
2480
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
2481
|
+
/* @__PURE__ */ jsx(SectionLabel, { children: "Who can view this post" }),
|
|
2482
|
+
/* @__PURE__ */ jsxs(
|
|
2483
|
+
"select",
|
|
2484
|
+
{
|
|
2485
|
+
id,
|
|
2486
|
+
value: value.privacy_level ?? "",
|
|
2487
|
+
onChange: (e) => onChange({
|
|
2488
|
+
...value,
|
|
2489
|
+
// Validate against the OFFERED (filtered) options, not the full set —
|
|
2490
|
+
// so a manipulated value (e.g. SELF_ONLY while branded) can't slip in.
|
|
2491
|
+
privacy_level: parsePrivacyLevel(e.target.value, options)
|
|
2492
|
+
}),
|
|
2493
|
+
style: selectStyle,
|
|
2494
|
+
children: [
|
|
2495
|
+
/* @__PURE__ */ jsx("option", { value: "", disabled: true, children: "Select who can view this post" }),
|
|
2496
|
+
options.map((level) => /* @__PURE__ */ jsx("option", { value: level, children: tiktokPrivacyLabel(level) }, level))
|
|
2497
|
+
]
|
|
2498
|
+
}
|
|
2499
|
+
),
|
|
2500
|
+
unselected ? /* @__PURE__ */ jsx(Hint, { children: TIKTOK_AUDIENCE_REQUIRED_HINT }) : null
|
|
2501
|
+
] });
|
|
2502
|
+
}
|
|
2503
|
+
var selectStyle = {
|
|
2504
|
+
width: "100%",
|
|
2505
|
+
appearance: "none",
|
|
2506
|
+
background: "transparent",
|
|
2507
|
+
color: "inherit",
|
|
2508
|
+
border: `1px solid ${TOKENS.BORDER}`,
|
|
2509
|
+
borderRadius: 10,
|
|
2510
|
+
padding: "10px 12px",
|
|
2511
|
+
fontSize: 14,
|
|
2512
|
+
fontFamily: "inherit",
|
|
2513
|
+
outline: "none",
|
|
2514
|
+
cursor: "pointer"
|
|
2515
|
+
};
|
|
2516
|
+
function TikTokCaptionField({
|
|
2517
|
+
value,
|
|
2518
|
+
onChange,
|
|
2519
|
+
postType,
|
|
2520
|
+
placeholder = "Describe your post\u2026",
|
|
2521
|
+
className,
|
|
2522
|
+
style
|
|
2523
|
+
}) {
|
|
2524
|
+
const id = useId();
|
|
2525
|
+
const max = captionMaxFor(postType);
|
|
2526
|
+
const count = value.length;
|
|
2527
|
+
const over = count > max;
|
|
2528
|
+
return /* @__PURE__ */ jsxs("div", { className, style: { ...wrapStyle3, ...style }, children: [
|
|
2529
|
+
/* @__PURE__ */ jsxs("div", { style: labelRowStyle, children: [
|
|
2530
|
+
/* @__PURE__ */ jsx("label", { htmlFor: id, style: labelStyle, children: "Caption" }),
|
|
2531
|
+
/* @__PURE__ */ jsxs(
|
|
2532
|
+
"span",
|
|
2533
|
+
{
|
|
2534
|
+
style: {
|
|
2535
|
+
...countStyle,
|
|
2536
|
+
color: over ? varRef2(TT_VAR.accent) : varRef2(TT_VAR.muted)
|
|
2537
|
+
},
|
|
2538
|
+
children: [
|
|
2539
|
+
count.toLocaleString(),
|
|
2540
|
+
" / ",
|
|
2541
|
+
max.toLocaleString()
|
|
2542
|
+
]
|
|
2543
|
+
}
|
|
2544
|
+
)
|
|
2545
|
+
] }),
|
|
2546
|
+
/* @__PURE__ */ jsx(
|
|
2547
|
+
"textarea",
|
|
2548
|
+
{
|
|
2549
|
+
id,
|
|
2550
|
+
value,
|
|
2551
|
+
onChange: (e) => onChange(e.target.value),
|
|
2552
|
+
placeholder,
|
|
2553
|
+
rows: 4,
|
|
2554
|
+
style: {
|
|
2555
|
+
...textareaStyle,
|
|
2556
|
+
borderColor: over ? varRef2(TT_VAR.accent) : varRef2(TT_VAR.border)
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
)
|
|
2560
|
+
] });
|
|
2561
|
+
}
|
|
2562
|
+
var wrapStyle3 = {
|
|
2563
|
+
display: "flex",
|
|
2564
|
+
flexDirection: "column",
|
|
2565
|
+
gap: 6,
|
|
2566
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'
|
|
2567
|
+
};
|
|
2568
|
+
var labelRowStyle = {
|
|
2569
|
+
display: "flex",
|
|
2570
|
+
alignItems: "baseline",
|
|
2571
|
+
justifyContent: "space-between"
|
|
2572
|
+
};
|
|
2573
|
+
var labelStyle = {
|
|
2574
|
+
fontSize: 13,
|
|
2575
|
+
fontWeight: 600,
|
|
2576
|
+
color: "inherit"
|
|
2577
|
+
};
|
|
2578
|
+
var countStyle = {
|
|
2579
|
+
fontSize: 12,
|
|
2580
|
+
fontVariantNumeric: "tabular-nums"
|
|
2581
|
+
};
|
|
2582
|
+
var textareaStyle = {
|
|
2583
|
+
width: "100%",
|
|
2584
|
+
resize: "vertical",
|
|
2585
|
+
background: "transparent",
|
|
2586
|
+
color: "inherit",
|
|
2587
|
+
border: "1px solid rgba(255,255,255,0.14)",
|
|
2588
|
+
borderRadius: 10,
|
|
2589
|
+
padding: "10px 12px",
|
|
2590
|
+
fontSize: 14,
|
|
2591
|
+
lineHeight: 1.4,
|
|
2592
|
+
fontFamily: "inherit",
|
|
2593
|
+
outline: "none",
|
|
2594
|
+
boxSizing: "border-box"
|
|
2595
|
+
};
|
|
2596
|
+
function CommercialDisclosure({
|
|
2597
|
+
value,
|
|
2598
|
+
onChange
|
|
2599
|
+
}) {
|
|
2600
|
+
const labelNotice = commercialLabelNotice(value);
|
|
2601
|
+
const incomplete = commercialDisclosureIncomplete(value);
|
|
2602
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
2603
|
+
/* @__PURE__ */ jsx(SectionLabel, { children: "Disclose post content" }),
|
|
2604
|
+
/* @__PURE__ */ jsx(
|
|
2605
|
+
Row,
|
|
2606
|
+
{
|
|
2607
|
+
label: "Disclose commercial content",
|
|
2608
|
+
sublabel: "Turn on if this post promotes a brand, product, or service.",
|
|
2609
|
+
control: /* @__PURE__ */ jsx(
|
|
2610
|
+
Switch,
|
|
2611
|
+
{
|
|
2612
|
+
checked: value.commercial_disclosure,
|
|
2613
|
+
ariaLabel: "Disclose commercial content",
|
|
2614
|
+
onChange: (next) => onChange(setCommercialDisclosure(value, next))
|
|
2615
|
+
}
|
|
2616
|
+
)
|
|
2617
|
+
}
|
|
2618
|
+
),
|
|
2619
|
+
value.commercial_disclosure ? /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8, paddingLeft: 2 }, children: [
|
|
2620
|
+
/* @__PURE__ */ jsx(
|
|
2621
|
+
CheckRow,
|
|
2622
|
+
{
|
|
2623
|
+
label: "Your brand",
|
|
2624
|
+
checked: value.your_brand,
|
|
2625
|
+
onChange: (next) => onChange(setBrandKind(value, "your_brand", next))
|
|
2626
|
+
}
|
|
2627
|
+
),
|
|
2628
|
+
/* @__PURE__ */ jsx(
|
|
2629
|
+
CheckRow,
|
|
2630
|
+
{
|
|
2631
|
+
label: "Branded content",
|
|
2632
|
+
checked: value.branded_content,
|
|
2633
|
+
onChange: (next) => onChange(setBrandKind(value, "branded_content", next))
|
|
2634
|
+
}
|
|
2635
|
+
),
|
|
2636
|
+
incomplete ? /* @__PURE__ */ jsx(Hint, { children: TIKTOK_DISCLOSURE_REQUIRED_HINT }) : null,
|
|
2637
|
+
labelNotice ? /* @__PURE__ */ jsx(Notice, { children: labelNotice }) : null
|
|
2638
|
+
] }) : null
|
|
2639
|
+
] });
|
|
2640
|
+
}
|
|
2641
|
+
function Declaration({ brandedContent }) {
|
|
2642
|
+
return /* @__PURE__ */ jsxs("p", { style: declarationStyle, children: [
|
|
2643
|
+
"By posting, you agree to TikTok's",
|
|
2644
|
+
" ",
|
|
2645
|
+
brandedContent ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2646
|
+
/* @__PURE__ */ jsx(DeclarationLink, { href: TIKTOK_BRANDED_CONTENT_POLICY_URL, children: "Branded Content Policy" }),
|
|
2647
|
+
" ",
|
|
2648
|
+
"and",
|
|
2649
|
+
" "
|
|
2650
|
+
] }) : null,
|
|
2651
|
+
/* @__PURE__ */ jsx(DeclarationLink, { href: TIKTOK_MUSIC_CONFIRMATION_URL, children: "Music Usage Confirmation" }),
|
|
2652
|
+
"."
|
|
2653
|
+
] });
|
|
2654
|
+
}
|
|
2655
|
+
function DeclarationLink({ href, children }) {
|
|
2656
|
+
return /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: "noreferrer", style: linkStyle2, children });
|
|
2657
|
+
}
|
|
2658
|
+
var declarationStyle = {
|
|
2659
|
+
margin: 0,
|
|
2660
|
+
fontSize: 12,
|
|
2661
|
+
color: TOKENS.MUTED,
|
|
2662
|
+
lineHeight: 1.45
|
|
2663
|
+
};
|
|
2664
|
+
var linkStyle2 = {
|
|
2665
|
+
color: "inherit",
|
|
2666
|
+
textDecoration: "underline"
|
|
2667
|
+
};
|
|
2668
|
+
function InteractionToggles({
|
|
2669
|
+
creatorInfo,
|
|
2670
|
+
value,
|
|
2671
|
+
onChange,
|
|
2672
|
+
isVideo
|
|
2673
|
+
}) {
|
|
2674
|
+
const rows = interactionRows(creatorInfo, isVideo);
|
|
2675
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
2676
|
+
/* @__PURE__ */ jsx(SectionLabel, { children: "Allow users to" }),
|
|
2677
|
+
rows.map((row) => {
|
|
2678
|
+
const on = Boolean(value[interactionValueKey(row.key)]);
|
|
2679
|
+
return /* @__PURE__ */ jsx(
|
|
2680
|
+
Row,
|
|
2681
|
+
{
|
|
2682
|
+
label: row.label,
|
|
2683
|
+
sublabel: row.disabled ? "Turned off by this creator" : void 0,
|
|
2684
|
+
control: /* @__PURE__ */ jsx(
|
|
2685
|
+
Switch,
|
|
2686
|
+
{
|
|
2687
|
+
checked: !row.disabled && on,
|
|
2688
|
+
disabled: row.disabled,
|
|
2689
|
+
ariaLabel: `Allow ${row.label}`,
|
|
2690
|
+
onChange: (next) => onChange(toggleInteraction(value, row.key, next))
|
|
2691
|
+
}
|
|
2692
|
+
)
|
|
2693
|
+
},
|
|
2694
|
+
row.key
|
|
2695
|
+
);
|
|
2696
|
+
})
|
|
2697
|
+
] });
|
|
2698
|
+
}
|
|
2699
|
+
function mediaCountValid(postType, count) {
|
|
2700
|
+
if (postType === "carousel") {
|
|
2701
|
+
return count >= 2 && count <= 35;
|
|
2702
|
+
}
|
|
2703
|
+
return count === 1;
|
|
2704
|
+
}
|
|
2705
|
+
function TikTokPublishPanel({
|
|
2706
|
+
variant,
|
|
2707
|
+
creatorInfo,
|
|
2708
|
+
caption,
|
|
2709
|
+
onCaptionChange,
|
|
2710
|
+
options,
|
|
2711
|
+
onOptionsChange,
|
|
2712
|
+
onPost,
|
|
2713
|
+
posting = false,
|
|
2714
|
+
theme = "auto",
|
|
2715
|
+
className,
|
|
2716
|
+
style
|
|
2717
|
+
}) {
|
|
2718
|
+
const dark = useIsDark2(theme);
|
|
2719
|
+
const isVideo = variant.post_type === "video";
|
|
2720
|
+
const captionOver = caption.length > captionMaxFor(variant.post_type);
|
|
2721
|
+
const mediaOk = mediaCountValid(variant.post_type, variant.media?.length ?? 0);
|
|
2722
|
+
const ready = !captionOver && mediaOk && tiktokOptionsReady(options);
|
|
2723
|
+
return /* @__PURE__ */ jsxs(
|
|
2724
|
+
"div",
|
|
2725
|
+
{
|
|
2726
|
+
className,
|
|
2727
|
+
style: {
|
|
2728
|
+
...paletteVars2(dark),
|
|
2729
|
+
...panelStyle,
|
|
2730
|
+
color: varRef2(TT_VAR.text),
|
|
2731
|
+
...style
|
|
2732
|
+
},
|
|
2733
|
+
children: [
|
|
2734
|
+
/* @__PURE__ */ jsx(
|
|
2735
|
+
TikTokCaptionField,
|
|
2736
|
+
{
|
|
2737
|
+
value: caption,
|
|
2738
|
+
onChange: onCaptionChange,
|
|
2739
|
+
postType: variant.post_type
|
|
2740
|
+
}
|
|
2741
|
+
),
|
|
2742
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
2743
|
+
/* @__PURE__ */ jsx(AudienceSelect, { creatorInfo, value: options, onChange: onOptionsChange }),
|
|
2744
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
2745
|
+
/* @__PURE__ */ jsx(
|
|
2746
|
+
InteractionToggles,
|
|
2747
|
+
{
|
|
2748
|
+
creatorInfo,
|
|
2749
|
+
value: options,
|
|
2750
|
+
onChange: onOptionsChange,
|
|
2751
|
+
isVideo
|
|
2752
|
+
}
|
|
2753
|
+
),
|
|
2754
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
2755
|
+
/* @__PURE__ */ jsx(CommercialDisclosure, { value: options, onChange: onOptionsChange }),
|
|
2756
|
+
isVideo ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2757
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
2758
|
+
/* @__PURE__ */ jsx(
|
|
2759
|
+
Row,
|
|
2760
|
+
{
|
|
2761
|
+
label: "AI-generated content",
|
|
2762
|
+
sublabel: "Disclose if this video was created or substantially edited with AI.",
|
|
2763
|
+
control: /* @__PURE__ */ jsx(
|
|
2764
|
+
Switch,
|
|
2765
|
+
{
|
|
2766
|
+
checked: options.aigc,
|
|
2767
|
+
ariaLabel: "AI-generated content",
|
|
2768
|
+
onChange: (next) => onOptionsChange({ ...options, aigc: next })
|
|
2769
|
+
}
|
|
2770
|
+
)
|
|
2771
|
+
}
|
|
2772
|
+
)
|
|
2773
|
+
] }) : null,
|
|
2774
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
2775
|
+
/* @__PURE__ */ jsx(Notice, { children: TIKTOK_PROCESSING_NOTICE }),
|
|
2776
|
+
/* @__PURE__ */ jsx(Declaration, { brandedContent: brandedContentDeclared(options) }),
|
|
2777
|
+
/* @__PURE__ */ jsx(
|
|
2778
|
+
"button",
|
|
2779
|
+
{
|
|
2780
|
+
type: "button",
|
|
2781
|
+
disabled: !ready || posting,
|
|
2782
|
+
onClick: onPost,
|
|
2783
|
+
style: {
|
|
2784
|
+
...postButtonStyle,
|
|
2785
|
+
opacity: !ready || posting ? 0.5 : 1,
|
|
2786
|
+
cursor: !ready || posting ? "not-allowed" : "pointer"
|
|
2787
|
+
},
|
|
2788
|
+
children: posting ? "Posting\u2026" : "Post"
|
|
2789
|
+
}
|
|
2790
|
+
)
|
|
2791
|
+
]
|
|
2792
|
+
}
|
|
2793
|
+
);
|
|
2794
|
+
}
|
|
2795
|
+
function Divider() {
|
|
2796
|
+
return /* @__PURE__ */ jsx("div", { style: dividerStyle });
|
|
2797
|
+
}
|
|
2798
|
+
var panelStyle = {
|
|
2799
|
+
display: "flex",
|
|
2800
|
+
flexDirection: "column",
|
|
2801
|
+
gap: 16,
|
|
2802
|
+
width: "100%",
|
|
2803
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'
|
|
2804
|
+
};
|
|
2805
|
+
var dividerStyle = {
|
|
2806
|
+
height: 1,
|
|
2807
|
+
background: TOKENS.BORDER
|
|
2808
|
+
};
|
|
2809
|
+
var postButtonStyle = {
|
|
2810
|
+
width: "100%",
|
|
2811
|
+
border: 0,
|
|
2812
|
+
borderRadius: 10,
|
|
2813
|
+
background: TOKENS.ACCENT,
|
|
2814
|
+
color: "#fff",
|
|
2815
|
+
fontSize: 15,
|
|
2816
|
+
fontWeight: 600,
|
|
2817
|
+
padding: "12px 16px",
|
|
2818
|
+
transition: "opacity 160ms ease"
|
|
2819
|
+
};
|
|
1687
2820
|
|
|
1688
|
-
export { Connect, LinkedInPostPreview, PostrunProvider, UploadError, XPostPreview, connectionKeys, mediaKeys, postKeys, profileKeys, tiktokKeys, useCalendar, useConnect, useConnection, useConnections, useCreatePost, useCreateProfile, useDeleteMedia, useDeletePost, useDeleteProfile, useDisconnect, useDiscoverableAccounts, useInfiniteList, useMedia, useMediaInfinite, useMediaList, useMediaUpload, usePost, usePostrun, usePosts, usePostsInfinite, useProfile, useProfiles, useProfilesInfinite, useSelectAccount, useTikTokCreatorInfo, useUpdateMedia, useUpdatePost, useUpdateProfile, useValidatePost };
|
|
2821
|
+
export { ArticleCard, AudienceSelect, CommercialDisclosure, Connect, Declaration, DocumentCard, InteractionToggles, LinkedInPostPreview, Poll, PostrunProvider, TikTokCaptionField, TikTokPostPreview, TikTokPublishPanel, UploadError, XPostPreview, connectionKeys, mediaKeys, postKeys, profileKeys, tiktokKeys, useCalendar, useConnect, useConnection, useConnections, useCreatePost, useCreateProfile, useDeleteMedia, useDeletePost, useDeleteProfile, useDisconnect, useDiscoverableAccounts, useInfiniteList, useMedia, useMediaInfinite, useMediaList, useMediaUpload, usePost, usePostrun, usePosts, usePostsInfinite, useProfile, useProfiles, useProfilesInfinite, useSelectAccount, useTikTokCreatorInfo, useUpdateMedia, useUpdatePost, useUpdateProfile, useValidatePost };
|
|
1689
2822
|
//# sourceMappingURL=index.js.map
|
|
1690
2823
|
//# sourceMappingURL=index.js.map
|