@opensite/ui 3.9.0 → 3.11.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/instagram-post-grid.cjs +789 -0
- package/dist/instagram-post-grid.d.cts +197 -0
- package/dist/instagram-post-grid.d.ts +197 -0
- package/dist/instagram-post-grid.js +768 -0
- package/dist/registry.cjs +456 -1
- package/dist/registry.d.cts +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/registry.js +456 -1
- package/dist/social-link-icon.d.cts +1 -1
- package/dist/social-link-icon.d.ts +1 -1
- package/package.json +7 -1
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { S as SectionBackground, s as SectionSpacing, t as PatternName } from './community-initiatives-Cgd-IXlI.cjs';
|
|
3
|
+
import { O as OptixFlowConfig } from './blocks-DyouPohq.cjs';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
import '@page-speed/pressable';
|
|
7
|
+
import '@opensite/hooks/usePlatformFromUrl';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A single Instagram post rendered as a grid tile.
|
|
11
|
+
*
|
|
12
|
+
* Mirrors the wire shape hydrated from the toastability Instagram feed
|
|
13
|
+
* (`PublicFeeds::InstagramPostSerializer`). Media URLs MUST be the re-hosted
|
|
14
|
+
* MediaRecord CDN URLs — never expiring Instagram CDN URLs.
|
|
15
|
+
*/
|
|
16
|
+
interface InstagramPostItem {
|
|
17
|
+
/**
|
|
18
|
+
* Unique identifier for the post
|
|
19
|
+
*/
|
|
20
|
+
id: string;
|
|
21
|
+
/**
|
|
22
|
+
* External Instagram permalink (opens instagram.com in a new tab)
|
|
23
|
+
*/
|
|
24
|
+
href: string;
|
|
25
|
+
/**
|
|
26
|
+
* Image / poster source URL (required — items without it are skipped)
|
|
27
|
+
*/
|
|
28
|
+
image: string;
|
|
29
|
+
/**
|
|
30
|
+
* Alt text for the image (falls back to "Instagram post")
|
|
31
|
+
*/
|
|
32
|
+
imageAlt?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Post caption (truncated for display).
|
|
35
|
+
*
|
|
36
|
+
* NOTE: For immersive rendering the caption must be a **string** — the
|
|
37
|
+
* library's `MediaItem.title`/`caption` are string-typed, so a caption is
|
|
38
|
+
* flowed through as text. A rich `ReactNode` caption (hand-authored markup,
|
|
39
|
+
* only ever used by the legacy pre-immersive block) cannot be threaded into
|
|
40
|
+
* the immersive card/viewer; when supplied it is dropped and the tile/viewer
|
|
41
|
+
* title falls back to `imageAlt` (then `"Instagram post"`). Hydrated feeds
|
|
42
|
+
* always send plain strings, so this only affects hand-authored usage.
|
|
43
|
+
*/
|
|
44
|
+
caption?: React.ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* Whether this post is a video/reel
|
|
47
|
+
*/
|
|
48
|
+
isVideo?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Video source URL (only used when `isVideo` is true)
|
|
51
|
+
*/
|
|
52
|
+
videoUrl?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Formatted post date
|
|
55
|
+
*/
|
|
56
|
+
date?: React.ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Number of likes (badge is only rendered when present)
|
|
59
|
+
*/
|
|
60
|
+
likeCount?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Number of comments (badge is only rendered when present)
|
|
63
|
+
*/
|
|
64
|
+
commentCount?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Number of views (badge is only rendered when present)
|
|
67
|
+
*/
|
|
68
|
+
viewCount?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Additional CSS classes for the tile
|
|
71
|
+
*/
|
|
72
|
+
className?: string;
|
|
73
|
+
}
|
|
74
|
+
interface InstagramPostGridProps {
|
|
75
|
+
/**
|
|
76
|
+
* Main heading content
|
|
77
|
+
*/
|
|
78
|
+
heading?: React.ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* Subheading/intro content below the heading
|
|
81
|
+
*/
|
|
82
|
+
subheading?: React.ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* Array of Instagram posts to display
|
|
85
|
+
*/
|
|
86
|
+
items?: InstagramPostItem[];
|
|
87
|
+
/**
|
|
88
|
+
* Custom slot for rendering items (overrides items array)
|
|
89
|
+
*/
|
|
90
|
+
itemsSlot?: React.ReactNode;
|
|
91
|
+
/**
|
|
92
|
+
* Additional CSS classes for the section
|
|
93
|
+
*/
|
|
94
|
+
className?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Additional CSS classes for the container
|
|
97
|
+
*/
|
|
98
|
+
containerClassName?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Additional CSS classes for the header container
|
|
101
|
+
*/
|
|
102
|
+
headerClassName?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Additional CSS classes for the heading
|
|
105
|
+
*/
|
|
106
|
+
headingClassName?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Additional CSS classes for the subheading
|
|
109
|
+
*/
|
|
110
|
+
subheadingClassName?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Additional CSS classes for the grid container
|
|
113
|
+
*/
|
|
114
|
+
gridClassName?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Additional CSS classes for each tile
|
|
117
|
+
*/
|
|
118
|
+
itemClassName?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Additional CSS classes for each media element
|
|
121
|
+
*/
|
|
122
|
+
imageClassName?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Background style for the section
|
|
125
|
+
*/
|
|
126
|
+
background?: SectionBackground;
|
|
127
|
+
/**
|
|
128
|
+
* Vertical spacing for the section
|
|
129
|
+
*/
|
|
130
|
+
spacing?: SectionSpacing;
|
|
131
|
+
/**
|
|
132
|
+
* Optional background pattern name or URL
|
|
133
|
+
*/
|
|
134
|
+
pattern?: PatternName | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Pattern overlay opacity (0-1)
|
|
137
|
+
*/
|
|
138
|
+
patternOpacity?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Additional CSS classes for the pattern overlay
|
|
141
|
+
*/
|
|
142
|
+
patternClassName?: string;
|
|
143
|
+
/**
|
|
144
|
+
* OptixFlow image optimization configuration
|
|
145
|
+
*/
|
|
146
|
+
optixFlowConfig?: OptixFlowConfig;
|
|
147
|
+
/** Optional Section ID */
|
|
148
|
+
sectionId?: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* InstagramPostGrid displays a website's Instagram feed as a responsive grid of
|
|
152
|
+
* vertical (9:16) tiles that open a fullscreen, swipeable immersive viewer.
|
|
153
|
+
*
|
|
154
|
+
* Composition is powered by `@page-speed/media-immersive`: each post maps to a
|
|
155
|
+
* `MediaItem` (photos are first-class images, reels are videos), tiles are
|
|
156
|
+
* `ThumbnailCard`s, and tapping one opens `ImmersiveViewer` — a TikTok/Reels-
|
|
157
|
+
* style pager. Per the annotated design, each tile shows a like-count pill
|
|
158
|
+
* top-left (only when a numeric like count exists — never fabricated), no
|
|
159
|
+
* duration timestamp, and a center glyph on hover only (a play triangle for
|
|
160
|
+
* reels, an expand icon for photos). The fullscreen viewer carries the caption
|
|
161
|
+
* plus a read-only engagement rail (likes/comments/views) and an explicit
|
|
162
|
+
* "Open in Instagram" egress rendered as a real `<a target="_blank"
|
|
163
|
+
* rel="noopener noreferrer">` (a crawlable, affordance-correct link — not a
|
|
164
|
+
* scripted `window.open` button); the old whole-tile link-out is REPLACED by
|
|
165
|
+
* opening the viewer, with the permalink egress living in the viewer.
|
|
166
|
+
*
|
|
167
|
+
* Consumer image concerns are honored: `imageClassName` and `optixFlowConfig`
|
|
168
|
+
* are forwarded onto each tile's poster image via the library's
|
|
169
|
+
* `posterImgProps` passthrough.
|
|
170
|
+
*
|
|
171
|
+
* Captions should be plain strings when used with immersive rendering; a rich
|
|
172
|
+
* `ReactNode` caption falls back to `imageAlt` (see the `caption` field doc).
|
|
173
|
+
*
|
|
174
|
+
* Posts without an image are skipped; an empty or missing `items` array renders
|
|
175
|
+
* nothing. Data is hydrated from the toastability Instagram feed — media URLs
|
|
176
|
+
* are the re-hosted MediaRecord CDN URLs, never expiring Instagram CDN URLs.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```tsx
|
|
180
|
+
* <InstagramPostGrid
|
|
181
|
+
* heading="Follow us on Instagram"
|
|
182
|
+
* items={[
|
|
183
|
+
* {
|
|
184
|
+
* id: "1",
|
|
185
|
+
* href: "https://www.instagram.com/p/abc123/",
|
|
186
|
+
* image: "https://cdn.ing/assets/i/r/1320/instagram-1.webp",
|
|
187
|
+
* caption: "Fresh out of the oven",
|
|
188
|
+
* likeCount: 128,
|
|
189
|
+
* commentCount: 12,
|
|
190
|
+
* },
|
|
191
|
+
* ]}
|
|
192
|
+
* />
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
declare function InstagramPostGrid({ sectionId, heading, subheading, items, itemsSlot, className, containerClassName, headerClassName, headingClassName, subheadingClassName, gridClassName, itemClassName, imageClassName, optixFlowConfig, background, spacing, pattern, patternOpacity, patternClassName, }: InstagramPostGridProps): React.JSX.Element | null;
|
|
196
|
+
|
|
197
|
+
export { InstagramPostGrid, type InstagramPostGridProps, type InstagramPostItem };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { S as SectionBackground, s as SectionSpacing, t as PatternName } from './community-initiatives-Dud0DKXB.js';
|
|
3
|
+
import { O as OptixFlowConfig } from './blocks-DyouPohq.js';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
import '@page-speed/pressable';
|
|
7
|
+
import '@opensite/hooks/usePlatformFromUrl';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A single Instagram post rendered as a grid tile.
|
|
11
|
+
*
|
|
12
|
+
* Mirrors the wire shape hydrated from the toastability Instagram feed
|
|
13
|
+
* (`PublicFeeds::InstagramPostSerializer`). Media URLs MUST be the re-hosted
|
|
14
|
+
* MediaRecord CDN URLs — never expiring Instagram CDN URLs.
|
|
15
|
+
*/
|
|
16
|
+
interface InstagramPostItem {
|
|
17
|
+
/**
|
|
18
|
+
* Unique identifier for the post
|
|
19
|
+
*/
|
|
20
|
+
id: string;
|
|
21
|
+
/**
|
|
22
|
+
* External Instagram permalink (opens instagram.com in a new tab)
|
|
23
|
+
*/
|
|
24
|
+
href: string;
|
|
25
|
+
/**
|
|
26
|
+
* Image / poster source URL (required — items without it are skipped)
|
|
27
|
+
*/
|
|
28
|
+
image: string;
|
|
29
|
+
/**
|
|
30
|
+
* Alt text for the image (falls back to "Instagram post")
|
|
31
|
+
*/
|
|
32
|
+
imageAlt?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Post caption (truncated for display).
|
|
35
|
+
*
|
|
36
|
+
* NOTE: For immersive rendering the caption must be a **string** — the
|
|
37
|
+
* library's `MediaItem.title`/`caption` are string-typed, so a caption is
|
|
38
|
+
* flowed through as text. A rich `ReactNode` caption (hand-authored markup,
|
|
39
|
+
* only ever used by the legacy pre-immersive block) cannot be threaded into
|
|
40
|
+
* the immersive card/viewer; when supplied it is dropped and the tile/viewer
|
|
41
|
+
* title falls back to `imageAlt` (then `"Instagram post"`). Hydrated feeds
|
|
42
|
+
* always send plain strings, so this only affects hand-authored usage.
|
|
43
|
+
*/
|
|
44
|
+
caption?: React.ReactNode;
|
|
45
|
+
/**
|
|
46
|
+
* Whether this post is a video/reel
|
|
47
|
+
*/
|
|
48
|
+
isVideo?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Video source URL (only used when `isVideo` is true)
|
|
51
|
+
*/
|
|
52
|
+
videoUrl?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Formatted post date
|
|
55
|
+
*/
|
|
56
|
+
date?: React.ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Number of likes (badge is only rendered when present)
|
|
59
|
+
*/
|
|
60
|
+
likeCount?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Number of comments (badge is only rendered when present)
|
|
63
|
+
*/
|
|
64
|
+
commentCount?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Number of views (badge is only rendered when present)
|
|
67
|
+
*/
|
|
68
|
+
viewCount?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Additional CSS classes for the tile
|
|
71
|
+
*/
|
|
72
|
+
className?: string;
|
|
73
|
+
}
|
|
74
|
+
interface InstagramPostGridProps {
|
|
75
|
+
/**
|
|
76
|
+
* Main heading content
|
|
77
|
+
*/
|
|
78
|
+
heading?: React.ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* Subheading/intro content below the heading
|
|
81
|
+
*/
|
|
82
|
+
subheading?: React.ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* Array of Instagram posts to display
|
|
85
|
+
*/
|
|
86
|
+
items?: InstagramPostItem[];
|
|
87
|
+
/**
|
|
88
|
+
* Custom slot for rendering items (overrides items array)
|
|
89
|
+
*/
|
|
90
|
+
itemsSlot?: React.ReactNode;
|
|
91
|
+
/**
|
|
92
|
+
* Additional CSS classes for the section
|
|
93
|
+
*/
|
|
94
|
+
className?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Additional CSS classes for the container
|
|
97
|
+
*/
|
|
98
|
+
containerClassName?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Additional CSS classes for the header container
|
|
101
|
+
*/
|
|
102
|
+
headerClassName?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Additional CSS classes for the heading
|
|
105
|
+
*/
|
|
106
|
+
headingClassName?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Additional CSS classes for the subheading
|
|
109
|
+
*/
|
|
110
|
+
subheadingClassName?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Additional CSS classes for the grid container
|
|
113
|
+
*/
|
|
114
|
+
gridClassName?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Additional CSS classes for each tile
|
|
117
|
+
*/
|
|
118
|
+
itemClassName?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Additional CSS classes for each media element
|
|
121
|
+
*/
|
|
122
|
+
imageClassName?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Background style for the section
|
|
125
|
+
*/
|
|
126
|
+
background?: SectionBackground;
|
|
127
|
+
/**
|
|
128
|
+
* Vertical spacing for the section
|
|
129
|
+
*/
|
|
130
|
+
spacing?: SectionSpacing;
|
|
131
|
+
/**
|
|
132
|
+
* Optional background pattern name or URL
|
|
133
|
+
*/
|
|
134
|
+
pattern?: PatternName | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Pattern overlay opacity (0-1)
|
|
137
|
+
*/
|
|
138
|
+
patternOpacity?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Additional CSS classes for the pattern overlay
|
|
141
|
+
*/
|
|
142
|
+
patternClassName?: string;
|
|
143
|
+
/**
|
|
144
|
+
* OptixFlow image optimization configuration
|
|
145
|
+
*/
|
|
146
|
+
optixFlowConfig?: OptixFlowConfig;
|
|
147
|
+
/** Optional Section ID */
|
|
148
|
+
sectionId?: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* InstagramPostGrid displays a website's Instagram feed as a responsive grid of
|
|
152
|
+
* vertical (9:16) tiles that open a fullscreen, swipeable immersive viewer.
|
|
153
|
+
*
|
|
154
|
+
* Composition is powered by `@page-speed/media-immersive`: each post maps to a
|
|
155
|
+
* `MediaItem` (photos are first-class images, reels are videos), tiles are
|
|
156
|
+
* `ThumbnailCard`s, and tapping one opens `ImmersiveViewer` — a TikTok/Reels-
|
|
157
|
+
* style pager. Per the annotated design, each tile shows a like-count pill
|
|
158
|
+
* top-left (only when a numeric like count exists — never fabricated), no
|
|
159
|
+
* duration timestamp, and a center glyph on hover only (a play triangle for
|
|
160
|
+
* reels, an expand icon for photos). The fullscreen viewer carries the caption
|
|
161
|
+
* plus a read-only engagement rail (likes/comments/views) and an explicit
|
|
162
|
+
* "Open in Instagram" egress rendered as a real `<a target="_blank"
|
|
163
|
+
* rel="noopener noreferrer">` (a crawlable, affordance-correct link — not a
|
|
164
|
+
* scripted `window.open` button); the old whole-tile link-out is REPLACED by
|
|
165
|
+
* opening the viewer, with the permalink egress living in the viewer.
|
|
166
|
+
*
|
|
167
|
+
* Consumer image concerns are honored: `imageClassName` and `optixFlowConfig`
|
|
168
|
+
* are forwarded onto each tile's poster image via the library's
|
|
169
|
+
* `posterImgProps` passthrough.
|
|
170
|
+
*
|
|
171
|
+
* Captions should be plain strings when used with immersive rendering; a rich
|
|
172
|
+
* `ReactNode` caption falls back to `imageAlt` (see the `caption` field doc).
|
|
173
|
+
*
|
|
174
|
+
* Posts without an image are skipped; an empty or missing `items` array renders
|
|
175
|
+
* nothing. Data is hydrated from the toastability Instagram feed — media URLs
|
|
176
|
+
* are the re-hosted MediaRecord CDN URLs, never expiring Instagram CDN URLs.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```tsx
|
|
180
|
+
* <InstagramPostGrid
|
|
181
|
+
* heading="Follow us on Instagram"
|
|
182
|
+
* items={[
|
|
183
|
+
* {
|
|
184
|
+
* id: "1",
|
|
185
|
+
* href: "https://www.instagram.com/p/abc123/",
|
|
186
|
+
* image: "https://cdn.ing/assets/i/r/1320/instagram-1.webp",
|
|
187
|
+
* caption: "Fresh out of the oven",
|
|
188
|
+
* likeCount: 128,
|
|
189
|
+
* commentCount: 12,
|
|
190
|
+
* },
|
|
191
|
+
* ]}
|
|
192
|
+
* />
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
declare function InstagramPostGrid({ sectionId, heading, subheading, items, itemsSlot, className, containerClassName, headerClassName, headingClassName, subheadingClassName, gridClassName, itemClassName, imageClassName, optixFlowConfig, background, spacing, pattern, patternOpacity, patternClassName, }: InstagramPostGridProps): React.JSX.Element | null;
|
|
196
|
+
|
|
197
|
+
export { InstagramPostGrid, type InstagramPostGridProps, type InstagramPostItem };
|