basklee-react 0.9.18 → 0.9.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "basklee-react",
3
- "version": "0.9.18",
3
+ "version": "0.9.19",
4
4
  "description": "Next.js 16 storefront for your Basklee marketplace: setup CLI, server API gateway, typed store and ready-made catalog, cart, checkout and account components in English, Russian and Spanish, plus an Android app build. Powered by Basklee: https://basklee.com",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -596,6 +596,16 @@ export function blogArticleVideos(
596
596
  return found;
597
597
  }
598
598
 
599
+ /** One video of an article for search engines (pageSeo IStorefrontVideo). */
600
+ export interface IBlogArticleVideoData {
601
+ name: string;
602
+ description?: string;
603
+ thumbnailUrl?: string;
604
+ uploadDate?: string;
605
+ embedUrl?: string;
606
+ contentUrl?: string;
607
+ }
608
+
599
609
  /**
600
610
  * An article's videos for search engines (pageSeo storefrontVideoObject):
601
611
  * the YouTube players and uploaded videos of its text, then the post's own
@@ -613,14 +623,7 @@ export function blogArticleVideoData(input: {
613
623
  published?: string;
614
624
  /** Makes an address complete (storefrontAbsoluteUrl). */
615
625
  absoluteUrl: (value: string | undefined) => string | undefined;
616
- }): {
617
- name: string;
618
- description?: string;
619
- thumbnailUrl?: string;
620
- uploadDate?: string;
621
- embedUrl?: string;
622
- contentUrl?: string;
623
- }[] {
626
+ }): IBlogArticleVideoData[] {
624
627
  const seen = new Set<string>();
625
628
  const named = (title: string) =>
626
629
  title && !/^youtube video$/i.test(title) ? title : input.title;
@@ -631,7 +634,7 @@ export function blogArticleVideoData(input: {
631
634
  ...(video.poster ? { poster: video.poster } : {}),
632
635
  }));
633
636
 
634
- return [...blogArticleVideos(input.html, ''), ...own].flatMap((video) => {
637
+ return [...blogArticleVideos(input.html, ''), ...own].flatMap((video): IBlogArticleVideoData[] => {
635
638
  const key = video.id ?? video.src;
636
639
 
637
640
  if (!key || seen.has(key)) {
@@ -161,7 +161,7 @@ export function storefrontProductVideoObjects(
161
161
  if (!product || !uploadDate) {
162
162
  return [];
163
163
  }
164
- return (product.videos ?? []).flatMap((video, index, list) => {
164
+ return (product.videos ?? []).flatMap((video, index, list): Record<string, unknown>[] => {
165
165
  const contentUrl = options.absoluteUrl(video.product_video ?? undefined);
166
166
  const thumbnailUrl = options.absoluteUrl(video.preview ?? undefined) || options.fallbackImage;
167
167
  if (!contentUrl || !thumbnailUrl) {