@postrun/react 2.6.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 +533 -156
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +94 -17
- package/dist/index.d.ts +94 -17
- package/dist/index.js +533 -159
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -15,6 +15,7 @@ var fi = require('react-icons/fi');
|
|
|
15
15
|
var twitterText = require('twitter-text');
|
|
16
16
|
var lu = require('react-icons/lu');
|
|
17
17
|
var useEmblaCarousel = require('embla-carousel-react');
|
|
18
|
+
var md = require('react-icons/md');
|
|
18
19
|
var io5 = require('react-icons/io5');
|
|
19
20
|
|
|
20
21
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -984,6 +985,42 @@ function useTikTokCreatorInfo(connectionId) {
|
|
|
984
985
|
queryClient
|
|
985
986
|
);
|
|
986
987
|
}
|
|
988
|
+
|
|
989
|
+
// src/preview/from-upload.ts
|
|
990
|
+
function previewKind(item) {
|
|
991
|
+
const detected = item.media?.kind;
|
|
992
|
+
if (detected) {
|
|
993
|
+
return detected === "document" ? null : detected;
|
|
994
|
+
}
|
|
995
|
+
const mime = item.file.type;
|
|
996
|
+
if (mime === "image/gif") {
|
|
997
|
+
return "gif";
|
|
998
|
+
}
|
|
999
|
+
if (mime.startsWith("video/")) {
|
|
1000
|
+
return "video";
|
|
1001
|
+
}
|
|
1002
|
+
if (mime.startsWith("image/")) {
|
|
1003
|
+
return "image";
|
|
1004
|
+
}
|
|
1005
|
+
return null;
|
|
1006
|
+
}
|
|
1007
|
+
function toPreviewMedia(items) {
|
|
1008
|
+
return items.flatMap((item) => {
|
|
1009
|
+
const kind = previewKind(item);
|
|
1010
|
+
if (!kind) {
|
|
1011
|
+
return [];
|
|
1012
|
+
}
|
|
1013
|
+
return [
|
|
1014
|
+
{
|
|
1015
|
+
kind,
|
|
1016
|
+
file: item.file,
|
|
1017
|
+
width: item.media?.source?.width ?? void 0,
|
|
1018
|
+
height: item.media?.source?.height ?? void 0,
|
|
1019
|
+
alt: item.media?.alt_text ?? void 0
|
|
1020
|
+
}
|
|
1021
|
+
];
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
987
1024
|
function fileKey(file) {
|
|
988
1025
|
return file ? `${file.name}:${file.size}:${file.lastModified}` : "";
|
|
989
1026
|
}
|
|
@@ -1319,6 +1356,8 @@ function XPostPreviewImpl({
|
|
|
1319
1356
|
);
|
|
1320
1357
|
}
|
|
1321
1358
|
var XPostPreview = react.memo(XPostPreviewImpl);
|
|
1359
|
+
|
|
1360
|
+
// src/preview/linkedin/theme.ts
|
|
1322
1361
|
var LI_VAR = {
|
|
1323
1362
|
bg: "--pr-li-bg",
|
|
1324
1363
|
text: "--pr-li-text",
|
|
@@ -1326,53 +1365,20 @@ var LI_VAR = {
|
|
|
1326
1365
|
border: "--pr-li-border",
|
|
1327
1366
|
accent: "--pr-li-accent"
|
|
1328
1367
|
};
|
|
1329
|
-
var LIGHT = {
|
|
1330
|
-
bg: "#ffffff",
|
|
1331
|
-
text: "rgba(0,0,0,0.9)",
|
|
1332
|
-
muted: "rgba(0,0,0,0.6)",
|
|
1333
|
-
border: "rgba(0,0,0,0.08)",
|
|
1334
|
-
accent: "rgb(10,102,194)"
|
|
1335
|
-
};
|
|
1336
|
-
var DARK = {
|
|
1337
|
-
bg: "#1b1f23",
|
|
1338
|
-
text: "rgba(255,255,255,0.9)",
|
|
1339
|
-
muted: "rgba(255,255,255,0.6)",
|
|
1340
|
-
border: "rgba(255,255,255,0.15)",
|
|
1341
|
-
accent: "rgb(112,181,249)"
|
|
1342
|
-
};
|
|
1343
1368
|
function varRef(name) {
|
|
1344
1369
|
return `var(${name})`;
|
|
1345
1370
|
}
|
|
1346
|
-
function paletteVars(
|
|
1347
|
-
const p = dark ? DARK : LIGHT;
|
|
1371
|
+
function paletteVars() {
|
|
1348
1372
|
return {
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
"
|
|
1373
|
+
[LI_VAR.bg]: "light-dark(#ffffff, #1b1f23)",
|
|
1374
|
+
[LI_VAR.text]: "light-dark(rgba(0,0,0,0.9), rgba(255,255,255,0.9))",
|
|
1375
|
+
[LI_VAR.muted]: "light-dark(rgba(0,0,0,0.6), rgba(255,255,255,0.6))",
|
|
1376
|
+
[LI_VAR.border]: "light-dark(rgba(0,0,0,0.08), rgba(255,255,255,0.15))",
|
|
1377
|
+
[LI_VAR.accent]: "light-dark(rgb(10,102,194), rgb(112,181,249))"
|
|
1354
1378
|
};
|
|
1355
1379
|
}
|
|
1356
|
-
function
|
|
1357
|
-
|
|
1358
|
-
react.useEffect(() => {
|
|
1359
|
-
if (typeof window === "undefined" || !window.matchMedia) {
|
|
1360
|
-
return;
|
|
1361
|
-
}
|
|
1362
|
-
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1363
|
-
setDark(mq.matches);
|
|
1364
|
-
const onChange = (event) => setDark(event.matches);
|
|
1365
|
-
mq.addEventListener("change", onChange);
|
|
1366
|
-
return () => mq.removeEventListener("change", onChange);
|
|
1367
|
-
}, []);
|
|
1368
|
-
return dark;
|
|
1369
|
-
}
|
|
1370
|
-
function useIsDark(theme) {
|
|
1371
|
-
const prefersDark = usePrefersDark();
|
|
1372
|
-
if (theme === "auto") {
|
|
1373
|
-
return prefersDark;
|
|
1374
|
-
}
|
|
1375
|
-
return theme === "dark";
|
|
1380
|
+
function colorSchemeFor(theme) {
|
|
1381
|
+
return theme === "auto" ? "light dark" : theme;
|
|
1376
1382
|
}
|
|
1377
1383
|
function domainOf(source) {
|
|
1378
1384
|
try {
|
|
@@ -1839,7 +1845,6 @@ function LinkedInPostPreviewImpl({
|
|
|
1839
1845
|
className,
|
|
1840
1846
|
style
|
|
1841
1847
|
}) {
|
|
1842
|
-
const dark = useIsDark(theme);
|
|
1843
1848
|
const resolvedMedia = useResolvedMedia(
|
|
1844
1849
|
media,
|
|
1845
1850
|
variant.media,
|
|
@@ -1851,8 +1856,9 @@ function LinkedInPostPreviewImpl({
|
|
|
1851
1856
|
accent: varRef(LI_VAR.accent),
|
|
1852
1857
|
muted: varRef(LI_VAR.muted)
|
|
1853
1858
|
};
|
|
1854
|
-
const
|
|
1855
|
-
...paletteVars(
|
|
1859
|
+
const cardStyle5 = {
|
|
1860
|
+
...paletteVars(),
|
|
1861
|
+
colorScheme: colorSchemeFor(theme),
|
|
1856
1862
|
background: varRef(LI_VAR.bg),
|
|
1857
1863
|
color: varRef(LI_VAR.text),
|
|
1858
1864
|
border: `1px solid ${varRef(LI_VAR.border)}`,
|
|
@@ -1862,7 +1868,7 @@ function LinkedInPostPreviewImpl({
|
|
|
1862
1868
|
fontFamily: FONT_STACK,
|
|
1863
1869
|
...style
|
|
1864
1870
|
};
|
|
1865
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style:
|
|
1871
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: cardStyle5, children: [
|
|
1866
1872
|
/* @__PURE__ */ jsxRuntime.jsx(Header, { author, visibility, time }),
|
|
1867
1873
|
variant.body ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "8px 16px 0" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1868
1874
|
PostBody,
|
|
@@ -1893,10 +1899,58 @@ function renderContent(variant, media) {
|
|
|
1893
1899
|
}
|
|
1894
1900
|
var INSET = { padding: "12px 16px 0" };
|
|
1895
1901
|
var LinkedInPostPreview = react.memo(LinkedInPostPreviewImpl);
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
var
|
|
1899
|
-
|
|
1902
|
+
|
|
1903
|
+
// src/preview/instagram/theme.ts
|
|
1904
|
+
var IG_VAR = {
|
|
1905
|
+
bg: "--pr-ig-bg",
|
|
1906
|
+
text: "--pr-ig-text",
|
|
1907
|
+
muted: "--pr-ig-muted",
|
|
1908
|
+
border: "--pr-ig-border",
|
|
1909
|
+
accent: "--pr-ig-accent"
|
|
1910
|
+
};
|
|
1911
|
+
function varRef2(name) {
|
|
1912
|
+
return `var(${name})`;
|
|
1913
|
+
}
|
|
1914
|
+
function paletteVars2() {
|
|
1915
|
+
return {
|
|
1916
|
+
[IG_VAR.bg]: "light-dark(#ffffff, #000000)",
|
|
1917
|
+
[IG_VAR.text]: "light-dark(#000000, #f5f5f5)",
|
|
1918
|
+
[IG_VAR.muted]: "light-dark(#737373, #a8a8a8)",
|
|
1919
|
+
[IG_VAR.border]: "light-dark(#dbdbdb, #262626)",
|
|
1920
|
+
[IG_VAR.accent]: "light-dark(#00376b, #e0f1ff)"
|
|
1921
|
+
};
|
|
1922
|
+
}
|
|
1923
|
+
function colorSchemeFor2(theme) {
|
|
1924
|
+
return theme === "auto" ? "light dark" : theme;
|
|
1925
|
+
}
|
|
1926
|
+
function Actions() {
|
|
1927
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: rowStyle, children: [
|
|
1928
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: leftStyle, children: [
|
|
1929
|
+
/* @__PURE__ */ jsxRuntime.jsx(fi.FiHeart, { size: 24, "aria-label": "Like", role: "img" }),
|
|
1930
|
+
/* @__PURE__ */ jsxRuntime.jsx(fi.FiMessageCircle, { size: 24, "aria-label": "Comment", role: "img" }),
|
|
1931
|
+
/* @__PURE__ */ jsxRuntime.jsx(fi.FiSend, { size: 24, "aria-label": "Share", role: "img" })
|
|
1932
|
+
] }),
|
|
1933
|
+
/* @__PURE__ */ jsxRuntime.jsx(fi.FiBookmark, { size: 24, "aria-label": "Save", role: "img" })
|
|
1934
|
+
] });
|
|
1935
|
+
}
|
|
1936
|
+
var rowStyle = {
|
|
1937
|
+
display: "flex",
|
|
1938
|
+
alignItems: "center",
|
|
1939
|
+
justifyContent: "space-between",
|
|
1940
|
+
padding: "10px 12px 4px",
|
|
1941
|
+
color: varRef2(IG_VAR.text)
|
|
1942
|
+
};
|
|
1943
|
+
var leftStyle = {
|
|
1944
|
+
display: "flex",
|
|
1945
|
+
alignItems: "center",
|
|
1946
|
+
gap: 16
|
|
1947
|
+
};
|
|
1948
|
+
function ExpandableText({
|
|
1949
|
+
children,
|
|
1950
|
+
lines = 2,
|
|
1951
|
+
toggleColor,
|
|
1952
|
+
style
|
|
1953
|
+
}) {
|
|
1900
1954
|
const [expanded, setExpanded] = react.useState(false);
|
|
1901
1955
|
const [overflowing, setOverflowing] = react.useState(false);
|
|
1902
1956
|
const ref = react.useRef(null);
|
|
@@ -1906,55 +1960,406 @@ function Caption({ body }) {
|
|
|
1906
1960
|
return;
|
|
1907
1961
|
}
|
|
1908
1962
|
setOverflowing(el.scrollHeight > el.clientHeight + 1);
|
|
1909
|
-
}, [
|
|
1910
|
-
const
|
|
1911
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style
|
|
1912
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref, style:
|
|
1913
|
-
(part, i) => IS_TOKEN.test(part) ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: LINK_COLOR }, children: part }, i) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: part }, i)
|
|
1914
|
-
) }),
|
|
1963
|
+
}, [expanded, children]);
|
|
1964
|
+
const textStyle = expanded ? FULL : { ...FULL, ...clampStyle(lines) };
|
|
1965
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style, children: [
|
|
1966
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref, style: textStyle, children }),
|
|
1915
1967
|
overflowing || expanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1916
1968
|
"button",
|
|
1917
1969
|
{
|
|
1918
1970
|
type: "button",
|
|
1919
1971
|
"aria-expanded": expanded,
|
|
1920
|
-
"aria-label": expanded ? "
|
|
1972
|
+
"aria-label": expanded ? "Show less" : "Show more",
|
|
1921
1973
|
onClick: () => setExpanded((v) => !v),
|
|
1922
|
-
style:
|
|
1974
|
+
style: { ...toggleStyle, color: toggleColor ?? "inherit" },
|
|
1923
1975
|
children: expanded ? "less" : "more"
|
|
1924
1976
|
}
|
|
1925
1977
|
) : null
|
|
1926
1978
|
] });
|
|
1927
1979
|
}
|
|
1928
|
-
var
|
|
1929
|
-
fontSize: 14,
|
|
1930
|
-
lineHeight: 1.35
|
|
1931
|
-
};
|
|
1932
|
-
var clampedTextStyle = {
|
|
1933
|
-
display: "-webkit-box",
|
|
1934
|
-
WebkitLineClamp: 2,
|
|
1935
|
-
WebkitBoxOrient: "vertical",
|
|
1936
|
-
overflow: "hidden",
|
|
1980
|
+
var FULL = {
|
|
1937
1981
|
whiteSpace: "pre-wrap",
|
|
1938
1982
|
wordBreak: "break-word"
|
|
1939
1983
|
};
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
};
|
|
1947
|
-
|
|
1984
|
+
function clampStyle(lines) {
|
|
1985
|
+
return {
|
|
1986
|
+
display: "-webkit-box",
|
|
1987
|
+
WebkitLineClamp: lines,
|
|
1988
|
+
WebkitBoxOrient: "vertical",
|
|
1989
|
+
overflow: "hidden"
|
|
1990
|
+
};
|
|
1991
|
+
}
|
|
1992
|
+
var toggleStyle = {
|
|
1948
1993
|
display: "inline-block",
|
|
1949
1994
|
marginTop: 2,
|
|
1950
1995
|
padding: 0,
|
|
1951
1996
|
border: 0,
|
|
1952
1997
|
background: "transparent",
|
|
1953
|
-
|
|
1954
|
-
|
|
1998
|
+
font: "inherit",
|
|
1999
|
+
fontWeight: 600,
|
|
2000
|
+
cursor: "pointer"
|
|
2001
|
+
};
|
|
2002
|
+
var TOKEN = /([#@][\p{L}\p{N}_.]+)/gu;
|
|
2003
|
+
var IS_TOKEN = /^[#@][\p{L}\p{N}_.]+$/u;
|
|
2004
|
+
function Caption({
|
|
2005
|
+
username,
|
|
2006
|
+
body
|
|
2007
|
+
}) {
|
|
2008
|
+
const parts = body.split(TOKEN);
|
|
2009
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2010
|
+
ExpandableText,
|
|
2011
|
+
{
|
|
2012
|
+
lines: 2,
|
|
2013
|
+
toggleColor: varRef2(IG_VAR.muted),
|
|
2014
|
+
style: wrapStyle3,
|
|
2015
|
+
children: [
|
|
2016
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: 600 }, children: [
|
|
2017
|
+
username,
|
|
2018
|
+
" "
|
|
2019
|
+
] }),
|
|
2020
|
+
parts.map(
|
|
2021
|
+
(part, i) => IS_TOKEN.test(part) ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: varRef2(IG_VAR.accent) }, children: part }, i) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: part }, i)
|
|
2022
|
+
)
|
|
2023
|
+
]
|
|
2024
|
+
}
|
|
2025
|
+
);
|
|
2026
|
+
}
|
|
2027
|
+
var wrapStyle3 = {
|
|
2028
|
+
padding: "4px 12px 0",
|
|
2029
|
+
fontSize: 14,
|
|
2030
|
+
lineHeight: 1.4,
|
|
2031
|
+
color: varRef2(IG_VAR.text)
|
|
2032
|
+
};
|
|
2033
|
+
function FeedMedia({ media }) {
|
|
2034
|
+
if (media.length <= 1) {
|
|
2035
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: frameStyle, children: media[0] ? /* @__PURE__ */ jsxRuntime.jsx(Tile2, { item: media[0] }) : null });
|
|
2036
|
+
}
|
|
2037
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Carousel, { media });
|
|
2038
|
+
}
|
|
2039
|
+
function Tile2({ item }) {
|
|
2040
|
+
if (item.kind === "video") {
|
|
2041
|
+
return /* @__PURE__ */ jsxRuntime.jsx("video", { src: item.src, poster: item.posterSrc, controls: true, style: mediaStyle });
|
|
2042
|
+
}
|
|
2043
|
+
return /* @__PURE__ */ jsxRuntime.jsx("img", { src: item.src, alt: item.alt ?? "", style: mediaStyle });
|
|
2044
|
+
}
|
|
2045
|
+
function Carousel({ media }) {
|
|
2046
|
+
const [emblaRef, emblaApi] = useEmblaCarousel__default.default({ loop: false, align: "start" });
|
|
2047
|
+
const [selected, setSelected] = react.useState(0);
|
|
2048
|
+
const sync = react.useCallback((api) => {
|
|
2049
|
+
setSelected(api.selectedScrollSnap());
|
|
2050
|
+
}, []);
|
|
2051
|
+
react.useEffect(() => {
|
|
2052
|
+
if (!emblaApi) {
|
|
2053
|
+
return;
|
|
2054
|
+
}
|
|
2055
|
+
sync(emblaApi);
|
|
2056
|
+
emblaApi.on("select", sync).on("reInit", sync);
|
|
2057
|
+
return () => {
|
|
2058
|
+
emblaApi.off("select", sync).off("reInit", sync);
|
|
2059
|
+
};
|
|
2060
|
+
}, [emblaApi, sync]);
|
|
2061
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: frameStyle, children: [
|
|
2062
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: emblaRef, style: { position: "absolute", inset: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", height: "100%" }, children: media.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { style: slideStyle, children: /* @__PURE__ */ jsxRuntime.jsx(Tile2, { item }) }, `${item.src}-${i}`)) }) }),
|
|
2063
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: pillStyle, children: [
|
|
2064
|
+
selected + 1,
|
|
2065
|
+
"/",
|
|
2066
|
+
media.length
|
|
2067
|
+
] }),
|
|
2068
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: dotsStyle, children: media.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2069
|
+
"span",
|
|
2070
|
+
{
|
|
2071
|
+
style: { ...dotStyle, opacity: i === selected ? 1 : 0.5 }
|
|
2072
|
+
},
|
|
2073
|
+
`dot-${item.src}-${i}`
|
|
2074
|
+
)) })
|
|
2075
|
+
] });
|
|
2076
|
+
}
|
|
2077
|
+
var frameStyle = {
|
|
2078
|
+
position: "relative",
|
|
2079
|
+
width: "100%",
|
|
2080
|
+
aspectRatio: "1 / 1",
|
|
2081
|
+
background: "#000",
|
|
2082
|
+
overflow: "hidden"
|
|
2083
|
+
};
|
|
2084
|
+
var mediaStyle = {
|
|
2085
|
+
position: "absolute",
|
|
2086
|
+
inset: 0,
|
|
2087
|
+
width: "100%",
|
|
2088
|
+
height: "100%",
|
|
2089
|
+
objectFit: "cover"
|
|
2090
|
+
};
|
|
2091
|
+
var slideStyle = {
|
|
2092
|
+
position: "relative",
|
|
2093
|
+
flex: "0 0 100%",
|
|
2094
|
+
minWidth: 0,
|
|
2095
|
+
height: "100%"
|
|
2096
|
+
};
|
|
2097
|
+
var pillStyle = {
|
|
2098
|
+
position: "absolute",
|
|
2099
|
+
top: 12,
|
|
2100
|
+
right: 12,
|
|
2101
|
+
background: "rgba(0,0,0,0.6)",
|
|
2102
|
+
color: "#fff",
|
|
2103
|
+
fontSize: 12,
|
|
2104
|
+
fontWeight: 600,
|
|
2105
|
+
padding: "2px 9px",
|
|
2106
|
+
borderRadius: 999
|
|
2107
|
+
};
|
|
2108
|
+
var dotsStyle = {
|
|
2109
|
+
position: "absolute",
|
|
2110
|
+
bottom: 10,
|
|
2111
|
+
left: "50%",
|
|
2112
|
+
transform: "translateX(-50%)",
|
|
2113
|
+
display: "flex",
|
|
2114
|
+
gap: 4
|
|
2115
|
+
};
|
|
2116
|
+
var dotStyle = {
|
|
2117
|
+
width: 6,
|
|
2118
|
+
height: 6,
|
|
2119
|
+
borderRadius: "50%",
|
|
2120
|
+
background: "#fff"
|
|
2121
|
+
};
|
|
2122
|
+
var PLACEHOLDER_AVATAR3 = "data:image/svg+xml;utf8," + encodeURIComponent(
|
|
2123
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><circle cx="16" cy="16" r="16" fill="#b3b3b3"/></svg>'
|
|
2124
|
+
);
|
|
2125
|
+
function Header2({
|
|
2126
|
+
author,
|
|
2127
|
+
collaborators
|
|
2128
|
+
}) {
|
|
2129
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: rowStyle2, children: [
|
|
2130
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2131
|
+
"img",
|
|
2132
|
+
{
|
|
2133
|
+
src: author.avatar_url ?? PLACEHOLDER_AVATAR3,
|
|
2134
|
+
alt: "",
|
|
2135
|
+
width: 32,
|
|
2136
|
+
height: 32,
|
|
2137
|
+
style: avatarStyle
|
|
2138
|
+
}
|
|
2139
|
+
),
|
|
2140
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 0, display: "flex", flexDirection: "column" }, children: [
|
|
2141
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: nameStyle, children: [
|
|
2142
|
+
author.username ?? "",
|
|
2143
|
+
author.verified ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2144
|
+
md.MdVerified,
|
|
2145
|
+
{
|
|
2146
|
+
size: 13,
|
|
2147
|
+
"aria-label": "Verified",
|
|
2148
|
+
role: "img",
|
|
2149
|
+
style: { color: "#3897f0", marginLeft: 3, flex: "0 0 auto" }
|
|
2150
|
+
}
|
|
2151
|
+
) : null
|
|
2152
|
+
] }),
|
|
2153
|
+
collaborators.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { style: collabStyle, children: [
|
|
2154
|
+
"with ",
|
|
2155
|
+
collaborators.map((c) => `@${c}`).join(", ")
|
|
2156
|
+
] }) : null
|
|
2157
|
+
] }),
|
|
2158
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2159
|
+
fi.FiMoreHorizontal,
|
|
2160
|
+
{
|
|
2161
|
+
size: 18,
|
|
2162
|
+
"aria-hidden": true,
|
|
2163
|
+
style: { marginLeft: "auto", color: varRef2(IG_VAR.text) }
|
|
2164
|
+
}
|
|
2165
|
+
)
|
|
2166
|
+
] });
|
|
2167
|
+
}
|
|
2168
|
+
var rowStyle2 = {
|
|
2169
|
+
display: "flex",
|
|
2170
|
+
alignItems: "center",
|
|
2171
|
+
gap: 10,
|
|
2172
|
+
padding: "10px 12px"
|
|
2173
|
+
};
|
|
2174
|
+
var avatarStyle = {
|
|
2175
|
+
width: 32,
|
|
2176
|
+
height: 32,
|
|
2177
|
+
borderRadius: "50%",
|
|
2178
|
+
objectFit: "cover",
|
|
2179
|
+
flex: "0 0 auto"
|
|
2180
|
+
};
|
|
2181
|
+
var nameStyle = {
|
|
2182
|
+
display: "flex",
|
|
2183
|
+
alignItems: "center",
|
|
2184
|
+
fontSize: 14,
|
|
1955
2185
|
fontWeight: 600,
|
|
1956
|
-
|
|
1957
|
-
|
|
2186
|
+
color: varRef2(IG_VAR.text),
|
|
2187
|
+
lineHeight: 1.2
|
|
2188
|
+
};
|
|
2189
|
+
var collabStyle = {
|
|
2190
|
+
fontSize: 12,
|
|
2191
|
+
color: varRef2(IG_VAR.muted),
|
|
2192
|
+
lineHeight: 1.2
|
|
2193
|
+
};
|
|
2194
|
+
function ReelPreview({
|
|
2195
|
+
author,
|
|
2196
|
+
body,
|
|
2197
|
+
media,
|
|
2198
|
+
audioName,
|
|
2199
|
+
className,
|
|
2200
|
+
style
|
|
2201
|
+
}) {
|
|
2202
|
+
const first = media[0];
|
|
2203
|
+
const username = author.username ?? "";
|
|
2204
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { ...cardStyle3, ...style }, children: [
|
|
2205
|
+
first ? first.kind === "video" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2206
|
+
"video",
|
|
2207
|
+
{
|
|
2208
|
+
src: first.src,
|
|
2209
|
+
poster: first.posterSrc,
|
|
2210
|
+
autoPlay: true,
|
|
2211
|
+
muted: true,
|
|
2212
|
+
loop: true,
|
|
2213
|
+
playsInline: true,
|
|
2214
|
+
style: coverStyle2
|
|
2215
|
+
}
|
|
2216
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("img", { src: first.src, alt: first.alt ?? "", style: coverStyle2 }) : null,
|
|
2217
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: scrimStyle }),
|
|
2218
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: infoStyle, children: [
|
|
2219
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: authorRowStyle, children: [
|
|
2220
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 600, fontSize: 14 }, children: username }),
|
|
2221
|
+
author.verified ? /* @__PURE__ */ jsxRuntime.jsx(md.MdVerified, { size: 13, "aria-label": "Verified", role: "img", style: { color: "#fff" } }) : null
|
|
2222
|
+
] }),
|
|
2223
|
+
body ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: captionStyle, children: body }) : null,
|
|
2224
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: audioStyle, children: [
|
|
2225
|
+
/* @__PURE__ */ jsxRuntime.jsx(md.MdMusicNote, { size: 14, "aria-hidden": true }),
|
|
2226
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: audioName ?? "Original audio" })
|
|
2227
|
+
] })
|
|
2228
|
+
] }),
|
|
2229
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: railStyle, children: [
|
|
2230
|
+
/* @__PURE__ */ jsxRuntime.jsx(fi.FiHeart, { size: 26, "aria-label": "Like", role: "img" }),
|
|
2231
|
+
/* @__PURE__ */ jsxRuntime.jsx(fi.FiMessageCircle, { size: 26, "aria-label": "Comment", role: "img" }),
|
|
2232
|
+
/* @__PURE__ */ jsxRuntime.jsx(fi.FiSend, { size: 26, "aria-label": "Share", role: "img" }),
|
|
2233
|
+
/* @__PURE__ */ jsxRuntime.jsx(fi.FiBookmark, { size: 26, "aria-label": "Save", role: "img" }),
|
|
2234
|
+
/* @__PURE__ */ jsxRuntime.jsx(fi.FiMoreHorizontal, { size: 22, "aria-hidden": true })
|
|
2235
|
+
] })
|
|
2236
|
+
] });
|
|
2237
|
+
}
|
|
2238
|
+
var cardStyle3 = {
|
|
2239
|
+
position: "relative",
|
|
2240
|
+
width: "100%",
|
|
2241
|
+
maxWidth: 320,
|
|
2242
|
+
aspectRatio: "9 / 16",
|
|
2243
|
+
borderRadius: 12,
|
|
2244
|
+
overflow: "hidden",
|
|
2245
|
+
background: "#000",
|
|
2246
|
+
color: "#fff",
|
|
2247
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'
|
|
2248
|
+
};
|
|
2249
|
+
var coverStyle2 = {
|
|
2250
|
+
position: "absolute",
|
|
2251
|
+
inset: 0,
|
|
2252
|
+
width: "100%",
|
|
2253
|
+
height: "100%",
|
|
2254
|
+
objectFit: "cover"
|
|
2255
|
+
};
|
|
2256
|
+
var scrimStyle = {
|
|
2257
|
+
position: "absolute",
|
|
2258
|
+
inset: 0,
|
|
2259
|
+
background: "linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.55) 100%)",
|
|
2260
|
+
pointerEvents: "none"
|
|
2261
|
+
};
|
|
2262
|
+
var infoStyle = {
|
|
2263
|
+
position: "absolute",
|
|
2264
|
+
left: 12,
|
|
2265
|
+
right: 60,
|
|
2266
|
+
bottom: 14,
|
|
2267
|
+
display: "flex",
|
|
2268
|
+
flexDirection: "column",
|
|
2269
|
+
gap: 6,
|
|
2270
|
+
textShadow: "0 1px 3px rgba(0,0,0,0.5)"
|
|
2271
|
+
};
|
|
2272
|
+
var authorRowStyle = {
|
|
2273
|
+
display: "flex",
|
|
2274
|
+
alignItems: "center",
|
|
2275
|
+
gap: 5
|
|
2276
|
+
};
|
|
2277
|
+
var captionStyle = {
|
|
2278
|
+
fontSize: 13,
|
|
2279
|
+
lineHeight: 1.35,
|
|
2280
|
+
display: "-webkit-box",
|
|
2281
|
+
WebkitLineClamp: 2,
|
|
2282
|
+
WebkitBoxOrient: "vertical",
|
|
2283
|
+
overflow: "hidden"
|
|
2284
|
+
};
|
|
2285
|
+
var audioStyle = {
|
|
2286
|
+
display: "flex",
|
|
2287
|
+
alignItems: "center",
|
|
2288
|
+
gap: 6,
|
|
2289
|
+
fontSize: 12
|
|
2290
|
+
};
|
|
2291
|
+
var railStyle = {
|
|
2292
|
+
position: "absolute",
|
|
2293
|
+
right: 8,
|
|
2294
|
+
bottom: 16,
|
|
2295
|
+
display: "flex",
|
|
2296
|
+
flexDirection: "column",
|
|
2297
|
+
alignItems: "center",
|
|
2298
|
+
gap: 18,
|
|
2299
|
+
color: "#fff",
|
|
2300
|
+
filter: "drop-shadow(0 1px 2px rgba(0,0,0,0.4))"
|
|
2301
|
+
};
|
|
2302
|
+
function InstagramPostPreviewImpl({
|
|
2303
|
+
variant,
|
|
2304
|
+
author,
|
|
2305
|
+
media,
|
|
2306
|
+
theme = "auto",
|
|
2307
|
+
className,
|
|
2308
|
+
style
|
|
2309
|
+
}) {
|
|
2310
|
+
const resolvedMedia = useResolvedMedia(
|
|
2311
|
+
media,
|
|
2312
|
+
variant.media,
|
|
2313
|
+
altSignatureOf(variant.media)
|
|
2314
|
+
);
|
|
2315
|
+
const settings = variant.settings;
|
|
2316
|
+
const isReel = variant.post_type === "reel" || settings?.media_type === "REELS";
|
|
2317
|
+
if (isReel) {
|
|
2318
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2319
|
+
ReelPreview,
|
|
2320
|
+
{
|
|
2321
|
+
author,
|
|
2322
|
+
body: variant.body ?? "",
|
|
2323
|
+
media: resolvedMedia,
|
|
2324
|
+
audioName: settings?.audio_name,
|
|
2325
|
+
className,
|
|
2326
|
+
style
|
|
2327
|
+
}
|
|
2328
|
+
);
|
|
2329
|
+
}
|
|
2330
|
+
const collaborators = settings?.collaborators ?? [];
|
|
2331
|
+
const cardStyle5 = {
|
|
2332
|
+
...paletteVars2(),
|
|
2333
|
+
colorScheme: colorSchemeFor2(theme),
|
|
2334
|
+
background: varRef2(IG_VAR.bg),
|
|
2335
|
+
color: varRef2(IG_VAR.text),
|
|
2336
|
+
border: `1px solid ${varRef2(IG_VAR.border)}`,
|
|
2337
|
+
borderRadius: 8,
|
|
2338
|
+
maxWidth: 470,
|
|
2339
|
+
overflow: "hidden",
|
|
2340
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
|
|
2341
|
+
...style
|
|
2342
|
+
};
|
|
2343
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: cardStyle5, children: [
|
|
2344
|
+
/* @__PURE__ */ jsxRuntime.jsx(Header2, { author, collaborators }),
|
|
2345
|
+
/* @__PURE__ */ jsxRuntime.jsx(FeedMedia, { media: resolvedMedia }),
|
|
2346
|
+
/* @__PURE__ */ jsxRuntime.jsx(Actions, {}),
|
|
2347
|
+
variant.body ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { paddingBottom: 12 }, children: /* @__PURE__ */ jsxRuntime.jsx(Caption, { username: author.username ?? "", body: variant.body }) }) : null
|
|
2348
|
+
] });
|
|
2349
|
+
}
|
|
2350
|
+
var InstagramPostPreview = react.memo(InstagramPostPreviewImpl);
|
|
2351
|
+
var LINK_COLOR = "#8ab4ff";
|
|
2352
|
+
var TOKEN2 = /([#@][\p{L}\p{N}_.]+)/gu;
|
|
2353
|
+
var IS_TOKEN2 = /^[#@][\p{L}\p{N}_.]+$/u;
|
|
2354
|
+
function Caption2({ body }) {
|
|
2355
|
+
const parts = body.split(TOKEN2);
|
|
2356
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ExpandableText, { lines: 2, toggleColor: "rgba(255,255,255,0.82)", style: wrapStyle4, children: parts.map(
|
|
2357
|
+
(part, i) => IS_TOKEN2.test(part) ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: LINK_COLOR }, children: part }, i) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: part }, i)
|
|
2358
|
+
) });
|
|
2359
|
+
}
|
|
2360
|
+
var wrapStyle4 = {
|
|
2361
|
+
fontSize: 14,
|
|
2362
|
+
lineHeight: 1.35
|
|
1958
2363
|
};
|
|
1959
2364
|
function Media2({
|
|
1960
2365
|
media,
|
|
@@ -1974,7 +2379,7 @@ function Media2({
|
|
|
1974
2379
|
muted: true,
|
|
1975
2380
|
loop: true,
|
|
1976
2381
|
playsInline: true,
|
|
1977
|
-
style:
|
|
2382
|
+
style: coverStyle3
|
|
1978
2383
|
}
|
|
1979
2384
|
);
|
|
1980
2385
|
}
|
|
@@ -2001,11 +2406,11 @@ function PhotoCarousel({ media }) {
|
|
|
2001
2406
|
};
|
|
2002
2407
|
}, [emblaApi, sync]);
|
|
2003
2408
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "absolute", inset: 0 }, children: [
|
|
2004
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: emblaRef, style: viewportStyle, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: containerStyle, children: media.map((m, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
2005
|
-
media.length > 1 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
2409
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: emblaRef, style: viewportStyle, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: containerStyle, children: media.map((m, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { style: slideStyle2, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: m.src, alt: m.alt ?? "", style: coverStyle3 }) }, `${m.src}-${i}`)) }) }),
|
|
2410
|
+
media.length > 1 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: dotsStyle2, children: media.map((m, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2006
2411
|
"span",
|
|
2007
2412
|
{
|
|
2008
|
-
style: { ...
|
|
2413
|
+
style: { ...dotStyle2, opacity: i === selected ? 1 : 0.4 }
|
|
2009
2414
|
},
|
|
2010
2415
|
`dot-${m.src}-${i}`
|
|
2011
2416
|
)) }) : null
|
|
@@ -2020,7 +2425,7 @@ function ProcessingMedia() {
|
|
|
2020
2425
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { position: "relative", zIndex: 1 }, children: "Processing media\u2026" })
|
|
2021
2426
|
] });
|
|
2022
2427
|
}
|
|
2023
|
-
var
|
|
2428
|
+
var coverStyle3 = {
|
|
2024
2429
|
position: "absolute",
|
|
2025
2430
|
inset: 0,
|
|
2026
2431
|
width: "100%",
|
|
@@ -2036,13 +2441,13 @@ var containerStyle = {
|
|
|
2036
2441
|
display: "flex",
|
|
2037
2442
|
height: "100%"
|
|
2038
2443
|
};
|
|
2039
|
-
var
|
|
2444
|
+
var slideStyle2 = {
|
|
2040
2445
|
position: "relative",
|
|
2041
2446
|
flex: "0 0 100%",
|
|
2042
2447
|
minWidth: 0,
|
|
2043
2448
|
height: "100%"
|
|
2044
2449
|
};
|
|
2045
|
-
var
|
|
2450
|
+
var dotsStyle2 = {
|
|
2046
2451
|
position: "absolute",
|
|
2047
2452
|
bottom: 124,
|
|
2048
2453
|
left: "50%",
|
|
@@ -2051,7 +2456,7 @@ var dotsStyle = {
|
|
|
2051
2456
|
gap: 5,
|
|
2052
2457
|
alignItems: "center"
|
|
2053
2458
|
};
|
|
2054
|
-
var
|
|
2459
|
+
var dotStyle2 = {
|
|
2055
2460
|
width: 6,
|
|
2056
2461
|
height: 6,
|
|
2057
2462
|
borderRadius: "50%",
|
|
@@ -2146,16 +2551,16 @@ function TikTokPostPreviewImpl({
|
|
|
2146
2551
|
const label = commercialLabel(variant.settings);
|
|
2147
2552
|
const isAigc = Boolean(variant.settings?.is_aigc);
|
|
2148
2553
|
const pending = (media?.length ?? 0) > 0 && resolvedMedia.length === 0;
|
|
2149
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { ...
|
|
2554
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { ...cardStyle4, ...style }, children: [
|
|
2150
2555
|
/* @__PURE__ */ jsxRuntime.jsx("style", { children: KEYFRAMES }),
|
|
2151
2556
|
/* @__PURE__ */ jsxRuntime.jsx(Media2, { media: resolvedMedia, pending }),
|
|
2152
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
2153
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
2557
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: scrimStyle2 }),
|
|
2558
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: infoStyle2, children: [
|
|
2154
2559
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: usernameStyle, children: handle }),
|
|
2155
|
-
variant.body ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2560
|
+
variant.body ? /* @__PURE__ */ jsxRuntime.jsx(Caption2, { body: variant.body }) : null,
|
|
2156
2561
|
label || isAigc ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: labelsStyle, children: [
|
|
2157
|
-
label ? /* @__PURE__ */ jsxRuntime.jsx("span", { style:
|
|
2158
|
-
isAigc ? /* @__PURE__ */ jsxRuntime.jsx("span", { style:
|
|
2562
|
+
label ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: pillStyle2, children: label }) : null,
|
|
2563
|
+
isAigc ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: pillStyle2, children: "Creator labeled as AI-generated" }) : null
|
|
2159
2564
|
] }) : null,
|
|
2160
2565
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: musicRowStyle, children: [
|
|
2161
2566
|
/* @__PURE__ */ jsxRuntime.jsx(io5.IoMusicalNotes, { size: 13 }),
|
|
@@ -2165,7 +2570,7 @@ function TikTokPostPreviewImpl({
|
|
|
2165
2570
|
] })
|
|
2166
2571
|
] })
|
|
2167
2572
|
] }),
|
|
2168
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
2573
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: railStyle2, children: [
|
|
2169
2574
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: avatarWrapStyle, children: [
|
|
2170
2575
|
/* @__PURE__ */ jsxRuntime.jsx(Avatar, { url: creator.avatar_url, name: creator.nickname }),
|
|
2171
2576
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: followBadgeStyle, children: /* @__PURE__ */ jsxRuntime.jsx(PlusIcon, { size: 14 }) })
|
|
@@ -2186,14 +2591,14 @@ function RailAction({ icon, count }) {
|
|
|
2186
2591
|
}
|
|
2187
2592
|
function Avatar({ url, name }) {
|
|
2188
2593
|
if (url) {
|
|
2189
|
-
return /* @__PURE__ */ jsxRuntime.jsx("img", { src: url, alt: name, style:
|
|
2594
|
+
return /* @__PURE__ */ jsxRuntime.jsx("img", { src: url, alt: name, style: avatarStyle2 });
|
|
2190
2595
|
}
|
|
2191
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...
|
|
2596
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...avatarStyle2, ...avatarFallbackStyle }, children: name.slice(0, 1).toUpperCase() });
|
|
2192
2597
|
}
|
|
2193
2598
|
function Disc({ url }) {
|
|
2194
2599
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: discStyle, children: url ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: url, alt: "", style: discImgStyle }) : null });
|
|
2195
2600
|
}
|
|
2196
|
-
var
|
|
2601
|
+
var cardStyle4 = {
|
|
2197
2602
|
position: "relative",
|
|
2198
2603
|
width: "100%",
|
|
2199
2604
|
maxWidth: 320,
|
|
@@ -2204,13 +2609,13 @@ var cardStyle3 = {
|
|
|
2204
2609
|
color: "#fff",
|
|
2205
2610
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'
|
|
2206
2611
|
};
|
|
2207
|
-
var
|
|
2612
|
+
var scrimStyle2 = {
|
|
2208
2613
|
position: "absolute",
|
|
2209
2614
|
inset: 0,
|
|
2210
2615
|
background: "linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%)",
|
|
2211
2616
|
pointerEvents: "none"
|
|
2212
2617
|
};
|
|
2213
|
-
var
|
|
2618
|
+
var infoStyle2 = {
|
|
2214
2619
|
position: "absolute",
|
|
2215
2620
|
left: 14,
|
|
2216
2621
|
right: 70,
|
|
@@ -2231,7 +2636,7 @@ var labelsStyle = {
|
|
|
2231
2636
|
gap: 4,
|
|
2232
2637
|
marginTop: 2
|
|
2233
2638
|
};
|
|
2234
|
-
var
|
|
2639
|
+
var pillStyle2 = {
|
|
2235
2640
|
display: "inline-flex",
|
|
2236
2641
|
alignItems: "center",
|
|
2237
2642
|
background: "rgba(255,255,255,0.18)",
|
|
@@ -2248,7 +2653,7 @@ var musicRowStyle = {
|
|
|
2248
2653
|
fontSize: 13,
|
|
2249
2654
|
marginTop: 4
|
|
2250
2655
|
};
|
|
2251
|
-
var
|
|
2656
|
+
var railStyle2 = {
|
|
2252
2657
|
position: "absolute",
|
|
2253
2658
|
right: 8,
|
|
2254
2659
|
bottom: 14,
|
|
@@ -2262,7 +2667,7 @@ var avatarWrapStyle = {
|
|
|
2262
2667
|
position: "relative",
|
|
2263
2668
|
marginBottom: 8
|
|
2264
2669
|
};
|
|
2265
|
-
var
|
|
2670
|
+
var avatarStyle2 = {
|
|
2266
2671
|
width: 46,
|
|
2267
2672
|
height: 46,
|
|
2268
2673
|
borderRadius: "50%",
|
|
@@ -2325,6 +2730,8 @@ var discImgStyle = {
|
|
|
2325
2730
|
};
|
|
2326
2731
|
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}}`;
|
|
2327
2732
|
var TikTokPostPreview = react.memo(TikTokPostPreviewImpl);
|
|
2733
|
+
|
|
2734
|
+
// src/preview/tiktok/theme.ts
|
|
2328
2735
|
var TT_VAR = {
|
|
2329
2736
|
text: "--pr-tt-text",
|
|
2330
2737
|
muted: "--pr-tt-muted",
|
|
@@ -2332,58 +2739,25 @@ var TT_VAR = {
|
|
|
2332
2739
|
accent: "--pr-tt-accent",
|
|
2333
2740
|
switchOff: "--pr-tt-switch-off"
|
|
2334
2741
|
};
|
|
2335
|
-
|
|
2336
|
-
text: "rgba(0,0,0,0.9)",
|
|
2337
|
-
muted: "rgba(0,0,0,0.55)",
|
|
2338
|
-
border: "rgba(0,0,0,0.12)",
|
|
2339
|
-
accent: "#fe2c55",
|
|
2340
|
-
switchOff: "rgba(0,0,0,0.18)"
|
|
2341
|
-
};
|
|
2342
|
-
var DARK2 = {
|
|
2343
|
-
text: "rgba(255,255,255,0.92)",
|
|
2344
|
-
muted: "#8a8a92",
|
|
2345
|
-
border: "rgba(255,255,255,0.14)",
|
|
2346
|
-
accent: "#fe2c55",
|
|
2347
|
-
switchOff: "rgba(255,255,255,0.22)"
|
|
2348
|
-
};
|
|
2349
|
-
function varRef2(name) {
|
|
2742
|
+
function varRef3(name) {
|
|
2350
2743
|
return `var(${name})`;
|
|
2351
2744
|
}
|
|
2352
|
-
function
|
|
2353
|
-
const p = dark ? DARK2 : LIGHT2;
|
|
2745
|
+
function paletteVars3() {
|
|
2354
2746
|
return {
|
|
2355
|
-
[TT_VAR.text]:
|
|
2356
|
-
[TT_VAR.muted]:
|
|
2357
|
-
[TT_VAR.border]:
|
|
2358
|
-
[TT_VAR.accent]:
|
|
2359
|
-
[TT_VAR.switchOff]:
|
|
2747
|
+
[TT_VAR.text]: "light-dark(rgba(0,0,0,0.9), rgba(255,255,255,0.92))",
|
|
2748
|
+
[TT_VAR.muted]: "light-dark(rgba(0,0,0,0.55), #8a8a92)",
|
|
2749
|
+
[TT_VAR.border]: "light-dark(rgba(0,0,0,0.12), rgba(255,255,255,0.14))",
|
|
2750
|
+
[TT_VAR.accent]: "#fe2c55",
|
|
2751
|
+
[TT_VAR.switchOff]: "light-dark(rgba(0,0,0,0.18), rgba(255,255,255,0.22))"
|
|
2360
2752
|
};
|
|
2361
2753
|
}
|
|
2362
|
-
function
|
|
2363
|
-
|
|
2364
|
-
react.useEffect(() => {
|
|
2365
|
-
if (typeof window === "undefined" || !window.matchMedia) {
|
|
2366
|
-
return;
|
|
2367
|
-
}
|
|
2368
|
-
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2369
|
-
setDark(mq.matches);
|
|
2370
|
-
const onChange = (event) => setDark(event.matches);
|
|
2371
|
-
mq.addEventListener("change", onChange);
|
|
2372
|
-
return () => mq.removeEventListener("change", onChange);
|
|
2373
|
-
}, []);
|
|
2374
|
-
return dark;
|
|
2754
|
+
function colorSchemeFor3(theme) {
|
|
2755
|
+
return theme === "auto" ? "light dark" : theme;
|
|
2375
2756
|
}
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
}
|
|
2381
|
-
return theme === "dark";
|
|
2382
|
-
}
|
|
2383
|
-
var MUTED2 = varRef2(TT_VAR.muted);
|
|
2384
|
-
var BORDER = varRef2(TT_VAR.border);
|
|
2385
|
-
var ACCENT = varRef2(TT_VAR.accent);
|
|
2386
|
-
var SWITCH_OFF = varRef2(TT_VAR.switchOff);
|
|
2757
|
+
var MUTED2 = varRef3(TT_VAR.muted);
|
|
2758
|
+
var BORDER = varRef3(TT_VAR.border);
|
|
2759
|
+
var ACCENT = varRef3(TT_VAR.accent);
|
|
2760
|
+
var SWITCH_OFF = varRef3(TT_VAR.switchOff);
|
|
2387
2761
|
var ON = "#34c759";
|
|
2388
2762
|
function Row({
|
|
2389
2763
|
label,
|
|
@@ -2391,7 +2765,7 @@ function Row({
|
|
|
2391
2765
|
control,
|
|
2392
2766
|
htmlFor
|
|
2393
2767
|
}) {
|
|
2394
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
2768
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: rowStyle3, children: [
|
|
2395
2769
|
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor, style: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
2396
2770
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 14 }, children: label }),
|
|
2397
2771
|
sublabel ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 12, color: MUTED2 }, children: sublabel }) : null
|
|
@@ -2463,7 +2837,7 @@ function CheckRow({
|
|
|
2463
2837
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 14 }, children: label })
|
|
2464
2838
|
] });
|
|
2465
2839
|
}
|
|
2466
|
-
var
|
|
2840
|
+
var rowStyle3 = {
|
|
2467
2841
|
display: "flex",
|
|
2468
2842
|
alignItems: "center",
|
|
2469
2843
|
justifyContent: "space-between",
|
|
@@ -2568,7 +2942,7 @@ function TikTokCaptionField({
|
|
|
2568
2942
|
const max = js.captionMaxFor(postType);
|
|
2569
2943
|
const count = value.length;
|
|
2570
2944
|
const over = count > max;
|
|
2571
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { ...
|
|
2945
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { ...wrapStyle5, ...style }, children: [
|
|
2572
2946
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: labelRowStyle, children: [
|
|
2573
2947
|
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, style: labelStyle, children: "Caption" }),
|
|
2574
2948
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2576,7 +2950,7 @@ function TikTokCaptionField({
|
|
|
2576
2950
|
{
|
|
2577
2951
|
style: {
|
|
2578
2952
|
...countStyle,
|
|
2579
|
-
color: over ?
|
|
2953
|
+
color: over ? varRef3(TT_VAR.accent) : varRef3(TT_VAR.muted)
|
|
2580
2954
|
},
|
|
2581
2955
|
children: [
|
|
2582
2956
|
count.toLocaleString(),
|
|
@@ -2596,13 +2970,13 @@ function TikTokCaptionField({
|
|
|
2596
2970
|
rows: 4,
|
|
2597
2971
|
style: {
|
|
2598
2972
|
...textareaStyle,
|
|
2599
|
-
borderColor: over ?
|
|
2973
|
+
borderColor: over ? varRef3(TT_VAR.accent) : varRef3(TT_VAR.border)
|
|
2600
2974
|
}
|
|
2601
2975
|
}
|
|
2602
2976
|
)
|
|
2603
2977
|
] });
|
|
2604
2978
|
}
|
|
2605
|
-
var
|
|
2979
|
+
var wrapStyle5 = {
|
|
2606
2980
|
display: "flex",
|
|
2607
2981
|
flexDirection: "column",
|
|
2608
2982
|
gap: 6,
|
|
@@ -2758,7 +3132,6 @@ function TikTokPublishPanel({
|
|
|
2758
3132
|
className,
|
|
2759
3133
|
style
|
|
2760
3134
|
}) {
|
|
2761
|
-
const dark = useIsDark2(theme);
|
|
2762
3135
|
const isVideo = variant.post_type === "video";
|
|
2763
3136
|
const captionOver = caption.length > js.captionMaxFor(variant.post_type);
|
|
2764
3137
|
const mediaOk = mediaCountValid(variant.post_type, variant.media?.length ?? 0);
|
|
@@ -2768,9 +3141,10 @@ function TikTokPublishPanel({
|
|
|
2768
3141
|
{
|
|
2769
3142
|
className,
|
|
2770
3143
|
style: {
|
|
2771
|
-
...
|
|
3144
|
+
...paletteVars3(),
|
|
3145
|
+
colorScheme: colorSchemeFor3(theme),
|
|
2772
3146
|
...panelStyle,
|
|
2773
|
-
color:
|
|
3147
|
+
color: varRef3(TT_VAR.text),
|
|
2774
3148
|
...style
|
|
2775
3149
|
},
|
|
2776
3150
|
children: [
|
|
@@ -2875,10 +3249,12 @@ exports.CommercialDisclosure = CommercialDisclosure;
|
|
|
2875
3249
|
exports.Connect = Connect;
|
|
2876
3250
|
exports.Declaration = Declaration;
|
|
2877
3251
|
exports.DocumentCard = DocumentCard;
|
|
3252
|
+
exports.InstagramPostPreview = InstagramPostPreview;
|
|
2878
3253
|
exports.InteractionToggles = InteractionToggles;
|
|
2879
3254
|
exports.LinkedInPostPreview = LinkedInPostPreview;
|
|
2880
3255
|
exports.Poll = Poll;
|
|
2881
3256
|
exports.PostrunProvider = PostrunProvider;
|
|
3257
|
+
exports.ReelPreview = ReelPreview;
|
|
2882
3258
|
exports.TikTokCaptionField = TikTokCaptionField;
|
|
2883
3259
|
exports.TikTokPostPreview = TikTokPostPreview;
|
|
2884
3260
|
exports.TikTokPublishPanel = TikTokPublishPanel;
|
|
@@ -2890,6 +3266,7 @@ exports.mediaKeys = mediaKeys;
|
|
|
2890
3266
|
exports.postKeys = postKeys;
|
|
2891
3267
|
exports.profileKeys = profileKeys;
|
|
2892
3268
|
exports.tiktokKeys = tiktokKeys;
|
|
3269
|
+
exports.toPreviewMedia = toPreviewMedia;
|
|
2893
3270
|
exports.useCalendar = useCalendar;
|
|
2894
3271
|
exports.useConnect = useConnect;
|
|
2895
3272
|
exports.useConnection = useConnection;
|