@opensite/ui 3.11.2 → 3.12.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 +131 -132
- package/dist/instagram-post-grid.d.cts +17 -1
- package/dist/instagram-post-grid.d.ts +17 -1
- package/dist/instagram-post-grid.js +131 -132
- package/dist/registry.cjs +135 -135
- package/dist/registry.js +135 -135
- package/dist/social-link-icon.d.cts +1 -1
- package/dist/social-link-icon.d.ts +1 -1
- package/package.json +1 -1
|
@@ -438,7 +438,10 @@ var CAPTION_SCRIM_STYLE = {
|
|
|
438
438
|
background: "linear-gradient(180deg, rgba(8,12,24,0) 0%, rgba(8,12,24,0.55) 45%, rgba(8,12,24,0.78) 100%)",
|
|
439
439
|
borderBottomLeftRadius: IG_TILE_RADIUS,
|
|
440
440
|
borderBottomRightRadius: IG_TILE_RADIUS,
|
|
441
|
-
pointerEvents: "none"
|
|
441
|
+
pointerEvents: "none",
|
|
442
|
+
// Hiding captions for now until we build in
|
|
443
|
+
// the dynamic behavior that clients can dictate
|
|
444
|
+
display: "none"
|
|
442
445
|
};
|
|
443
446
|
var CAPTION_TEXT_STYLE = {
|
|
444
447
|
color: "#fff",
|
|
@@ -518,7 +521,7 @@ function likeBadge(likeCount) {
|
|
|
518
521
|
letterSpacing: "0.01em"
|
|
519
522
|
},
|
|
520
523
|
children: [
|
|
521
|
-
/* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "
|
|
524
|
+
/* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "mdi/cards-heart", size: 15, "aria-hidden": "true" }),
|
|
522
525
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: likeCount.toLocaleString() })
|
|
523
526
|
]
|
|
524
527
|
}
|
|
@@ -527,157 +530,148 @@ function likeBadge(likeCount) {
|
|
|
527
530
|
var VIEWER_ACTIONS = [
|
|
528
531
|
{
|
|
529
532
|
id: "open-in-instagram",
|
|
530
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/
|
|
533
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/instagram", size: 22, "aria-hidden": "true" }),
|
|
531
534
|
label: "Instagram",
|
|
532
535
|
ariaLabel: "Open in Instagram",
|
|
533
536
|
onPress: (item) => openPermalink(item)
|
|
534
537
|
}
|
|
535
538
|
];
|
|
536
|
-
function
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
onPress
|
|
541
|
-
}) {
|
|
542
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
543
|
-
"button",
|
|
539
|
+
function InstagramViewerRail({ item }) {
|
|
540
|
+
const meta = item.meta ?? {};
|
|
541
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
542
|
+
"div",
|
|
544
543
|
{
|
|
545
|
-
type: "button",
|
|
546
|
-
"aria-label": `${count.toLocaleString()} ${label}`,
|
|
547
|
-
onClick: (e) => {
|
|
548
|
-
e.stopPropagation();
|
|
549
|
-
onPress();
|
|
550
|
-
},
|
|
551
544
|
style: {
|
|
545
|
+
position: "absolute",
|
|
546
|
+
right: 11,
|
|
547
|
+
bottom: 135,
|
|
552
548
|
display: "flex",
|
|
553
549
|
flexDirection: "column",
|
|
554
550
|
alignItems: "center",
|
|
555
|
-
gap:
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
background: "transparent",
|
|
559
|
-
color: "inherit",
|
|
560
|
-
cursor: "pointer",
|
|
561
|
-
font: "inherit"
|
|
551
|
+
gap: 18,
|
|
552
|
+
color: "var(--psmi-chrome-fg, #fff)",
|
|
553
|
+
zIndex: 3
|
|
562
554
|
},
|
|
563
|
-
children:
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
555
|
+
children: meta.href ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
556
|
+
"a",
|
|
557
|
+
{
|
|
558
|
+
href: meta.href,
|
|
559
|
+
target: "_blank",
|
|
560
|
+
rel: "noopener noreferrer",
|
|
561
|
+
"aria-label": "Open in Instagram",
|
|
562
|
+
onClick: (e) => e.stopPropagation(),
|
|
563
|
+
style: {
|
|
564
|
+
display: "flex",
|
|
565
|
+
flexDirection: "column",
|
|
566
|
+
alignItems: "center",
|
|
567
|
+
padding: 0,
|
|
568
|
+
border: "none",
|
|
569
|
+
background: "transparent",
|
|
570
|
+
color: "inherit",
|
|
571
|
+
cursor: "pointer",
|
|
572
|
+
font: "inherit",
|
|
573
|
+
textDecoration: "none"
|
|
574
|
+
},
|
|
575
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
576
|
+
"span",
|
|
577
|
+
{
|
|
578
|
+
style: {
|
|
579
|
+
width: 46,
|
|
580
|
+
height: 46,
|
|
581
|
+
borderRadius: "50%",
|
|
582
|
+
background: "var(--psmi-chrome-bg, rgba(255,255,255,0.14))",
|
|
583
|
+
backdropFilter: "blur(6px)",
|
|
584
|
+
WebkitBackdropFilter: "blur(6px)",
|
|
585
|
+
display: "flex",
|
|
586
|
+
alignItems: "center",
|
|
587
|
+
justifyContent: "center"
|
|
588
|
+
},
|
|
589
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
590
|
+
DynamicIcon,
|
|
591
|
+
{
|
|
592
|
+
name: "lucide/instagram",
|
|
593
|
+
size: 22,
|
|
594
|
+
"aria-hidden": "true"
|
|
595
|
+
}
|
|
596
|
+
)
|
|
597
|
+
}
|
|
598
|
+
)
|
|
599
|
+
}
|
|
600
|
+
) : null
|
|
583
601
|
}
|
|
584
602
|
);
|
|
585
603
|
}
|
|
586
|
-
function
|
|
587
|
-
|
|
588
|
-
|
|
604
|
+
function profileUrl(username) {
|
|
605
|
+
return `https://www.instagram.com/${username.replace(/^@+/, "")}/`;
|
|
606
|
+
}
|
|
607
|
+
var USERNAME_BADGE_STYLE = {
|
|
608
|
+
display: "inline-flex",
|
|
609
|
+
alignItems: "center",
|
|
610
|
+
gap: 7,
|
|
611
|
+
marginBottom: 10,
|
|
612
|
+
padding: "7px 12px",
|
|
613
|
+
borderRadius: 999,
|
|
614
|
+
background: "var(--psmi-chrome-bg, rgba(255,255,255,0.16))",
|
|
615
|
+
backdropFilter: "blur(8px)",
|
|
616
|
+
WebkitBackdropFilter: "blur(8px)",
|
|
617
|
+
border: "1px solid rgba(255, 255, 255, 0.18)",
|
|
618
|
+
color: "inherit",
|
|
619
|
+
fontSize: 13,
|
|
620
|
+
fontWeight: 700,
|
|
621
|
+
lineHeight: 1,
|
|
622
|
+
letterSpacing: "0.01em",
|
|
623
|
+
textDecoration: "none",
|
|
624
|
+
pointerEvents: "auto"
|
|
625
|
+
};
|
|
626
|
+
var VIEWER_TITLE_STYLE = {
|
|
627
|
+
fontSize: 16,
|
|
628
|
+
fontWeight: 700,
|
|
629
|
+
lineHeight: 1.35,
|
|
630
|
+
textShadow: "0 1px 2px rgba(0, 0, 0, 0.4)",
|
|
631
|
+
display: "-webkit-box",
|
|
632
|
+
WebkitLineClamp: 2,
|
|
633
|
+
WebkitBoxOrient: "vertical",
|
|
634
|
+
overflow: "hidden"
|
|
635
|
+
};
|
|
636
|
+
function InstagramViewerCaption({
|
|
637
|
+
item,
|
|
638
|
+
username
|
|
639
|
+
}) {
|
|
640
|
+
const handle = username?.replace(/^@+/, "");
|
|
641
|
+
const badgeContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
642
|
+
/* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/instagram", size: 14, "aria-hidden": "true" }),
|
|
643
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: handle ? `@${handle}` : "Instagram" })
|
|
644
|
+
] });
|
|
589
645
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
590
646
|
"div",
|
|
591
647
|
{
|
|
592
648
|
style: {
|
|
593
649
|
position: "absolute",
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
alignItems: "center",
|
|
599
|
-
gap: 18,
|
|
650
|
+
left: 16,
|
|
651
|
+
// Mirrors the library caption card's clearance for the actions rail.
|
|
652
|
+
right: 78,
|
|
653
|
+
bottom: 34,
|
|
600
654
|
color: "var(--psmi-chrome-fg, #fff)",
|
|
601
|
-
zIndex:
|
|
655
|
+
zIndex: 2
|
|
602
656
|
},
|
|
603
657
|
children: [
|
|
604
|
-
|
|
605
|
-
RailStat,
|
|
606
|
-
{
|
|
607
|
-
iconName: "lucide/heart",
|
|
608
|
-
count: meta.likeCount,
|
|
609
|
-
label: "likes",
|
|
610
|
-
onPress: open
|
|
611
|
-
}
|
|
612
|
-
) : null,
|
|
613
|
-
typeof meta.commentCount === "number" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
614
|
-
RailStat,
|
|
615
|
-
{
|
|
616
|
-
iconName: "lucide/message-circle",
|
|
617
|
-
count: meta.commentCount,
|
|
618
|
-
label: "comments",
|
|
619
|
-
onPress: open
|
|
620
|
-
}
|
|
621
|
-
) : null,
|
|
622
|
-
typeof meta.viewCount === "number" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
623
|
-
RailStat,
|
|
624
|
-
{
|
|
625
|
-
iconName: "lucide/eye",
|
|
626
|
-
count: meta.viewCount,
|
|
627
|
-
label: "views",
|
|
628
|
-
onPress: open
|
|
629
|
-
}
|
|
630
|
-
) : null,
|
|
631
|
-
meta.href ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
658
|
+
handle ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
632
659
|
"a",
|
|
633
660
|
{
|
|
634
|
-
href:
|
|
661
|
+
href: profileUrl(handle),
|
|
635
662
|
target: "_blank",
|
|
636
663
|
rel: "noopener noreferrer",
|
|
637
|
-
"aria-label":
|
|
664
|
+
"aria-label": `Open @${handle} on Instagram`,
|
|
638
665
|
onClick: (e) => e.stopPropagation(),
|
|
639
|
-
style: {
|
|
640
|
-
|
|
641
|
-
flexDirection: "column",
|
|
642
|
-
alignItems: "center",
|
|
643
|
-
gap: 5,
|
|
644
|
-
padding: 0,
|
|
645
|
-
border: "none",
|
|
646
|
-
background: "transparent",
|
|
647
|
-
color: "inherit",
|
|
648
|
-
cursor: "pointer",
|
|
649
|
-
font: "inherit",
|
|
650
|
-
textDecoration: "none"
|
|
651
|
-
},
|
|
652
|
-
children: [
|
|
653
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
654
|
-
"span",
|
|
655
|
-
{
|
|
656
|
-
style: {
|
|
657
|
-
width: 46,
|
|
658
|
-
height: 46,
|
|
659
|
-
borderRadius: "50%",
|
|
660
|
-
background: "var(--psmi-chrome-bg, rgba(255,255,255,0.14))",
|
|
661
|
-
backdropFilter: "blur(6px)",
|
|
662
|
-
WebkitBackdropFilter: "blur(6px)",
|
|
663
|
-
display: "flex",
|
|
664
|
-
alignItems: "center",
|
|
665
|
-
justifyContent: "center"
|
|
666
|
-
},
|
|
667
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
668
|
-
DynamicIcon,
|
|
669
|
-
{
|
|
670
|
-
name: "lucide/external-link",
|
|
671
|
-
size: 22,
|
|
672
|
-
"aria-hidden": "true"
|
|
673
|
-
}
|
|
674
|
-
)
|
|
675
|
-
}
|
|
676
|
-
),
|
|
677
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", style: { fontSize: 11, fontWeight: 600 }, children: "Instagram" })
|
|
678
|
-
]
|
|
666
|
+
style: { ...USERNAME_BADGE_STYLE, cursor: "pointer" },
|
|
667
|
+
children: badgeContent
|
|
679
668
|
}
|
|
680
|
-
) :
|
|
669
|
+
) : (
|
|
670
|
+
// No username supplied: never fabricate a handle — degrade to a
|
|
671
|
+
// non-interactive "Instagram" chip in the same position.
|
|
672
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: USERNAME_BADGE_STYLE, children: badgeContent })
|
|
673
|
+
),
|
|
674
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: VIEWER_TITLE_STYLE, children: item.title })
|
|
681
675
|
]
|
|
682
676
|
}
|
|
683
677
|
);
|
|
@@ -687,7 +681,8 @@ function InstagramFeedGrid({
|
|
|
687
681
|
gridClassName,
|
|
688
682
|
itemClassName,
|
|
689
683
|
imageClassName,
|
|
690
|
-
optixFlowConfig
|
|
684
|
+
optixFlowConfig,
|
|
685
|
+
showLikeBadges = false
|
|
691
686
|
}) {
|
|
692
687
|
const { open } = mediaImmersive.useImmersiveFeed();
|
|
693
688
|
const posterImgProps = React.useMemo(() => {
|
|
@@ -724,7 +719,7 @@ function InstagramFeedGrid({
|
|
|
724
719
|
showDuration: false,
|
|
725
720
|
glyphMode: "hover",
|
|
726
721
|
posterImgProps,
|
|
727
|
-
badgeSlot: typeof likeCount === "number" ? likeBadge(likeCount) : void 0
|
|
722
|
+
badgeSlot: showLikeBadges && typeof likeCount === "number" ? likeBadge(likeCount) : void 0
|
|
728
723
|
}
|
|
729
724
|
),
|
|
730
725
|
mediaItem.title ? (
|
|
@@ -754,6 +749,8 @@ function InstagramPostGrid({
|
|
|
754
749
|
itemClassName,
|
|
755
750
|
imageClassName,
|
|
756
751
|
optixFlowConfig,
|
|
752
|
+
username,
|
|
753
|
+
showLikeBadges = false,
|
|
757
754
|
background,
|
|
758
755
|
pattern,
|
|
759
756
|
patternOpacity,
|
|
@@ -762,7 +759,7 @@ function InstagramPostGrid({
|
|
|
762
759
|
const mediaItems = React.useMemo(() => {
|
|
763
760
|
if (itemsSlot || !items) return [];
|
|
764
761
|
const withImage = items.filter((item) => Boolean(item.image));
|
|
765
|
-
if (process.env.NODE_ENV !== "production" && withImage.length < items.length) {
|
|
762
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production" && withImage.length < items.length) {
|
|
766
763
|
const skipped = items.filter((item) => !item.image);
|
|
767
764
|
const skippedIds = skipped.map((item) => item.id).join(", ");
|
|
768
765
|
console.warn(
|
|
@@ -791,7 +788,7 @@ function InstagramPostGrid({
|
|
|
791
788
|
"h2",
|
|
792
789
|
{
|
|
793
790
|
className: cn(
|
|
794
|
-
"text-xl font-medium tracking-tight md:text-
|
|
791
|
+
"text-xl font-medium tracking-tight md:text-3xl lg:text-5xl text-balance",
|
|
795
792
|
headingClassName
|
|
796
793
|
),
|
|
797
794
|
children: heading
|
|
@@ -801,7 +798,7 @@ function InstagramPostGrid({
|
|
|
801
798
|
"p",
|
|
802
799
|
{
|
|
803
800
|
className: cn(
|
|
804
|
-
"max-w-2xl text-balance
|
|
801
|
+
"max-w-full md:max-w-2xl text-balance opacity-75",
|
|
805
802
|
subheadingClassName
|
|
806
803
|
),
|
|
807
804
|
children: subheading
|
|
@@ -825,14 +822,16 @@ function InstagramPostGrid({
|
|
|
825
822
|
gridClassName,
|
|
826
823
|
itemClassName,
|
|
827
824
|
imageClassName,
|
|
828
|
-
optixFlowConfig
|
|
825
|
+
optixFlowConfig,
|
|
826
|
+
showLikeBadges
|
|
829
827
|
}
|
|
830
828
|
),
|
|
831
829
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
832
830
|
mediaImmersive.ImmersiveViewer,
|
|
833
831
|
{
|
|
834
832
|
ariaLabel: "Instagram post viewer",
|
|
835
|
-
renderActions: ({ item }) => /* @__PURE__ */ jsxRuntime.jsx(InstagramViewerRail, { item })
|
|
833
|
+
renderActions: ({ item }) => /* @__PURE__ */ jsxRuntime.jsx(InstagramViewerRail, { item }),
|
|
834
|
+
renderCaption: (item) => /* @__PURE__ */ jsxRuntime.jsx(InstagramViewerCaption, { item, username })
|
|
836
835
|
}
|
|
837
836
|
)
|
|
838
837
|
] })
|
|
@@ -144,6 +144,22 @@ interface InstagramPostGridProps {
|
|
|
144
144
|
* OptixFlow image optimization configuration
|
|
145
145
|
*/
|
|
146
146
|
optixFlowConfig?: OptixFlowConfig;
|
|
147
|
+
/**
|
|
148
|
+
* Instagram account username (leading `@` tolerated). Renders as a
|
|
149
|
+
* prominent, semi-transparent, clickable `@username` badge in the fullscreen
|
|
150
|
+
* viewer's caption card that opens the account's profile
|
|
151
|
+
* (`https://www.instagram.com/<username>/`) in a new tab. When omitted the
|
|
152
|
+
* badge degrades to a non-clickable "Instagram" chip — a handle is never
|
|
153
|
+
* fabricated.
|
|
154
|
+
*/
|
|
155
|
+
username?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Show the like-count pill on grid tiles. Defaults to `false`: clients with
|
|
158
|
+
* low like counts don't want them visible, so the pills stay hidden until
|
|
159
|
+
* per-client dynamic visibility ships. The pill implementation is retained
|
|
160
|
+
* intentionally — flip this prop to bring it back.
|
|
161
|
+
*/
|
|
162
|
+
showLikeBadges?: boolean;
|
|
147
163
|
/** Optional Section ID */
|
|
148
164
|
sectionId?: string;
|
|
149
165
|
}
|
|
@@ -192,6 +208,6 @@ interface InstagramPostGridProps {
|
|
|
192
208
|
* />
|
|
193
209
|
* ```
|
|
194
210
|
*/
|
|
195
|
-
declare function InstagramPostGrid({ sectionId, heading, subheading, items, itemsSlot, className, containerClassName, spacing, headerClassName, headingClassName, subheadingClassName, gridClassName, itemClassName, imageClassName, optixFlowConfig, background, pattern, patternOpacity, patternClassName, }: InstagramPostGridProps): React.JSX.Element | null;
|
|
211
|
+
declare function InstagramPostGrid({ sectionId, heading, subheading, items, itemsSlot, className, containerClassName, spacing, headerClassName, headingClassName, subheadingClassName, gridClassName, itemClassName, imageClassName, optixFlowConfig, username, showLikeBadges, background, pattern, patternOpacity, patternClassName, }: InstagramPostGridProps): React.JSX.Element | null;
|
|
196
212
|
|
|
197
213
|
export { InstagramPostGrid, type InstagramPostGridProps, type InstagramPostItem };
|
|
@@ -144,6 +144,22 @@ interface InstagramPostGridProps {
|
|
|
144
144
|
* OptixFlow image optimization configuration
|
|
145
145
|
*/
|
|
146
146
|
optixFlowConfig?: OptixFlowConfig;
|
|
147
|
+
/**
|
|
148
|
+
* Instagram account username (leading `@` tolerated). Renders as a
|
|
149
|
+
* prominent, semi-transparent, clickable `@username` badge in the fullscreen
|
|
150
|
+
* viewer's caption card that opens the account's profile
|
|
151
|
+
* (`https://www.instagram.com/<username>/`) in a new tab. When omitted the
|
|
152
|
+
* badge degrades to a non-clickable "Instagram" chip — a handle is never
|
|
153
|
+
* fabricated.
|
|
154
|
+
*/
|
|
155
|
+
username?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Show the like-count pill on grid tiles. Defaults to `false`: clients with
|
|
158
|
+
* low like counts don't want them visible, so the pills stay hidden until
|
|
159
|
+
* per-client dynamic visibility ships. The pill implementation is retained
|
|
160
|
+
* intentionally — flip this prop to bring it back.
|
|
161
|
+
*/
|
|
162
|
+
showLikeBadges?: boolean;
|
|
147
163
|
/** Optional Section ID */
|
|
148
164
|
sectionId?: string;
|
|
149
165
|
}
|
|
@@ -192,6 +208,6 @@ interface InstagramPostGridProps {
|
|
|
192
208
|
* />
|
|
193
209
|
* ```
|
|
194
210
|
*/
|
|
195
|
-
declare function InstagramPostGrid({ sectionId, heading, subheading, items, itemsSlot, className, containerClassName, spacing, headerClassName, headingClassName, subheadingClassName, gridClassName, itemClassName, imageClassName, optixFlowConfig, background, pattern, patternOpacity, patternClassName, }: InstagramPostGridProps): React.JSX.Element | null;
|
|
211
|
+
declare function InstagramPostGrid({ sectionId, heading, subheading, items, itemsSlot, className, containerClassName, spacing, headerClassName, headingClassName, subheadingClassName, gridClassName, itemClassName, imageClassName, optixFlowConfig, username, showLikeBadges, background, pattern, patternOpacity, patternClassName, }: InstagramPostGridProps): React.JSX.Element | null;
|
|
196
212
|
|
|
197
213
|
export { InstagramPostGrid, type InstagramPostGridProps, type InstagramPostItem };
|