@postrun/react 2.13.0 → 2.14.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 +204 -177
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +158 -137
- package/dist/index.d.ts +158 -137
- package/dist/index.js +204 -178
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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, InstagramPostVariant, PostVariant, LinkedInPostVariant, TikTokPostVariant, XPostVariant, XPoll as XPoll$1, TikTokCreatorInfo, TikTokOptionsValue } from '@postrun/js';
|
|
5
|
+
import { PostrunClient, ListProfilesQuery, DiscoverableAccountList, Connection, ConnectionKind, ConnectionStatus, ListMediaQuery, ListPostsQuery, ConnectablePlatform, MediaResource, MediaTarget, Metadata, ComposePostInput, PostValidation, MediaKind, InstagramPostVariant, PostVariant, LinkedInPostVariant, TikTokPostVariant, XPostVariant, PostVariantInput, XPoll as XPoll$1, TikTokCreatorInfo, TikTokOptionsValue } from '@postrun/js';
|
|
6
6
|
export { PostValidation, PostVariant, PostVariantError, TIKTOK_CAPTION_MAX, TikTokCreatorInfo, UploadError, ValidationIssue, captionMaxFor } from '@postrun/js';
|
|
7
7
|
import { TwitterComponents } from 'react-tweet';
|
|
8
8
|
|
|
@@ -5307,8 +5307,9 @@ declare function useTikTokCreatorInfo(connectionId: string | null): _tanstack_re
|
|
|
5307
5307
|
* A platform's FETCHED (read) variant — one member of a stored `Post`'s
|
|
5308
5308
|
* `variants`, as returned by `usePost`/`usePosts`/the calendar. Since the API's
|
|
5309
5309
|
* read variant is now a typed discriminated union, it carries the SAME typed
|
|
5310
|
-
* `settings`/`body`/`post_type
|
|
5311
|
-
*
|
|
5310
|
+
* `settings`/`body`/`post_type` the write variant does, plus the read-only
|
|
5311
|
+
* `id`/`status`/`result`/`error` AND the enriched `media[].media` (the full
|
|
5312
|
+
* `MediaResource` inline) — so a fetched post previews with no extra fetch.
|
|
5312
5313
|
*/
|
|
5313
5314
|
type ReadPostVariant<P extends PostVariant['platform']> = Extract<PostVariant, {
|
|
5314
5315
|
platform: P;
|
|
@@ -5316,147 +5317,152 @@ type ReadPostVariant<P extends PostVariant['platform']> = Extract<PostVariant, {
|
|
|
5316
5317
|
/**
|
|
5317
5318
|
* What a preview's `variant` prop accepts: EITHER the compose-time **write**
|
|
5318
5319
|
* variant (`XPostVariant`, …) OR the fetched **read** variant. Both expose the
|
|
5319
|
-
* typed `settings`, `body`, `post_type`, and `media
|
|
5320
|
-
*
|
|
5321
|
-
*
|
|
5320
|
+
* typed `settings`, `body`, `post_type`, and ordered `media` refs the cards read
|
|
5321
|
+
* — so you can hand a preview a post you just built OR one you fetched, with no
|
|
5322
|
+
* transform. A read variant additionally carries each media's full asset inline;
|
|
5323
|
+
* a write/draft variant references media by id (resolve it via the `media` prop).
|
|
5322
5324
|
*/
|
|
5323
5325
|
type XPreviewVariant = XPostVariant | ReadPostVariant<'x'>;
|
|
5324
5326
|
type LinkedInPreviewVariant = LinkedInPostVariant | ReadPostVariant<'linkedin'>;
|
|
5325
5327
|
type TikTokPreviewVariant = TikTokPostVariant | ReadPostVariant<'tiktok'>;
|
|
5326
5328
|
type InstagramPreviewVariant = InstagramPostVariant | ReadPostVariant<'instagram'>;
|
|
5327
5329
|
/**
|
|
5328
|
-
*
|
|
5330
|
+
* The author a preview header renders. It is DERIVED from the SDK `Connection`
|
|
5331
|
+
* (the system of record for who's posting) — the card reads `avatar_url`,
|
|
5332
|
+
* `username`, and `external_account_name` straight off it, so the header can't
|
|
5333
|
+
* drift from the connection. Pass the whole connection; the card picks what it
|
|
5334
|
+
* needs.
|
|
5329
5335
|
*
|
|
5330
|
-
*
|
|
5331
|
-
*
|
|
5332
|
-
*
|
|
5333
|
-
* Fields the API does NOT store (a verified badge, a display name distinct from
|
|
5334
|
-
* the handle, a LinkedIn headline) are presentation extras the customer supplies;
|
|
5335
|
-
* those are the documented backend gaps. Media `kind` derives from `MediaKind`;
|
|
5336
|
-
* pixels are still a `url`/`File` because a variant references media by id.
|
|
5336
|
+
* The two things our API does NOT store on a connection are presentation extras
|
|
5337
|
+
* a customer may supply via the preview's own props: a `verified` badge and a
|
|
5338
|
+
* LinkedIn `headline`. Everything else comes from the connection.
|
|
5337
5339
|
*/
|
|
5338
|
-
|
|
5339
|
-
* preview author derives from (so the field names + nullability match the API). */
|
|
5340
|
-
type ConnectionIdentity = Pick<Connection, 'username' | 'avatar_url'>;
|
|
5341
|
-
/**
|
|
5342
|
-
* The author identity rendered in an X preview header. `username` (the `@handle`)
|
|
5343
|
-
* and `avatar_url` are DERIVED from the SDK `Connection`; `name` (the display
|
|
5344
|
-
* name) and `verified` are presentation extras our API doesn't store.
|
|
5345
|
-
*/
|
|
5346
|
-
type XPreviewAuthor = ConnectionIdentity & {
|
|
5347
|
-
/** Display name, e.g. "Acme Studio". NOT on Connection — caller-supplied. */
|
|
5348
|
-
name: string;
|
|
5349
|
-
/** Show the verified badge. NOT on Connection — caller-supplied. */
|
|
5350
|
-
verified?: boolean;
|
|
5351
|
-
};
|
|
5352
|
-
/**
|
|
5353
|
-
* The author identity rendered in a LinkedIn preview header. LinkedIn shows a
|
|
5354
|
-
* display `name` + a one-line `headline`. `username`/`avatar_url` are DERIVED
|
|
5355
|
-
* from the SDK `Connection`; `name`/`headline`/`verified` are presentation extras
|
|
5356
|
-
* our API doesn't store (LinkedIn's `username` is also documented as NULL today).
|
|
5357
|
-
*/
|
|
5358
|
-
type LinkedInPreviewAuthor = ConnectionIdentity & {
|
|
5359
|
-
/** Display name, e.g. "Acme Studio". NOT on Connection — caller-supplied. */
|
|
5360
|
-
name: string;
|
|
5361
|
-
/** One-line headline under the name. NOT on Connection — caller-supplied. */
|
|
5362
|
-
headline?: string;
|
|
5363
|
-
/** Show the verified badge. NOT on Connection — caller-supplied. */
|
|
5364
|
-
verified?: boolean;
|
|
5365
|
-
};
|
|
5366
|
-
/**
|
|
5367
|
-
* The author identity rendered in an Instagram preview header. Instagram shows
|
|
5368
|
-
* the `username` (no separate display name) + an optional verified badge.
|
|
5369
|
-
*
|
|
5370
|
-
* `username` / `avatar_url` are DERIVED from the SDK `Connection` (`string | null`,
|
|
5371
|
-
* so build it straight from `useConnections()`). `verified` is a presentation
|
|
5372
|
-
* extra — our API does NOT store verified status on a connection (a backend gap),
|
|
5373
|
-
* so the customer supplies it (or omit it).
|
|
5374
|
-
*/
|
|
5375
|
-
type InstagramPreviewAuthor = ConnectionIdentity & {
|
|
5376
|
-
/** Verified badge. NOT sourced from our Connection — presentation-only. */
|
|
5377
|
-
verified?: boolean;
|
|
5378
|
-
};
|
|
5340
|
+
type PreviewConnection = Pick<Connection, 'platform' | 'username' | 'avatar_url' | 'external_account_name'>;
|
|
5379
5341
|
/** The media kinds a social preview can render (documents are not previewable
|
|
5380
5342
|
* here) — derived from the SDK's `MediaKind`, never re-listed. */
|
|
5381
5343
|
type PreviewMediaKind = Extract<MediaKind, 'image' | 'video' | 'gif'>;
|
|
5382
5344
|
/**
|
|
5383
|
-
* One media item
|
|
5384
|
-
*
|
|
5385
|
-
*
|
|
5386
|
-
*
|
|
5345
|
+
* One media item resolved for rendering — the shared shape every platform card's
|
|
5346
|
+
* renderer consumes. Produced by `resolveVariantMedia` straight from the SDK
|
|
5347
|
+
* `MediaResource`; pixels come from the per-platform rendition `url`, never a
|
|
5348
|
+
* local `File`.
|
|
5349
|
+
*
|
|
5350
|
+
* `state` is honest: a `ready` item has its `src` (the rendition URL); a
|
|
5351
|
+
* `processing` item has NO `src` (the asset or its rendition isn't ready) and the
|
|
5352
|
+
* card shows the shared "Processing media…" placeholder in its place.
|
|
5387
5353
|
*/
|
|
5388
|
-
|
|
5354
|
+
type ResolvedMedia = {
|
|
5389
5355
|
kind: PreviewMediaKind;
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
/** Natural pixel width — improves layout fidelity when known. */
|
|
5356
|
+
state: 'ready';
|
|
5357
|
+
src: string;
|
|
5393
5358
|
width?: number;
|
|
5394
|
-
/** Natural pixel height — improves layout fidelity when known. */
|
|
5395
5359
|
height?: number;
|
|
5396
|
-
/** Alt text; falls back to the variant media's `alt_text_override`. */
|
|
5397
5360
|
alt?: string;
|
|
5398
|
-
|
|
5399
|
-
posterUrl?: string;
|
|
5400
|
-
}
|
|
5401
|
-
/** @deprecated Use {@link PreviewMedia}. Kept as an alias for back-compat. */
|
|
5402
|
-
type XPreviewMedia = PreviewMedia;
|
|
5403
|
-
/** A media item with its pixels already resolved to a single URL by the
|
|
5404
|
-
* component (shared by every platform preview's renderer). */
|
|
5405
|
-
interface ResolvedMedia {
|
|
5361
|
+
} | {
|
|
5406
5362
|
kind: PreviewMediaKind;
|
|
5407
|
-
|
|
5363
|
+
state: 'processing';
|
|
5364
|
+
src?: undefined;
|
|
5408
5365
|
width?: number;
|
|
5409
5366
|
height?: number;
|
|
5410
5367
|
alt?: string;
|
|
5411
|
-
|
|
5412
|
-
}
|
|
5368
|
+
};
|
|
5369
|
+
/** A resolved item that has pixels — the `ready` member of {@link ResolvedMedia}
|
|
5370
|
+
* (so `src` is guaranteed). Renderers that draw actual media take this; the
|
|
5371
|
+
* card decides up front whether to render pixels or the processing placeholder. */
|
|
5372
|
+
type ReadyMedia = Extract<ResolvedMedia, {
|
|
5373
|
+
state: 'ready';
|
|
5374
|
+
}>;
|
|
5375
|
+
/** Narrow a resolved item to its ready (has-pixels) form. */
|
|
5376
|
+
declare function isReadyMedia(item: ResolvedMedia): item is ReadyMedia;
|
|
5413
5377
|
/**
|
|
5414
5378
|
* Content for the nested quoted card. Supplied separately because our schema
|
|
5415
|
-
* carries only an opaque `quote_tweet_id` (no quoted text/author).
|
|
5379
|
+
* carries only an opaque `quote_tweet_id` (no quoted text/author/media).
|
|
5416
5380
|
*/
|
|
5417
5381
|
interface XPreviewQuotedTweet {
|
|
5418
|
-
|
|
5382
|
+
/** The quoted account's display name. */
|
|
5383
|
+
name: string;
|
|
5384
|
+
/** The quoted account's @handle. */
|
|
5385
|
+
username?: string | null;
|
|
5386
|
+
/** The quoted account's avatar URL. */
|
|
5387
|
+
avatar_url?: string | null;
|
|
5419
5388
|
body?: string;
|
|
5420
|
-
media?:
|
|
5389
|
+
media?: ResolvedMedia[];
|
|
5421
5390
|
}
|
|
5422
5391
|
|
|
5423
|
-
|
|
5392
|
+
/**
|
|
5393
|
+
* The single media resolver every platform preview shares. It turns a variant's
|
|
5394
|
+
* ordered media references into the `ResolvedMedia[]` a card renders — pulling
|
|
5395
|
+
* pixels from the SDK `MediaResource` ONLY (the per-platform rendition `url`),
|
|
5396
|
+
* never a local `File`/object URL.
|
|
5397
|
+
*
|
|
5398
|
+
* A variant references media by id (`media[].media_id`). Two ways the full asset
|
|
5399
|
+
* arrives, and we read whichever is present:
|
|
5400
|
+
* - **Read / enriched variant:** `media[].media` carries the full `MediaResource`
|
|
5401
|
+
* inline (the GET /v1/posts shape) — used directly.
|
|
5402
|
+
* - **Compose / draft variant:** the write variant has only ids, so the host
|
|
5403
|
+
* passes the uploaded assets as `fallback` (e.g. `useMediaUpload().ready`),
|
|
5404
|
+
* matched by `media_id`.
|
|
5405
|
+
*
|
|
5406
|
+
* Media STATE is honest, straight off the resource: an asset still uploading /
|
|
5407
|
+
* processing (or whose this-platform rendition isn't ready) resolves with
|
|
5408
|
+
* `state: 'processing'` and no `src` — the card shows the shared "Processing
|
|
5409
|
+
* media…" placeholder; a ready rendition resolves with `state: 'ready'` + its
|
|
5410
|
+
* pixel URL. Documents aren't previewable and are dropped.
|
|
5411
|
+
*/
|
|
5412
|
+
/** One variant's media reference — the WRITE (compose, id-only) OR the READ
|
|
5413
|
+
* (enriched, carries the full asset inline) shape. Both are derived from the SDK
|
|
5414
|
+
* variant unions, never re-declared. The write member is `media_id`-only; the
|
|
5415
|
+
* read member adds `media`/`position`. */
|
|
5416
|
+
type VariantMediaRef = NonNullable<PostVariantInput['media']>[number] | NonNullable<PostVariant['media']>[number];
|
|
5417
|
+
/**
|
|
5418
|
+
* Resolve a variant's media to renderable items for ONE platform target.
|
|
5419
|
+
*
|
|
5420
|
+
* @param refs the variant's `media` array (write or read shape)
|
|
5421
|
+
* @param target the media render target for this platform (`x`, `linkedin`,
|
|
5422
|
+
* `instagram`, `tiktok`, `facebook_page`)
|
|
5423
|
+
* @param fallback uploaded assets to resolve compose-time ids against (the read
|
|
5424
|
+
* variant carries its own enriched assets, so this is optional)
|
|
5425
|
+
*/
|
|
5426
|
+
declare function resolveVariantMedia(refs: readonly VariantMediaRef[] | undefined, target: MediaTarget, fallback?: readonly MediaResource[]): ResolvedMedia[];
|
|
5424
5427
|
|
|
5425
5428
|
interface XPostPreviewProps {
|
|
5426
5429
|
/** The X variant — either a compose-time write variant or a fetched read
|
|
5427
|
-
* variant
|
|
5430
|
+
* variant. A read variant carries its media assets inline; for a compose
|
|
5431
|
+
* variant, pass the uploaded assets via `media`. */
|
|
5428
5432
|
variant: XPreviewVariant;
|
|
5429
|
-
/**
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
media
|
|
5433
|
+
/** The posting account — the SDK `Connection`. The header derives the name,
|
|
5434
|
+
* @handle, and avatar from it. */
|
|
5435
|
+
connection: PreviewConnection;
|
|
5436
|
+
/** Uploaded assets to resolve a compose variant's media ids against (e.g.
|
|
5437
|
+
* `useMediaUpload().ready`). A read variant carries its own assets inline, so
|
|
5438
|
+
* this is only needed for a compose-time draft. */
|
|
5439
|
+
media?: readonly MediaResource[];
|
|
5440
|
+
/** Show the X verified badge — our API doesn't store it, so you supply it. */
|
|
5441
|
+
verified?: boolean;
|
|
5433
5442
|
/** Content for the quoted card when `settings.quote_tweet_id` is set. */
|
|
5434
5443
|
quotedTweet?: XPreviewQuotedTweet;
|
|
5435
5444
|
/** The replied-to account's handle (our schema only stores the parent id). */
|
|
5436
5445
|
replyToHandle?: string;
|
|
5437
|
-
/** Color scheme. `auto` (default) follows the OS color scheme
|
|
5438
|
-
* the same resolution every Postrun preview card uses. */
|
|
5446
|
+
/** Color scheme. `auto` (default) follows the OS color scheme. */
|
|
5439
5447
|
theme?: 'light' | 'dark' | 'auto';
|
|
5440
5448
|
/** Show the static action row (icons, no counts). Default true. */
|
|
5441
5449
|
showActions?: boolean;
|
|
5442
5450
|
/** Class applied to the wrapper — your hook for sizing, shadows, etc. */
|
|
5443
5451
|
className?: string;
|
|
5444
|
-
/** Inline styles on the wrapper — e.g. react-tweet CSS variables
|
|
5445
|
-
* (`{ ['--tweet-container-margin']: '0' }`). */
|
|
5452
|
+
/** Inline styles on the wrapper — e.g. react-tweet CSS variables. */
|
|
5446
5453
|
style?: CSSProperties;
|
|
5447
5454
|
/** Override react-tweet's internal pieces (e.g. `next/image` avatars). */
|
|
5448
5455
|
components?: TwitterComponents;
|
|
5449
5456
|
}
|
|
5450
5457
|
/**
|
|
5451
5458
|
* A faithful, pixel-accurate preview of how an X post will look once published,
|
|
5452
|
-
* rendered straight from a Postrun X variant
|
|
5453
|
-
* card X
|
|
5454
|
-
*
|
|
5455
|
-
*
|
|
5459
|
+
* rendered straight from a Postrun X variant + the posting `Connection`. Built on
|
|
5460
|
+
* `react-tweet` (the same card X ships): pass the schema, render the preview.
|
|
5461
|
+
* Media pixels come from the resolved per-platform renditions — a still-processing
|
|
5462
|
+
* asset shows the shared "Processing media…" tile instead of a fake image.
|
|
5456
5463
|
*/
|
|
5457
|
-
declare function XPostPreviewImpl({ variant,
|
|
5458
|
-
/** Memoized: re-renders only when its props change
|
|
5459
|
-
* already absorbs unstable media arrays). */
|
|
5464
|
+
declare function XPostPreviewImpl({ variant, connection, media, verified, quotedTweet, replyToHandle, theme, showActions, className, style, components: componentsProp, }: XPostPreviewProps): react.JSX.Element;
|
|
5465
|
+
/** Memoized: re-renders only when its props change. */
|
|
5460
5466
|
declare const XPostPreview: react.MemoExoticComponent<typeof XPostPreviewImpl>;
|
|
5461
5467
|
|
|
5462
5468
|
/**
|
|
@@ -5484,26 +5490,31 @@ type LinkedInTheme = 'light' | 'dark' | 'auto';
|
|
|
5484
5490
|
|
|
5485
5491
|
/**
|
|
5486
5492
|
* A faithful, schema-driven preview of how a LinkedIn post will look in-feed,
|
|
5487
|
-
* rendered straight from a Postrun LinkedIn variant
|
|
5488
|
-
*
|
|
5489
|
-
*
|
|
5490
|
-
*
|
|
5493
|
+
* rendered straight from a Postrun LinkedIn variant + the posting `Connection`.
|
|
5494
|
+
* Clean-room components mirroring the real feed card: header with headline +
|
|
5495
|
+
* audience icon, an entity-highlighted body with the "…more" fold, the
|
|
5496
|
+
* 1/2/3/4/+N image mosaic (or a video), and a static action bar.
|
|
5491
5497
|
*
|
|
5492
5498
|
* Renders every `content_kind`: text, single/multi image, video, plus the rich
|
|
5493
5499
|
* units — article share card, poll, and document — each driven from
|
|
5494
|
-
* `settings.{article,poll,document}
|
|
5495
|
-
*
|
|
5496
|
-
*
|
|
5497
|
-
* the `--pr-li-*` CSS variables the card reads.
|
|
5500
|
+
* `settings.{article,poll,document}`. Media pixels come from the resolved
|
|
5501
|
+
* per-platform renditions; a still-processing asset shows the shared
|
|
5502
|
+
* "Processing media…" tile.
|
|
5498
5503
|
*/
|
|
5499
5504
|
interface LinkedInPostPreviewProps {
|
|
5500
|
-
/** The LinkedIn variant —
|
|
5501
|
-
*
|
|
5505
|
+
/** The LinkedIn variant — compose-time write OR fetched read (carries assets
|
|
5506
|
+
* inline). */
|
|
5502
5507
|
variant: LinkedInPreviewVariant;
|
|
5503
|
-
/**
|
|
5504
|
-
|
|
5505
|
-
/**
|
|
5506
|
-
|
|
5508
|
+
/** The posting account — the SDK `Connection`. Name/avatar derive from it. */
|
|
5509
|
+
connection: PreviewConnection;
|
|
5510
|
+
/** Uploaded assets to resolve a compose variant's media ids against (e.g.
|
|
5511
|
+
* `useMediaUpload().ready`); a read variant carries its own inline. */
|
|
5512
|
+
media?: readonly MediaResource[];
|
|
5513
|
+
/** One-line headline under the name — our API doesn't store it, so you supply
|
|
5514
|
+
* it. */
|
|
5515
|
+
headline?: string;
|
|
5516
|
+
/** Show the verified badge — our API doesn't store it, so you supply it. */
|
|
5517
|
+
verified?: boolean;
|
|
5507
5518
|
/** Color scheme. `auto` (default) follows the OS preference. */
|
|
5508
5519
|
theme?: LinkedInTheme;
|
|
5509
5520
|
/** Relative time label shown in the header. Default "Now". */
|
|
@@ -5515,9 +5526,8 @@ interface LinkedInPostPreviewProps {
|
|
|
5515
5526
|
/** Inline styles on the card — including `--pr-li-*` variable overrides. */
|
|
5516
5527
|
style?: CSSProperties;
|
|
5517
5528
|
}
|
|
5518
|
-
declare function LinkedInPostPreviewImpl({ variant,
|
|
5519
|
-
/** Memoized: re-renders only when its props change
|
|
5520
|
-
* absorbs unstable media arrays). */
|
|
5529
|
+
declare function LinkedInPostPreviewImpl({ variant, connection, media, headline, verified, theme, time, showActions, className, style, }: LinkedInPostPreviewProps): react.JSX.Element;
|
|
5530
|
+
/** Memoized: re-renders only when its props change. */
|
|
5521
5531
|
declare const LinkedInPostPreview: react.MemoExoticComponent<typeof LinkedInPostPreviewImpl>;
|
|
5522
5532
|
|
|
5523
5533
|
/**
|
|
@@ -5532,7 +5542,7 @@ type LinkedInArticle = NonNullable<NonNullable<LinkedInPostVariant['settings']>[
|
|
|
5532
5542
|
interface ArticleCardProps {
|
|
5533
5543
|
article: LinkedInArticle;
|
|
5534
5544
|
/** Resolved thumbnail pixels (from `article.thumbnail_media_id`), if any. */
|
|
5535
|
-
thumbnail?:
|
|
5545
|
+
thumbnail?: ReadyMedia;
|
|
5536
5546
|
}
|
|
5537
5547
|
declare function ArticleCard({ article, thumbnail }: ArticleCardProps): react.JSX.Element;
|
|
5538
5548
|
|
|
@@ -5561,7 +5571,7 @@ type LinkedInDocument = NonNullable<NonNullable<LinkedInPostVariant['settings']>
|
|
|
5561
5571
|
interface DocumentCardProps {
|
|
5562
5572
|
document: LinkedInDocument;
|
|
5563
5573
|
/** Resolved first-page pixels (from the document asset on media[]), if any. */
|
|
5564
|
-
cover?:
|
|
5574
|
+
cover?: ReadyMedia;
|
|
5565
5575
|
}
|
|
5566
5576
|
declare function DocumentCard({ document, cover }: DocumentCardProps): react.JSX.Element;
|
|
5567
5577
|
|
|
@@ -5579,36 +5589,45 @@ type InstagramTheme = 'light' | 'dark' | 'auto';
|
|
|
5579
5589
|
|
|
5580
5590
|
/**
|
|
5581
5591
|
* A faithful, schema-driven preview of how an Instagram post will look, rendered
|
|
5582
|
-
* straight from a Postrun Instagram variant
|
|
5583
|
-
*
|
|
5584
|
-
*
|
|
5585
|
-
*
|
|
5586
|
-
*
|
|
5587
|
-
*
|
|
5588
|
-
* Clean-room (there's no package to "buy" — Instagram's embed only renders
|
|
5589
|
-
* already-published posts), referencing the real IG feed + Postiz.
|
|
5592
|
+
* straight from a Postrun Instagram variant + the posting `Connection`. Covers a
|
|
5593
|
+
* **feed** post (single image / carousel) and a **reel** (9:16 video). Identity
|
|
5594
|
+
* (`username`/`avatar_url`) derives from the connection; `verified` is a caller
|
|
5595
|
+
* extra. Media pixels come from the resolved per-platform renditions; a
|
|
5596
|
+
* still-processing asset shows the shared "Processing media…" tile. Feed themes
|
|
5597
|
+
* light/dark/`auto`; the reel is always dark.
|
|
5590
5598
|
*/
|
|
5591
5599
|
interface InstagramPostPreviewProps {
|
|
5592
|
-
/** The Instagram variant —
|
|
5593
|
-
*
|
|
5600
|
+
/** The Instagram variant — compose-time write OR fetched read (carries assets
|
|
5601
|
+
* inline). */
|
|
5594
5602
|
variant: InstagramPreviewVariant;
|
|
5595
|
-
/**
|
|
5596
|
-
|
|
5597
|
-
/**
|
|
5598
|
-
|
|
5603
|
+
/** The posting account — the SDK `Connection`. Username/avatar derive from it. */
|
|
5604
|
+
connection: PreviewConnection;
|
|
5605
|
+
/** Uploaded assets to resolve a compose variant's media ids against (e.g.
|
|
5606
|
+
* `useMediaUpload().ready`); a read variant carries its own inline. */
|
|
5607
|
+
media?: readonly MediaResource[];
|
|
5608
|
+
/** Show the verified seal — our API doesn't store it, so you supply it. */
|
|
5609
|
+
verified?: boolean;
|
|
5599
5610
|
/** Color scheme for the feed card. `auto` (default) follows the OS. */
|
|
5600
5611
|
theme?: InstagramTheme;
|
|
5601
5612
|
className?: string;
|
|
5602
5613
|
style?: CSSProperties;
|
|
5603
5614
|
}
|
|
5604
|
-
declare function InstagramPostPreviewImpl({ variant,
|
|
5605
|
-
/** Memoized
|
|
5615
|
+
declare function InstagramPostPreviewImpl({ variant, connection, media, verified, theme, className, style, }: InstagramPostPreviewProps): react.JSX.Element;
|
|
5616
|
+
/** Memoized. */
|
|
5606
5617
|
declare const InstagramPostPreview: react.MemoExoticComponent<typeof InstagramPostPreviewImpl>;
|
|
5607
5618
|
|
|
5619
|
+
/** The Instagram header's identity view-model — `username`/`avatar_url` derive
|
|
5620
|
+
* from the connection; `verified` is caller-supplied (not stored on ours). */
|
|
5621
|
+
interface InstagramAuthor {
|
|
5622
|
+
username?: string | null;
|
|
5623
|
+
avatar_url?: string | null;
|
|
5624
|
+
verified?: boolean;
|
|
5625
|
+
}
|
|
5626
|
+
|
|
5608
5627
|
interface ReelPreviewProps {
|
|
5609
|
-
author:
|
|
5628
|
+
author: InstagramAuthor;
|
|
5610
5629
|
body: string;
|
|
5611
|
-
media: readonly
|
|
5630
|
+
media: readonly ReadyMedia[];
|
|
5612
5631
|
/** Media is referenced but its pixels aren't resolved yet (still processing). */
|
|
5613
5632
|
pending?: boolean;
|
|
5614
5633
|
/** The reel's audio label (`settings.audio_name`); defaults to "Original audio". */
|
|
@@ -5638,10 +5657,12 @@ interface TikTokPostPreviewProps {
|
|
|
5638
5657
|
/** The TikTok variant — either a compose-time write variant or a fetched read
|
|
5639
5658
|
* variant (both carry the typed settings/body the card renders). */
|
|
5640
5659
|
variant: TikTokPreviewVariant;
|
|
5641
|
-
/** Live creator info (nickname/avatar, audience options, interaction flags)
|
|
5660
|
+
/** Live creator info (nickname/avatar, audience options, interaction flags) —
|
|
5661
|
+
* TikTok's Required-UX makes this the authoritative creator identity. */
|
|
5642
5662
|
creatorInfo: TikTokCreatorInfo;
|
|
5643
|
-
/**
|
|
5644
|
-
|
|
5663
|
+
/** Uploaded assets to resolve a compose variant's media ids against (e.g.
|
|
5664
|
+
* `useMediaUpload().ready`); a read variant carries its own inline. */
|
|
5665
|
+
media?: readonly MediaResource[];
|
|
5645
5666
|
/** Class applied to the phone frame — your hook for sizing. */
|
|
5646
5667
|
className?: string;
|
|
5647
5668
|
/** Inline styles on the frame. */
|
|
@@ -5759,4 +5780,4 @@ declare function Declaration({ brandedContent }: {
|
|
|
5759
5780
|
brandedContent: boolean;
|
|
5760
5781
|
}): react.JSX.Element;
|
|
5761
5782
|
|
|
5762
|
-
export { ArticleCard, type ArticleCardProps, AudienceSelect, type CalendarFilters, CommercialDisclosure, Connect, type ConnectErrorReason, type ConnectOutcome, type ConnectProps, type ConnectRenderApi, type ConnectState, type
|
|
5783
|
+
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 InstagramPreviewVariant, type InstagramTheme, InteractionToggles, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewVariant, type LiveOptions, type MediaUploadItem, type MediaUploadOptions, type MediaUploadStatus, Poll, type PollProps, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewConnection, type PreviewMediaKind, type ReadPostVariant, type ReadyMedia, ReelPreview, type ReelPreviewProps, type ResolvedMedia, TikTokCaptionField, type TikTokCaptionFieldProps, TikTokPostPreview, type TikTokPostPreviewProps, type TikTokPreviewVariant, TikTokPublishPanel, type TikTokPublishPanelProps, type TikTokTheme, type UseConnectParams, type UseConnectResult, type UseMediaUploadOptions, type UseMediaUploadResult, XPoll, type XPollProps, XPostPreview, type XPostPreviewProps, type XPreviewQuotedTweet, type XPreviewVariant, connectionKeys, isReadyMedia, mediaKeys, postKeys, profileKeys, resolveVariantMedia, 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 };
|