@postrun/react 2.25.0 → 3.1.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 CHANGED
@@ -2120,7 +2120,7 @@ function LinkedInPostPreviewImpl({
2120
2120
  ...style
2121
2121
  };
2122
2122
  const hasContent = Boolean(variant.body) || resolved.length > 0 || Boolean(
2123
- variant.settings?.content_kind && variant.settings.content_kind !== "text"
2123
+ variant.settings?.article || variant.settings?.poll || variant.settings?.document
2124
2124
  );
2125
2125
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: cardStyle5, children: [
2126
2126
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2152,15 +2152,14 @@ var emptyBodyStyle2 = {
2152
2152
  };
2153
2153
  function renderContent(variant, media, pending) {
2154
2154
  const settings = variant.settings;
2155
- const kind = settings?.content_kind;
2156
2155
  const [firstMedia] = media;
2157
- if (kind === "article" && settings?.article) {
2156
+ if (settings?.article) {
2158
2157
  return /* @__PURE__ */ jsxRuntime.jsx("div", { style: INSET, children: /* @__PURE__ */ jsxRuntime.jsx(ArticleCard, { article: settings.article, thumbnail: firstMedia }) });
2159
2158
  }
2160
- if (kind === "poll" && settings?.poll) {
2159
+ if (settings?.poll) {
2161
2160
  return /* @__PURE__ */ jsxRuntime.jsx("div", { style: INSET, children: /* @__PURE__ */ jsxRuntime.jsx(Poll, { poll: settings.poll }) });
2162
2161
  }
2163
- if (kind === "document" && settings?.document) {
2162
+ if (settings?.document) {
2164
2163
  return /* @__PURE__ */ jsxRuntime.jsx("div", { style: INSET, children: /* @__PURE__ */ jsxRuntime.jsx(DocumentCard, { document: settings.document, cover: firstMedia }) });
2165
2164
  }
2166
2165
  if (media.length > 0) {
@@ -2640,7 +2639,7 @@ function InstagramPostPreviewImpl({
2640
2639
  [connection, verified]
2641
2640
  );
2642
2641
  const settings = variant.settings;
2643
- const isReel = variant.post_type === "reel";
2642
+ const isReel = resolved.length === 1 && resolved[0]?.kind === "video";
2644
2643
  if (isReel) {
2645
2644
  return /* @__PURE__ */ jsxRuntime.jsx(
2646
2645
  ReelPreview,
@@ -3437,6 +3436,7 @@ function mediaCountValid(postType, count) {
3437
3436
  }
3438
3437
  function TikTokPublishPanel({
3439
3438
  variant,
3439
+ postType,
3440
3440
  creatorInfo,
3441
3441
  caption,
3442
3442
  onCaptionChange,
@@ -3448,9 +3448,9 @@ function TikTokPublishPanel({
3448
3448
  className,
3449
3449
  style
3450
3450
  }) {
3451
- const isVideo = variant.post_type === "video";
3452
- const captionOver = caption.length > js.captionMaxFor(variant.post_type);
3453
- const mediaOk = mediaCountValid(variant.post_type, variant.media?.length ?? 0);
3451
+ const isVideo = postType === "video";
3452
+ const captionOver = caption.length > js.captionMaxFor(postType);
3453
+ const mediaOk = mediaCountValid(postType, variant.media?.length ?? 0);
3454
3454
  const ready = !captionOver && mediaOk && js.tiktokOptionsReady(options);
3455
3455
  return /* @__PURE__ */ jsxRuntime.jsxs(
3456
3456
  "div",
@@ -3469,7 +3469,7 @@ function TikTokPublishPanel({
3469
3469
  {
3470
3470
  value: caption,
3471
3471
  onChange: onCaptionChange,
3472
- postType: variant.post_type
3472
+ postType
3473
3473
  }
3474
3474
  ),
3475
3475
  /* @__PURE__ */ jsxRuntime.jsx(Divider, {}),