@opinly/next 0.1.18 → 0.1.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.
@@ -84,7 +84,7 @@ const BlogPost = ({
84
84
  }
85
85
  ),
86
86
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-12 w-full", children: [
87
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bg-orange-600", children: [
87
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
88
88
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
89
  import_bread_crumbs.BreadCrumbs,
90
90
  {
@@ -97,9 +97,8 @@ const BlogPost = ({
97
97
  }
98
98
  ),
99
99
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-op-heading text-4xl font-bold mb-2 leading-tight", children: post.title }),
100
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-sm mb-4 text-op-muted", children: [
100
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-sm mb-4 text-op-muted space-x-1", children: [
101
101
  post.author && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
102
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Author:" }),
103
102
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
104
103
  import_link.default,
105
104
  {
@@ -111,22 +110,24 @@ const BlogPost = ({
111
110
  " ",
112
111
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-op-muted", children: "\xB7" })
113
112
  ] }),
114
- (0, import_reading_time.calculateReadingTime)(content),
115
- " min read \xB7",
116
- " ",
117
- (0, import_dates.formatDate)(post.firstPublishedAt) || "Today"
113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
114
+ (0, import_reading_time.calculateReadingTime)(content),
115
+ " min read ",
116
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "\xB7" })
117
+ ] }),
118
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: (0, import_dates.formatDate)(post.firstPublishedAt) || "Today" })
118
119
  ] })
119
120
  ] }),
120
121
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
121
122
  "div",
122
123
  {
123
124
  className: (0, import_merge.cn)(
124
- "flex flex-col-reverse mx-auto w-full ",
125
- "md:flex-row",
125
+ "flex md:space-x-12 flex-col mx-auto w-full",
126
+ "md:flex-row-reverse",
126
127
  classNames.container
127
128
  ),
128
129
  children: [
129
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("article", { className: "w-full md:w-3/4 order-2 lg:order-1 flex items-start space-x-4 ", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "prose w-full", children: [
130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("article", { className: "w-full md:w-3/4 order-2 md:order-1 flex items-start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "prose w-full ", children: [
130
131
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_content.Content, { content, classNames }),
131
132
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_faq.FAQS, { faqs: post.faqs })
132
133
  ] }) }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/blog-post/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { JSONContent } from \"@tiptap/core\";\nimport Link from \"next/link\";\nimport { cn } from \"../../utils/merge\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { BlogPostRes } from \"./_types/blog-post\";\nimport {\n genBlogPostingJSONLD,\n genBreadcrumbJSONLD,\n genFaqJSONLD,\n} from \"./_helpers/json-ld\";\nimport { BlogComponentClassNames } from \"./_types/class-names\";\nimport { FAQS } from \"./_components/faq\";\nimport { calculateReadingTime } from \"./_helpers/reading-time\";\nimport { Content } from \"./_components/content\";\nimport { TableOfContents } from \"./_components/table-of-contents\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { formatDate } from \"../../utils/dates\";\nimport Script from \"next/script\";\n\nexport const BlogPost = ({\n post,\n classNames = {},\n}: {\n post: BlogPostRes;\n classNames?: BlogComponentClassNames;\n notFoundComponent?: React.ReactNode;\n}) => {\n const content = post.content as JSONContent;\n\n console.log(\"is app router\", !opinlyConfig.pagesRouter);\n\n return (\n <>\n {post.faqs && (\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genFaqJSONLD(post.faqs)).replace(\n /</g,\n \"\\\\u003c\"\n ),\n }}\n />\n )}\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBlogPostingJSONLD(post)),\n }}\n />\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBreadcrumbJSONLD(post)),\n }}\n />\n <div className=\"max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8\">\n <div className=\"flex flex-col gap-12 w-full\">\n <div className=\"bg-orange-600\">\n <BreadCrumbs\n breadcrumbs={[\n post.folder && {\n url: `${opinlyConfig.blogPrefix}/${post.folder.slug}`,\n name: post.folder.name,\n },\n ]}\n />\n\n <h1 className=\"text-op-heading text-4xl font-bold mb-2 leading-tight\">\n {post.title}\n </h1>\n <div className=\"text-sm mb-4 text-op-muted\">\n {post.author && (\n <>\n <span>Author:</span>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${post.author?.slug}`}\n className=\"font-medium\"\n >\n {post.author?.name}\n </Link>{\" \"}\n <span className=\"text-op-muted\">·</span>\n </>\n )}\n {calculateReadingTime(content)} min read ·{\" \"}\n {formatDate(post.firstPublishedAt as string) || \"Today\"}\n </div>\n </div>\n\n <div\n className={cn(\n \"flex flex-col-reverse mx-auto w-full \",\n \"md:flex-row\",\n classNames.container\n )}\n >\n <article className=\"w-full md:w-3/4 order-2 lg:order-1 flex items-start space-x-4 \">\n <div className=\"prose w-full\">\n <Content content={content} classNames={classNames} />\n <FAQS faqs={post.faqs} />\n </div>\n </article>\n <div className=\"flex md:w-1/4 md:sticky md:top-20\">\n <TableOfContents\n content={content}\n author={post.author}\n post={post}\n />\n </div>\n </div>\n </div>\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCQ;AAjCR,kBAAiB;AACjB,mBAAmB;AACnB,wBAA6B;AAE7B,qBAIO;AAEP,iBAAqB;AACrB,0BAAqC;AACrC,qBAAwB;AACxB,+BAAgC;AAChC,0BAA4B;AAC5B,mBAA2B;AAC3B,oBAAmB;AAEZ,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA,aAAa,CAAC;AAChB,MAIM;AACJ,QAAM,UAAU,KAAK;AAErB,UAAQ,IAAI,iBAAiB,CAAC,+BAAa,WAAW;AAEtD,SACE,4EACG;AAAA,SAAK,QACJ;AAAA,MAAC,cAAAA;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,MAAK;AAAA,QACL,yBAAyB;AAAA,UACvB,QAAQ,KAAK,cAAU,6BAAa,KAAK,IAAI,CAAC,EAAE;AAAA,YAC9C;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IAEF;AAAA,MAAC,cAAAA;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,MAAK;AAAA,QACL,yBAAyB;AAAA,UACvB,QAAQ,KAAK,cAAU,qCAAqB,IAAI,CAAC;AAAA,QACnD;AAAA;AAAA,IACF;AAAA,IACA;AAAA,MAAC,cAAAA;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,MAAK;AAAA,QACL,yBAAyB;AAAA,UACvB,QAAQ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AA;AAAA;AAAA,MACF;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["Script","Link"]}
1
+ {"version":3,"sources":["../../../src/components/blog-post/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { JSONContent } from \"@tiptap/core\";\nimport Link from \"next/link\";\nimport { cn } from \"../../utils/merge\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { BlogPostRes } from \"./_types/blog-post\";\nimport {\n genBlogPostingJSONLD,\n genBreadcrumbJSONLD,\n genFaqJSONLD,\n} from \"./_helpers/json-ld\";\nimport { BlogComponentClassNames } from \"./_types/class-names\";\nimport { FAQS } from \"./_components/faq\";\nimport { calculateReadingTime } from \"./_helpers/reading-time\";\nimport { Content } from \"./_components/content\";\nimport { TableOfContents } from \"./_components/table-of-contents\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { formatDate } from \"../../utils/dates\";\nimport Script from \"next/script\";\n\nexport const BlogPost = ({\n post,\n classNames = {},\n}: {\n post: BlogPostRes;\n classNames?: BlogComponentClassNames;\n notFoundComponent?: React.ReactNode;\n}) => {\n const content = post.content as JSONContent;\n\n console.log(\"is app router\", !opinlyConfig.pagesRouter);\n\n return (\n <>\n {post.faqs && (\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genFaqJSONLD(post.faqs)).replace(\n /</g,\n \"\\\\u003c\"\n ),\n }}\n />\n )}\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBlogPostingJSONLD(post)),\n }}\n />\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBreadcrumbJSONLD(post)),\n }}\n />\n <div className=\"max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8\">\n <div className=\"flex flex-col gap-12 w-full\">\n <div>\n <BreadCrumbs\n breadcrumbs={[\n post.folder && {\n url: `${opinlyConfig.blogPrefix}/${post.folder.slug}`,\n name: post.folder.name,\n },\n ]}\n />\n\n <h1 className=\"text-op-heading text-4xl font-bold mb-2 leading-tight\">\n {post.title}\n </h1>\n <div className=\"text-sm mb-4 text-op-muted space-x-1\">\n {post.author && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${post.author?.slug}`}\n className=\"font-medium\"\n >\n {post.author?.name}\n </Link>{\" \"}\n <span className=\"text-op-muted\">·</span>\n </>\n )}\n <span>\n {calculateReadingTime(content)} min read <span>·</span>\n </span>\n <span>\n {formatDate(post.firstPublishedAt as string) || \"Today\"}\n </span>\n </div>\n </div>\n\n <div\n className={cn(\n \"flex md:space-x-12 flex-col mx-auto w-full\",\n \"md:flex-row-reverse\",\n classNames.container\n )}\n >\n <article className=\"w-full md:w-3/4 order-2 md:order-1 flex items-start\">\n <div className=\"prose w-full \">\n <Content content={content} classNames={classNames} />\n <FAQS faqs={post.faqs} />\n </div>\n </article>\n <div className=\"flex md:w-1/4 md:sticky md:top-20\">\n <TableOfContents\n content={content}\n author={post.author}\n post={post}\n />\n </div>\n </div>\n </div>\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCQ;AAjCR,kBAAiB;AACjB,mBAAmB;AACnB,wBAA6B;AAE7B,qBAIO;AAEP,iBAAqB;AACrB,0BAAqC;AACrC,qBAAwB;AACxB,+BAAgC;AAChC,0BAA4B;AAC5B,mBAA2B;AAC3B,oBAAmB;AAEZ,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA,aAAa,CAAC;AAChB,MAIM;AACJ,QAAM,UAAU,KAAK;AAErB,UAAQ,IAAI,iBAAiB,CAAC,+BAAa,WAAW;AAEtD,SACE,4EACG;AAAA,SAAK,QACJ;AAAA,MAAC,cAAAA;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,MAAK;AAAA,QACL,yBAAyB;AAAA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AA0B,KAAK,SAClD;AAAA,WACF;AAAA,SACF;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,eAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA,WAAW;AAAA,UACb;AAAA,UAEA;AAAA,wDAAC,aAAQ,WAAU,uDACjB,uDAAC,SAAI,WAAU,iBACb;AAAA,0DAAC,0BAAQ,SAAkB,YAAwB;AAAA,cACnD,4CAAC,mBAAK,MAAM,KAAK,MAAM;AAAA,eACzB,GACF;AAAA,YACA,4CAAC,SAAI,WAAU,qCACb;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA,QAAQ,KAAK;AAAA,gBACb;AAAA;AAAA,YACF,GACF;AAAA;AAAA;AAAA,MACF;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["Script","Link"]}
@@ -55,7 +55,7 @@ const BlogPost = ({
55
55
  }
56
56
  ),
57
57
  /* @__PURE__ */ jsx("div", { className: "max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-12 w-full", children: [
58
- /* @__PURE__ */ jsxs("div", { className: "bg-orange-600", children: [
58
+ /* @__PURE__ */ jsxs("div", { children: [
59
59
  /* @__PURE__ */ jsx(
60
60
  BreadCrumbs,
61
61
  {
@@ -68,9 +68,8 @@ const BlogPost = ({
68
68
  }
69
69
  ),
70
70
  /* @__PURE__ */ jsx("h1", { className: "text-op-heading text-4xl font-bold mb-2 leading-tight", children: post.title }),
71
- /* @__PURE__ */ jsxs("div", { className: "text-sm mb-4 text-op-muted", children: [
71
+ /* @__PURE__ */ jsxs("div", { className: "text-sm mb-4 text-op-muted space-x-1", children: [
72
72
  post.author && /* @__PURE__ */ jsxs(Fragment, { children: [
73
- /* @__PURE__ */ jsx("span", { children: "Author:" }),
74
73
  /* @__PURE__ */ jsx(
75
74
  Link,
76
75
  {
@@ -82,22 +81,24 @@ const BlogPost = ({
82
81
  " ",
83
82
  /* @__PURE__ */ jsx("span", { className: "text-op-muted", children: "\xB7" })
84
83
  ] }),
85
- calculateReadingTime(content),
86
- " min read \xB7",
87
- " ",
88
- formatDate(post.firstPublishedAt) || "Today"
84
+ /* @__PURE__ */ jsxs("span", { children: [
85
+ calculateReadingTime(content),
86
+ " min read ",
87
+ /* @__PURE__ */ jsx("span", { children: "\xB7" })
88
+ ] }),
89
+ /* @__PURE__ */ jsx("span", { children: formatDate(post.firstPublishedAt) || "Today" })
89
90
  ] })
90
91
  ] }),
91
92
  /* @__PURE__ */ jsxs(
92
93
  "div",
93
94
  {
94
95
  className: cn(
95
- "flex flex-col-reverse mx-auto w-full ",
96
- "md:flex-row",
96
+ "flex md:space-x-12 flex-col mx-auto w-full",
97
+ "md:flex-row-reverse",
97
98
  classNames.container
98
99
  ),
99
100
  children: [
100
- /* @__PURE__ */ jsx("article", { className: "w-full md:w-3/4 order-2 lg:order-1 flex items-start space-x-4 ", children: /* @__PURE__ */ jsxs("div", { className: "prose w-full", children: [
101
+ /* @__PURE__ */ jsx("article", { className: "w-full md:w-3/4 order-2 md:order-1 flex items-start", children: /* @__PURE__ */ jsxs("div", { className: "prose w-full ", children: [
101
102
  /* @__PURE__ */ jsx(Content, { content, classNames }),
102
103
  /* @__PURE__ */ jsx(FAQS, { faqs: post.faqs })
103
104
  ] }) }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/blog-post/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { JSONContent } from \"@tiptap/core\";\nimport Link from \"next/link\";\nimport { cn } from \"../../utils/merge\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { BlogPostRes } from \"./_types/blog-post\";\nimport {\n genBlogPostingJSONLD,\n genBreadcrumbJSONLD,\n genFaqJSONLD,\n} from \"./_helpers/json-ld\";\nimport { BlogComponentClassNames } from \"./_types/class-names\";\nimport { FAQS } from \"./_components/faq\";\nimport { calculateReadingTime } from \"./_helpers/reading-time\";\nimport { Content } from \"./_components/content\";\nimport { TableOfContents } from \"./_components/table-of-contents\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { formatDate } from \"../../utils/dates\";\nimport Script from \"next/script\";\n\nexport const BlogPost = ({\n post,\n classNames = {},\n}: {\n post: BlogPostRes;\n classNames?: BlogComponentClassNames;\n notFoundComponent?: React.ReactNode;\n}) => {\n const content = post.content as JSONContent;\n\n console.log(\"is app router\", !opinlyConfig.pagesRouter);\n\n return (\n <>\n {post.faqs && (\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genFaqJSONLD(post.faqs)).replace(\n /</g,\n \"\\\\u003c\"\n ),\n }}\n />\n )}\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBlogPostingJSONLD(post)),\n }}\n />\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBreadcrumbJSONLD(post)),\n }}\n />\n <div className=\"max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8\">\n <div className=\"flex flex-col gap-12 w-full\">\n <div className=\"bg-orange-600\">\n <BreadCrumbs\n breadcrumbs={[\n post.folder && {\n url: `${opinlyConfig.blogPrefix}/${post.folder.slug}`,\n name: post.folder.name,\n },\n ]}\n />\n\n <h1 className=\"text-op-heading text-4xl font-bold mb-2 leading-tight\">\n {post.title}\n </h1>\n <div className=\"text-sm mb-4 text-op-muted\">\n {post.author && (\n <>\n <span>Author:</span>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${post.author?.slug}`}\n className=\"font-medium\"\n >\n {post.author?.name}\n </Link>{\" \"}\n <span className=\"text-op-muted\">·</span>\n </>\n )}\n {calculateReadingTime(content)} min read ·{\" \"}\n {formatDate(post.firstPublishedAt as string) || \"Today\"}\n </div>\n </div>\n\n <div\n className={cn(\n \"flex flex-col-reverse mx-auto w-full \",\n \"md:flex-row\",\n classNames.container\n )}\n >\n <article className=\"w-full md:w-3/4 order-2 lg:order-1 flex items-start space-x-4 \">\n <div className=\"prose w-full\">\n <Content content={content} classNames={classNames} />\n <FAQS faqs={post.faqs} />\n </div>\n </article>\n <div className=\"flex md:w-1/4 md:sticky md:top-20\">\n <TableOfContents\n content={content}\n author={post.author}\n post={post}\n />\n </div>\n </div>\n </div>\n </div>\n </>\n );\n};\n"],"mappings":"AAmCQ,SA0CQ,UA1CR,KA0CQ,YA1CR;AAjCR,OAAO,UAAU;AACjB,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAE7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,YAAY;AACrB,SAAS,4BAA4B;AACrC,SAAS,eAAe;AACxB,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,OAAO,YAAY;AAEZ,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA,aAAa,CAAC;AAChB,MAIM;AACJ,QAAM,UAAU,KAAK;AAErB,UAAQ,IAAI,iBAAiB,CAAC,aAAa,WAAW;AAEtD,SACE,iCACG;AAAA,SAAK,QACJ;AAAA,MAAC;AAAA;AAAA,QACC,UAAS;AAAA,QACT,MAAK;AAAA,QACL,yBAAyB;AAAA,UACvB,QAAQ,KAAK,UAAU,aAAa,KAAK,IAAI,CAAC,EAAE;AAAA,YAC9C;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IAEF;AAAA,MAAC;AAAA;AAAA,QACC,UAAS;AAAA,QACT,MAAK;AAAA,QACL,yBAAyB;AAAA,UACvB,QAAQ,KAAK,UAAU,qBAAqB,IAAI,CAAC;AAAA,QACnD;AAAA;AAAA,IACF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAS;AAAA,QACT,MAAK;AAAA,QACL,yBAAyB;AAAA,UACvB,QAAQ,KAAK,UAAU,oBAAoB,IAAI,CAAC;AAAA,QAClD;AAAA;AAAA,IACF;A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../src/components/blog-post/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { JSONContent } from \"@tiptap/core\";\nimport Link from \"next/link\";\nimport { cn } from \"../../utils/merge\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { BlogPostRes } from \"./_types/blog-post\";\nimport {\n genBlogPostingJSONLD,\n genBreadcrumbJSONLD,\n genFaqJSONLD,\n} from \"./_helpers/json-ld\";\nimport { BlogComponentClassNames } from \"./_types/class-names\";\nimport { FAQS } from \"./_components/faq\";\nimport { calculateReadingTime } from \"./_helpers/reading-time\";\nimport { Content } from \"./_components/content\";\nimport { TableOfContents } from \"./_components/table-of-contents\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { formatDate } from \"../../utils/dates\";\nimport Script from \"next/script\";\n\nexport const BlogPost = ({\n post,\n classNames = {},\n}: {\n post: BlogPostRes;\n classNames?: BlogComponentClassNames;\n notFoundComponent?: React.ReactNode;\n}) => {\n const content = post.content as JSONContent;\n\n console.log(\"is app router\", !opinlyConfig.pagesRouter);\n\n return (\n <>\n {post.faqs && (\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genFaqJSONLD(post.faqs)).replace(\n /</g,\n \"\\\\u003c\"\n ),\n }}\n />\n )}\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBlogPostingJSONLD(post)),\n }}\n />\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBreadcrumbJSONLD(post)),\n }}\n />\n <div className=\"max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8\">\n <div className=\"flex flex-col gap-12 w-full\">\n <div>\n <BreadCrumbs\n breadcrumbs={[\n post.folder && {\n url: `${opinlyConfig.blogPrefix}/${post.folder.slug}`,\n name: post.folder.name,\n },\n ]}\n />\n\n <h1 className=\"text-op-heading text-4xl font-bold mb-2 leading-tight\">\n {post.title}\n </h1>\n <div className=\"text-sm mb-4 text-op-muted space-x-1\">\n {post.author && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${post.author?.slug}`}\n className=\"font-medium\"\n >\n {post.author?.name}\n </Link>{\" \"}\n <span className=\"text-op-muted\">·</span>\n </>\n )}\n <span>\n {calculateReadingTime(content)} min read <span>·</span>\n </span>\n <span>\n {formatDate(post.firstPublishedAt as string) || \"Today\"}\n </span>\n </div>\n </div>\n\n <div\n className={cn(\n \"flex md:space-x-12 flex-col mx-auto w-full\",\n \"md:flex-row-reverse\",\n classNames.container\n )}\n >\n <article className=\"w-full md:w-3/4 order-2 md:order-1 flex items-start\">\n <div className=\"prose w-full \">\n <Content content={content} classNames={classNames} />\n <FAQS faqs={post.faqs} />\n </div>\n </article>\n <div className=\"flex md:w-1/4 md:sticky md:top-20\">\n <TableOfContents\n content={content}\n author={post.author}\n post={post}\n />\n </div>\n </div>\n </div>\n </div>\n </>\n );\n};\n"],"mappings":"AAmCQ,SA0CQ,UA1CR,KA0CQ,YA1CR;AAjCR,OAAO,UAAU;AACjB,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAE7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,YAAY;AACrB,SAAS,4BAA4B;AACrC,SAAS,eAAe;AACxB,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,OAAO,YAAY;AAEZ,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA,aAAa,CAAC;AAChB,MAIM;AACJ,QAAM,UAAU,KAAK;AAErB,UAAQ,IAAI,iBAAiB,CAAC,aAAa,WAAW;AAEtD,SACE,iCACG;AAAA,SAAK,QACJ;AAAA,MAAC;AAAA;AAAA,QACC,UAAS;AAAA,QACT,MAAK;AAAA,QACL,yBAAyB;AAAA,UACvB,QAAQ,KAAK,UAAU,aAAa,KAAK,IAAI,CAAC,E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T;AAAA,YACA;AAAA,YACA,WAAW;AAAA,UACb;AAAA,UAEA;AAAA,gCAAC,aAAQ,WAAU,uDACjB,+BAAC,SAAI,WAAU,iBACb;AAAA,kCAAC,WAAQ,SAAkB,YAAwB;AAAA,cACnD,oBAAC,QAAK,MAAM,KAAK,MAAM;AAAA,eACzB,GACF;AAAA,YACA,oBAAC,SAAI,WAAU,qCACb;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA,QAAQ,KAAK;AAAA,gBACb;AAAA;AAAA,YACF,GACF;AAAA;AAAA;AAAA,MACF;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":[]}
@@ -69,7 +69,20 @@ const HomePageFolders = ({
69
69
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-op-muted", children: folder.description })
70
70
  ] }),
71
71
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20", children: [
72
- folder.posts.filter((post) => post !== null).map((post) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_preview.PostPreview, { post }, post.slug)),
72
+ folder.posts.filter((post) => post !== null).map((post) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
+ import_post_preview.PostPreview,
74
+ {
75
+ post: {
76
+ ...post,
77
+ folder: {
78
+ name: folder.title,
79
+ slug: folder.slug,
80
+ description: folder.description || ""
81
+ }
82
+ }
83
+ },
84
+ post.slug
85
+ )),
73
86
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex justify-center w-full h-full items-center ", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
74
87
  import_link.default,
75
88
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/home-page/folders.tsx"],"sourcesContent":["import Link from \"next/link\";\nimport { PostPreview } from \"../post-preview\";\nimport { ArrowRight } from \"lucide-react\";\nimport { Opinly } from \"@opinly/backend\";\n\nexport const HomePageFoldersSkeleton = () => {\n return (\n <>\n {Array(2) // render 2 folder sections\n .fill(null)\n .map((_, sectionIdx) => (\n <div key={sectionIdx} className=\"space-y-4 mb-5\">\n {/* Folder title + description */}\n <div className=\"animate-pulse space-y-2\">\n <div className=\"h-8 w-1/3 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"h-4 w-1/2 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n\n {/* Posts grid */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {Array(3) // 3 post placeholders\n .fill(null)\n .map((__, postIdx) => (\n <div key={postIdx} className=\"animate-pulse space-y-3\">\n {/* Image */}\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n {/* Title bar */}\n <div className=\"h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded\" />\n {/* Description line */}\n <div className=\"h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n ))}\n\n {/* “View all” link */}\n <div className=\"flex justify-center items-center animate-pulse\">\n <div className=\"h-4 w-48 bg-gray-200 text-op-heading rounded\" />\n </div>\n </div>\n </div>\n ))}\n </>\n );\n};\n\nexport const HomePageFolders = ({\n folders,\n}: {\n folders: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"folders\"];\n}) => {\n return (\n <div className=\"flex flex-col gap-10 mt-20\">\n {folders.map((folder) => (\n <div className=\"space-y-4\">\n <div className=\"flex flex-col gap-2 mb-20\">\n <Link\n key={folder.slug}\n href={`/blog/${folder.slug}`}\n className=\"text-3xl\"\n >\n {folder.title}\n </Link>\n <p className=\"text-sm text-op-muted\">{folder.description}</p>\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20\">\n {folder.posts\n .filter((post) => post !== null)\n .map((post) => (\n <PostPreview key={post.slug} post={post as any} />\n ))}\n <div className=\"flex justify-center w-full h-full items-center \">\n <Link\n href={`/blog/${folder.slug}`}\n className=\"flex items-center gap-2\"\n >\n <span>View all posts in {folder.title}</span>\n <ArrowRight className=\"w-4 h-4\" />\n </Link>\n </div>\n </div>\n </div>\n ))}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOI;AAPJ,kBAAiB;AACjB,0BAA4B;AAC5B,0BAA2B;AAGpB,MAAM,0BAA0B,MAAM;AAC3C,SACE,2EACG,gBAAM,CAAC,EACL,KAAK,IAAI,EACT,IAAI,CAAC,GAAG,eACP,6CAAC,SAAqB,WAAU,kBAE9B;AAAA,iDAAC,SAAI,WAAU,2BACb;AAAA,kDAAC,SAAI,WAAU,kDAAiD;AAAA,MAChE,4CAAC,SAAI,WAAU,kDAAiD;AAAA,OAClE;AAAA,IAGA,6CAAC,SAAI,WAAU,yDACZ;AAAA,YAAM,CAAC,EACL,KAAK,IAAI,EACT,IAAI,CAAC,IAAI,YACR,6CAAC,SAAkB,WAAU,2BAE3B;AAAA,oDAAC,SAAI,WAAU,uDAAsD;AAAA,QAErE,4CAAC,SAAI,WAAU,kDAAiD;AAAA,QAEhE,4CAAC,SAAI,WAAU,mDAAkD;AAAA,WANzD,OAOV,CACD;AAAA,MAGH,4CAAC,SAAI,WAAU,kDACb,sDAAC,SAAI,WAAU,gDAA+C,GAChE;AAAA,OACF;AAAA,OA1BQ,UA2BV,CACD,GACL;AAEJ;AAEO,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AACF,MAKM;AACJ,SACE,4CAAC,SAAI,WAAU,8BACZ,kBAAQ,IAAI,CAAC,WACZ,6CAAC,SAAI,WAAU,aACb;AAAA,iDAAC,SAAI,WAAU,6BACb;AAAA;AAAA,QAAC,YAAAA;AAAA,QAAA;AAAA,UAEC,MAAM,SAAS,OAAO,IAAI;AAAA,UAC1B,WAAU;AAAA,UAET,iBAAO;AAAA;AAAA,QAJH,OAAO;AAAA,MAKd;AAAA,MACA,4CAAC,OAAE,WAAU,yBAAyB,iBAAO,aAAY;AAAA,OAC3D;AAAA,IACA,6CAAC,SAAI,WAAU,+DACZ;AAAA,aAAO,MACL,OAAO,CAAC,SAAS,SAAS,IAAI,EAC9B,IAAI,CAAC,SACJ,4CAAC,mCAA4B,QAAX,KAAK,IAAyB,CACjD;AAAA,MACH,4CAAC,SAAI,WAAU,mDACb;AAAA,QAAC,YAAAA;AAAA,QAAA;AAAA,UACC,MAAM,SAAS,OAAO,IAAI;AAAA,UAC1B,WAAU;AAAA,UAEV;AAAA,yDAAC,UAAK;AAAA;AAAA,cAAmB,OAAO;AAAA,eAAM;AAAA,YACtC,4CAAC,kCAAW,WAAU,WAAU;AAAA;AAAA;AAAA,MAClC,GACF;AAAA,OACF;AAAA,KACF,CACD,GACH;AAEJ;","names":["Link"]}
1
+ {"version":3,"sources":["../../../src/components/home-page/folders.tsx"],"sourcesContent":["import Link from \"next/link\";\nimport { PostPreview } from \"../post-preview\";\nimport { ArrowRight } from \"lucide-react\";\nimport { Opinly } from \"@opinly/backend\";\n\nexport const HomePageFoldersSkeleton = () => {\n return (\n <>\n {Array(2) // render 2 folder sections\n .fill(null)\n .map((_, sectionIdx) => (\n <div key={sectionIdx} className=\"space-y-4 mb-5\">\n {/* Folder title + description */}\n <div className=\"animate-pulse space-y-2\">\n <div className=\"h-8 w-1/3 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"h-4 w-1/2 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n\n {/* Posts grid */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {Array(3) // 3 post placeholders\n .fill(null)\n .map((__, postIdx) => (\n <div key={postIdx} className=\"animate-pulse space-y-3\">\n {/* Image */}\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n {/* Title bar */}\n <div className=\"h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded\" />\n {/* Description line */}\n <div className=\"h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n ))}\n\n {/* “View all” link */}\n <div className=\"flex justify-center items-center animate-pulse\">\n <div className=\"h-4 w-48 bg-gray-200 text-op-heading rounded\" />\n </div>\n </div>\n </div>\n ))}\n </>\n );\n};\n\nexport const HomePageFolders = ({\n folders,\n}: {\n folders: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"folders\"];\n}) => {\n return (\n <div className=\"flex flex-col gap-10 mt-20\">\n {folders.map((folder) => (\n <div className=\"space-y-4\">\n <div className=\"flex flex-col gap-2 mb-20\">\n <Link\n key={folder.slug}\n href={`/blog/${folder.slug}`}\n className=\"text-3xl\"\n >\n {folder.title}\n </Link>\n <p className=\"text-sm text-op-muted\">{folder.description}</p>\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20\">\n {folder.posts\n .filter((post) => post !== null)\n .map((post) => (\n <PostPreview\n key={post.slug}\n post={{\n ...post,\n folder: {\n name: folder.title,\n slug: folder.slug,\n description: folder.description || \"\",\n },\n }}\n />\n ))}\n <div className=\"flex justify-center w-full h-full items-center \">\n <Link\n href={`/blog/${folder.slug}`}\n className=\"flex items-center gap-2\"\n >\n <span>View all posts in {folder.title}</span>\n <ArrowRight className=\"w-4 h-4\" />\n </Link>\n </div>\n </div>\n </div>\n ))}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOI;AAPJ,kBAAiB;AACjB,0BAA4B;AAC5B,0BAA2B;AAGpB,MAAM,0BAA0B,MAAM;AAC3C,SACE,2EACG,gBAAM,CAAC,EACL,KAAK,IAAI,EACT,IAAI,CAAC,GAAG,eACP,6CAAC,SAAqB,WAAU,kBAE9B;AAAA,iDAAC,SAAI,WAAU,2BACb;AAAA,kDAAC,SAAI,WAAU,kDA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S,OAAO,IAAI;AAAA,UAC1B,WAAU;AAAA,UAEV;AAAA,yDAAC,UAAK;AAAA;AAAA,cAAmB,OAAO;AAAA,eAAM;AAAA,YACtC,4CAAC,kCAAW,WAAU,WAAU;AAAA;AAAA;AAAA,MAClC,GACF;AAAA,OACF;AAAA,KACF,CACD,GACH;AAEJ;","names":["Link"]}
@@ -35,7 +35,20 @@ const HomePageFolders = ({
35
35
  /* @__PURE__ */ jsx("p", { className: "text-sm text-op-muted", children: folder.description })
36
36
  ] }),
37
37
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20", children: [
38
- folder.posts.filter((post) => post !== null).map((post) => /* @__PURE__ */ jsx(PostPreview, { post }, post.slug)),
38
+ folder.posts.filter((post) => post !== null).map((post) => /* @__PURE__ */ jsx(
39
+ PostPreview,
40
+ {
41
+ post: {
42
+ ...post,
43
+ folder: {
44
+ name: folder.title,
45
+ slug: folder.slug,
46
+ description: folder.description || ""
47
+ }
48
+ }
49
+ },
50
+ post.slug
51
+ )),
39
52
  /* @__PURE__ */ jsx("div", { className: "flex justify-center w-full h-full items-center ", children: /* @__PURE__ */ jsxs(
40
53
  Link,
41
54
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/home-page/folders.tsx"],"sourcesContent":["import Link from \"next/link\";\nimport { PostPreview } from \"../post-preview\";\nimport { ArrowRight } from \"lucide-react\";\nimport { Opinly } from \"@opinly/backend\";\n\nexport const HomePageFoldersSkeleton = () => {\n return (\n <>\n {Array(2) // render 2 folder sections\n .fill(null)\n .map((_, sectionIdx) => (\n <div key={sectionIdx} className=\"space-y-4 mb-5\">\n {/* Folder title + description */}\n <div className=\"animate-pulse space-y-2\">\n <div className=\"h-8 w-1/3 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"h-4 w-1/2 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n\n {/* Posts grid */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {Array(3) // 3 post placeholders\n .fill(null)\n .map((__, postIdx) => (\n <div key={postIdx} className=\"animate-pulse space-y-3\">\n {/* Image */}\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n {/* Title bar */}\n <div className=\"h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded\" />\n {/* Description line */}\n <div className=\"h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n ))}\n\n {/* “View all” link */}\n <div className=\"flex justify-center items-center animate-pulse\">\n <div className=\"h-4 w-48 bg-gray-200 text-op-heading rounded\" />\n </div>\n </div>\n </div>\n ))}\n </>\n );\n};\n\nexport const HomePageFolders = ({\n folders,\n}: {\n folders: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"folders\"];\n}) => {\n return (\n <div className=\"flex flex-col gap-10 mt-20\">\n {folders.map((folder) => (\n <div className=\"space-y-4\">\n <div className=\"flex flex-col gap-2 mb-20\">\n <Link\n key={folder.slug}\n href={`/blog/${folder.slug}`}\n className=\"text-3xl\"\n >\n {folder.title}\n </Link>\n <p className=\"text-sm text-op-muted\">{folder.description}</p>\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20\">\n {folder.posts\n .filter((post) => post !== null)\n .map((post) => (\n <PostPreview key={post.slug} post={post as any} />\n ))}\n <div className=\"flex justify-center w-full h-full items-center \">\n <Link\n href={`/blog/${folder.slug}`}\n className=\"flex items-center gap-2\"\n >\n <span>View all posts in {folder.title}</span>\n <ArrowRight className=\"w-4 h-4\" />\n </Link>\n </div>\n </div>\n </div>\n ))}\n </div>\n );\n};\n"],"mappings":"AAOI,mBAOU,KADF,YANR;AAPJ,OAAO,UAAU;AACjB,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAGpB,MAAM,0BAA0B,MAAM;AAC3C,SACE,gCACG,gBA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CAAC,UAAK;AAAA;AAAA,cAAmB,OAAO;AAAA,eAAM;AAAA,YACtC,oBAAC,cAAW,WAAU,WAAU;AAAA;AAAA;AAAA,MAClC,GACF;AAAA,OACF;AAAA,KACF,CACD,GACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/home-page/folders.tsx"],"sourcesContent":["import Link from \"next/link\";\nimport { PostPreview } from \"../post-preview\";\nimport { ArrowRight } from \"lucide-react\";\nimport { Opinly } from \"@opinly/backend\";\n\nexport const HomePageFoldersSkeleton = () => {\n return (\n <>\n {Array(2) // render 2 folder sections\n .fill(null)\n .map((_, sectionIdx) => (\n <div key={sectionIdx} className=\"space-y-4 mb-5\">\n {/* Folder title + description */}\n <div className=\"animate-pulse space-y-2\">\n <div className=\"h-8 w-1/3 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"h-4 w-1/2 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n\n {/* Posts grid */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {Array(3) // 3 post placeholders\n .fill(null)\n .map((__, postIdx) => (\n <div key={postIdx} className=\"animate-pulse space-y-3\">\n {/* Image */}\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n {/* Title bar */}\n <div className=\"h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded\" />\n {/* Description line */}\n <div className=\"h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n ))}\n\n {/* “View all” link */}\n <div className=\"flex justify-center items-center animate-pulse\">\n <div className=\"h-4 w-48 bg-gray-200 text-op-heading rounded\" />\n </div>\n </div>\n </div>\n ))}\n </>\n );\n};\n\nexport const HomePageFolders = ({\n folders,\n}: {\n folders: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"folders\"];\n}) => {\n return (\n <div className=\"flex flex-col gap-10 mt-20\">\n {folders.map((folder) => (\n <div className=\"space-y-4\">\n <div className=\"flex flex-col gap-2 mb-20\">\n <Link\n key={folder.slug}\n href={`/blog/${folder.slug}`}\n className=\"text-3xl\"\n >\n {folder.title}\n </Link>\n <p className=\"text-sm text-op-muted\">{folder.description}</p>\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20\">\n {folder.posts\n .filter((post) => post !== null)\n .map((post) => (\n <PostPreview\n key={post.slug}\n post={{\n ...post,\n folder: {\n name: folder.title,\n slug: folder.slug,\n description: folder.description || \"\",\n },\n }}\n />\n ))}\n <div className=\"flex justify-center w-full h-full items-center \">\n <Link\n href={`/blog/${folder.slug}`}\n className=\"flex items-center gap-2\"\n >\n <span>View all posts in {folder.title}</span>\n <ArrowRight className=\"w-4 h-4\" />\n </Link>\n </div>\n </div>\n </div>\n ))}\n </div>\n );\n};\n"],"mappings":"AAOI,mBAOU,KADF,YANR;AAPJ,OAAO,UAAU;AACjB,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAGpB,MAAM,0BAA0B,MAAM;AAC3C,SACE,gCACG,gBAAM,CAAC,EACL,KAAK,IAAI,EACT,IAAI,CAAC,GAAG,eACP,qBAAC,SAAqB,WAAU,kBAE9B;AAAA,yBAAC,SAAI,WAAU,2BACb;AAAA,0BAAC,SAAI,WAAU,kDAAiD;AAAA,MAChE,oBAAC,SAAI,WAAU,kDAAiD;AAAA,OAClE;AAAA,IAGA,qBAAC,SAAI,WAAU,yDACZ;AAAA,YAAM,CAAC,EACL,KAAK,IAAI,EACT,IAAI,CAAC,IAAI,YACR,qBAAC,SAAkB,WAAU,2BAE3B;AAAA,4BAAC,SAAI,WAAU,uDAAsD;AAAA,QAErE,oBAAC,SAAI,WAAU,kDAAiD;AAAA,QAEhE,oBAAC,SAAI,WAAU,mDAAkD;AAAA,WANzD,OAOV,CACD;AAAA,MAGH,oBAAC,SAAI,WAAU,kDACb,8BAAC,SAAI,WAAU,gDAA+C,GAChE;AAAA,OACF;AAAA,OA1BQ,UA2BV,CACD,GACL;AAEJ;AAEO,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AACF,MAKM;AACJ,SACE,oBAAC,SAAI,WAAU,8BACZ,kBAAQ,IAAI,CAAC,WACZ,qBAAC,SAAI,WAAU,aACb;AAAA,yBAAC,SAAI,WAAU,6BACb;AAAA;AAAA,QAAC;AAAA;AAAA,UAEC,MAAM,SAAS,OAAO,IAAI;AAAA,UAC1B,WAAU;AAAA,UAET,iBAAO;AAAA;AAAA,QAJH,OAAO;AAAA,MAKd;AAAA,MACA,oBAAC,OAAE,WAAU,yBAAyB,iBAAO,aAAY;AAAA,OAC3D;AAAA,IACA,qBAAC,SAAI,WAAU,+DACZ;AAAA,aAAO,MACL,OAAO,CAAC,SAAS,SAAS,IAAI,EAC9B,IAAI,CAAC,SACJ;AAAA,QAAC;AAAA;AAAA,UAEC,MAAM;AAAA,YACJ,GAAG;AAAA,YACH,QAAQ;AAAA,cACN,MAAM,OAAO;AAAA,cACb,MAAM,OAAO;AAAA,cACb,aAAa,OAAO,eAAe;AAAA,YACrC;AAAA,UACF;AAAA;AAAA,QARK,KAAK;AAAA,MASZ,CACD;AAAA,MACH,oBAAC,SAAI,WAAU,mDACb;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,SAAS,OAAO,IAAI;AAAA,UAC1B,WAAU;AAAA,UAEV;AAAA,iCAAC,UAAK;AAAA;AAAA,cAAmB,OAAO;AAAA,eAAM;AAAA,YACtC,oBAAC,cAAW,WAAU,WAAU;AAAA;AAAA;AAAA,MAClC,GACF;AAAA,OACF;AAAA,KACF,CACD,GACH;AAEJ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opinly/next",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "dist/index.cjs",
@@ -31,7 +31,7 @@
31
31
  "schema-dts": "^1.1.5",
32
32
  "tailwind-merge": "^1.14.0",
33
33
  "zod": "^3.25.67",
34
- "@opinly/backend": "0.1.18"
34
+ "@opinly/backend": "0.1.19"
35
35
  },
36
36
  "engines": {
37
37
  "node": ">=16"