@postrun/react 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1159 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +194 -5
- package/dist/index.d.ts +194 -5
- package/dist/index.js +1145 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2,8 +2,8 @@ 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 } from '@postrun/js';
|
|
6
|
-
export { PostValidation, PostVariant, PostVariantError, TikTokCreatorInfo, ValidationIssue } from '@postrun/js';
|
|
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';
|
|
6
|
+
export { PostValidation, PostVariant, PostVariantError, TIKTOK_CAPTION_MAX, TikTokCreatorInfo, ValidationIssue, captionMaxFor } from '@postrun/js';
|
|
7
7
|
import { TwitterComponents } from 'react-tweet';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1374,6 +1374,7 @@ declare function useValidatePost(profileId: string): {
|
|
|
1374
1374
|
got?: string;
|
|
1375
1375
|
variant_index: number;
|
|
1376
1376
|
path: Array<string | number>;
|
|
1377
|
+
platform?: "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
|
|
1377
1378
|
display_error: string;
|
|
1378
1379
|
}[];
|
|
1379
1380
|
isPending: boolean;
|
|
@@ -1674,6 +1675,16 @@ interface PreviewMedia {
|
|
|
1674
1675
|
}
|
|
1675
1676
|
/** @deprecated Use {@link PreviewMedia}. Kept as an alias for back-compat. */
|
|
1676
1677
|
type XPreviewMedia = PreviewMedia;
|
|
1678
|
+
/** A media item with its pixels already resolved to a single URL by the
|
|
1679
|
+
* component (shared by every platform preview's renderer). */
|
|
1680
|
+
interface ResolvedMedia {
|
|
1681
|
+
kind: PreviewMediaKind;
|
|
1682
|
+
src: string;
|
|
1683
|
+
width?: number;
|
|
1684
|
+
height?: number;
|
|
1685
|
+
alt?: string;
|
|
1686
|
+
posterSrc?: string;
|
|
1687
|
+
}
|
|
1677
1688
|
/**
|
|
1678
1689
|
* Content for the nested quoted card. Supplied separately because our schema
|
|
1679
1690
|
* carries only an opaque `quote_tweet_id` (no quoted text/author).
|
|
@@ -1735,8 +1746,9 @@ type LinkedInTheme = 'light' | 'dark' | 'auto';
|
|
|
1735
1746
|
* with headline + audience icon, an entity-highlighted body with the "…more"
|
|
1736
1747
|
* fold, the 1/2/3/4/+N image mosaic (or a video), and a static action bar.
|
|
1737
1748
|
*
|
|
1738
|
-
*
|
|
1739
|
-
*
|
|
1749
|
+
* Renders every `content_kind`: text, single/multi image, video, plus the rich
|
|
1750
|
+
* units — article share card, poll, and document — each driven from
|
|
1751
|
+
* `settings.{article,poll,document}` (see `renderContent`).
|
|
1740
1752
|
*
|
|
1741
1753
|
* Customize via `theme` (light/dark/auto), `className`/`style`, or by overriding
|
|
1742
1754
|
* the `--pr-li-*` CSS variables the card reads.
|
|
@@ -1764,4 +1776,181 @@ declare function LinkedInPostPreviewImpl({ variant, author, media, theme, time,
|
|
|
1764
1776
|
* absorbs unstable media arrays). */
|
|
1765
1777
|
declare const LinkedInPostPreview: react.MemoExoticComponent<typeof LinkedInPostPreviewImpl>;
|
|
1766
1778
|
|
|
1767
|
-
|
|
1779
|
+
/**
|
|
1780
|
+
* A LinkedIn article share card (`content_kind: 'article'`) — the link unit
|
|
1781
|
+
* LinkedIn renders below the commentary: an optional thumbnail, then a panel with
|
|
1782
|
+
* the source domain (muted), the headline (bold), and the optional description.
|
|
1783
|
+
* Driven straight from `settings.article`; the thumbnail pixels (resolved from
|
|
1784
|
+
* `article.thumbnail_media_id`) are passed in by the host.
|
|
1785
|
+
*/
|
|
1786
|
+
/** The article settings shape — derived from the contract, never re-declared. */
|
|
1787
|
+
type LinkedInArticle = NonNullable<NonNullable<LinkedInPostVariant['settings']>['article']>;
|
|
1788
|
+
interface ArticleCardProps {
|
|
1789
|
+
article: LinkedInArticle;
|
|
1790
|
+
/** Resolved thumbnail pixels (from `article.thumbnail_media_id`), if any. */
|
|
1791
|
+
thumbnail?: ResolvedMedia;
|
|
1792
|
+
}
|
|
1793
|
+
declare function ArticleCard({ article, thumbnail }: ArticleCardProps): react.JSX.Element;
|
|
1794
|
+
|
|
1795
|
+
/**
|
|
1796
|
+
* A LinkedIn poll (`content_kind: 'poll'`) — the question, the 2–4 option rows
|
|
1797
|
+
* (rendered as the pre-vote outlined buttons LinkedIn shows), and the footer
|
|
1798
|
+
* ("0 votes • <duration>"). A fresh poll has no votes, so we never fabricate
|
|
1799
|
+
* counts. Driven straight from `settings.poll`.
|
|
1800
|
+
*/
|
|
1801
|
+
/** The poll settings shape — derived from the contract, never re-declared. */
|
|
1802
|
+
type LinkedInPoll = NonNullable<NonNullable<LinkedInPostVariant['settings']>['poll']>;
|
|
1803
|
+
interface PollProps {
|
|
1804
|
+
poll: LinkedInPoll;
|
|
1805
|
+
}
|
|
1806
|
+
declare function Poll({ poll }: PollProps): react.JSX.Element;
|
|
1807
|
+
|
|
1808
|
+
/**
|
|
1809
|
+
* A LinkedIn document post (`content_kind: 'document'`) — the PDF/slide unit
|
|
1810
|
+
* LinkedIn renders as a page preview with a dark caption bar (title + "Document").
|
|
1811
|
+
* The document asset rides on the variant `media[]`; if the host resolves a
|
|
1812
|
+
* first-page image it shows here, otherwise a clean document affordance. Title is
|
|
1813
|
+
* required by the contract, so it always renders. Driven by `settings.document`.
|
|
1814
|
+
*/
|
|
1815
|
+
/** The document settings shape — derived from the contract, never re-declared. */
|
|
1816
|
+
type LinkedInDocument = NonNullable<NonNullable<LinkedInPostVariant['settings']>['document']>;
|
|
1817
|
+
interface DocumentCardProps {
|
|
1818
|
+
document: LinkedInDocument;
|
|
1819
|
+
/** Resolved first-page pixels (from the document asset on media[]), if any. */
|
|
1820
|
+
cover?: ResolvedMedia;
|
|
1821
|
+
}
|
|
1822
|
+
declare function DocumentCard({ document, cover }: DocumentCardProps): react.JSX.Element;
|
|
1823
|
+
|
|
1824
|
+
/**
|
|
1825
|
+
* Public props for the TikTok post preview — a faithful render of how a post will
|
|
1826
|
+
* look on TikTok, driven straight from our Post object plus the live creator info
|
|
1827
|
+
* the Content-Posting policy requires the publishing UI to show.
|
|
1828
|
+
*
|
|
1829
|
+
* The component is presentational: the host collects the variant + creator info
|
|
1830
|
+
* (via `useTikTokCreatorInfo`) + resolves media pixels, and passes them in. Later
|
|
1831
|
+
* chunks add the editable caption + the consent-gated Post button.
|
|
1832
|
+
*/
|
|
1833
|
+
interface TikTokPostPreviewProps {
|
|
1834
|
+
/** The TikTok variant from our schema — the content source, untouched. */
|
|
1835
|
+
variant: TikTokPostVariant;
|
|
1836
|
+
/** Live creator info (nickname/avatar, audience options, interaction flags). */
|
|
1837
|
+
creatorInfo: TikTokCreatorInfo;
|
|
1838
|
+
/** Resolved media pixels (processed URLs or compose-time File blobs). */
|
|
1839
|
+
media?: PreviewMedia[];
|
|
1840
|
+
/** Class applied to the phone frame — your hook for sizing. */
|
|
1841
|
+
className?: string;
|
|
1842
|
+
/** Inline styles on the frame. */
|
|
1843
|
+
style?: CSSProperties;
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
declare function TikTokPostPreviewImpl({ variant, creatorInfo, media, className, style, }: TikTokPostPreviewProps): react.JSX.Element;
|
|
1847
|
+
/** Memoized: the resolved-media hook absorbs unstable media arrays. */
|
|
1848
|
+
declare const TikTokPostPreview: react.MemoExoticComponent<typeof TikTokPostPreviewImpl>;
|
|
1849
|
+
|
|
1850
|
+
/**
|
|
1851
|
+
* Theming for the TikTok publish PANEL. The preview card itself is always dark
|
|
1852
|
+
* (TikTok's video surface is always dark), so only the panel adapts. We expose a
|
|
1853
|
+
* small set of CSS custom properties on the panel root; controls read
|
|
1854
|
+
* `var(--pr-tt-*)`, so a customer can restyle via `style`/`className` without a
|
|
1855
|
+
* fork. Mirrors the LinkedIn preview's theme approach.
|
|
1856
|
+
*/
|
|
1857
|
+
type TikTokTheme = 'light' | 'dark' | 'auto';
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* The TikTok publish/confirmation panel — the Required-UX surface that turns a
|
|
1861
|
+
* preview into a compliant publish flow. It composes the editable caption (#2),
|
|
1862
|
+
* audience (#5), interaction (#6), commercial disclosure (#7), the video-only
|
|
1863
|
+
* AIGC toggle (SHOULD), the processing notice (#10), the consent declaration
|
|
1864
|
+
* directly above the button (#8), and the consent-gated Post button (#9) — which
|
|
1865
|
+
* fires `onPost` ONLY on an explicit click and is disabled until the post is
|
|
1866
|
+
* valid.
|
|
1867
|
+
*
|
|
1868
|
+
* All logic comes from `@postrun/js` (the single source); this is the render.
|
|
1869
|
+
*/
|
|
1870
|
+
interface TikTokPublishPanelProps {
|
|
1871
|
+
/** The variant — drives post_type (caps, interaction set) + media count. */
|
|
1872
|
+
variant: TikTokPostVariant;
|
|
1873
|
+
/** Live creator info (audience options, interaction gates). */
|
|
1874
|
+
creatorInfo: TikTokCreatorInfo;
|
|
1875
|
+
/** Editable caption (controlled) + its setter. */
|
|
1876
|
+
caption: string;
|
|
1877
|
+
onCaptionChange: (value: string) => void;
|
|
1878
|
+
/** The TikTok options value (controlled) + its setter. */
|
|
1879
|
+
options: TikTokOptionsValue;
|
|
1880
|
+
onOptionsChange: (value: TikTokOptionsValue) => void;
|
|
1881
|
+
/** Fired ONLY on an explicit Post click — the affirmative-consent gate (#9). */
|
|
1882
|
+
onPost: () => void;
|
|
1883
|
+
/** Disable the button + show a busy label while a publish is in flight. */
|
|
1884
|
+
posting?: boolean;
|
|
1885
|
+
/** Colour scheme. `auto` (default) follows the OS preference. */
|
|
1886
|
+
theme?: TikTokTheme;
|
|
1887
|
+
className?: string;
|
|
1888
|
+
style?: CSSProperties;
|
|
1889
|
+
}
|
|
1890
|
+
declare function TikTokPublishPanel({ variant, creatorInfo, caption, onCaptionChange, options, onOptionsChange, onPost, posting, theme, className, style, }: TikTokPublishPanelProps): react.JSX.Element;
|
|
1891
|
+
|
|
1892
|
+
interface TikTokCaptionFieldProps {
|
|
1893
|
+
/** The caption text (controlled). */
|
|
1894
|
+
value: string;
|
|
1895
|
+
/** Fired on every edit — keep your variant `body` in sync with this. */
|
|
1896
|
+
onChange: (value: string) => void;
|
|
1897
|
+
/** Drives the cap (video → 2200, photo → 4000). */
|
|
1898
|
+
postType: TikTokPostVariant['post_type'];
|
|
1899
|
+
/** Placeholder shown when empty. */
|
|
1900
|
+
placeholder?: string;
|
|
1901
|
+
className?: string;
|
|
1902
|
+
style?: CSSProperties;
|
|
1903
|
+
}
|
|
1904
|
+
declare function TikTokCaptionField({ value, onChange, postType, placeholder, className, style, }: TikTokCaptionFieldProps): react.JSX.Element;
|
|
1905
|
+
|
|
1906
|
+
/**
|
|
1907
|
+
* The audience / privacy selector — MUST #5. TikTok mandates an explicit choice
|
|
1908
|
+
* with NO default, so the select opens on a disabled placeholder and an unchosen
|
|
1909
|
+
* value shows the required hint. Options come from the creator's allowed set;
|
|
1910
|
+
* branded content drops SELF_ONLY (handled in `audiencePrivacyOptions`).
|
|
1911
|
+
*/
|
|
1912
|
+
declare function AudienceSelect({ creatorInfo, value, onChange, }: {
|
|
1913
|
+
creatorInfo: TikTokCreatorInfo;
|
|
1914
|
+
value: TikTokOptionsValue;
|
|
1915
|
+
onChange: (value: TikTokOptionsValue) => void;
|
|
1916
|
+
}): react.JSX.Element;
|
|
1917
|
+
|
|
1918
|
+
/**
|
|
1919
|
+
* The interaction toggles — MUST #6. Video shows Comment / Duet / Stitch; a photo
|
|
1920
|
+
* post shows only Comment (TikTok mandate). None default on; an interaction the
|
|
1921
|
+
* creator forbids renders disabled and forced off. The rows + the forbidden flags
|
|
1922
|
+
* come from `interactionRows` (the single source).
|
|
1923
|
+
*/
|
|
1924
|
+
declare function InteractionToggles({ creatorInfo, value, onChange, isVideo, }: {
|
|
1925
|
+
creatorInfo: TikTokCreatorInfo;
|
|
1926
|
+
value: TikTokOptionsValue;
|
|
1927
|
+
onChange: (value: TikTokOptionsValue) => void;
|
|
1928
|
+
isVideo: boolean;
|
|
1929
|
+
}): react.JSX.Element;
|
|
1930
|
+
|
|
1931
|
+
/**
|
|
1932
|
+
* Commercial-content disclosure — MUST #7. Off by default. When on, the user must
|
|
1933
|
+
* pick at least one of "Your brand" / "Branded content" (else the required hint
|
|
1934
|
+
* blocks publish), and the resulting label notice is shown verbatim:
|
|
1935
|
+
* Your brand → "Your photo/video will be labeled as 'Promotional content'"
|
|
1936
|
+
* Branded content→ "Your photo/video will be labeled as 'Paid partnership'"
|
|
1937
|
+
* Branded content can't be private (handled in `setBrandKind` / the audience list).
|
|
1938
|
+
*/
|
|
1939
|
+
declare function CommercialDisclosure({ value, onChange, }: {
|
|
1940
|
+
value: TikTokOptionsValue;
|
|
1941
|
+
onChange: (value: TikTokOptionsValue) => void;
|
|
1942
|
+
}): react.JSX.Element;
|
|
1943
|
+
|
|
1944
|
+
/**
|
|
1945
|
+
* The consent declaration — MUST #8. Rendered DIRECTLY above the Post button. The
|
|
1946
|
+
* wording switches on whether the post is disclosed as branded content (verbatim
|
|
1947
|
+
* TikTok copy):
|
|
1948
|
+
* default → "By posting, you agree to TikTok's Music Usage Confirmation"
|
|
1949
|
+
* branded → "By posting, you agree to TikTok's Branded Content Policy and
|
|
1950
|
+
* Music Usage Confirmation."
|
|
1951
|
+
*/
|
|
1952
|
+
declare function Declaration({ brandedContent }: {
|
|
1953
|
+
brandedContent: boolean;
|
|
1954
|
+
}): react.JSX.Element;
|
|
1955
|
+
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ 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 } from '@postrun/js';
|
|
6
|
-
export { PostValidation, PostVariant, PostVariantError, TikTokCreatorInfo, ValidationIssue } from '@postrun/js';
|
|
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';
|
|
6
|
+
export { PostValidation, PostVariant, PostVariantError, TIKTOK_CAPTION_MAX, TikTokCreatorInfo, ValidationIssue, captionMaxFor } from '@postrun/js';
|
|
7
7
|
import { TwitterComponents } from 'react-tweet';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1374,6 +1374,7 @@ declare function useValidatePost(profileId: string): {
|
|
|
1374
1374
|
got?: string;
|
|
1375
1375
|
variant_index: number;
|
|
1376
1376
|
path: Array<string | number>;
|
|
1377
|
+
platform?: "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
|
|
1377
1378
|
display_error: string;
|
|
1378
1379
|
}[];
|
|
1379
1380
|
isPending: boolean;
|
|
@@ -1674,6 +1675,16 @@ interface PreviewMedia {
|
|
|
1674
1675
|
}
|
|
1675
1676
|
/** @deprecated Use {@link PreviewMedia}. Kept as an alias for back-compat. */
|
|
1676
1677
|
type XPreviewMedia = PreviewMedia;
|
|
1678
|
+
/** A media item with its pixels already resolved to a single URL by the
|
|
1679
|
+
* component (shared by every platform preview's renderer). */
|
|
1680
|
+
interface ResolvedMedia {
|
|
1681
|
+
kind: PreviewMediaKind;
|
|
1682
|
+
src: string;
|
|
1683
|
+
width?: number;
|
|
1684
|
+
height?: number;
|
|
1685
|
+
alt?: string;
|
|
1686
|
+
posterSrc?: string;
|
|
1687
|
+
}
|
|
1677
1688
|
/**
|
|
1678
1689
|
* Content for the nested quoted card. Supplied separately because our schema
|
|
1679
1690
|
* carries only an opaque `quote_tweet_id` (no quoted text/author).
|
|
@@ -1735,8 +1746,9 @@ type LinkedInTheme = 'light' | 'dark' | 'auto';
|
|
|
1735
1746
|
* with headline + audience icon, an entity-highlighted body with the "…more"
|
|
1736
1747
|
* fold, the 1/2/3/4/+N image mosaic (or a video), and a static action bar.
|
|
1737
1748
|
*
|
|
1738
|
-
*
|
|
1739
|
-
*
|
|
1749
|
+
* Renders every `content_kind`: text, single/multi image, video, plus the rich
|
|
1750
|
+
* units — article share card, poll, and document — each driven from
|
|
1751
|
+
* `settings.{article,poll,document}` (see `renderContent`).
|
|
1740
1752
|
*
|
|
1741
1753
|
* Customize via `theme` (light/dark/auto), `className`/`style`, or by overriding
|
|
1742
1754
|
* the `--pr-li-*` CSS variables the card reads.
|
|
@@ -1764,4 +1776,181 @@ declare function LinkedInPostPreviewImpl({ variant, author, media, theme, time,
|
|
|
1764
1776
|
* absorbs unstable media arrays). */
|
|
1765
1777
|
declare const LinkedInPostPreview: react.MemoExoticComponent<typeof LinkedInPostPreviewImpl>;
|
|
1766
1778
|
|
|
1767
|
-
|
|
1779
|
+
/**
|
|
1780
|
+
* A LinkedIn article share card (`content_kind: 'article'`) — the link unit
|
|
1781
|
+
* LinkedIn renders below the commentary: an optional thumbnail, then a panel with
|
|
1782
|
+
* the source domain (muted), the headline (bold), and the optional description.
|
|
1783
|
+
* Driven straight from `settings.article`; the thumbnail pixels (resolved from
|
|
1784
|
+
* `article.thumbnail_media_id`) are passed in by the host.
|
|
1785
|
+
*/
|
|
1786
|
+
/** The article settings shape — derived from the contract, never re-declared. */
|
|
1787
|
+
type LinkedInArticle = NonNullable<NonNullable<LinkedInPostVariant['settings']>['article']>;
|
|
1788
|
+
interface ArticleCardProps {
|
|
1789
|
+
article: LinkedInArticle;
|
|
1790
|
+
/** Resolved thumbnail pixels (from `article.thumbnail_media_id`), if any. */
|
|
1791
|
+
thumbnail?: ResolvedMedia;
|
|
1792
|
+
}
|
|
1793
|
+
declare function ArticleCard({ article, thumbnail }: ArticleCardProps): react.JSX.Element;
|
|
1794
|
+
|
|
1795
|
+
/**
|
|
1796
|
+
* A LinkedIn poll (`content_kind: 'poll'`) — the question, the 2–4 option rows
|
|
1797
|
+
* (rendered as the pre-vote outlined buttons LinkedIn shows), and the footer
|
|
1798
|
+
* ("0 votes • <duration>"). A fresh poll has no votes, so we never fabricate
|
|
1799
|
+
* counts. Driven straight from `settings.poll`.
|
|
1800
|
+
*/
|
|
1801
|
+
/** The poll settings shape — derived from the contract, never re-declared. */
|
|
1802
|
+
type LinkedInPoll = NonNullable<NonNullable<LinkedInPostVariant['settings']>['poll']>;
|
|
1803
|
+
interface PollProps {
|
|
1804
|
+
poll: LinkedInPoll;
|
|
1805
|
+
}
|
|
1806
|
+
declare function Poll({ poll }: PollProps): react.JSX.Element;
|
|
1807
|
+
|
|
1808
|
+
/**
|
|
1809
|
+
* A LinkedIn document post (`content_kind: 'document'`) — the PDF/slide unit
|
|
1810
|
+
* LinkedIn renders as a page preview with a dark caption bar (title + "Document").
|
|
1811
|
+
* The document asset rides on the variant `media[]`; if the host resolves a
|
|
1812
|
+
* first-page image it shows here, otherwise a clean document affordance. Title is
|
|
1813
|
+
* required by the contract, so it always renders. Driven by `settings.document`.
|
|
1814
|
+
*/
|
|
1815
|
+
/** The document settings shape — derived from the contract, never re-declared. */
|
|
1816
|
+
type LinkedInDocument = NonNullable<NonNullable<LinkedInPostVariant['settings']>['document']>;
|
|
1817
|
+
interface DocumentCardProps {
|
|
1818
|
+
document: LinkedInDocument;
|
|
1819
|
+
/** Resolved first-page pixels (from the document asset on media[]), if any. */
|
|
1820
|
+
cover?: ResolvedMedia;
|
|
1821
|
+
}
|
|
1822
|
+
declare function DocumentCard({ document, cover }: DocumentCardProps): react.JSX.Element;
|
|
1823
|
+
|
|
1824
|
+
/**
|
|
1825
|
+
* Public props for the TikTok post preview — a faithful render of how a post will
|
|
1826
|
+
* look on TikTok, driven straight from our Post object plus the live creator info
|
|
1827
|
+
* the Content-Posting policy requires the publishing UI to show.
|
|
1828
|
+
*
|
|
1829
|
+
* The component is presentational: the host collects the variant + creator info
|
|
1830
|
+
* (via `useTikTokCreatorInfo`) + resolves media pixels, and passes them in. Later
|
|
1831
|
+
* chunks add the editable caption + the consent-gated Post button.
|
|
1832
|
+
*/
|
|
1833
|
+
interface TikTokPostPreviewProps {
|
|
1834
|
+
/** The TikTok variant from our schema — the content source, untouched. */
|
|
1835
|
+
variant: TikTokPostVariant;
|
|
1836
|
+
/** Live creator info (nickname/avatar, audience options, interaction flags). */
|
|
1837
|
+
creatorInfo: TikTokCreatorInfo;
|
|
1838
|
+
/** Resolved media pixels (processed URLs or compose-time File blobs). */
|
|
1839
|
+
media?: PreviewMedia[];
|
|
1840
|
+
/** Class applied to the phone frame — your hook for sizing. */
|
|
1841
|
+
className?: string;
|
|
1842
|
+
/** Inline styles on the frame. */
|
|
1843
|
+
style?: CSSProperties;
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
declare function TikTokPostPreviewImpl({ variant, creatorInfo, media, className, style, }: TikTokPostPreviewProps): react.JSX.Element;
|
|
1847
|
+
/** Memoized: the resolved-media hook absorbs unstable media arrays. */
|
|
1848
|
+
declare const TikTokPostPreview: react.MemoExoticComponent<typeof TikTokPostPreviewImpl>;
|
|
1849
|
+
|
|
1850
|
+
/**
|
|
1851
|
+
* Theming for the TikTok publish PANEL. The preview card itself is always dark
|
|
1852
|
+
* (TikTok's video surface is always dark), so only the panel adapts. We expose a
|
|
1853
|
+
* small set of CSS custom properties on the panel root; controls read
|
|
1854
|
+
* `var(--pr-tt-*)`, so a customer can restyle via `style`/`className` without a
|
|
1855
|
+
* fork. Mirrors the LinkedIn preview's theme approach.
|
|
1856
|
+
*/
|
|
1857
|
+
type TikTokTheme = 'light' | 'dark' | 'auto';
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* The TikTok publish/confirmation panel — the Required-UX surface that turns a
|
|
1861
|
+
* preview into a compliant publish flow. It composes the editable caption (#2),
|
|
1862
|
+
* audience (#5), interaction (#6), commercial disclosure (#7), the video-only
|
|
1863
|
+
* AIGC toggle (SHOULD), the processing notice (#10), the consent declaration
|
|
1864
|
+
* directly above the button (#8), and the consent-gated Post button (#9) — which
|
|
1865
|
+
* fires `onPost` ONLY on an explicit click and is disabled until the post is
|
|
1866
|
+
* valid.
|
|
1867
|
+
*
|
|
1868
|
+
* All logic comes from `@postrun/js` (the single source); this is the render.
|
|
1869
|
+
*/
|
|
1870
|
+
interface TikTokPublishPanelProps {
|
|
1871
|
+
/** The variant — drives post_type (caps, interaction set) + media count. */
|
|
1872
|
+
variant: TikTokPostVariant;
|
|
1873
|
+
/** Live creator info (audience options, interaction gates). */
|
|
1874
|
+
creatorInfo: TikTokCreatorInfo;
|
|
1875
|
+
/** Editable caption (controlled) + its setter. */
|
|
1876
|
+
caption: string;
|
|
1877
|
+
onCaptionChange: (value: string) => void;
|
|
1878
|
+
/** The TikTok options value (controlled) + its setter. */
|
|
1879
|
+
options: TikTokOptionsValue;
|
|
1880
|
+
onOptionsChange: (value: TikTokOptionsValue) => void;
|
|
1881
|
+
/** Fired ONLY on an explicit Post click — the affirmative-consent gate (#9). */
|
|
1882
|
+
onPost: () => void;
|
|
1883
|
+
/** Disable the button + show a busy label while a publish is in flight. */
|
|
1884
|
+
posting?: boolean;
|
|
1885
|
+
/** Colour scheme. `auto` (default) follows the OS preference. */
|
|
1886
|
+
theme?: TikTokTheme;
|
|
1887
|
+
className?: string;
|
|
1888
|
+
style?: CSSProperties;
|
|
1889
|
+
}
|
|
1890
|
+
declare function TikTokPublishPanel({ variant, creatorInfo, caption, onCaptionChange, options, onOptionsChange, onPost, posting, theme, className, style, }: TikTokPublishPanelProps): react.JSX.Element;
|
|
1891
|
+
|
|
1892
|
+
interface TikTokCaptionFieldProps {
|
|
1893
|
+
/** The caption text (controlled). */
|
|
1894
|
+
value: string;
|
|
1895
|
+
/** Fired on every edit — keep your variant `body` in sync with this. */
|
|
1896
|
+
onChange: (value: string) => void;
|
|
1897
|
+
/** Drives the cap (video → 2200, photo → 4000). */
|
|
1898
|
+
postType: TikTokPostVariant['post_type'];
|
|
1899
|
+
/** Placeholder shown when empty. */
|
|
1900
|
+
placeholder?: string;
|
|
1901
|
+
className?: string;
|
|
1902
|
+
style?: CSSProperties;
|
|
1903
|
+
}
|
|
1904
|
+
declare function TikTokCaptionField({ value, onChange, postType, placeholder, className, style, }: TikTokCaptionFieldProps): react.JSX.Element;
|
|
1905
|
+
|
|
1906
|
+
/**
|
|
1907
|
+
* The audience / privacy selector — MUST #5. TikTok mandates an explicit choice
|
|
1908
|
+
* with NO default, so the select opens on a disabled placeholder and an unchosen
|
|
1909
|
+
* value shows the required hint. Options come from the creator's allowed set;
|
|
1910
|
+
* branded content drops SELF_ONLY (handled in `audiencePrivacyOptions`).
|
|
1911
|
+
*/
|
|
1912
|
+
declare function AudienceSelect({ creatorInfo, value, onChange, }: {
|
|
1913
|
+
creatorInfo: TikTokCreatorInfo;
|
|
1914
|
+
value: TikTokOptionsValue;
|
|
1915
|
+
onChange: (value: TikTokOptionsValue) => void;
|
|
1916
|
+
}): react.JSX.Element;
|
|
1917
|
+
|
|
1918
|
+
/**
|
|
1919
|
+
* The interaction toggles — MUST #6. Video shows Comment / Duet / Stitch; a photo
|
|
1920
|
+
* post shows only Comment (TikTok mandate). None default on; an interaction the
|
|
1921
|
+
* creator forbids renders disabled and forced off. The rows + the forbidden flags
|
|
1922
|
+
* come from `interactionRows` (the single source).
|
|
1923
|
+
*/
|
|
1924
|
+
declare function InteractionToggles({ creatorInfo, value, onChange, isVideo, }: {
|
|
1925
|
+
creatorInfo: TikTokCreatorInfo;
|
|
1926
|
+
value: TikTokOptionsValue;
|
|
1927
|
+
onChange: (value: TikTokOptionsValue) => void;
|
|
1928
|
+
isVideo: boolean;
|
|
1929
|
+
}): react.JSX.Element;
|
|
1930
|
+
|
|
1931
|
+
/**
|
|
1932
|
+
* Commercial-content disclosure — MUST #7. Off by default. When on, the user must
|
|
1933
|
+
* pick at least one of "Your brand" / "Branded content" (else the required hint
|
|
1934
|
+
* blocks publish), and the resulting label notice is shown verbatim:
|
|
1935
|
+
* Your brand → "Your photo/video will be labeled as 'Promotional content'"
|
|
1936
|
+
* Branded content→ "Your photo/video will be labeled as 'Paid partnership'"
|
|
1937
|
+
* Branded content can't be private (handled in `setBrandKind` / the audience list).
|
|
1938
|
+
*/
|
|
1939
|
+
declare function CommercialDisclosure({ value, onChange, }: {
|
|
1940
|
+
value: TikTokOptionsValue;
|
|
1941
|
+
onChange: (value: TikTokOptionsValue) => void;
|
|
1942
|
+
}): react.JSX.Element;
|
|
1943
|
+
|
|
1944
|
+
/**
|
|
1945
|
+
* The consent declaration — MUST #8. Rendered DIRECTLY above the Post button. The
|
|
1946
|
+
* wording switches on whether the post is disclosed as branded content (verbatim
|
|
1947
|
+
* TikTok copy):
|
|
1948
|
+
* default → "By posting, you agree to TikTok's Music Usage Confirmation"
|
|
1949
|
+
* branded → "By posting, you agree to TikTok's Branded Content Policy and
|
|
1950
|
+
* Music Usage Confirmation."
|
|
1951
|
+
*/
|
|
1952
|
+
declare function Declaration({ brandedContent }: {
|
|
1953
|
+
brandedContent: boolean;
|
|
1954
|
+
}): react.JSX.Element;
|
|
1955
|
+
|
|
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 };
|