@postrun/react 2.5.0 → 2.7.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 +85 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +85 -17
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
import { QueryClient, QueryKey } from '@tanstack/react-query';
|
|
5
|
-
import { PostrunClient, ListProfilesQuery, DiscoverableAccountList, Connection, ConnectionKind, ConnectionStatus, ListMediaQuery, ListPostsQuery, ConnectablePlatform, MediaResource, MediaTarget, Metadata, ComposePostInput, PostValidation, MediaKind, XPostVariant, LinkedInPostVariant, TikTokPostVariant, TikTokCreatorInfo, TikTokOptionsValue } from '@postrun/js';
|
|
5
|
+
import { PostrunClient, ListProfilesQuery, DiscoverableAccountList, Connection, ConnectionKind, ConnectionStatus, ListMediaQuery, ListPostsQuery, ConnectablePlatform, MediaResource, MediaTarget, Metadata, ComposePostInput, PostValidation, MediaKind, XPostVariant, XPoll as XPoll$1, LinkedInPostVariant, TikTokPostVariant, TikTokCreatorInfo, TikTokOptionsValue } from '@postrun/js';
|
|
6
6
|
export { PostValidation, PostVariant, PostVariantError, TIKTOK_CAPTION_MAX, TikTokCreatorInfo, ValidationIssue, captionMaxFor } from '@postrun/js';
|
|
7
7
|
import { TwitterComponents } from 'react-tweet';
|
|
8
8
|
|
|
@@ -1695,6 +1695,8 @@ interface XPreviewQuotedTweet {
|
|
|
1695
1695
|
media?: PreviewMedia[];
|
|
1696
1696
|
}
|
|
1697
1697
|
|
|
1698
|
+
declare function toPreviewMedia(items: readonly MediaUploadItem[]): PreviewMedia[];
|
|
1699
|
+
|
|
1698
1700
|
interface XPostPreviewProps {
|
|
1699
1701
|
/** The X variant from our schema — the content source, untouched. */
|
|
1700
1702
|
variant: XPostVariant;
|
|
@@ -1730,6 +1732,17 @@ declare function XPostPreviewImpl({ variant, author, media, quotedTweet, replyTo
|
|
|
1730
1732
|
* already absorbs unstable media arrays). */
|
|
1731
1733
|
declare const XPostPreview: react.MemoExoticComponent<typeof XPostPreviewImpl>;
|
|
1732
1734
|
|
|
1735
|
+
/**
|
|
1736
|
+
* An X poll (`settings.poll`) rendered in the post preview — the 2–4 options as
|
|
1737
|
+
* X's pre-vote outlined buttons, then an honest "0 votes · <time left>" footer
|
|
1738
|
+
* (a draft poll has no votes; never fabricate counts). Colors inherit
|
|
1739
|
+
* react-tweet's CSS variables, so it matches the card in light and dark.
|
|
1740
|
+
*/
|
|
1741
|
+
interface XPollProps {
|
|
1742
|
+
poll: XPoll$1;
|
|
1743
|
+
}
|
|
1744
|
+
declare function XPoll({ poll }: XPollProps): react.JSX.Element;
|
|
1745
|
+
|
|
1733
1746
|
/**
|
|
1734
1747
|
* LinkedIn preview theming. Unlike the X preview (which inherits react-tweet's
|
|
1735
1748
|
* CSS), we own the LinkedIn card, so we expose a small set of CSS custom
|
|
@@ -1953,4 +1966,4 @@ declare function Declaration({ brandedContent }: {
|
|
|
1953
1966
|
brandedContent: boolean;
|
|
1954
1967
|
}): react.JSX.Element;
|
|
1955
1968
|
|
|
1956
|
-
export { ArticleCard, type ArticleCardProps, AudienceSelect, type CalendarFilters, CommercialDisclosure, Connect, type ConnectErrorReason, type ConnectOutcome, type ConnectProps, type ConnectRenderApi, type ConnectState, type ConnectionsFilter, Declaration, type DiscoverableAccount, DocumentCard, type DocumentCardProps, type InfiniteList, InteractionToggles, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewAuthor, type LiveOptions, type MediaUploadItem, type MediaUploadOptions, type MediaUploadStatus, Poll, type PollProps, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewMedia, type PreviewMediaKind, TikTokCaptionField, type TikTokCaptionFieldProps, TikTokPostPreview, type TikTokPostPreviewProps, TikTokPublishPanel, type TikTokPublishPanelProps, type TikTokTheme, UploadError, type UseConnectParams, type UseConnectResult, type UseMediaUploadOptions, type UseMediaUploadResult, XPostPreview, type XPostPreviewProps, type XPreviewAuthor, type XPreviewMedia, type XPreviewQuotedTweet, 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 };
|
|
1969
|
+
export { ArticleCard, type ArticleCardProps, AudienceSelect, type CalendarFilters, CommercialDisclosure, Connect, type ConnectErrorReason, type ConnectOutcome, type ConnectProps, type ConnectRenderApi, type ConnectState, type ConnectionsFilter, Declaration, type DiscoverableAccount, DocumentCard, type DocumentCardProps, type InfiniteList, InteractionToggles, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewAuthor, type LiveOptions, type MediaUploadItem, type MediaUploadOptions, type MediaUploadStatus, Poll, type PollProps, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewMedia, type PreviewMediaKind, TikTokCaptionField, type TikTokCaptionFieldProps, TikTokPostPreview, type TikTokPostPreviewProps, TikTokPublishPanel, type TikTokPublishPanelProps, type TikTokTheme, UploadError, type UseConnectParams, type UseConnectResult, type UseMediaUploadOptions, type UseMediaUploadResult, XPoll, type XPollProps, XPostPreview, type XPostPreviewProps, type XPreviewAuthor, type XPreviewMedia, type XPreviewQuotedTweet, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
4
|
import { QueryClient, QueryKey } from '@tanstack/react-query';
|
|
5
|
-
import { PostrunClient, ListProfilesQuery, DiscoverableAccountList, Connection, ConnectionKind, ConnectionStatus, ListMediaQuery, ListPostsQuery, ConnectablePlatform, MediaResource, MediaTarget, Metadata, ComposePostInput, PostValidation, MediaKind, XPostVariant, LinkedInPostVariant, TikTokPostVariant, TikTokCreatorInfo, TikTokOptionsValue } from '@postrun/js';
|
|
5
|
+
import { PostrunClient, ListProfilesQuery, DiscoverableAccountList, Connection, ConnectionKind, ConnectionStatus, ListMediaQuery, ListPostsQuery, ConnectablePlatform, MediaResource, MediaTarget, Metadata, ComposePostInput, PostValidation, MediaKind, XPostVariant, XPoll as XPoll$1, LinkedInPostVariant, TikTokPostVariant, TikTokCreatorInfo, TikTokOptionsValue } from '@postrun/js';
|
|
6
6
|
export { PostValidation, PostVariant, PostVariantError, TIKTOK_CAPTION_MAX, TikTokCreatorInfo, ValidationIssue, captionMaxFor } from '@postrun/js';
|
|
7
7
|
import { TwitterComponents } from 'react-tweet';
|
|
8
8
|
|
|
@@ -1695,6 +1695,8 @@ interface XPreviewQuotedTweet {
|
|
|
1695
1695
|
media?: PreviewMedia[];
|
|
1696
1696
|
}
|
|
1697
1697
|
|
|
1698
|
+
declare function toPreviewMedia(items: readonly MediaUploadItem[]): PreviewMedia[];
|
|
1699
|
+
|
|
1698
1700
|
interface XPostPreviewProps {
|
|
1699
1701
|
/** The X variant from our schema — the content source, untouched. */
|
|
1700
1702
|
variant: XPostVariant;
|
|
@@ -1730,6 +1732,17 @@ declare function XPostPreviewImpl({ variant, author, media, quotedTweet, replyTo
|
|
|
1730
1732
|
* already absorbs unstable media arrays). */
|
|
1731
1733
|
declare const XPostPreview: react.MemoExoticComponent<typeof XPostPreviewImpl>;
|
|
1732
1734
|
|
|
1735
|
+
/**
|
|
1736
|
+
* An X poll (`settings.poll`) rendered in the post preview — the 2–4 options as
|
|
1737
|
+
* X's pre-vote outlined buttons, then an honest "0 votes · <time left>" footer
|
|
1738
|
+
* (a draft poll has no votes; never fabricate counts). Colors inherit
|
|
1739
|
+
* react-tweet's CSS variables, so it matches the card in light and dark.
|
|
1740
|
+
*/
|
|
1741
|
+
interface XPollProps {
|
|
1742
|
+
poll: XPoll$1;
|
|
1743
|
+
}
|
|
1744
|
+
declare function XPoll({ poll }: XPollProps): react.JSX.Element;
|
|
1745
|
+
|
|
1733
1746
|
/**
|
|
1734
1747
|
* LinkedIn preview theming. Unlike the X preview (which inherits react-tweet's
|
|
1735
1748
|
* CSS), we own the LinkedIn card, so we expose a small set of CSS custom
|
|
@@ -1953,4 +1966,4 @@ declare function Declaration({ brandedContent }: {
|
|
|
1953
1966
|
brandedContent: boolean;
|
|
1954
1967
|
}): react.JSX.Element;
|
|
1955
1968
|
|
|
1956
|
-
export { ArticleCard, type ArticleCardProps, AudienceSelect, type CalendarFilters, CommercialDisclosure, Connect, type ConnectErrorReason, type ConnectOutcome, type ConnectProps, type ConnectRenderApi, type ConnectState, type ConnectionsFilter, Declaration, type DiscoverableAccount, DocumentCard, type DocumentCardProps, type InfiniteList, InteractionToggles, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewAuthor, type LiveOptions, type MediaUploadItem, type MediaUploadOptions, type MediaUploadStatus, Poll, type PollProps, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewMedia, type PreviewMediaKind, TikTokCaptionField, type TikTokCaptionFieldProps, TikTokPostPreview, type TikTokPostPreviewProps, TikTokPublishPanel, type TikTokPublishPanelProps, type TikTokTheme, UploadError, type UseConnectParams, type UseConnectResult, type UseMediaUploadOptions, type UseMediaUploadResult, XPostPreview, type XPostPreviewProps, type XPreviewAuthor, type XPreviewMedia, type XPreviewQuotedTweet, 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 };
|
|
1969
|
+
export { ArticleCard, type ArticleCardProps, AudienceSelect, type CalendarFilters, CommercialDisclosure, Connect, type ConnectErrorReason, type ConnectOutcome, type ConnectProps, type ConnectRenderApi, type ConnectState, type ConnectionsFilter, Declaration, type DiscoverableAccount, DocumentCard, type DocumentCardProps, type InfiniteList, InteractionToggles, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewAuthor, type LiveOptions, type MediaUploadItem, type MediaUploadOptions, type MediaUploadStatus, Poll, type PollProps, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewMedia, type PreviewMediaKind, TikTokCaptionField, type TikTokCaptionFieldProps, TikTokPostPreview, type TikTokPostPreviewProps, TikTokPublishPanel, type TikTokPublishPanelProps, type TikTokTheme, UploadError, type UseConnectParams, type UseConnectResult, type UseMediaUploadOptions, type UseMediaUploadResult, XPoll, type XPollProps, XPostPreview, type XPostPreviewProps, type XPreviewAuthor, type XPreviewMedia, type XPreviewQuotedTweet, 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 };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
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 { 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';
|
|
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';
|
|
6
6
|
import Nango, { AuthError } from '@nangohq/frontend';
|
|
7
7
|
import pWaitFor, { TimeoutError } from 'p-wait-for';
|
|
@@ -9,8 +9,8 @@ import pLimit from 'p-limit';
|
|
|
9
9
|
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
|
-
import { FiMessageCircle, FiRepeat, FiHeart, FiBarChart2, FiShare, FiGlobe, FiUsers, FiThumbsUp, FiMessageSquare, FiSend, FiFileText } from 'react-icons/fi';
|
|
13
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';
|
|
14
14
|
import twitterText from 'twitter-text';
|
|
15
15
|
import { LuBadgeCheck } from 'react-icons/lu';
|
|
16
16
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
@@ -973,6 +973,42 @@ function useTikTokCreatorInfo(connectionId) {
|
|
|
973
973
|
queryClient
|
|
974
974
|
);
|
|
975
975
|
}
|
|
976
|
+
|
|
977
|
+
// src/preview/from-upload.ts
|
|
978
|
+
function previewKind(item) {
|
|
979
|
+
const detected = item.media?.kind;
|
|
980
|
+
if (detected) {
|
|
981
|
+
return detected === "document" ? null : detected;
|
|
982
|
+
}
|
|
983
|
+
const mime = item.file.type;
|
|
984
|
+
if (mime === "image/gif") {
|
|
985
|
+
return "gif";
|
|
986
|
+
}
|
|
987
|
+
if (mime.startsWith("video/")) {
|
|
988
|
+
return "video";
|
|
989
|
+
}
|
|
990
|
+
if (mime.startsWith("image/")) {
|
|
991
|
+
return "image";
|
|
992
|
+
}
|
|
993
|
+
return null;
|
|
994
|
+
}
|
|
995
|
+
function toPreviewMedia(items) {
|
|
996
|
+
return items.flatMap((item) => {
|
|
997
|
+
const kind = previewKind(item);
|
|
998
|
+
if (!kind) {
|
|
999
|
+
return [];
|
|
1000
|
+
}
|
|
1001
|
+
return [
|
|
1002
|
+
{
|
|
1003
|
+
kind,
|
|
1004
|
+
file: item.file,
|
|
1005
|
+
width: item.media?.source?.width ?? void 0,
|
|
1006
|
+
height: item.media?.source?.height ?? void 0,
|
|
1007
|
+
alt: item.media?.alt_text ?? void 0
|
|
1008
|
+
}
|
|
1009
|
+
];
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
976
1012
|
function fileKey(file) {
|
|
977
1013
|
return file ? `${file.name}:${file.size}:${file.lastModified}` : "";
|
|
978
1014
|
}
|
|
@@ -1029,6 +1065,37 @@ function useResolvedMedia(media, altFallbacks, altSignature) {
|
|
|
1029
1065
|
[signature, altSignature, objectUrls]
|
|
1030
1066
|
);
|
|
1031
1067
|
}
|
|
1068
|
+
function XPoll({ poll }) {
|
|
1069
|
+
return /* @__PURE__ */ jsxs("div", { style: wrapStyle, children: [
|
|
1070
|
+
poll.options.map((option, i) => /* @__PURE__ */ jsx("div", { style: optionStyle, children: option }, `${option}-${i}`)),
|
|
1071
|
+
/* @__PURE__ */ jsxs("div", { style: footerStyle, children: [
|
|
1072
|
+
"0 votes \xB7 ",
|
|
1073
|
+
xPollDurationLabel(poll.duration_minutes)
|
|
1074
|
+
] })
|
|
1075
|
+
] });
|
|
1076
|
+
}
|
|
1077
|
+
var BLUE = "var(--tweet-color-blue-primary, #1d9bf0)";
|
|
1078
|
+
var MUTED = "var(--tweet-color-gray-secondary, #536471)";
|
|
1079
|
+
var wrapStyle = {
|
|
1080
|
+
display: "flex",
|
|
1081
|
+
flexDirection: "column",
|
|
1082
|
+
gap: 8,
|
|
1083
|
+
marginTop: 12
|
|
1084
|
+
};
|
|
1085
|
+
var optionStyle = {
|
|
1086
|
+
border: `1px solid ${BLUE}`,
|
|
1087
|
+
color: BLUE,
|
|
1088
|
+
borderRadius: 999,
|
|
1089
|
+
padding: "8px 16px",
|
|
1090
|
+
textAlign: "center",
|
|
1091
|
+
fontSize: 15,
|
|
1092
|
+
fontWeight: 700
|
|
1093
|
+
};
|
|
1094
|
+
var footerStyle = {
|
|
1095
|
+
fontSize: 13,
|
|
1096
|
+
color: MUTED,
|
|
1097
|
+
marginTop: 2
|
|
1098
|
+
};
|
|
1032
1099
|
var ROW = {
|
|
1033
1100
|
display: "flex",
|
|
1034
1101
|
justifyContent: "space-between",
|
|
@@ -1269,6 +1336,7 @@ function XPostPreviewImpl({
|
|
|
1269
1336
|
tweet.in_reply_to_screen_name ? /* @__PURE__ */ jsx(TweetInReplyTo, { tweet }) : null,
|
|
1270
1337
|
/* @__PURE__ */ jsx(TweetBody, { tweet }),
|
|
1271
1338
|
tweet.mediaDetails?.length ? /* @__PURE__ */ jsx(TweetMedia, { tweet, components }) : null,
|
|
1339
|
+
variant.settings?.poll ? /* @__PURE__ */ jsx(XPoll, { poll: variant.settings.poll }) : null,
|
|
1272
1340
|
tweet.quoted_tweet ? /* @__PURE__ */ jsx(QuotedTweet, { tweet: tweet.quoted_tweet }) : null,
|
|
1273
1341
|
showActions ? /* @__PURE__ */ jsx(XPreviewActions, {}) : null
|
|
1274
1342
|
] })
|
|
@@ -1640,16 +1708,16 @@ function Media({ media }) {
|
|
|
1640
1708
|
return /* @__PURE__ */ jsx(ImageMosaic, { media: images });
|
|
1641
1709
|
}
|
|
1642
1710
|
function Poll({ poll }) {
|
|
1643
|
-
return /* @__PURE__ */ jsxs("div", { style:
|
|
1711
|
+
return /* @__PURE__ */ jsxs("div", { style: wrapStyle2, children: [
|
|
1644
1712
|
/* @__PURE__ */ jsx("div", { style: questionStyle, children: poll.question }),
|
|
1645
|
-
/* @__PURE__ */ jsx("div", { style: optionsStyle, children: poll.options.map((option, i) => /* @__PURE__ */ jsx("div", { style:
|
|
1646
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
1713
|
+
/* @__PURE__ */ jsx("div", { style: optionsStyle, children: poll.options.map((option, i) => /* @__PURE__ */ jsx("div", { style: optionStyle2, children: option }, `${option}-${i}`)) }),
|
|
1714
|
+
/* @__PURE__ */ jsxs("div", { style: footerStyle2, children: [
|
|
1647
1715
|
"0 votes \u2022 ",
|
|
1648
1716
|
linkedinPollDurationLabel(poll.duration)
|
|
1649
1717
|
] })
|
|
1650
1718
|
] });
|
|
1651
1719
|
}
|
|
1652
|
-
var
|
|
1720
|
+
var wrapStyle2 = {
|
|
1653
1721
|
border: `1px solid ${varRef(LI_VAR.border)}`,
|
|
1654
1722
|
borderRadius: 8,
|
|
1655
1723
|
padding: 12,
|
|
@@ -1668,7 +1736,7 @@ var optionsStyle = {
|
|
|
1668
1736
|
flexDirection: "column",
|
|
1669
1737
|
gap: 8
|
|
1670
1738
|
};
|
|
1671
|
-
var
|
|
1739
|
+
var optionStyle2 = {
|
|
1672
1740
|
border: `1px solid ${varRef(LI_VAR.accent)}`,
|
|
1673
1741
|
borderRadius: 999,
|
|
1674
1742
|
padding: "8px 16px",
|
|
@@ -1677,7 +1745,7 @@ var optionStyle = {
|
|
|
1677
1745
|
fontWeight: 600,
|
|
1678
1746
|
color: varRef(LI_VAR.accent)
|
|
1679
1747
|
};
|
|
1680
|
-
var
|
|
1748
|
+
var footerStyle2 = {
|
|
1681
1749
|
fontSize: 12,
|
|
1682
1750
|
color: varRef(LI_VAR.muted)
|
|
1683
1751
|
};
|
|
@@ -1865,7 +1933,7 @@ function Caption({ body }) {
|
|
|
1865
1933
|
setOverflowing(el.scrollHeight > el.clientHeight + 1);
|
|
1866
1934
|
}, [body, expanded]);
|
|
1867
1935
|
const parts = body.split(TOKEN);
|
|
1868
|
-
return /* @__PURE__ */ jsxs("div", { style:
|
|
1936
|
+
return /* @__PURE__ */ jsxs("div", { style: wrapStyle3, children: [
|
|
1869
1937
|
/* @__PURE__ */ jsx("div", { ref, style: expanded ? expandedTextStyle : clampedTextStyle, children: parts.map(
|
|
1870
1938
|
(part, i) => IS_TOKEN.test(part) ? /* @__PURE__ */ jsx("span", { style: { color: LINK_COLOR }, children: part }, i) : /* @__PURE__ */ jsx("span", { children: part }, i)
|
|
1871
1939
|
) }),
|
|
@@ -1882,7 +1950,7 @@ function Caption({ body }) {
|
|
|
1882
1950
|
) : null
|
|
1883
1951
|
] });
|
|
1884
1952
|
}
|
|
1885
|
-
var
|
|
1953
|
+
var wrapStyle3 = {
|
|
1886
1954
|
fontSize: 14,
|
|
1887
1955
|
lineHeight: 1.35
|
|
1888
1956
|
};
|
|
@@ -2337,7 +2405,7 @@ function useIsDark2(theme) {
|
|
|
2337
2405
|
}
|
|
2338
2406
|
return theme === "dark";
|
|
2339
2407
|
}
|
|
2340
|
-
var
|
|
2408
|
+
var MUTED2 = varRef2(TT_VAR.muted);
|
|
2341
2409
|
var BORDER = varRef2(TT_VAR.border);
|
|
2342
2410
|
var ACCENT = varRef2(TT_VAR.accent);
|
|
2343
2411
|
var SWITCH_OFF = varRef2(TT_VAR.switchOff);
|
|
@@ -2351,7 +2419,7 @@ function Row({
|
|
|
2351
2419
|
return /* @__PURE__ */ jsxs("div", { style: rowStyle, children: [
|
|
2352
2420
|
/* @__PURE__ */ jsxs("label", { htmlFor, style: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
2353
2421
|
/* @__PURE__ */ jsx("span", { style: { fontSize: 14 }, children: label }),
|
|
2354
|
-
sublabel ? /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color:
|
|
2422
|
+
sublabel ? /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: MUTED2 }, children: sublabel }) : null
|
|
2355
2423
|
] }),
|
|
2356
2424
|
control
|
|
2357
2425
|
] });
|
|
@@ -2459,7 +2527,7 @@ var hintStyle = {
|
|
|
2459
2527
|
var noticeStyle = {
|
|
2460
2528
|
margin: 0,
|
|
2461
2529
|
fontSize: 12,
|
|
2462
|
-
color:
|
|
2530
|
+
color: MUTED2,
|
|
2463
2531
|
lineHeight: 1.4
|
|
2464
2532
|
};
|
|
2465
2533
|
var checkRowStyle = {
|
|
@@ -2468,7 +2536,7 @@ var checkRowStyle = {
|
|
|
2468
2536
|
gap: 10,
|
|
2469
2537
|
cursor: "pointer"
|
|
2470
2538
|
};
|
|
2471
|
-
var TOKENS = { MUTED, BORDER, ACCENT};
|
|
2539
|
+
var TOKENS = { MUTED: MUTED2, BORDER, ACCENT};
|
|
2472
2540
|
function AudienceSelect({
|
|
2473
2541
|
creatorInfo,
|
|
2474
2542
|
value,
|
|
@@ -2525,7 +2593,7 @@ function TikTokCaptionField({
|
|
|
2525
2593
|
const max = captionMaxFor(postType);
|
|
2526
2594
|
const count = value.length;
|
|
2527
2595
|
const over = count > max;
|
|
2528
|
-
return /* @__PURE__ */ jsxs("div", { className, style: { ...
|
|
2596
|
+
return /* @__PURE__ */ jsxs("div", { className, style: { ...wrapStyle4, ...style }, children: [
|
|
2529
2597
|
/* @__PURE__ */ jsxs("div", { style: labelRowStyle, children: [
|
|
2530
2598
|
/* @__PURE__ */ jsx("label", { htmlFor: id, style: labelStyle, children: "Caption" }),
|
|
2531
2599
|
/* @__PURE__ */ jsxs(
|
|
@@ -2559,7 +2627,7 @@ function TikTokCaptionField({
|
|
|
2559
2627
|
)
|
|
2560
2628
|
] });
|
|
2561
2629
|
}
|
|
2562
|
-
var
|
|
2630
|
+
var wrapStyle4 = {
|
|
2563
2631
|
display: "flex",
|
|
2564
2632
|
flexDirection: "column",
|
|
2565
2633
|
gap: 6,
|
|
@@ -2818,6 +2886,6 @@ var postButtonStyle = {
|
|
|
2818
2886
|
transition: "opacity 160ms ease"
|
|
2819
2887
|
};
|
|
2820
2888
|
|
|
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 };
|
|
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 };
|
|
2822
2890
|
//# sourceMappingURL=index.js.map
|
|
2823
2891
|
//# sourceMappingURL=index.js.map
|