@postrun/react 2.7.0 → 2.8.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 +496 -156
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +92 -17
- package/dist/index.d.ts +92 -17
- package/dist/index.js +497 -159
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createContext, memo, useMemo, useState, useEffect,
|
|
2
|
+
import { createContext, memo, useMemo, useState, useEffect, Fragment as Fragment$1, useCallback, useRef, useLayoutEffect, createElement, useContext, useId } from 'react';
|
|
3
3
|
import { useInfiniteQuery, useQuery, useMutation, QueryClient } from '@tanstack/react-query';
|
|
4
4
|
import { xPollDurationLabel, 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
5
|
export { TIKTOK_CAPTION_MAX, captionMaxFor } from '@postrun/js';
|
|
@@ -10,10 +10,11 @@ import pRetry, { AbortError } from 'p-retry';
|
|
|
10
10
|
import axios, { isAxiosError } from 'axios';
|
|
11
11
|
import { enrichTweet, TweetContainer, TweetHeader, TweetInReplyTo, TweetBody, TweetMedia, QuotedTweet } from 'react-tweet';
|
|
12
12
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
-
import { FiMessageCircle, FiRepeat, FiHeart, FiBarChart2, FiShare, FiGlobe, FiUsers, FiThumbsUp, FiMessageSquare, FiSend, FiFileText } from 'react-icons/fi';
|
|
13
|
+
import { FiMessageCircle, FiRepeat, FiHeart, FiBarChart2, FiShare, FiGlobe, FiUsers, FiThumbsUp, FiMessageSquare, FiSend, FiBookmark, FiMoreHorizontal, FiFileText } from 'react-icons/fi';
|
|
14
14
|
import twitterText from 'twitter-text';
|
|
15
15
|
import { LuBadgeCheck } from 'react-icons/lu';
|
|
16
16
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
17
|
+
import { MdVerified, MdMusicNote } from 'react-icons/md';
|
|
17
18
|
import { IoMusicalNotes } from 'react-icons/io5';
|
|
18
19
|
|
|
19
20
|
// src/context.tsx
|
|
@@ -1344,6 +1345,8 @@ function XPostPreviewImpl({
|
|
|
1344
1345
|
);
|
|
1345
1346
|
}
|
|
1346
1347
|
var XPostPreview = memo(XPostPreviewImpl);
|
|
1348
|
+
|
|
1349
|
+
// src/preview/linkedin/theme.ts
|
|
1347
1350
|
var LI_VAR = {
|
|
1348
1351
|
bg: "--pr-li-bg",
|
|
1349
1352
|
text: "--pr-li-text",
|
|
@@ -1351,53 +1354,20 @@ var LI_VAR = {
|
|
|
1351
1354
|
border: "--pr-li-border",
|
|
1352
1355
|
accent: "--pr-li-accent"
|
|
1353
1356
|
};
|
|
1354
|
-
var LIGHT = {
|
|
1355
|
-
bg: "#ffffff",
|
|
1356
|
-
text: "rgba(0,0,0,0.9)",
|
|
1357
|
-
muted: "rgba(0,0,0,0.6)",
|
|
1358
|
-
border: "rgba(0,0,0,0.08)",
|
|
1359
|
-
accent: "rgb(10,102,194)"
|
|
1360
|
-
};
|
|
1361
|
-
var DARK = {
|
|
1362
|
-
bg: "#1b1f23",
|
|
1363
|
-
text: "rgba(255,255,255,0.9)",
|
|
1364
|
-
muted: "rgba(255,255,255,0.6)",
|
|
1365
|
-
border: "rgba(255,255,255,0.15)",
|
|
1366
|
-
accent: "rgb(112,181,249)"
|
|
1367
|
-
};
|
|
1368
1357
|
function varRef(name) {
|
|
1369
1358
|
return `var(${name})`;
|
|
1370
1359
|
}
|
|
1371
|
-
function paletteVars(
|
|
1372
|
-
const p = dark ? DARK : LIGHT;
|
|
1360
|
+
function paletteVars() {
|
|
1373
1361
|
return {
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
"
|
|
1362
|
+
[LI_VAR.bg]: "light-dark(#ffffff, #1b1f23)",
|
|
1363
|
+
[LI_VAR.text]: "light-dark(rgba(0,0,0,0.9), rgba(255,255,255,0.9))",
|
|
1364
|
+
[LI_VAR.muted]: "light-dark(rgba(0,0,0,0.6), rgba(255,255,255,0.6))",
|
|
1365
|
+
[LI_VAR.border]: "light-dark(rgba(0,0,0,0.08), rgba(255,255,255,0.15))",
|
|
1366
|
+
[LI_VAR.accent]: "light-dark(rgb(10,102,194), rgb(112,181,249))"
|
|
1379
1367
|
};
|
|
1380
1368
|
}
|
|
1381
|
-
function
|
|
1382
|
-
|
|
1383
|
-
useEffect(() => {
|
|
1384
|
-
if (typeof window === "undefined" || !window.matchMedia) {
|
|
1385
|
-
return;
|
|
1386
|
-
}
|
|
1387
|
-
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1388
|
-
setDark(mq.matches);
|
|
1389
|
-
const onChange = (event) => setDark(event.matches);
|
|
1390
|
-
mq.addEventListener("change", onChange);
|
|
1391
|
-
return () => mq.removeEventListener("change", onChange);
|
|
1392
|
-
}, []);
|
|
1393
|
-
return dark;
|
|
1394
|
-
}
|
|
1395
|
-
function useIsDark(theme) {
|
|
1396
|
-
const prefersDark = usePrefersDark();
|
|
1397
|
-
if (theme === "auto") {
|
|
1398
|
-
return prefersDark;
|
|
1399
|
-
}
|
|
1400
|
-
return theme === "dark";
|
|
1369
|
+
function colorSchemeFor(theme) {
|
|
1370
|
+
return theme === "auto" ? "light dark" : theme;
|
|
1401
1371
|
}
|
|
1402
1372
|
function domainOf(source) {
|
|
1403
1373
|
try {
|
|
@@ -1864,7 +1834,6 @@ function LinkedInPostPreviewImpl({
|
|
|
1864
1834
|
className,
|
|
1865
1835
|
style
|
|
1866
1836
|
}) {
|
|
1867
|
-
const dark = useIsDark(theme);
|
|
1868
1837
|
const resolvedMedia = useResolvedMedia(
|
|
1869
1838
|
media,
|
|
1870
1839
|
variant.media,
|
|
@@ -1876,8 +1845,9 @@ function LinkedInPostPreviewImpl({
|
|
|
1876
1845
|
accent: varRef(LI_VAR.accent),
|
|
1877
1846
|
muted: varRef(LI_VAR.muted)
|
|
1878
1847
|
};
|
|
1879
|
-
const
|
|
1880
|
-
...paletteVars(
|
|
1848
|
+
const cardStyle5 = {
|
|
1849
|
+
...paletteVars(),
|
|
1850
|
+
colorScheme: colorSchemeFor(theme),
|
|
1881
1851
|
background: varRef(LI_VAR.bg),
|
|
1882
1852
|
color: varRef(LI_VAR.text),
|
|
1883
1853
|
border: `1px solid ${varRef(LI_VAR.border)}`,
|
|
@@ -1887,7 +1857,7 @@ function LinkedInPostPreviewImpl({
|
|
|
1887
1857
|
fontFamily: FONT_STACK,
|
|
1888
1858
|
...style
|
|
1889
1859
|
};
|
|
1890
|
-
return /* @__PURE__ */ jsxs("div", { className, style:
|
|
1860
|
+
return /* @__PURE__ */ jsxs("div", { className, style: cardStyle5, children: [
|
|
1891
1861
|
/* @__PURE__ */ jsx(Header, { author, visibility, time }),
|
|
1892
1862
|
variant.body ? /* @__PURE__ */ jsx("div", { style: { padding: "8px 16px 0" }, children: /* @__PURE__ */ jsx(
|
|
1893
1863
|
PostBody,
|
|
@@ -1918,10 +1888,58 @@ function renderContent(variant, media) {
|
|
|
1918
1888
|
}
|
|
1919
1889
|
var INSET = { padding: "12px 16px 0" };
|
|
1920
1890
|
var LinkedInPostPreview = memo(LinkedInPostPreviewImpl);
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
var
|
|
1924
|
-
|
|
1891
|
+
|
|
1892
|
+
// src/preview/instagram/theme.ts
|
|
1893
|
+
var IG_VAR = {
|
|
1894
|
+
bg: "--pr-ig-bg",
|
|
1895
|
+
text: "--pr-ig-text",
|
|
1896
|
+
muted: "--pr-ig-muted",
|
|
1897
|
+
border: "--pr-ig-border",
|
|
1898
|
+
accent: "--pr-ig-accent"
|
|
1899
|
+
};
|
|
1900
|
+
function varRef2(name) {
|
|
1901
|
+
return `var(${name})`;
|
|
1902
|
+
}
|
|
1903
|
+
function paletteVars2() {
|
|
1904
|
+
return {
|
|
1905
|
+
[IG_VAR.bg]: "light-dark(#ffffff, #000000)",
|
|
1906
|
+
[IG_VAR.text]: "light-dark(#000000, #f5f5f5)",
|
|
1907
|
+
[IG_VAR.muted]: "light-dark(#737373, #a8a8a8)",
|
|
1908
|
+
[IG_VAR.border]: "light-dark(#dbdbdb, #262626)",
|
|
1909
|
+
[IG_VAR.accent]: "light-dark(#00376b, #e0f1ff)"
|
|
1910
|
+
};
|
|
1911
|
+
}
|
|
1912
|
+
function colorSchemeFor2(theme) {
|
|
1913
|
+
return theme === "auto" ? "light dark" : theme;
|
|
1914
|
+
}
|
|
1915
|
+
function Actions() {
|
|
1916
|
+
return /* @__PURE__ */ jsxs("div", { style: rowStyle, children: [
|
|
1917
|
+
/* @__PURE__ */ jsxs("div", { style: leftStyle, children: [
|
|
1918
|
+
/* @__PURE__ */ jsx(FiHeart, { size: 24, "aria-label": "Like", role: "img" }),
|
|
1919
|
+
/* @__PURE__ */ jsx(FiMessageCircle, { size: 24, "aria-label": "Comment", role: "img" }),
|
|
1920
|
+
/* @__PURE__ */ jsx(FiSend, { size: 24, "aria-label": "Share", role: "img" })
|
|
1921
|
+
] }),
|
|
1922
|
+
/* @__PURE__ */ jsx(FiBookmark, { size: 24, "aria-label": "Save", role: "img" })
|
|
1923
|
+
] });
|
|
1924
|
+
}
|
|
1925
|
+
var rowStyle = {
|
|
1926
|
+
display: "flex",
|
|
1927
|
+
alignItems: "center",
|
|
1928
|
+
justifyContent: "space-between",
|
|
1929
|
+
padding: "10px 12px 4px",
|
|
1930
|
+
color: varRef2(IG_VAR.text)
|
|
1931
|
+
};
|
|
1932
|
+
var leftStyle = {
|
|
1933
|
+
display: "flex",
|
|
1934
|
+
alignItems: "center",
|
|
1935
|
+
gap: 16
|
|
1936
|
+
};
|
|
1937
|
+
function ExpandableText({
|
|
1938
|
+
children,
|
|
1939
|
+
lines = 2,
|
|
1940
|
+
toggleColor,
|
|
1941
|
+
style
|
|
1942
|
+
}) {
|
|
1925
1943
|
const [expanded, setExpanded] = useState(false);
|
|
1926
1944
|
const [overflowing, setOverflowing] = useState(false);
|
|
1927
1945
|
const ref = useRef(null);
|
|
@@ -1931,55 +1949,406 @@ function Caption({ body }) {
|
|
|
1931
1949
|
return;
|
|
1932
1950
|
}
|
|
1933
1951
|
setOverflowing(el.scrollHeight > el.clientHeight + 1);
|
|
1934
|
-
}, [
|
|
1935
|
-
const
|
|
1936
|
-
return /* @__PURE__ */ jsxs("div", { style
|
|
1937
|
-
/* @__PURE__ */ jsx("div", { ref, style:
|
|
1938
|
-
(part, i) => IS_TOKEN.test(part) ? /* @__PURE__ */ jsx("span", { style: { color: LINK_COLOR }, children: part }, i) : /* @__PURE__ */ jsx("span", { children: part }, i)
|
|
1939
|
-
) }),
|
|
1952
|
+
}, [expanded, children]);
|
|
1953
|
+
const textStyle = expanded ? FULL : { ...FULL, ...clampStyle(lines) };
|
|
1954
|
+
return /* @__PURE__ */ jsxs("div", { style, children: [
|
|
1955
|
+
/* @__PURE__ */ jsx("div", { ref, style: textStyle, children }),
|
|
1940
1956
|
overflowing || expanded ? /* @__PURE__ */ jsx(
|
|
1941
1957
|
"button",
|
|
1942
1958
|
{
|
|
1943
1959
|
type: "button",
|
|
1944
1960
|
"aria-expanded": expanded,
|
|
1945
|
-
"aria-label": expanded ? "
|
|
1961
|
+
"aria-label": expanded ? "Show less" : "Show more",
|
|
1946
1962
|
onClick: () => setExpanded((v) => !v),
|
|
1947
|
-
style:
|
|
1963
|
+
style: { ...toggleStyle, color: toggleColor ?? "inherit" },
|
|
1948
1964
|
children: expanded ? "less" : "more"
|
|
1949
1965
|
}
|
|
1950
1966
|
) : null
|
|
1951
1967
|
] });
|
|
1952
1968
|
}
|
|
1953
|
-
var
|
|
1954
|
-
fontSize: 14,
|
|
1955
|
-
lineHeight: 1.35
|
|
1956
|
-
};
|
|
1957
|
-
var clampedTextStyle = {
|
|
1958
|
-
display: "-webkit-box",
|
|
1959
|
-
WebkitLineClamp: 2,
|
|
1960
|
-
WebkitBoxOrient: "vertical",
|
|
1961
|
-
overflow: "hidden",
|
|
1969
|
+
var FULL = {
|
|
1962
1970
|
whiteSpace: "pre-wrap",
|
|
1963
1971
|
wordBreak: "break-word"
|
|
1964
1972
|
};
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
};
|
|
1972
|
-
|
|
1973
|
+
function clampStyle(lines) {
|
|
1974
|
+
return {
|
|
1975
|
+
display: "-webkit-box",
|
|
1976
|
+
WebkitLineClamp: lines,
|
|
1977
|
+
WebkitBoxOrient: "vertical",
|
|
1978
|
+
overflow: "hidden"
|
|
1979
|
+
};
|
|
1980
|
+
}
|
|
1981
|
+
var toggleStyle = {
|
|
1973
1982
|
display: "inline-block",
|
|
1974
1983
|
marginTop: 2,
|
|
1975
1984
|
padding: 0,
|
|
1976
1985
|
border: 0,
|
|
1977
1986
|
background: "transparent",
|
|
1978
|
-
|
|
1979
|
-
|
|
1987
|
+
font: "inherit",
|
|
1988
|
+
fontWeight: 600,
|
|
1989
|
+
cursor: "pointer"
|
|
1990
|
+
};
|
|
1991
|
+
var TOKEN = /([#@][\p{L}\p{N}_.]+)/gu;
|
|
1992
|
+
var IS_TOKEN = /^[#@][\p{L}\p{N}_.]+$/u;
|
|
1993
|
+
function Caption({
|
|
1994
|
+
username,
|
|
1995
|
+
body
|
|
1996
|
+
}) {
|
|
1997
|
+
const parts = body.split(TOKEN);
|
|
1998
|
+
return /* @__PURE__ */ jsxs(
|
|
1999
|
+
ExpandableText,
|
|
2000
|
+
{
|
|
2001
|
+
lines: 2,
|
|
2002
|
+
toggleColor: varRef2(IG_VAR.muted),
|
|
2003
|
+
style: wrapStyle3,
|
|
2004
|
+
children: [
|
|
2005
|
+
/* @__PURE__ */ jsxs("span", { style: { fontWeight: 600 }, children: [
|
|
2006
|
+
username,
|
|
2007
|
+
" "
|
|
2008
|
+
] }),
|
|
2009
|
+
parts.map(
|
|
2010
|
+
(part, i) => IS_TOKEN.test(part) ? /* @__PURE__ */ jsx("span", { style: { color: varRef2(IG_VAR.accent) }, children: part }, i) : /* @__PURE__ */ jsx("span", { children: part }, i)
|
|
2011
|
+
)
|
|
2012
|
+
]
|
|
2013
|
+
}
|
|
2014
|
+
);
|
|
2015
|
+
}
|
|
2016
|
+
var wrapStyle3 = {
|
|
2017
|
+
padding: "4px 12px 0",
|
|
2018
|
+
fontSize: 14,
|
|
2019
|
+
lineHeight: 1.4,
|
|
2020
|
+
color: varRef2(IG_VAR.text)
|
|
2021
|
+
};
|
|
2022
|
+
function FeedMedia({ media }) {
|
|
2023
|
+
if (media.length <= 1) {
|
|
2024
|
+
return /* @__PURE__ */ jsx("div", { style: frameStyle, children: media[0] ? /* @__PURE__ */ jsx(Tile2, { item: media[0] }) : null });
|
|
2025
|
+
}
|
|
2026
|
+
return /* @__PURE__ */ jsx(Carousel, { media });
|
|
2027
|
+
}
|
|
2028
|
+
function Tile2({ item }) {
|
|
2029
|
+
if (item.kind === "video") {
|
|
2030
|
+
return /* @__PURE__ */ jsx("video", { src: item.src, poster: item.posterSrc, controls: true, style: mediaStyle });
|
|
2031
|
+
}
|
|
2032
|
+
return /* @__PURE__ */ jsx("img", { src: item.src, alt: item.alt ?? "", style: mediaStyle });
|
|
2033
|
+
}
|
|
2034
|
+
function Carousel({ media }) {
|
|
2035
|
+
const [emblaRef, emblaApi] = useEmblaCarousel({ loop: false, align: "start" });
|
|
2036
|
+
const [selected, setSelected] = useState(0);
|
|
2037
|
+
const sync = useCallback((api) => {
|
|
2038
|
+
setSelected(api.selectedScrollSnap());
|
|
2039
|
+
}, []);
|
|
2040
|
+
useEffect(() => {
|
|
2041
|
+
if (!emblaApi) {
|
|
2042
|
+
return;
|
|
2043
|
+
}
|
|
2044
|
+
sync(emblaApi);
|
|
2045
|
+
emblaApi.on("select", sync).on("reInit", sync);
|
|
2046
|
+
return () => {
|
|
2047
|
+
emblaApi.off("select", sync).off("reInit", sync);
|
|
2048
|
+
};
|
|
2049
|
+
}, [emblaApi, sync]);
|
|
2050
|
+
return /* @__PURE__ */ jsxs("div", { style: frameStyle, children: [
|
|
2051
|
+
/* @__PURE__ */ jsx("div", { ref: emblaRef, style: { position: "absolute", inset: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsx("div", { style: { display: "flex", height: "100%" }, children: media.map((item, i) => /* @__PURE__ */ jsx("div", { style: slideStyle, children: /* @__PURE__ */ jsx(Tile2, { item }) }, `${item.src}-${i}`)) }) }),
|
|
2052
|
+
/* @__PURE__ */ jsxs("div", { style: pillStyle, children: [
|
|
2053
|
+
selected + 1,
|
|
2054
|
+
"/",
|
|
2055
|
+
media.length
|
|
2056
|
+
] }),
|
|
2057
|
+
/* @__PURE__ */ jsx("div", { style: dotsStyle, children: media.map((item, i) => /* @__PURE__ */ jsx(
|
|
2058
|
+
"span",
|
|
2059
|
+
{
|
|
2060
|
+
style: { ...dotStyle, opacity: i === selected ? 1 : 0.5 }
|
|
2061
|
+
},
|
|
2062
|
+
`dot-${item.src}-${i}`
|
|
2063
|
+
)) })
|
|
2064
|
+
] });
|
|
2065
|
+
}
|
|
2066
|
+
var frameStyle = {
|
|
2067
|
+
position: "relative",
|
|
2068
|
+
width: "100%",
|
|
2069
|
+
aspectRatio: "1 / 1",
|
|
2070
|
+
background: "#000",
|
|
2071
|
+
overflow: "hidden"
|
|
2072
|
+
};
|
|
2073
|
+
var mediaStyle = {
|
|
2074
|
+
position: "absolute",
|
|
2075
|
+
inset: 0,
|
|
2076
|
+
width: "100%",
|
|
2077
|
+
height: "100%",
|
|
2078
|
+
objectFit: "cover"
|
|
2079
|
+
};
|
|
2080
|
+
var slideStyle = {
|
|
2081
|
+
position: "relative",
|
|
2082
|
+
flex: "0 0 100%",
|
|
2083
|
+
minWidth: 0,
|
|
2084
|
+
height: "100%"
|
|
2085
|
+
};
|
|
2086
|
+
var pillStyle = {
|
|
2087
|
+
position: "absolute",
|
|
2088
|
+
top: 12,
|
|
2089
|
+
right: 12,
|
|
2090
|
+
background: "rgba(0,0,0,0.6)",
|
|
2091
|
+
color: "#fff",
|
|
2092
|
+
fontSize: 12,
|
|
2093
|
+
fontWeight: 600,
|
|
2094
|
+
padding: "2px 9px",
|
|
2095
|
+
borderRadius: 999
|
|
2096
|
+
};
|
|
2097
|
+
var dotsStyle = {
|
|
2098
|
+
position: "absolute",
|
|
2099
|
+
bottom: 10,
|
|
2100
|
+
left: "50%",
|
|
2101
|
+
transform: "translateX(-50%)",
|
|
2102
|
+
display: "flex",
|
|
2103
|
+
gap: 4
|
|
2104
|
+
};
|
|
2105
|
+
var dotStyle = {
|
|
2106
|
+
width: 6,
|
|
2107
|
+
height: 6,
|
|
2108
|
+
borderRadius: "50%",
|
|
2109
|
+
background: "#fff"
|
|
2110
|
+
};
|
|
2111
|
+
var PLACEHOLDER_AVATAR3 = "data:image/svg+xml;utf8," + encodeURIComponent(
|
|
2112
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><circle cx="16" cy="16" r="16" fill="#b3b3b3"/></svg>'
|
|
2113
|
+
);
|
|
2114
|
+
function Header2({
|
|
2115
|
+
author,
|
|
2116
|
+
collaborators
|
|
2117
|
+
}) {
|
|
2118
|
+
return /* @__PURE__ */ jsxs("div", { style: rowStyle2, children: [
|
|
2119
|
+
/* @__PURE__ */ jsx(
|
|
2120
|
+
"img",
|
|
2121
|
+
{
|
|
2122
|
+
src: author.avatar_url ?? PLACEHOLDER_AVATAR3,
|
|
2123
|
+
alt: "",
|
|
2124
|
+
width: 32,
|
|
2125
|
+
height: 32,
|
|
2126
|
+
style: avatarStyle
|
|
2127
|
+
}
|
|
2128
|
+
),
|
|
2129
|
+
/* @__PURE__ */ jsxs("div", { style: { minWidth: 0, display: "flex", flexDirection: "column" }, children: [
|
|
2130
|
+
/* @__PURE__ */ jsxs("span", { style: nameStyle, children: [
|
|
2131
|
+
author.username ?? "",
|
|
2132
|
+
author.verified ? /* @__PURE__ */ jsx(
|
|
2133
|
+
MdVerified,
|
|
2134
|
+
{
|
|
2135
|
+
size: 13,
|
|
2136
|
+
"aria-label": "Verified",
|
|
2137
|
+
role: "img",
|
|
2138
|
+
style: { color: "#3897f0", marginLeft: 3, flex: "0 0 auto" }
|
|
2139
|
+
}
|
|
2140
|
+
) : null
|
|
2141
|
+
] }),
|
|
2142
|
+
collaborators.length > 0 ? /* @__PURE__ */ jsxs("span", { style: collabStyle, children: [
|
|
2143
|
+
"with ",
|
|
2144
|
+
collaborators.map((c) => `@${c}`).join(", ")
|
|
2145
|
+
] }) : null
|
|
2146
|
+
] }),
|
|
2147
|
+
/* @__PURE__ */ jsx(
|
|
2148
|
+
FiMoreHorizontal,
|
|
2149
|
+
{
|
|
2150
|
+
size: 18,
|
|
2151
|
+
"aria-hidden": true,
|
|
2152
|
+
style: { marginLeft: "auto", color: varRef2(IG_VAR.text) }
|
|
2153
|
+
}
|
|
2154
|
+
)
|
|
2155
|
+
] });
|
|
2156
|
+
}
|
|
2157
|
+
var rowStyle2 = {
|
|
2158
|
+
display: "flex",
|
|
2159
|
+
alignItems: "center",
|
|
2160
|
+
gap: 10,
|
|
2161
|
+
padding: "10px 12px"
|
|
2162
|
+
};
|
|
2163
|
+
var avatarStyle = {
|
|
2164
|
+
width: 32,
|
|
2165
|
+
height: 32,
|
|
2166
|
+
borderRadius: "50%",
|
|
2167
|
+
objectFit: "cover",
|
|
2168
|
+
flex: "0 0 auto"
|
|
2169
|
+
};
|
|
2170
|
+
var nameStyle = {
|
|
2171
|
+
display: "flex",
|
|
2172
|
+
alignItems: "center",
|
|
2173
|
+
fontSize: 14,
|
|
1980
2174
|
fontWeight: 600,
|
|
1981
|
-
|
|
1982
|
-
|
|
2175
|
+
color: varRef2(IG_VAR.text),
|
|
2176
|
+
lineHeight: 1.2
|
|
2177
|
+
};
|
|
2178
|
+
var collabStyle = {
|
|
2179
|
+
fontSize: 12,
|
|
2180
|
+
color: varRef2(IG_VAR.muted),
|
|
2181
|
+
lineHeight: 1.2
|
|
2182
|
+
};
|
|
2183
|
+
function ReelPreview({
|
|
2184
|
+
author,
|
|
2185
|
+
body,
|
|
2186
|
+
media,
|
|
2187
|
+
audioName,
|
|
2188
|
+
className,
|
|
2189
|
+
style
|
|
2190
|
+
}) {
|
|
2191
|
+
const first = media[0];
|
|
2192
|
+
const username = author.username ?? "";
|
|
2193
|
+
return /* @__PURE__ */ jsxs("div", { className, style: { ...cardStyle3, ...style }, children: [
|
|
2194
|
+
first ? first.kind === "video" ? /* @__PURE__ */ jsx(
|
|
2195
|
+
"video",
|
|
2196
|
+
{
|
|
2197
|
+
src: first.src,
|
|
2198
|
+
poster: first.posterSrc,
|
|
2199
|
+
autoPlay: true,
|
|
2200
|
+
muted: true,
|
|
2201
|
+
loop: true,
|
|
2202
|
+
playsInline: true,
|
|
2203
|
+
style: coverStyle2
|
|
2204
|
+
}
|
|
2205
|
+
) : /* @__PURE__ */ jsx("img", { src: first.src, alt: first.alt ?? "", style: coverStyle2 }) : null,
|
|
2206
|
+
/* @__PURE__ */ jsx("div", { style: scrimStyle }),
|
|
2207
|
+
/* @__PURE__ */ jsxs("div", { style: infoStyle, children: [
|
|
2208
|
+
/* @__PURE__ */ jsxs("div", { style: authorRowStyle, children: [
|
|
2209
|
+
/* @__PURE__ */ jsx("span", { style: { fontWeight: 600, fontSize: 14 }, children: username }),
|
|
2210
|
+
author.verified ? /* @__PURE__ */ jsx(MdVerified, { size: 13, "aria-label": "Verified", role: "img", style: { color: "#fff" } }) : null
|
|
2211
|
+
] }),
|
|
2212
|
+
body ? /* @__PURE__ */ jsx("div", { style: captionStyle, children: body }) : null,
|
|
2213
|
+
/* @__PURE__ */ jsxs("div", { style: audioStyle, children: [
|
|
2214
|
+
/* @__PURE__ */ jsx(MdMusicNote, { size: 14, "aria-hidden": true }),
|
|
2215
|
+
/* @__PURE__ */ jsx("span", { children: audioName ?? "Original audio" })
|
|
2216
|
+
] })
|
|
2217
|
+
] }),
|
|
2218
|
+
/* @__PURE__ */ jsxs("div", { style: railStyle, children: [
|
|
2219
|
+
/* @__PURE__ */ jsx(FiHeart, { size: 26, "aria-label": "Like", role: "img" }),
|
|
2220
|
+
/* @__PURE__ */ jsx(FiMessageCircle, { size: 26, "aria-label": "Comment", role: "img" }),
|
|
2221
|
+
/* @__PURE__ */ jsx(FiSend, { size: 26, "aria-label": "Share", role: "img" }),
|
|
2222
|
+
/* @__PURE__ */ jsx(FiBookmark, { size: 26, "aria-label": "Save", role: "img" }),
|
|
2223
|
+
/* @__PURE__ */ jsx(FiMoreHorizontal, { size: 22, "aria-hidden": true })
|
|
2224
|
+
] })
|
|
2225
|
+
] });
|
|
2226
|
+
}
|
|
2227
|
+
var cardStyle3 = {
|
|
2228
|
+
position: "relative",
|
|
2229
|
+
width: "100%",
|
|
2230
|
+
maxWidth: 320,
|
|
2231
|
+
aspectRatio: "9 / 16",
|
|
2232
|
+
borderRadius: 12,
|
|
2233
|
+
overflow: "hidden",
|
|
2234
|
+
background: "#000",
|
|
2235
|
+
color: "#fff",
|
|
2236
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'
|
|
2237
|
+
};
|
|
2238
|
+
var coverStyle2 = {
|
|
2239
|
+
position: "absolute",
|
|
2240
|
+
inset: 0,
|
|
2241
|
+
width: "100%",
|
|
2242
|
+
height: "100%",
|
|
2243
|
+
objectFit: "cover"
|
|
2244
|
+
};
|
|
2245
|
+
var scrimStyle = {
|
|
2246
|
+
position: "absolute",
|
|
2247
|
+
inset: 0,
|
|
2248
|
+
background: "linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.55) 100%)",
|
|
2249
|
+
pointerEvents: "none"
|
|
2250
|
+
};
|
|
2251
|
+
var infoStyle = {
|
|
2252
|
+
position: "absolute",
|
|
2253
|
+
left: 12,
|
|
2254
|
+
right: 60,
|
|
2255
|
+
bottom: 14,
|
|
2256
|
+
display: "flex",
|
|
2257
|
+
flexDirection: "column",
|
|
2258
|
+
gap: 6,
|
|
2259
|
+
textShadow: "0 1px 3px rgba(0,0,0,0.5)"
|
|
2260
|
+
};
|
|
2261
|
+
var authorRowStyle = {
|
|
2262
|
+
display: "flex",
|
|
2263
|
+
alignItems: "center",
|
|
2264
|
+
gap: 5
|
|
2265
|
+
};
|
|
2266
|
+
var captionStyle = {
|
|
2267
|
+
fontSize: 13,
|
|
2268
|
+
lineHeight: 1.35,
|
|
2269
|
+
display: "-webkit-box",
|
|
2270
|
+
WebkitLineClamp: 2,
|
|
2271
|
+
WebkitBoxOrient: "vertical",
|
|
2272
|
+
overflow: "hidden"
|
|
2273
|
+
};
|
|
2274
|
+
var audioStyle = {
|
|
2275
|
+
display: "flex",
|
|
2276
|
+
alignItems: "center",
|
|
2277
|
+
gap: 6,
|
|
2278
|
+
fontSize: 12
|
|
2279
|
+
};
|
|
2280
|
+
var railStyle = {
|
|
2281
|
+
position: "absolute",
|
|
2282
|
+
right: 8,
|
|
2283
|
+
bottom: 16,
|
|
2284
|
+
display: "flex",
|
|
2285
|
+
flexDirection: "column",
|
|
2286
|
+
alignItems: "center",
|
|
2287
|
+
gap: 18,
|
|
2288
|
+
color: "#fff",
|
|
2289
|
+
filter: "drop-shadow(0 1px 2px rgba(0,0,0,0.4))"
|
|
2290
|
+
};
|
|
2291
|
+
function InstagramPostPreviewImpl({
|
|
2292
|
+
variant,
|
|
2293
|
+
author,
|
|
2294
|
+
media,
|
|
2295
|
+
theme = "auto",
|
|
2296
|
+
className,
|
|
2297
|
+
style
|
|
2298
|
+
}) {
|
|
2299
|
+
const resolvedMedia = useResolvedMedia(
|
|
2300
|
+
media,
|
|
2301
|
+
variant.media,
|
|
2302
|
+
altSignatureOf(variant.media)
|
|
2303
|
+
);
|
|
2304
|
+
const settings = variant.settings;
|
|
2305
|
+
const isReel = variant.post_type === "reel" || settings?.media_type === "REELS";
|
|
2306
|
+
if (isReel) {
|
|
2307
|
+
return /* @__PURE__ */ jsx(
|
|
2308
|
+
ReelPreview,
|
|
2309
|
+
{
|
|
2310
|
+
author,
|
|
2311
|
+
body: variant.body ?? "",
|
|
2312
|
+
media: resolvedMedia,
|
|
2313
|
+
audioName: settings?.audio_name,
|
|
2314
|
+
className,
|
|
2315
|
+
style
|
|
2316
|
+
}
|
|
2317
|
+
);
|
|
2318
|
+
}
|
|
2319
|
+
const collaborators = settings?.collaborators ?? [];
|
|
2320
|
+
const cardStyle5 = {
|
|
2321
|
+
...paletteVars2(),
|
|
2322
|
+
colorScheme: colorSchemeFor2(theme),
|
|
2323
|
+
background: varRef2(IG_VAR.bg),
|
|
2324
|
+
color: varRef2(IG_VAR.text),
|
|
2325
|
+
border: `1px solid ${varRef2(IG_VAR.border)}`,
|
|
2326
|
+
borderRadius: 8,
|
|
2327
|
+
maxWidth: 470,
|
|
2328
|
+
overflow: "hidden",
|
|
2329
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
|
|
2330
|
+
...style
|
|
2331
|
+
};
|
|
2332
|
+
return /* @__PURE__ */ jsxs("div", { className, style: cardStyle5, children: [
|
|
2333
|
+
/* @__PURE__ */ jsx(Header2, { author, collaborators }),
|
|
2334
|
+
/* @__PURE__ */ jsx(FeedMedia, { media: resolvedMedia }),
|
|
2335
|
+
/* @__PURE__ */ jsx(Actions, {}),
|
|
2336
|
+
variant.body ? /* @__PURE__ */ jsx("div", { style: { paddingBottom: 12 }, children: /* @__PURE__ */ jsx(Caption, { username: author.username ?? "", body: variant.body }) }) : null
|
|
2337
|
+
] });
|
|
2338
|
+
}
|
|
2339
|
+
var InstagramPostPreview = memo(InstagramPostPreviewImpl);
|
|
2340
|
+
var LINK_COLOR = "#8ab4ff";
|
|
2341
|
+
var TOKEN2 = /([#@][\p{L}\p{N}_.]+)/gu;
|
|
2342
|
+
var IS_TOKEN2 = /^[#@][\p{L}\p{N}_.]+$/u;
|
|
2343
|
+
function Caption2({ body }) {
|
|
2344
|
+
const parts = body.split(TOKEN2);
|
|
2345
|
+
return /* @__PURE__ */ jsx(ExpandableText, { lines: 2, toggleColor: "rgba(255,255,255,0.82)", style: wrapStyle4, children: parts.map(
|
|
2346
|
+
(part, i) => IS_TOKEN2.test(part) ? /* @__PURE__ */ jsx("span", { style: { color: LINK_COLOR }, children: part }, i) : /* @__PURE__ */ jsx("span", { children: part }, i)
|
|
2347
|
+
) });
|
|
2348
|
+
}
|
|
2349
|
+
var wrapStyle4 = {
|
|
2350
|
+
fontSize: 14,
|
|
2351
|
+
lineHeight: 1.35
|
|
1983
2352
|
};
|
|
1984
2353
|
function Media2({
|
|
1985
2354
|
media,
|
|
@@ -1999,7 +2368,7 @@ function Media2({
|
|
|
1999
2368
|
muted: true,
|
|
2000
2369
|
loop: true,
|
|
2001
2370
|
playsInline: true,
|
|
2002
|
-
style:
|
|
2371
|
+
style: coverStyle3
|
|
2003
2372
|
}
|
|
2004
2373
|
);
|
|
2005
2374
|
}
|
|
@@ -2026,11 +2395,11 @@ function PhotoCarousel({ media }) {
|
|
|
2026
2395
|
};
|
|
2027
2396
|
}, [emblaApi, sync]);
|
|
2028
2397
|
return /* @__PURE__ */ jsxs("div", { style: { position: "absolute", inset: 0 }, children: [
|
|
2029
|
-
/* @__PURE__ */ jsx("div", { ref: emblaRef, style: viewportStyle, children: /* @__PURE__ */ jsx("div", { style: containerStyle, children: media.map((m, i) => /* @__PURE__ */ jsx("div", { style:
|
|
2030
|
-
media.length > 1 ? /* @__PURE__ */ jsx("div", { style:
|
|
2398
|
+
/* @__PURE__ */ jsx("div", { ref: emblaRef, style: viewportStyle, children: /* @__PURE__ */ jsx("div", { style: containerStyle, children: media.map((m, i) => /* @__PURE__ */ jsx("div", { style: slideStyle2, children: /* @__PURE__ */ jsx("img", { src: m.src, alt: m.alt ?? "", style: coverStyle3 }) }, `${m.src}-${i}`)) }) }),
|
|
2399
|
+
media.length > 1 ? /* @__PURE__ */ jsx("div", { style: dotsStyle2, children: media.map((m, i) => /* @__PURE__ */ jsx(
|
|
2031
2400
|
"span",
|
|
2032
2401
|
{
|
|
2033
|
-
style: { ...
|
|
2402
|
+
style: { ...dotStyle2, opacity: i === selected ? 1 : 0.4 }
|
|
2034
2403
|
},
|
|
2035
2404
|
`dot-${m.src}-${i}`
|
|
2036
2405
|
)) }) : null
|
|
@@ -2045,7 +2414,7 @@ function ProcessingMedia() {
|
|
|
2045
2414
|
/* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children: "Processing media\u2026" })
|
|
2046
2415
|
] });
|
|
2047
2416
|
}
|
|
2048
|
-
var
|
|
2417
|
+
var coverStyle3 = {
|
|
2049
2418
|
position: "absolute",
|
|
2050
2419
|
inset: 0,
|
|
2051
2420
|
width: "100%",
|
|
@@ -2061,13 +2430,13 @@ var containerStyle = {
|
|
|
2061
2430
|
display: "flex",
|
|
2062
2431
|
height: "100%"
|
|
2063
2432
|
};
|
|
2064
|
-
var
|
|
2433
|
+
var slideStyle2 = {
|
|
2065
2434
|
position: "relative",
|
|
2066
2435
|
flex: "0 0 100%",
|
|
2067
2436
|
minWidth: 0,
|
|
2068
2437
|
height: "100%"
|
|
2069
2438
|
};
|
|
2070
|
-
var
|
|
2439
|
+
var dotsStyle2 = {
|
|
2071
2440
|
position: "absolute",
|
|
2072
2441
|
bottom: 124,
|
|
2073
2442
|
left: "50%",
|
|
@@ -2076,7 +2445,7 @@ var dotsStyle = {
|
|
|
2076
2445
|
gap: 5,
|
|
2077
2446
|
alignItems: "center"
|
|
2078
2447
|
};
|
|
2079
|
-
var
|
|
2448
|
+
var dotStyle2 = {
|
|
2080
2449
|
width: 6,
|
|
2081
2450
|
height: 6,
|
|
2082
2451
|
borderRadius: "50%",
|
|
@@ -2171,16 +2540,16 @@ function TikTokPostPreviewImpl({
|
|
|
2171
2540
|
const label = commercialLabel(variant.settings);
|
|
2172
2541
|
const isAigc = Boolean(variant.settings?.is_aigc);
|
|
2173
2542
|
const pending = (media?.length ?? 0) > 0 && resolvedMedia.length === 0;
|
|
2174
|
-
return /* @__PURE__ */ jsxs("div", { className, style: { ...
|
|
2543
|
+
return /* @__PURE__ */ jsxs("div", { className, style: { ...cardStyle4, ...style }, children: [
|
|
2175
2544
|
/* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
|
|
2176
2545
|
/* @__PURE__ */ jsx(Media2, { media: resolvedMedia, pending }),
|
|
2177
|
-
/* @__PURE__ */ jsx("div", { style:
|
|
2178
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
2546
|
+
/* @__PURE__ */ jsx("div", { style: scrimStyle2 }),
|
|
2547
|
+
/* @__PURE__ */ jsxs("div", { style: infoStyle2, children: [
|
|
2179
2548
|
/* @__PURE__ */ jsx("div", { style: usernameStyle, children: handle }),
|
|
2180
|
-
variant.body ? /* @__PURE__ */ jsx(
|
|
2549
|
+
variant.body ? /* @__PURE__ */ jsx(Caption2, { body: variant.body }) : null,
|
|
2181
2550
|
label || isAigc ? /* @__PURE__ */ jsxs("div", { style: labelsStyle, children: [
|
|
2182
|
-
label ? /* @__PURE__ */ jsx("span", { style:
|
|
2183
|
-
isAigc ? /* @__PURE__ */ jsx("span", { style:
|
|
2551
|
+
label ? /* @__PURE__ */ jsx("span", { style: pillStyle2, children: label }) : null,
|
|
2552
|
+
isAigc ? /* @__PURE__ */ jsx("span", { style: pillStyle2, children: "Creator labeled as AI-generated" }) : null
|
|
2184
2553
|
] }) : null,
|
|
2185
2554
|
/* @__PURE__ */ jsxs("div", { style: musicRowStyle, children: [
|
|
2186
2555
|
/* @__PURE__ */ jsx(IoMusicalNotes, { size: 13 }),
|
|
@@ -2190,7 +2559,7 @@ function TikTokPostPreviewImpl({
|
|
|
2190
2559
|
] })
|
|
2191
2560
|
] })
|
|
2192
2561
|
] }),
|
|
2193
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
2562
|
+
/* @__PURE__ */ jsxs("div", { style: railStyle2, children: [
|
|
2194
2563
|
/* @__PURE__ */ jsxs("div", { style: avatarWrapStyle, children: [
|
|
2195
2564
|
/* @__PURE__ */ jsx(Avatar, { url: creator.avatar_url, name: creator.nickname }),
|
|
2196
2565
|
/* @__PURE__ */ jsx("span", { style: followBadgeStyle, children: /* @__PURE__ */ jsx(PlusIcon, { size: 14 }) })
|
|
@@ -2211,14 +2580,14 @@ function RailAction({ icon, count }) {
|
|
|
2211
2580
|
}
|
|
2212
2581
|
function Avatar({ url, name }) {
|
|
2213
2582
|
if (url) {
|
|
2214
|
-
return /* @__PURE__ */ jsx("img", { src: url, alt: name, style:
|
|
2583
|
+
return /* @__PURE__ */ jsx("img", { src: url, alt: name, style: avatarStyle2 });
|
|
2215
2584
|
}
|
|
2216
|
-
return /* @__PURE__ */ jsx("div", { style: { ...
|
|
2585
|
+
return /* @__PURE__ */ jsx("div", { style: { ...avatarStyle2, ...avatarFallbackStyle }, children: name.slice(0, 1).toUpperCase() });
|
|
2217
2586
|
}
|
|
2218
2587
|
function Disc({ url }) {
|
|
2219
2588
|
return /* @__PURE__ */ jsx("div", { style: discStyle, children: url ? /* @__PURE__ */ jsx("img", { src: url, alt: "", style: discImgStyle }) : null });
|
|
2220
2589
|
}
|
|
2221
|
-
var
|
|
2590
|
+
var cardStyle4 = {
|
|
2222
2591
|
position: "relative",
|
|
2223
2592
|
width: "100%",
|
|
2224
2593
|
maxWidth: 320,
|
|
@@ -2229,13 +2598,13 @@ var cardStyle3 = {
|
|
|
2229
2598
|
color: "#fff",
|
|
2230
2599
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'
|
|
2231
2600
|
};
|
|
2232
|
-
var
|
|
2601
|
+
var scrimStyle2 = {
|
|
2233
2602
|
position: "absolute",
|
|
2234
2603
|
inset: 0,
|
|
2235
2604
|
background: "linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%)",
|
|
2236
2605
|
pointerEvents: "none"
|
|
2237
2606
|
};
|
|
2238
|
-
var
|
|
2607
|
+
var infoStyle2 = {
|
|
2239
2608
|
position: "absolute",
|
|
2240
2609
|
left: 14,
|
|
2241
2610
|
right: 70,
|
|
@@ -2256,7 +2625,7 @@ var labelsStyle = {
|
|
|
2256
2625
|
gap: 4,
|
|
2257
2626
|
marginTop: 2
|
|
2258
2627
|
};
|
|
2259
|
-
var
|
|
2628
|
+
var pillStyle2 = {
|
|
2260
2629
|
display: "inline-flex",
|
|
2261
2630
|
alignItems: "center",
|
|
2262
2631
|
background: "rgba(255,255,255,0.18)",
|
|
@@ -2273,7 +2642,7 @@ var musicRowStyle = {
|
|
|
2273
2642
|
fontSize: 13,
|
|
2274
2643
|
marginTop: 4
|
|
2275
2644
|
};
|
|
2276
|
-
var
|
|
2645
|
+
var railStyle2 = {
|
|
2277
2646
|
position: "absolute",
|
|
2278
2647
|
right: 8,
|
|
2279
2648
|
bottom: 14,
|
|
@@ -2287,7 +2656,7 @@ var avatarWrapStyle = {
|
|
|
2287
2656
|
position: "relative",
|
|
2288
2657
|
marginBottom: 8
|
|
2289
2658
|
};
|
|
2290
|
-
var
|
|
2659
|
+
var avatarStyle2 = {
|
|
2291
2660
|
width: 46,
|
|
2292
2661
|
height: 46,
|
|
2293
2662
|
borderRadius: "50%",
|
|
@@ -2350,6 +2719,8 @@ var discImgStyle = {
|
|
|
2350
2719
|
};
|
|
2351
2720
|
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}}`;
|
|
2352
2721
|
var TikTokPostPreview = memo(TikTokPostPreviewImpl);
|
|
2722
|
+
|
|
2723
|
+
// src/preview/tiktok/theme.ts
|
|
2353
2724
|
var TT_VAR = {
|
|
2354
2725
|
text: "--pr-tt-text",
|
|
2355
2726
|
muted: "--pr-tt-muted",
|
|
@@ -2357,58 +2728,25 @@ var TT_VAR = {
|
|
|
2357
2728
|
accent: "--pr-tt-accent",
|
|
2358
2729
|
switchOff: "--pr-tt-switch-off"
|
|
2359
2730
|
};
|
|
2360
|
-
|
|
2361
|
-
text: "rgba(0,0,0,0.9)",
|
|
2362
|
-
muted: "rgba(0,0,0,0.55)",
|
|
2363
|
-
border: "rgba(0,0,0,0.12)",
|
|
2364
|
-
accent: "#fe2c55",
|
|
2365
|
-
switchOff: "rgba(0,0,0,0.18)"
|
|
2366
|
-
};
|
|
2367
|
-
var DARK2 = {
|
|
2368
|
-
text: "rgba(255,255,255,0.92)",
|
|
2369
|
-
muted: "#8a8a92",
|
|
2370
|
-
border: "rgba(255,255,255,0.14)",
|
|
2371
|
-
accent: "#fe2c55",
|
|
2372
|
-
switchOff: "rgba(255,255,255,0.22)"
|
|
2373
|
-
};
|
|
2374
|
-
function varRef2(name) {
|
|
2731
|
+
function varRef3(name) {
|
|
2375
2732
|
return `var(${name})`;
|
|
2376
2733
|
}
|
|
2377
|
-
function
|
|
2378
|
-
const p = dark ? DARK2 : LIGHT2;
|
|
2734
|
+
function paletteVars3() {
|
|
2379
2735
|
return {
|
|
2380
|
-
[TT_VAR.text]:
|
|
2381
|
-
[TT_VAR.muted]:
|
|
2382
|
-
[TT_VAR.border]:
|
|
2383
|
-
[TT_VAR.accent]:
|
|
2384
|
-
[TT_VAR.switchOff]:
|
|
2736
|
+
[TT_VAR.text]: "light-dark(rgba(0,0,0,0.9), rgba(255,255,255,0.92))",
|
|
2737
|
+
[TT_VAR.muted]: "light-dark(rgba(0,0,0,0.55), #8a8a92)",
|
|
2738
|
+
[TT_VAR.border]: "light-dark(rgba(0,0,0,0.12), rgba(255,255,255,0.14))",
|
|
2739
|
+
[TT_VAR.accent]: "#fe2c55",
|
|
2740
|
+
[TT_VAR.switchOff]: "light-dark(rgba(0,0,0,0.18), rgba(255,255,255,0.22))"
|
|
2385
2741
|
};
|
|
2386
2742
|
}
|
|
2387
|
-
function
|
|
2388
|
-
|
|
2389
|
-
useEffect(() => {
|
|
2390
|
-
if (typeof window === "undefined" || !window.matchMedia) {
|
|
2391
|
-
return;
|
|
2392
|
-
}
|
|
2393
|
-
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2394
|
-
setDark(mq.matches);
|
|
2395
|
-
const onChange = (event) => setDark(event.matches);
|
|
2396
|
-
mq.addEventListener("change", onChange);
|
|
2397
|
-
return () => mq.removeEventListener("change", onChange);
|
|
2398
|
-
}, []);
|
|
2399
|
-
return dark;
|
|
2743
|
+
function colorSchemeFor3(theme) {
|
|
2744
|
+
return theme === "auto" ? "light dark" : theme;
|
|
2400
2745
|
}
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
}
|
|
2406
|
-
return theme === "dark";
|
|
2407
|
-
}
|
|
2408
|
-
var MUTED2 = varRef2(TT_VAR.muted);
|
|
2409
|
-
var BORDER = varRef2(TT_VAR.border);
|
|
2410
|
-
var ACCENT = varRef2(TT_VAR.accent);
|
|
2411
|
-
var SWITCH_OFF = varRef2(TT_VAR.switchOff);
|
|
2746
|
+
var MUTED2 = varRef3(TT_VAR.muted);
|
|
2747
|
+
var BORDER = varRef3(TT_VAR.border);
|
|
2748
|
+
var ACCENT = varRef3(TT_VAR.accent);
|
|
2749
|
+
var SWITCH_OFF = varRef3(TT_VAR.switchOff);
|
|
2412
2750
|
var ON = "#34c759";
|
|
2413
2751
|
function Row({
|
|
2414
2752
|
label,
|
|
@@ -2416,7 +2754,7 @@ function Row({
|
|
|
2416
2754
|
control,
|
|
2417
2755
|
htmlFor
|
|
2418
2756
|
}) {
|
|
2419
|
-
return /* @__PURE__ */ jsxs("div", { style:
|
|
2757
|
+
return /* @__PURE__ */ jsxs("div", { style: rowStyle3, children: [
|
|
2420
2758
|
/* @__PURE__ */ jsxs("label", { htmlFor, style: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
2421
2759
|
/* @__PURE__ */ jsx("span", { style: { fontSize: 14 }, children: label }),
|
|
2422
2760
|
sublabel ? /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: MUTED2 }, children: sublabel }) : null
|
|
@@ -2488,7 +2826,7 @@ function CheckRow({
|
|
|
2488
2826
|
/* @__PURE__ */ jsx("span", { style: { fontSize: 14 }, children: label })
|
|
2489
2827
|
] });
|
|
2490
2828
|
}
|
|
2491
|
-
var
|
|
2829
|
+
var rowStyle3 = {
|
|
2492
2830
|
display: "flex",
|
|
2493
2831
|
alignItems: "center",
|
|
2494
2832
|
justifyContent: "space-between",
|
|
@@ -2593,7 +2931,7 @@ function TikTokCaptionField({
|
|
|
2593
2931
|
const max = captionMaxFor(postType);
|
|
2594
2932
|
const count = value.length;
|
|
2595
2933
|
const over = count > max;
|
|
2596
|
-
return /* @__PURE__ */ jsxs("div", { className, style: { ...
|
|
2934
|
+
return /* @__PURE__ */ jsxs("div", { className, style: { ...wrapStyle5, ...style }, children: [
|
|
2597
2935
|
/* @__PURE__ */ jsxs("div", { style: labelRowStyle, children: [
|
|
2598
2936
|
/* @__PURE__ */ jsx("label", { htmlFor: id, style: labelStyle, children: "Caption" }),
|
|
2599
2937
|
/* @__PURE__ */ jsxs(
|
|
@@ -2601,7 +2939,7 @@ function TikTokCaptionField({
|
|
|
2601
2939
|
{
|
|
2602
2940
|
style: {
|
|
2603
2941
|
...countStyle,
|
|
2604
|
-
color: over ?
|
|
2942
|
+
color: over ? varRef3(TT_VAR.accent) : varRef3(TT_VAR.muted)
|
|
2605
2943
|
},
|
|
2606
2944
|
children: [
|
|
2607
2945
|
count.toLocaleString(),
|
|
@@ -2621,13 +2959,13 @@ function TikTokCaptionField({
|
|
|
2621
2959
|
rows: 4,
|
|
2622
2960
|
style: {
|
|
2623
2961
|
...textareaStyle,
|
|
2624
|
-
borderColor: over ?
|
|
2962
|
+
borderColor: over ? varRef3(TT_VAR.accent) : varRef3(TT_VAR.border)
|
|
2625
2963
|
}
|
|
2626
2964
|
}
|
|
2627
2965
|
)
|
|
2628
2966
|
] });
|
|
2629
2967
|
}
|
|
2630
|
-
var
|
|
2968
|
+
var wrapStyle5 = {
|
|
2631
2969
|
display: "flex",
|
|
2632
2970
|
flexDirection: "column",
|
|
2633
2971
|
gap: 6,
|
|
@@ -2783,7 +3121,6 @@ function TikTokPublishPanel({
|
|
|
2783
3121
|
className,
|
|
2784
3122
|
style
|
|
2785
3123
|
}) {
|
|
2786
|
-
const dark = useIsDark2(theme);
|
|
2787
3124
|
const isVideo = variant.post_type === "video";
|
|
2788
3125
|
const captionOver = caption.length > captionMaxFor(variant.post_type);
|
|
2789
3126
|
const mediaOk = mediaCountValid(variant.post_type, variant.media?.length ?? 0);
|
|
@@ -2793,9 +3130,10 @@ function TikTokPublishPanel({
|
|
|
2793
3130
|
{
|
|
2794
3131
|
className,
|
|
2795
3132
|
style: {
|
|
2796
|
-
...
|
|
3133
|
+
...paletteVars3(),
|
|
3134
|
+
colorScheme: colorSchemeFor3(theme),
|
|
2797
3135
|
...panelStyle,
|
|
2798
|
-
color:
|
|
3136
|
+
color: varRef3(TT_VAR.text),
|
|
2799
3137
|
...style
|
|
2800
3138
|
},
|
|
2801
3139
|
children: [
|
|
@@ -2886,6 +3224,6 @@ var postButtonStyle = {
|
|
|
2886
3224
|
transition: "opacity 160ms ease"
|
|
2887
3225
|
};
|
|
2888
3226
|
|
|
2889
|
-
export { ArticleCard, AudienceSelect, CommercialDisclosure, Connect, Declaration, DocumentCard, InteractionToggles, LinkedInPostPreview, Poll, PostrunProvider, TikTokCaptionField, TikTokPostPreview, TikTokPublishPanel, UploadError, XPoll, XPostPreview, connectionKeys, mediaKeys, postKeys, profileKeys, tiktokKeys, toPreviewMedia, 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 };
|
|
3227
|
+
export { ArticleCard, AudienceSelect, CommercialDisclosure, Connect, Declaration, DocumentCard, InstagramPostPreview, InteractionToggles, LinkedInPostPreview, Poll, PostrunProvider, ReelPreview, TikTokCaptionField, TikTokPostPreview, TikTokPublishPanel, UploadError, XPoll, XPostPreview, connectionKeys, mediaKeys, postKeys, profileKeys, tiktokKeys, toPreviewMedia, 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 };
|
|
2890
3228
|
//# sourceMappingURL=index.js.map
|
|
2891
3229
|
//# sourceMappingURL=index.js.map
|