@postrun/react 2.15.0 → 2.16.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 +1 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2941,9 +2941,9 @@ interface XPreviewQuotedTweet {
|
|
|
2941
2941
|
* pixel URL. Documents aren't previewable and are dropped.
|
|
2942
2942
|
*/
|
|
2943
2943
|
/** One variant's media reference — the WRITE (compose, id-only) OR the READ
|
|
2944
|
-
* (enriched, carries the full
|
|
2945
|
-
* variant unions, never re-declared. The
|
|
2946
|
-
*
|
|
2944
|
+
* (enriched, carries the full `MediaResource` inline) shape. Both are derived
|
|
2945
|
+
* from the SDK variant unions, never re-declared. The read member's inline asset
|
|
2946
|
+
* IS the shared `Media` component (same type as `MediaResource`), so no bridge. */
|
|
2947
2947
|
type VariantMediaRef = NonNullable<PostVariantInput['media']>[number] | NonNullable<PostVariant['media']>[number];
|
|
2948
2948
|
/**
|
|
2949
2949
|
* Resolve a variant's media to renderable items for ONE platform target.
|
package/dist/index.d.ts
CHANGED
|
@@ -2941,9 +2941,9 @@ interface XPreviewQuotedTweet {
|
|
|
2941
2941
|
* pixel URL. Documents aren't previewable and are dropped.
|
|
2942
2942
|
*/
|
|
2943
2943
|
/** One variant's media reference — the WRITE (compose, id-only) OR the READ
|
|
2944
|
-
* (enriched, carries the full
|
|
2945
|
-
* variant unions, never re-declared. The
|
|
2946
|
-
*
|
|
2944
|
+
* (enriched, carries the full `MediaResource` inline) shape. Both are derived
|
|
2945
|
+
* from the SDK variant unions, never re-declared. The read member's inline asset
|
|
2946
|
+
* IS the shared `Media` component (same type as `MediaResource`), so no bridge. */
|
|
2947
2947
|
type VariantMediaRef = NonNullable<PostVariantInput['media']>[number] | NonNullable<PostVariant['media']>[number];
|
|
2948
2948
|
/**
|
|
2949
2949
|
* Resolve a variant's media to renderable items for ONE platform target.
|
package/dist/index.js
CHANGED
|
@@ -930,9 +930,6 @@ function resourceFor(ref, fallback) {
|
|
|
930
930
|
}
|
|
931
931
|
return fallback?.find((asset) => asset.id === ref.media_id);
|
|
932
932
|
}
|
|
933
|
-
function renditionFor(asset, target) {
|
|
934
|
-
return asset.per_platform[target];
|
|
935
|
-
}
|
|
936
933
|
function resolveVariantMedia(refs, target, fallback) {
|
|
937
934
|
return (refs ?? []).flatMap((ref) => {
|
|
938
935
|
const asset = resourceFor(ref, fallback);
|
|
@@ -946,7 +943,7 @@ function resolveVariantMedia(refs, target, fallback) {
|
|
|
946
943
|
const alt = ref.alt_text_override ?? asset.alt_text ?? void 0;
|
|
947
944
|
const width = asset.source?.width ?? void 0;
|
|
948
945
|
const height = asset.source?.height ?? void 0;
|
|
949
|
-
const rendition =
|
|
946
|
+
const rendition = asset.per_platform[target];
|
|
950
947
|
if (asset.status === "ready" && rendition?.status === "ready" && rendition.url) {
|
|
951
948
|
return [
|
|
952
949
|
{
|