@postrun/react 2.25.0 → 3.0.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.js CHANGED
@@ -2093,7 +2093,7 @@ function LinkedInPostPreviewImpl({
2093
2093
  ...style
2094
2094
  };
2095
2095
  const hasContent = Boolean(variant.body) || resolved.length > 0 || Boolean(
2096
- variant.settings?.content_kind && variant.settings.content_kind !== "text"
2096
+ variant.settings?.article || variant.settings?.poll || variant.settings?.document
2097
2097
  );
2098
2098
  return /* @__PURE__ */ jsxs("div", { className, style: cardStyle5, children: [
2099
2099
  /* @__PURE__ */ jsx(
@@ -2125,15 +2125,14 @@ var emptyBodyStyle2 = {
2125
2125
  };
2126
2126
  function renderContent(variant, media, pending) {
2127
2127
  const settings = variant.settings;
2128
- const kind = settings?.content_kind;
2129
2128
  const [firstMedia] = media;
2130
- if (kind === "article" && settings?.article) {
2129
+ if (settings?.article) {
2131
2130
  return /* @__PURE__ */ jsx("div", { style: INSET, children: /* @__PURE__ */ jsx(ArticleCard, { article: settings.article, thumbnail: firstMedia }) });
2132
2131
  }
2133
- if (kind === "poll" && settings?.poll) {
2132
+ if (settings?.poll) {
2134
2133
  return /* @__PURE__ */ jsx("div", { style: INSET, children: /* @__PURE__ */ jsx(Poll, { poll: settings.poll }) });
2135
2134
  }
2136
- if (kind === "document" && settings?.document) {
2135
+ if (settings?.document) {
2137
2136
  return /* @__PURE__ */ jsx("div", { style: INSET, children: /* @__PURE__ */ jsx(DocumentCard, { document: settings.document, cover: firstMedia }) });
2138
2137
  }
2139
2138
  if (media.length > 0) {
@@ -2613,7 +2612,7 @@ function InstagramPostPreviewImpl({
2613
2612
  [connection, verified]
2614
2613
  );
2615
2614
  const settings = variant.settings;
2616
- const isReel = variant.post_type === "reel";
2615
+ const isReel = resolved.length === 1 && resolved[0]?.kind === "video";
2617
2616
  if (isReel) {
2618
2617
  return /* @__PURE__ */ jsx(
2619
2618
  ReelPreview,
@@ -3410,6 +3409,7 @@ function mediaCountValid(postType, count) {
3410
3409
  }
3411
3410
  function TikTokPublishPanel({
3412
3411
  variant,
3412
+ postType,
3413
3413
  creatorInfo,
3414
3414
  caption,
3415
3415
  onCaptionChange,
@@ -3421,9 +3421,9 @@ function TikTokPublishPanel({
3421
3421
  className,
3422
3422
  style
3423
3423
  }) {
3424
- const isVideo = variant.post_type === "video";
3425
- const captionOver = caption.length > captionMaxFor(variant.post_type);
3426
- const mediaOk = mediaCountValid(variant.post_type, variant.media?.length ?? 0);
3424
+ const isVideo = postType === "video";
3425
+ const captionOver = caption.length > captionMaxFor(postType);
3426
+ const mediaOk = mediaCountValid(postType, variant.media?.length ?? 0);
3427
3427
  const ready = !captionOver && mediaOk && tiktokOptionsReady(options);
3428
3428
  return /* @__PURE__ */ jsxs(
3429
3429
  "div",
@@ -3442,7 +3442,7 @@ function TikTokPublishPanel({
3442
3442
  {
3443
3443
  value: caption,
3444
3444
  onChange: onCaptionChange,
3445
- postType: variant.post_type
3445
+ postType
3446
3446
  }
3447
3447
  ),
3448
3448
  /* @__PURE__ */ jsx(Divider, {}),