@postrun/react 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +496 -156
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +92 -17
- package/dist/index.d.ts +92 -17
- package/dist/index.js +497 -159
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.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, XPoll as XPoll$1, 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, InstagramPostVariant, 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
|
|
|
@@ -1618,16 +1618,19 @@ declare function useTikTokCreatorInfo(connectionId: string | null): _tanstack_re
|
|
|
1618
1618
|
}>, Error>;
|
|
1619
1619
|
|
|
1620
1620
|
/**
|
|
1621
|
-
* Public input types for the post-preview components.
|
|
1622
|
-
* CUSTOMER supplies for presentation — NOT shapes from our OpenAPI contract — so
|
|
1623
|
-
* they are authored here rather than derived. The one value with a contract
|
|
1624
|
-
* counterpart, a media asset's `kind`, IS derived from the SDK's `MediaKind`.
|
|
1621
|
+
* Public input types for the post-preview components.
|
|
1625
1622
|
*
|
|
1626
|
-
*
|
|
1627
|
-
*
|
|
1628
|
-
*
|
|
1629
|
-
*
|
|
1623
|
+
* Identity that our API DOES store on a `Connection` (`username`, `avatar_url`,
|
|
1624
|
+
* `profile_url`) is DERIVED from the SDK `Connection` type — never re-declared —
|
|
1625
|
+
* so a preview author can be built straight from a connection and can't drift.
|
|
1626
|
+
* Fields the API does NOT store (a verified badge, a display name distinct from
|
|
1627
|
+
* the handle, a LinkedIn headline) are presentation extras the customer supplies;
|
|
1628
|
+
* those are the documented backend gaps. Media `kind` derives from `MediaKind`;
|
|
1629
|
+
* pixels are still a `url`/`File` because a variant references media by id.
|
|
1630
1630
|
*/
|
|
1631
|
+
/** The identity fields our `Connection` stores — the SDK-driven base every
|
|
1632
|
+
* preview author derives from (so the field names + nullability match the API). */
|
|
1633
|
+
type ConnectionIdentity = Pick<Connection, 'username' | 'avatar_url'>;
|
|
1631
1634
|
/** The author identity rendered in an X preview header. */
|
|
1632
1635
|
interface XPreviewAuthor {
|
|
1633
1636
|
/** Display name, e.g. "Acme Studio". */
|
|
@@ -1651,6 +1654,19 @@ interface LinkedInPreviewAuthor {
|
|
|
1651
1654
|
/** Show the verified badge. Default false. */
|
|
1652
1655
|
verified?: boolean;
|
|
1653
1656
|
}
|
|
1657
|
+
/**
|
|
1658
|
+
* The author identity rendered in an Instagram preview header. Instagram shows
|
|
1659
|
+
* the `username` (no separate display name) + an optional verified badge.
|
|
1660
|
+
*
|
|
1661
|
+
* `username` / `avatar_url` are DERIVED from the SDK `Connection` (`string | null`,
|
|
1662
|
+
* so build it straight from `useConnections()`). `verified` is a presentation
|
|
1663
|
+
* extra — our API does NOT store verified status on a connection (a backend gap),
|
|
1664
|
+
* so the customer supplies it (or omit it).
|
|
1665
|
+
*/
|
|
1666
|
+
type InstagramPreviewAuthor = ConnectionIdentity & {
|
|
1667
|
+
/** Verified badge. NOT sourced from our Connection — presentation-only. */
|
|
1668
|
+
verified?: boolean;
|
|
1669
|
+
};
|
|
1654
1670
|
/** The media kinds a social preview can render (documents are not previewable
|
|
1655
1671
|
* here) — derived from the SDK's `MediaKind`, never re-listed. */
|
|
1656
1672
|
type PreviewMediaKind = Extract<MediaKind, 'image' | 'video' | 'gif'>;
|
|
@@ -1708,7 +1724,8 @@ interface XPostPreviewProps {
|
|
|
1708
1724
|
quotedTweet?: XPreviewQuotedTweet;
|
|
1709
1725
|
/** The replied-to account's handle (our schema only stores the parent id). */
|
|
1710
1726
|
replyToHandle?: string;
|
|
1711
|
-
/** Color scheme. `auto` (default)
|
|
1727
|
+
/** Color scheme. `auto` (default) follows the OS color scheme (light/dark) —
|
|
1728
|
+
* the same resolution every Postrun preview card uses. */
|
|
1712
1729
|
theme?: 'light' | 'dark' | 'auto';
|
|
1713
1730
|
/** Show the static action row (icons, no counts). Default true. */
|
|
1714
1731
|
showActions?: boolean;
|
|
@@ -1744,11 +1761,14 @@ interface XPollProps {
|
|
|
1744
1761
|
declare function XPoll({ poll }: XPollProps): react.JSX.Element;
|
|
1745
1762
|
|
|
1746
1763
|
/**
|
|
1747
|
-
* LinkedIn preview theming.
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1750
|
-
*
|
|
1751
|
-
*
|
|
1764
|
+
* LinkedIn preview theming. We own the card, so we expose CSS custom properties
|
|
1765
|
+
* on the wrapper; components read `var(--pr-li-*)`.
|
|
1766
|
+
*
|
|
1767
|
+
* `auto` follows the OS color scheme the SAME way every card does (X via
|
|
1768
|
+
* react-tweet's `@media (prefers-color-scheme)`): the vars use the CSS
|
|
1769
|
+
* `light-dark()` function and the card sets `color-scheme` (`light dark` for auto,
|
|
1770
|
+
* else the explicit scheme). This resolves in CSS — instant, SSR-safe, no
|
|
1771
|
+
* JS-after-mount flash — so all previews agree on what `auto` means.
|
|
1752
1772
|
*/
|
|
1753
1773
|
type LinkedInTheme = 'light' | 'dark' | 'auto';
|
|
1754
1774
|
|
|
@@ -1834,6 +1854,60 @@ interface DocumentCardProps {
|
|
|
1834
1854
|
}
|
|
1835
1855
|
declare function DocumentCard({ document, cover }: DocumentCardProps): react.JSX.Element;
|
|
1836
1856
|
|
|
1857
|
+
/**
|
|
1858
|
+
* Instagram feed-card theming. We own the card, so we expose CSS custom
|
|
1859
|
+
* properties on the wrapper; components read `var(--pr-ig-*)`.
|
|
1860
|
+
*
|
|
1861
|
+
* `auto` follows the OS color scheme the SAME way every card does (X via
|
|
1862
|
+
* react-tweet's `@media (prefers-color-scheme)`): the vars use the CSS
|
|
1863
|
+
* `light-dark()` function and the card sets `color-scheme` (`light dark` for auto,
|
|
1864
|
+
* else the explicit scheme). This resolves in CSS — instant, SSR-safe, no
|
|
1865
|
+
* JS-after-mount flash — so all previews agree on what `auto` means.
|
|
1866
|
+
*/
|
|
1867
|
+
type InstagramTheme = 'light' | 'dark' | 'auto';
|
|
1868
|
+
|
|
1869
|
+
/**
|
|
1870
|
+
* A faithful, schema-driven preview of how an Instagram post will look, rendered
|
|
1871
|
+
* straight from a Postrun Instagram variant. Covers everything the API supports:
|
|
1872
|
+
* a **feed** post (single image / carousel) and a **reel** (9:16 video). Identity
|
|
1873
|
+
* is SDK-driven (`author` derives from `Connection`); creator details (username,
|
|
1874
|
+
* avatar, verified, collaborators) and the audio label come from the variant +
|
|
1875
|
+
* author. Feed themes light/dark/`auto`; the reel is always dark.
|
|
1876
|
+
*
|
|
1877
|
+
* Clean-room (there's no package to "buy" — Instagram's embed only renders
|
|
1878
|
+
* already-published posts), referencing the real IG feed + Postiz.
|
|
1879
|
+
*/
|
|
1880
|
+
interface InstagramPostPreviewProps {
|
|
1881
|
+
/** The Instagram variant from our schema — the content source, untouched. */
|
|
1882
|
+
variant: InstagramPostVariant;
|
|
1883
|
+
/** Author identity (SDK-driven; `verified` is a presentation extra). */
|
|
1884
|
+
author: InstagramPreviewAuthor;
|
|
1885
|
+
/** Resolved media pixels (processed URLs or compose-time File blobs). */
|
|
1886
|
+
media?: PreviewMedia[];
|
|
1887
|
+
/** Color scheme for the feed card. `auto` (default) follows the OS. */
|
|
1888
|
+
theme?: InstagramTheme;
|
|
1889
|
+
className?: string;
|
|
1890
|
+
style?: CSSProperties;
|
|
1891
|
+
}
|
|
1892
|
+
declare function InstagramPostPreviewImpl({ variant, author, media, theme, className, style, }: InstagramPostPreviewProps): react.JSX.Element;
|
|
1893
|
+
/** Memoized: the resolved-media hook absorbs unstable media arrays. */
|
|
1894
|
+
declare const InstagramPostPreview: react.MemoExoticComponent<typeof InstagramPostPreviewImpl>;
|
|
1895
|
+
|
|
1896
|
+
/**
|
|
1897
|
+
* An Instagram Reel preview — the 9:16 vertical card: full-bleed video, the
|
|
1898
|
+
* username/verified + caption overlaid bottom-left, an audio row ("♪ <audio>"),
|
|
1899
|
+
* and the right action rail (like/comment/share/save/more — no fabricated
|
|
1900
|
+
* counts). Always dark, like the real Reels surface.
|
|
1901
|
+
*/
|
|
1902
|
+
declare function ReelPreview({ author, body, media, audioName, className, style, }: {
|
|
1903
|
+
author: InstagramPreviewAuthor;
|
|
1904
|
+
body: string;
|
|
1905
|
+
media: readonly ResolvedMedia[];
|
|
1906
|
+
audioName?: string;
|
|
1907
|
+
className?: string;
|
|
1908
|
+
style?: CSSProperties;
|
|
1909
|
+
}): react.JSX.Element;
|
|
1910
|
+
|
|
1837
1911
|
/**
|
|
1838
1912
|
* Public props for the TikTok post preview — a faithful render of how a post will
|
|
1839
1913
|
* look on TikTok, driven straight from our Post object plus the live creator info
|
|
@@ -1865,7 +1939,8 @@ declare const TikTokPostPreview: react.MemoExoticComponent<typeof TikTokPostPrev
|
|
|
1865
1939
|
* (TikTok's video surface is always dark), so only the panel adapts. We expose a
|
|
1866
1940
|
* small set of CSS custom properties on the panel root; controls read
|
|
1867
1941
|
* `var(--pr-tt-*)`, so a customer can restyle via `style`/`className` without a
|
|
1868
|
-
* fork.
|
|
1942
|
+
* fork. `auto` follows the OS color scheme via CSS `light-dark()` — the same way
|
|
1943
|
+
* every preview card resolves `auto`.
|
|
1869
1944
|
*/
|
|
1870
1945
|
type TikTokTheme = 'light' | 'dark' | 'auto';
|
|
1871
1946
|
|
|
@@ -1966,4 +2041,4 @@ declare function Declaration({ brandedContent }: {
|
|
|
1966
2041
|
brandedContent: boolean;
|
|
1967
2042
|
}): react.JSX.Element;
|
|
1968
2043
|
|
|
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 };
|
|
2044
|
+
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, InstagramPostPreview, type InstagramPostPreviewProps, type InstagramPreviewAuthor, type InstagramTheme, 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, ReelPreview, 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, XPoll as XPoll$1, 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, InstagramPostVariant, 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
|
|
|
@@ -1618,16 +1618,19 @@ declare function useTikTokCreatorInfo(connectionId: string | null): _tanstack_re
|
|
|
1618
1618
|
}>, Error>;
|
|
1619
1619
|
|
|
1620
1620
|
/**
|
|
1621
|
-
* Public input types for the post-preview components.
|
|
1622
|
-
* CUSTOMER supplies for presentation — NOT shapes from our OpenAPI contract — so
|
|
1623
|
-
* they are authored here rather than derived. The one value with a contract
|
|
1624
|
-
* counterpart, a media asset's `kind`, IS derived from the SDK's `MediaKind`.
|
|
1621
|
+
* Public input types for the post-preview components.
|
|
1625
1622
|
*
|
|
1626
|
-
*
|
|
1627
|
-
*
|
|
1628
|
-
*
|
|
1629
|
-
*
|
|
1623
|
+
* Identity that our API DOES store on a `Connection` (`username`, `avatar_url`,
|
|
1624
|
+
* `profile_url`) is DERIVED from the SDK `Connection` type — never re-declared —
|
|
1625
|
+
* so a preview author can be built straight from a connection and can't drift.
|
|
1626
|
+
* Fields the API does NOT store (a verified badge, a display name distinct from
|
|
1627
|
+
* the handle, a LinkedIn headline) are presentation extras the customer supplies;
|
|
1628
|
+
* those are the documented backend gaps. Media `kind` derives from `MediaKind`;
|
|
1629
|
+
* pixels are still a `url`/`File` because a variant references media by id.
|
|
1630
1630
|
*/
|
|
1631
|
+
/** The identity fields our `Connection` stores — the SDK-driven base every
|
|
1632
|
+
* preview author derives from (so the field names + nullability match the API). */
|
|
1633
|
+
type ConnectionIdentity = Pick<Connection, 'username' | 'avatar_url'>;
|
|
1631
1634
|
/** The author identity rendered in an X preview header. */
|
|
1632
1635
|
interface XPreviewAuthor {
|
|
1633
1636
|
/** Display name, e.g. "Acme Studio". */
|
|
@@ -1651,6 +1654,19 @@ interface LinkedInPreviewAuthor {
|
|
|
1651
1654
|
/** Show the verified badge. Default false. */
|
|
1652
1655
|
verified?: boolean;
|
|
1653
1656
|
}
|
|
1657
|
+
/**
|
|
1658
|
+
* The author identity rendered in an Instagram preview header. Instagram shows
|
|
1659
|
+
* the `username` (no separate display name) + an optional verified badge.
|
|
1660
|
+
*
|
|
1661
|
+
* `username` / `avatar_url` are DERIVED from the SDK `Connection` (`string | null`,
|
|
1662
|
+
* so build it straight from `useConnections()`). `verified` is a presentation
|
|
1663
|
+
* extra — our API does NOT store verified status on a connection (a backend gap),
|
|
1664
|
+
* so the customer supplies it (or omit it).
|
|
1665
|
+
*/
|
|
1666
|
+
type InstagramPreviewAuthor = ConnectionIdentity & {
|
|
1667
|
+
/** Verified badge. NOT sourced from our Connection — presentation-only. */
|
|
1668
|
+
verified?: boolean;
|
|
1669
|
+
};
|
|
1654
1670
|
/** The media kinds a social preview can render (documents are not previewable
|
|
1655
1671
|
* here) — derived from the SDK's `MediaKind`, never re-listed. */
|
|
1656
1672
|
type PreviewMediaKind = Extract<MediaKind, 'image' | 'video' | 'gif'>;
|
|
@@ -1708,7 +1724,8 @@ interface XPostPreviewProps {
|
|
|
1708
1724
|
quotedTweet?: XPreviewQuotedTweet;
|
|
1709
1725
|
/** The replied-to account's handle (our schema only stores the parent id). */
|
|
1710
1726
|
replyToHandle?: string;
|
|
1711
|
-
/** Color scheme. `auto` (default)
|
|
1727
|
+
/** Color scheme. `auto` (default) follows the OS color scheme (light/dark) —
|
|
1728
|
+
* the same resolution every Postrun preview card uses. */
|
|
1712
1729
|
theme?: 'light' | 'dark' | 'auto';
|
|
1713
1730
|
/** Show the static action row (icons, no counts). Default true. */
|
|
1714
1731
|
showActions?: boolean;
|
|
@@ -1744,11 +1761,14 @@ interface XPollProps {
|
|
|
1744
1761
|
declare function XPoll({ poll }: XPollProps): react.JSX.Element;
|
|
1745
1762
|
|
|
1746
1763
|
/**
|
|
1747
|
-
* LinkedIn preview theming.
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1750
|
-
*
|
|
1751
|
-
*
|
|
1764
|
+
* LinkedIn preview theming. We own the card, so we expose CSS custom properties
|
|
1765
|
+
* on the wrapper; components read `var(--pr-li-*)`.
|
|
1766
|
+
*
|
|
1767
|
+
* `auto` follows the OS color scheme the SAME way every card does (X via
|
|
1768
|
+
* react-tweet's `@media (prefers-color-scheme)`): the vars use the CSS
|
|
1769
|
+
* `light-dark()` function and the card sets `color-scheme` (`light dark` for auto,
|
|
1770
|
+
* else the explicit scheme). This resolves in CSS — instant, SSR-safe, no
|
|
1771
|
+
* JS-after-mount flash — so all previews agree on what `auto` means.
|
|
1752
1772
|
*/
|
|
1753
1773
|
type LinkedInTheme = 'light' | 'dark' | 'auto';
|
|
1754
1774
|
|
|
@@ -1834,6 +1854,60 @@ interface DocumentCardProps {
|
|
|
1834
1854
|
}
|
|
1835
1855
|
declare function DocumentCard({ document, cover }: DocumentCardProps): react.JSX.Element;
|
|
1836
1856
|
|
|
1857
|
+
/**
|
|
1858
|
+
* Instagram feed-card theming. We own the card, so we expose CSS custom
|
|
1859
|
+
* properties on the wrapper; components read `var(--pr-ig-*)`.
|
|
1860
|
+
*
|
|
1861
|
+
* `auto` follows the OS color scheme the SAME way every card does (X via
|
|
1862
|
+
* react-tweet's `@media (prefers-color-scheme)`): the vars use the CSS
|
|
1863
|
+
* `light-dark()` function and the card sets `color-scheme` (`light dark` for auto,
|
|
1864
|
+
* else the explicit scheme). This resolves in CSS — instant, SSR-safe, no
|
|
1865
|
+
* JS-after-mount flash — so all previews agree on what `auto` means.
|
|
1866
|
+
*/
|
|
1867
|
+
type InstagramTheme = 'light' | 'dark' | 'auto';
|
|
1868
|
+
|
|
1869
|
+
/**
|
|
1870
|
+
* A faithful, schema-driven preview of how an Instagram post will look, rendered
|
|
1871
|
+
* straight from a Postrun Instagram variant. Covers everything the API supports:
|
|
1872
|
+
* a **feed** post (single image / carousel) and a **reel** (9:16 video). Identity
|
|
1873
|
+
* is SDK-driven (`author` derives from `Connection`); creator details (username,
|
|
1874
|
+
* avatar, verified, collaborators) and the audio label come from the variant +
|
|
1875
|
+
* author. Feed themes light/dark/`auto`; the reel is always dark.
|
|
1876
|
+
*
|
|
1877
|
+
* Clean-room (there's no package to "buy" — Instagram's embed only renders
|
|
1878
|
+
* already-published posts), referencing the real IG feed + Postiz.
|
|
1879
|
+
*/
|
|
1880
|
+
interface InstagramPostPreviewProps {
|
|
1881
|
+
/** The Instagram variant from our schema — the content source, untouched. */
|
|
1882
|
+
variant: InstagramPostVariant;
|
|
1883
|
+
/** Author identity (SDK-driven; `verified` is a presentation extra). */
|
|
1884
|
+
author: InstagramPreviewAuthor;
|
|
1885
|
+
/** Resolved media pixels (processed URLs or compose-time File blobs). */
|
|
1886
|
+
media?: PreviewMedia[];
|
|
1887
|
+
/** Color scheme for the feed card. `auto` (default) follows the OS. */
|
|
1888
|
+
theme?: InstagramTheme;
|
|
1889
|
+
className?: string;
|
|
1890
|
+
style?: CSSProperties;
|
|
1891
|
+
}
|
|
1892
|
+
declare function InstagramPostPreviewImpl({ variant, author, media, theme, className, style, }: InstagramPostPreviewProps): react.JSX.Element;
|
|
1893
|
+
/** Memoized: the resolved-media hook absorbs unstable media arrays. */
|
|
1894
|
+
declare const InstagramPostPreview: react.MemoExoticComponent<typeof InstagramPostPreviewImpl>;
|
|
1895
|
+
|
|
1896
|
+
/**
|
|
1897
|
+
* An Instagram Reel preview — the 9:16 vertical card: full-bleed video, the
|
|
1898
|
+
* username/verified + caption overlaid bottom-left, an audio row ("♪ <audio>"),
|
|
1899
|
+
* and the right action rail (like/comment/share/save/more — no fabricated
|
|
1900
|
+
* counts). Always dark, like the real Reels surface.
|
|
1901
|
+
*/
|
|
1902
|
+
declare function ReelPreview({ author, body, media, audioName, className, style, }: {
|
|
1903
|
+
author: InstagramPreviewAuthor;
|
|
1904
|
+
body: string;
|
|
1905
|
+
media: readonly ResolvedMedia[];
|
|
1906
|
+
audioName?: string;
|
|
1907
|
+
className?: string;
|
|
1908
|
+
style?: CSSProperties;
|
|
1909
|
+
}): react.JSX.Element;
|
|
1910
|
+
|
|
1837
1911
|
/**
|
|
1838
1912
|
* Public props for the TikTok post preview — a faithful render of how a post will
|
|
1839
1913
|
* look on TikTok, driven straight from our Post object plus the live creator info
|
|
@@ -1865,7 +1939,8 @@ declare const TikTokPostPreview: react.MemoExoticComponent<typeof TikTokPostPrev
|
|
|
1865
1939
|
* (TikTok's video surface is always dark), so only the panel adapts. We expose a
|
|
1866
1940
|
* small set of CSS custom properties on the panel root; controls read
|
|
1867
1941
|
* `var(--pr-tt-*)`, so a customer can restyle via `style`/`className` without a
|
|
1868
|
-
* fork.
|
|
1942
|
+
* fork. `auto` follows the OS color scheme via CSS `light-dark()` — the same way
|
|
1943
|
+
* every preview card resolves `auto`.
|
|
1869
1944
|
*/
|
|
1870
1945
|
type TikTokTheme = 'light' | 'dark' | 'auto';
|
|
1871
1946
|
|
|
@@ -1966,4 +2041,4 @@ declare function Declaration({ brandedContent }: {
|
|
|
1966
2041
|
brandedContent: boolean;
|
|
1967
2042
|
}): react.JSX.Element;
|
|
1968
2043
|
|
|
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 };
|
|
2044
|
+
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, InstagramPostPreview, type InstagramPostPreviewProps, type InstagramPreviewAuthor, type InstagramTheme, 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, ReelPreview, 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 };
|