@opinly/next 0.1.25 → 1.0.0-alpha.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.
Files changed (209) hide show
  1. package/dist/config.cjs +16 -7
  2. package/dist/config.cjs.map +1 -1
  3. package/dist/config.d.cts +7 -2
  4. package/dist/config.d.ts +7 -2
  5. package/dist/config.js +16 -7
  6. package/dist/config.js.map +1 -1
  7. package/dist/index.cjs +33 -3
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +12 -6
  10. package/dist/index.d.ts +12 -6
  11. package/dist/index.js +26 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/json-ld.cjs +61 -0
  14. package/dist/json-ld.cjs.map +1 -0
  15. package/dist/json-ld.d.cts +17 -0
  16. package/dist/json-ld.d.ts +17 -0
  17. package/dist/json-ld.js +38 -0
  18. package/dist/json-ld.js.map +1 -0
  19. package/dist/utils/generate-metadata.cjs +23 -32
  20. package/dist/utils/generate-metadata.cjs.map +1 -1
  21. package/dist/utils/generate-metadata.d.cts +11 -2
  22. package/dist/utils/generate-metadata.d.ts +11 -2
  23. package/dist/utils/generate-metadata.js +23 -32
  24. package/dist/utils/generate-metadata.js.map +1 -1
  25. package/dist/utils/generate-sitemap-xml.cjs.map +1 -1
  26. package/dist/utils/generate-sitemap-xml.d.cts +5 -3
  27. package/dist/utils/generate-sitemap-xml.d.ts +5 -3
  28. package/dist/utils/generate-sitemap-xml.js.map +1 -1
  29. package/dist/utils/sdk-config.cjs +6 -2
  30. package/dist/utils/sdk-config.cjs.map +1 -1
  31. package/dist/utils/sdk-config.d.cts +4 -0
  32. package/dist/utils/sdk-config.d.ts +4 -0
  33. package/dist/utils/sdk-config.js +6 -2
  34. package/dist/utils/sdk-config.js.map +1 -1
  35. package/package.json +9 -23
  36. package/dist/components/author-page/_helpers/json-ld.cjs +0 -44
  37. package/dist/components/author-page/_helpers/json-ld.cjs.map +0 -1
  38. package/dist/components/author-page/_helpers/json-ld.d.cts +0 -8
  39. package/dist/components/author-page/_helpers/json-ld.d.ts +0 -8
  40. package/dist/components/author-page/_helpers/json-ld.js +0 -20
  41. package/dist/components/author-page/_helpers/json-ld.js.map +0 -1
  42. package/dist/components/author-page/index.cjs +0 -104
  43. package/dist/components/author-page/index.cjs.map +0 -1
  44. package/dist/components/author-page/index.d.cts +0 -10
  45. package/dist/components/author-page/index.d.ts +0 -10
  46. package/dist/components/author-page/index.js +0 -70
  47. package/dist/components/author-page/index.js.map +0 -1
  48. package/dist/components/authors-page/_helpers/json-ld.cjs +0 -53
  49. package/dist/components/authors-page/_helpers/json-ld.cjs.map +0 -1
  50. package/dist/components/authors-page/_helpers/json-ld.d.cts +0 -8
  51. package/dist/components/authors-page/_helpers/json-ld.d.ts +0 -8
  52. package/dist/components/authors-page/_helpers/json-ld.js +0 -29
  53. package/dist/components/authors-page/_helpers/json-ld.js.map +0 -1
  54. package/dist/components/authors-page/index.cjs +0 -121
  55. package/dist/components/authors-page/index.cjs.map +0 -1
  56. package/dist/components/authors-page/index.d.cts +0 -10
  57. package/dist/components/authors-page/index.d.ts +0 -10
  58. package/dist/components/authors-page/index.js +0 -87
  59. package/dist/components/authors-page/index.js.map +0 -1
  60. package/dist/components/blog-post/_components/content.cjs +0 -157
  61. package/dist/components/blog-post/_components/content.cjs.map +0 -1
  62. package/dist/components/blog-post/_components/content.d.cts +0 -10
  63. package/dist/components/blog-post/_components/content.d.ts +0 -10
  64. package/dist/components/blog-post/_components/content.js +0 -123
  65. package/dist/components/blog-post/_components/content.js.map +0 -1
  66. package/dist/components/blog-post/_components/faq.cjs +0 -39
  67. package/dist/components/blog-post/_components/faq.cjs.map +0 -1
  68. package/dist/components/blog-post/_components/faq.d.cts +0 -9
  69. package/dist/components/blog-post/_components/faq.d.ts +0 -9
  70. package/dist/components/blog-post/_components/faq.js +0 -15
  71. package/dist/components/blog-post/_components/faq.js.map +0 -1
  72. package/dist/components/blog-post/_components/share.cjs +0 -100
  73. package/dist/components/blog-post/_components/share.cjs.map +0 -1
  74. package/dist/components/blog-post/_components/share.d.cts +0 -9
  75. package/dist/components/blog-post/_components/share.d.ts +0 -9
  76. package/dist/components/blog-post/_components/share.js +0 -66
  77. package/dist/components/blog-post/_components/share.js.map +0 -1
  78. package/dist/components/blog-post/_components/table-of-contents.cjs +0 -111
  79. package/dist/components/blog-post/_components/table-of-contents.cjs.map +0 -1
  80. package/dist/components/blog-post/_components/table-of-contents.d.cts +0 -14
  81. package/dist/components/blog-post/_components/table-of-contents.d.ts +0 -14
  82. package/dist/components/blog-post/_components/table-of-contents.js +0 -77
  83. package/dist/components/blog-post/_components/table-of-contents.js.map +0 -1
  84. package/dist/components/blog-post/_helpers/calc-reading-time.cjs +0 -2
  85. package/dist/components/blog-post/_helpers/calc-reading-time.cjs.map +0 -1
  86. package/dist/components/blog-post/_helpers/calc-reading-time.d.cts +0 -2
  87. package/dist/components/blog-post/_helpers/calc-reading-time.d.ts +0 -2
  88. package/dist/components/blog-post/_helpers/calc-reading-time.js +0 -1
  89. package/dist/components/blog-post/_helpers/calc-reading-time.js.map +0 -1
  90. package/dist/components/blog-post/_helpers/extract-headings.cjs +0 -45
  91. package/dist/components/blog-post/_helpers/extract-headings.cjs.map +0 -1
  92. package/dist/components/blog-post/_helpers/extract-headings.d.cts +0 -9
  93. package/dist/components/blog-post/_helpers/extract-headings.d.ts +0 -9
  94. package/dist/components/blog-post/_helpers/extract-headings.js +0 -21
  95. package/dist/components/blog-post/_helpers/extract-headings.js.map +0 -1
  96. package/dist/components/blog-post/_helpers/json-ld.cjs +0 -162
  97. package/dist/components/blog-post/_helpers/json-ld.cjs.map +0 -1
  98. package/dist/components/blog-post/_helpers/json-ld.d.cts +0 -15
  99. package/dist/components/blog-post/_helpers/json-ld.d.ts +0 -15
  100. package/dist/components/blog-post/_helpers/json-ld.js +0 -135
  101. package/dist/components/blog-post/_helpers/json-ld.js.map +0 -1
  102. package/dist/components/blog-post/_helpers/reading-time.cjs +0 -50
  103. package/dist/components/blog-post/_helpers/reading-time.cjs.map +0 -1
  104. package/dist/components/blog-post/_helpers/reading-time.d.cts +0 -6
  105. package/dist/components/blog-post/_helpers/reading-time.d.ts +0 -6
  106. package/dist/components/blog-post/_helpers/reading-time.js +0 -25
  107. package/dist/components/blog-post/_helpers/reading-time.js.map +0 -1
  108. package/dist/components/blog-post/_types/blog-post.cjs +0 -17
  109. package/dist/components/blog-post/_types/blog-post.cjs.map +0 -1
  110. package/dist/components/blog-post/_types/blog-post.d.cts +0 -7
  111. package/dist/components/blog-post/_types/blog-post.d.ts +0 -7
  112. package/dist/components/blog-post/_types/blog-post.js +0 -1
  113. package/dist/components/blog-post/_types/blog-post.js.map +0 -1
  114. package/dist/components/blog-post/_types/class-names.cjs +0 -17
  115. package/dist/components/blog-post/_types/class-names.cjs.map +0 -1
  116. package/dist/components/blog-post/_types/class-names.d.cts +0 -12
  117. package/dist/components/blog-post/_types/class-names.d.ts +0 -12
  118. package/dist/components/blog-post/_types/class-names.js +0 -1
  119. package/dist/components/blog-post/_types/class-names.js.map +0 -1
  120. package/dist/components/blog-post/index.cjs +0 -134
  121. package/dist/components/blog-post/index.cjs.map +0 -1
  122. package/dist/components/blog-post/index.d.cts +0 -15
  123. package/dist/components/blog-post/index.d.ts +0 -15
  124. package/dist/components/blog-post/index.js +0 -100
  125. package/dist/components/blog-post/index.js.map +0 -1
  126. package/dist/components/bread-crumbs.cjs +0 -60
  127. package/dist/components/bread-crumbs.cjs.map +0 -1
  128. package/dist/components/bread-crumbs.d.cts +0 -10
  129. package/dist/components/bread-crumbs.d.ts +0 -10
  130. package/dist/components/bread-crumbs.js +0 -26
  131. package/dist/components/bread-crumbs.js.map +0 -1
  132. package/dist/components/folder-page/_helpers/json-ld.cjs +0 -43
  133. package/dist/components/folder-page/_helpers/json-ld.cjs.map +0 -1
  134. package/dist/components/folder-page/_helpers/json-ld.d.cts +0 -8
  135. package/dist/components/folder-page/_helpers/json-ld.d.ts +0 -8
  136. package/dist/components/folder-page/_helpers/json-ld.js +0 -19
  137. package/dist/components/folder-page/_helpers/json-ld.js.map +0 -1
  138. package/dist/components/folder-page/index.cjs +0 -84
  139. package/dist/components/folder-page/index.cjs.map +0 -1
  140. package/dist/components/folder-page/index.d.cts +0 -10
  141. package/dist/components/folder-page/index.d.ts +0 -10
  142. package/dist/components/folder-page/index.js +0 -60
  143. package/dist/components/folder-page/index.js.map +0 -1
  144. package/dist/components/home-page/_helpers/json-ld.cjs +0 -43
  145. package/dist/components/home-page/_helpers/json-ld.cjs.map +0 -1
  146. package/dist/components/home-page/_helpers/json-ld.d.cts +0 -3
  147. package/dist/components/home-page/_helpers/json-ld.d.ts +0 -3
  148. package/dist/components/home-page/_helpers/json-ld.js +0 -19
  149. package/dist/components/home-page/_helpers/json-ld.js.map +0 -1
  150. package/dist/components/home-page/folders.cjs +0 -108
  151. package/dist/components/home-page/folders.cjs.map +0 -1
  152. package/dist/components/home-page/folders.d.cts +0 -11
  153. package/dist/components/home-page/folders.d.ts +0 -11
  154. package/dist/components/home-page/folders.js +0 -73
  155. package/dist/components/home-page/folders.js.map +0 -1
  156. package/dist/components/home-page/index.cjs +0 -50
  157. package/dist/components/home-page/index.cjs.map +0 -1
  158. package/dist/components/home-page/index.d.cts +0 -14
  159. package/dist/components/home-page/index.d.ts +0 -14
  160. package/dist/components/home-page/index.js +0 -26
  161. package/dist/components/home-page/index.js.map +0 -1
  162. package/dist/components/home-page/pagination.cjs +0 -97
  163. package/dist/components/home-page/pagination.cjs.map +0 -1
  164. package/dist/components/home-page/pagination.d.cts +0 -9
  165. package/dist/components/home-page/pagination.d.ts +0 -9
  166. package/dist/components/home-page/pagination.js +0 -63
  167. package/dist/components/home-page/pagination.js.map +0 -1
  168. package/dist/components/home-page/top-posts.cjs +0 -35
  169. package/dist/components/home-page/top-posts.cjs.map +0 -1
  170. package/dist/components/home-page/top-posts.d.cts +0 -10
  171. package/dist/components/home-page/top-posts.d.ts +0 -10
  172. package/dist/components/home-page/top-posts.js +0 -11
  173. package/dist/components/home-page/top-posts.js.map +0 -1
  174. package/dist/components/json-ld.cjs +0 -92
  175. package/dist/components/json-ld.cjs.map +0 -1
  176. package/dist/components/json-ld.d.cts +0 -13
  177. package/dist/components/json-ld.d.ts +0 -13
  178. package/dist/components/json-ld.js +0 -57
  179. package/dist/components/json-ld.js.map +0 -1
  180. package/dist/components/opinly-blog.cjs +0 -59
  181. package/dist/components/opinly-blog.cjs.map +0 -1
  182. package/dist/components/opinly-blog.d.cts +0 -16
  183. package/dist/components/opinly-blog.d.ts +0 -16
  184. package/dist/components/opinly-blog.js +0 -35
  185. package/dist/components/opinly-blog.js.map +0 -1
  186. package/dist/components/post-preview.cjs +0 -114
  187. package/dist/components/post-preview.cjs.map +0 -1
  188. package/dist/components/post-preview.d.cts +0 -10
  189. package/dist/components/post-preview.d.ts +0 -10
  190. package/dist/components/post-preview.js +0 -79
  191. package/dist/components/post-preview.js.map +0 -1
  192. package/dist/pages/index.cjs +0 -23
  193. package/dist/pages/index.cjs.map +0 -1
  194. package/dist/pages/index.d.cts +0 -3
  195. package/dist/pages/index.d.ts +0 -3
  196. package/dist/pages/index.js +0 -2
  197. package/dist/pages/index.js.map +0 -1
  198. package/dist/pages/opinly-blog-pages.cjs +0 -127
  199. package/dist/pages/opinly-blog-pages.cjs.map +0 -1
  200. package/dist/pages/opinly-blog-pages.d.cts +0 -9
  201. package/dist/pages/opinly-blog-pages.d.ts +0 -9
  202. package/dist/pages/opinly-blog-pages.js +0 -103
  203. package/dist/pages/opinly-blog-pages.js.map +0 -1
  204. package/dist/utils/json-ld.cjs +0 -2
  205. package/dist/utils/json-ld.cjs.map +0 -1
  206. package/dist/utils/json-ld.d.cts +0 -2
  207. package/dist/utils/json-ld.d.ts +0 -2
  208. package/dist/utils/json-ld.js +0 -1
  209. package/dist/utils/json-ld.js.map +0 -1
@@ -1,10 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { JSONContent } from '@tiptap/core';
3
- import { BlogComponentClassNames } from '../_types/class-names.cjs';
4
-
5
- declare const Content: ({ content, classNames, }: {
6
- content: JSONContent;
7
- classNames: BlogComponentClassNames;
8
- }) => react_jsx_runtime.JSX.Element;
9
-
10
- export { Content };
@@ -1,10 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { JSONContent } from '@tiptap/core';
3
- import { BlogComponentClassNames } from '../_types/class-names.js';
4
-
5
- declare const Content: ({ content, classNames, }: {
6
- content: JSONContent;
7
- classNames: BlogComponentClassNames;
8
- }) => react_jsx_runtime.JSX.Element;
9
-
10
- export { Content };
@@ -1,123 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { cn } from "../../../utils/merge";
3
- import Link from "next/link";
4
- import Image from "next/image";
5
- import { opinlyConfig } from "../../../utils/sdk-config";
6
- import React from "react";
7
- function renderTiptapContent(content, classNames) {
8
- if (!content?.content) return [];
9
- return content.content.map((node, index) => {
10
- switch (node.type) {
11
- case "paragraph":
12
- return /* @__PURE__ */ jsx("p", { className: classNames.paragraph || "mb-4", children: renderChildren(node.content, classNames) }, index);
13
- case "heading": {
14
- const text = node.content?.[0]?.text ?? "";
15
- const slug = text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
16
- const Tag = `h${node.attrs?.level || 1}`;
17
- return /* @__PURE__ */ jsx(
18
- Tag,
19
- {
20
- id: slug,
21
- className: classNames.heading || "mt-8 mb-4 font-bold text-op-heading",
22
- children: renderChildren(node.content, classNames)
23
- },
24
- index
25
- );
26
- }
27
- case "image":
28
- const fileKey = node.attrs?.fileKey;
29
- if (!fileKey) {
30
- return null;
31
- }
32
- return /* @__PURE__ */ jsx(
33
- "div",
34
- {
35
- className: cn(
36
- "w-full max-w-[800px] my-10 rounded-lg overflow-hidden flex items-center justify-center",
37
- classNames.image
38
- ),
39
- children: /* @__PURE__ */ jsx(
40
- Image,
41
- {
42
- unoptimized: opinlyConfig.unoptimizedImages,
43
- src: `${opinlyConfig.imagesPrefix}/${fileKey}`,
44
- title: node.attrs?.title || "",
45
- alt: node.attrs?.alt || "",
46
- width: 800,
47
- height: 400,
48
- className: "rounded-lg max-w-full max-h-full"
49
- }
50
- )
51
- },
52
- index
53
- );
54
- case "bulletList":
55
- return /* @__PURE__ */ jsx(
56
- "ul",
57
- {
58
- className: cn("list-disc pl-6 my-4", classNames.bulletList),
59
- children: renderTiptapContent(node, classNames)
60
- },
61
- index
62
- );
63
- case "orderedList":
64
- return /* @__PURE__ */ jsx(
65
- "ol",
66
- {
67
- className: cn("list-decimal pl-6 my-4", classNames.orderedList),
68
- children: renderTiptapContent(node, classNames)
69
- },
70
- index
71
- );
72
- case "listItem":
73
- if (node.content && node.content.length === 1 && node.content[0].type === "paragraph") {
74
- return /* @__PURE__ */ jsx("li", { className: cn("my-1", classNames.listItem), children: renderChildren(node.content[0].content, classNames) }, index);
75
- }
76
- return /* @__PURE__ */ jsx("li", { className: cn("my-1", classNames.listItem), children: renderChildren(node.content, classNames) }, index);
77
- default:
78
- return null;
79
- }
80
- }).filter(Boolean);
81
- }
82
- const Content = ({
83
- content,
84
- classNames
85
- }) => {
86
- return /* @__PURE__ */ jsx("div", { className: "prose min-w-full", children: renderTiptapContent(content, classNames) });
87
- };
88
- function renderChildren(nodes, classNames) {
89
- if (!nodes) {
90
- return [];
91
- }
92
- return nodes.map((child, idx) => {
93
- if (child.type === "text") {
94
- let text = child.text;
95
- if (child.marks) {
96
- child.marks.forEach((mark) => {
97
- if (mark.type === "bold") text = /* @__PURE__ */ jsx("strong", { children: text }, idx);
98
- if (mark.type === "italic") text = /* @__PURE__ */ jsx("em", { children: text }, idx);
99
- if (mark.type === "link")
100
- text = /* @__PURE__ */ jsx(
101
- Link,
102
- {
103
- href: mark.attrs?.href,
104
- className: classNames.link || "text-blue-600 underline",
105
- children: text
106
- },
107
- idx
108
- );
109
- });
110
- }
111
- return /* @__PURE__ */ jsx("span", { children: text }, idx);
112
- } else {
113
- return /* @__PURE__ */ jsx(React.Fragment, { children: renderTiptapContent(
114
- { ...child, content: child.content },
115
- classNames
116
- ) }, idx);
117
- }
118
- }).filter(Boolean);
119
- }
120
- export {
121
- Content
122
- };
123
- //# sourceMappingURL=content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/blog-post/_components/content.tsx"],"sourcesContent":["import type { JSONContent } from \"@tiptap/core\";\nimport { BlogComponentClassNames } from \"../_types/class-names\";\nimport { cn } from \"../../../utils/merge\";\nimport Link from \"next/link\";\nimport { JSX } from \"react\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../../utils/sdk-config\";\nimport React from \"react\";\n\nfunction renderTiptapContent(\n content: JSONContent,\n classNames: BlogComponentClassNames\n): React.ReactNode[] {\n if (!content?.content) return [];\n\n return content.content\n .map((node, index) => {\n switch (node.type) {\n case \"paragraph\":\n return (\n <p key={index} className={classNames.paragraph || \"mb-4\"}>\n {renderChildren(node.content, classNames)}\n </p>\n );\n case \"heading\": {\n const text = node.content?.[0]?.text ?? \"\";\n const slug = text\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n const Tag = `h${\n node.attrs?.level || 1\n }` as keyof JSX.IntrinsicElements;\n return (\n <Tag\n key={index}\n id={slug}\n className={\n classNames.heading || \"mt-8 mb-4 font-bold text-op-heading\"\n }\n >\n {renderChildren(node.content, classNames)}\n </Tag>\n );\n }\n case \"image\":\n const fileKey = node.attrs?.fileKey;\n\n if (!fileKey) {\n return null;\n }\n\n return (\n <div\n key={index}\n className={cn(\n \"w-full max-w-[800px] my-10 rounded-lg overflow-hidden flex items-center justify-center\",\n classNames.image\n )}\n >\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n src={`${opinlyConfig.imagesPrefix}/${fileKey}`}\n title={node.attrs?.title || \"\"}\n alt={node.attrs?.alt || \"\"}\n width={800}\n height={400}\n className=\"rounded-lg max-w-full max-h-full\"\n />\n </div>\n );\n case \"bulletList\":\n return (\n <ul\n key={index}\n className={cn(\"list-disc pl-6 my-4\", classNames.bulletList)}\n >\n {renderTiptapContent(node, classNames)}\n </ul>\n );\n case \"orderedList\":\n return (\n <ol\n key={index}\n className={cn(\"list-decimal pl-6 my-4\", classNames.orderedList)}\n >\n {renderTiptapContent(node, classNames)}\n </ol>\n );\n case \"listItem\":\n if (\n node.content &&\n node.content.length === 1 &&\n node.content[0].type === \"paragraph\"\n ) {\n return (\n <li key={index} className={cn(\"my-1\", classNames.listItem)}>\n {renderChildren(node.content[0].content, classNames)}\n </li>\n );\n }\n return (\n <li key={index} className={cn(\"my-1\", classNames.listItem)}>\n {renderChildren(node.content, classNames)}\n </li>\n );\n default:\n return null;\n }\n })\n .filter(Boolean);\n}\n\nexport const Content = ({\n content,\n classNames,\n}: {\n content: JSONContent;\n classNames: BlogComponentClassNames;\n}) => {\n return (\n <div className=\"prose min-w-full\">\n {renderTiptapContent(content, classNames)}\n </div>\n );\n};\n\nfunction renderChildren(\n nodes: JSONContent[\"content\"] | undefined,\n classNames: BlogComponentClassNames\n): JSX.Element[] {\n if (!nodes) {\n return [];\n }\n\n return nodes\n .map((child, idx) => {\n if (child.type === \"text\") {\n let text: React.ReactNode = child.text;\n if (child.marks) {\n child.marks.forEach((mark) => {\n if (mark.type === \"bold\") text = <strong key={idx}>{text}</strong>;\n if (mark.type === \"italic\") text = <em key={idx}>{text}</em>;\n if (mark.type === \"link\")\n text = (\n <Link\n key={idx}\n href={mark.attrs?.href}\n className={classNames.link || \"text-blue-600 underline\"}\n >\n {text}\n </Link>\n );\n });\n }\n return <span key={idx}>{text}</span>;\n } else {\n // Recursively render non-text nodes (e.g., paragraph, listItem, etc.)\n return (\n <React.Fragment key={idx}>\n {renderTiptapContent(\n { ...child, content: child.content },\n classNames\n )}\n </React.Fragment>\n );\n }\n })\n .filter(Boolean) as JSX.Element[];\n}\n"],"mappings":"AAoBY;AAlBZ,SAAS,UAAU;AACnB,OAAO,UAAU;AAEjB,OAAO,WAAW;AAClB,S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,cAJI;AAAA,YAKP;AAAA,QAEN,CAAC;AAAA,MACH;AACA,aAAO,oBAAC,UAAgB,kBAAN,GAAW;AAAA,IAC/B,OAAO;AAEL,aACE,oBAAC,MAAM,UAAN,EACE;AAAA,QACC,EAAE,GAAG,OAAO,SAAS,MAAM,QAAQ;AAAA,QACnC;AAAA,MACF,KAJmB,GAKrB;AAAA,IAEJ;AAAA,EACF,CAAC,EACA,OAAO,OAAO;AACnB;","names":[]}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var faq_exports = {};
20
- __export(faq_exports, {
21
- FAQS: () => FAQS
22
- });
23
- module.exports = __toCommonJS(faq_exports);
24
- var import_jsx_runtime = require("react/jsx-runtime");
25
- const FAQS = ({ faqs }) => {
26
- if (!faqs) return null;
27
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
28
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-lg font-semibold mb-2", children: "FAQS" }),
29
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { children: faqs.map((faq) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { children: [
30
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-lg text-op-heading font-semibold mb-2", children: faq.question }),
31
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-op-body", children: faq.answer })
32
- ] }, faq.question)) })
33
- ] });
34
- };
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {
37
- FAQS
38
- });
39
- //# sourceMappingURL=faq.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/blog-post/_components/faq.tsx"],"sourcesContent":["import { BlogPostRes } from \"../_types/blog-post\";\n\nexport const FAQS = ({ faqs }: { faqs: BlogPostRes[\"faqs\"] }) => {\n if (!faqs) return null;\n return (\n <div>\n <h2 className=\"text-lg font-semibold mb-2\">FAQS</h2>\n <ul>\n {faqs.map((faq) => (\n <li key={faq.question}>\n <h3 className=\"text-lg text-op-heading font-semibold mb-2\">\n {faq.question}\n </h3>\n <p className=\"text-sm text-op-body\">{faq.answer}</p>\n </li>\n ))}\n </ul>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMM;AAJC,MAAM,OAAO,CAAC,EAAE,KAAK,MAAqC;AAC/D,MAAI,CAAC,KAAM,QAAO;AAClB,SACE,6CAAC,SACC;AAAA,gDAAC,QAAG,WAAU,8BAA6B,kBAAI;AAAA,IAC/C,4CAAC,QACE,eAAK,IAAI,CAAC,QACT,6CAAC,QACC;AAAA,kDAAC,QAAG,WAAU,8CACX,cAAI,UACP;AAAA,MACA,4CAAC,OAAE,WAAU,wBAAwB,cAAI,QAAO;AAAA,SAJzC,IAAI,QAKb,CACD,GACH;AAAA,KACF;AAEJ;","names":[]}
@@ -1,9 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { BlogPostRes } from '../_types/blog-post.cjs';
3
- import '@opinly/backend';
4
-
5
- declare const FAQS: ({ faqs }: {
6
- faqs: BlogPostRes["faqs"];
7
- }) => react_jsx_runtime.JSX.Element | null;
8
-
9
- export { FAQS };
@@ -1,9 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { BlogPostRes } from '../_types/blog-post.js';
3
- import '@opinly/backend';
4
-
5
- declare const FAQS: ({ faqs }: {
6
- faqs: BlogPostRes["faqs"];
7
- }) => react_jsx_runtime.JSX.Element | null;
8
-
9
- export { FAQS };
@@ -1,15 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- const FAQS = ({ faqs }) => {
3
- if (!faqs) return null;
4
- return /* @__PURE__ */ jsxs("div", { children: [
5
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold mb-2", children: "FAQS" }),
6
- /* @__PURE__ */ jsx("ul", { children: faqs.map((faq) => /* @__PURE__ */ jsxs("li", { children: [
7
- /* @__PURE__ */ jsx("h3", { className: "text-lg text-op-heading font-semibold mb-2", children: faq.question }),
8
- /* @__PURE__ */ jsx("p", { className: "text-sm text-op-body", children: faq.answer })
9
- ] }, faq.question)) })
10
- ] });
11
- };
12
- export {
13
- FAQS
14
- };
15
- //# sourceMappingURL=faq.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/blog-post/_components/faq.tsx"],"sourcesContent":["import { BlogPostRes } from \"../_types/blog-post\";\n\nexport const FAQS = ({ faqs }: { faqs: BlogPostRes[\"faqs\"] }) => {\n if (!faqs) return null;\n return (\n <div>\n <h2 className=\"text-lg font-semibold mb-2\">FAQS</h2>\n <ul>\n {faqs.map((faq) => (\n <li key={faq.question}>\n <h3 className=\"text-lg text-op-heading font-semibold mb-2\">\n {faq.question}\n </h3>\n <p className=\"text-sm text-op-body\">{faq.answer}</p>\n </li>\n ))}\n </ul>\n </div>\n );\n};\n"],"mappings":"AAMM,cAGI,YAHJ;AAJC,MAAM,OAAO,CAAC,EAAE,KAAK,MAAqC;AAC/D,MAAI,CAAC,KAAM,QAAO;AAClB,SACE,qBAAC,SACC;AAAA,wBAAC,QAAG,WAAU,8BAA6B,kBAAI;AAAA,IAC/C,oBAAC,QACE,eAAK,IAAI,CAAC,QACT,qBAAC,QACC;AAAA,0BAAC,QAAG,WAAU,8CACX,cAAI,UACP;AAAA,MACA,oBAAC,OAAE,WAAU,wBAAwB,cAAI,QAAO;AAAA,SAJzC,IAAI,QAKb,CACD,GACH;AAAA,KACF;AAEJ;","names":[]}
@@ -1,100 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var share_exports = {};
30
- __export(share_exports, {
31
- Share: () => Share
32
- });
33
- module.exports = __toCommonJS(share_exports);
34
- var import_jsx_runtime = require("react/jsx-runtime");
35
- var import_lucide_react = require("lucide-react");
36
- var import_link = __toESM(require("next/link"), 1);
37
- var import_sdk_config = require("../../../utils/sdk-config");
38
- const Share = ({ post }) => {
39
- const postUrl = encodeURIComponent(`${import_sdk_config.opinlyConfig.blogUrl}/${post.slug}`);
40
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-2 mb-6", children: [
41
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
42
- import_link.default,
43
- {
44
- href: `https://linkedin.com/sharing/share-offsite?url=${postUrl}`,
45
- target: "_blank",
46
- rel: "noopener noreferrer",
47
- className: "border p-1 rounded flex items-center justify-center w-8 h-8",
48
- children: [
49
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Share on LinkedIn" }),
50
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Linkedin, { className: "w-4 h-4" })
51
- ]
52
- }
53
- ),
54
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
55
- import_link.default,
56
- {
57
- href: `https://twitter.com/intent/tweet?url=${postUrl}&text=${encodeURIComponent(
58
- `Check out this article by ${post.author?.name}`
59
- )}`,
60
- target: "_blank",
61
- rel: "noopener noreferrer",
62
- className: "border p-1 rounded flex items-center justify-center w-8 h-8",
63
- children: [
64
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Share on Twitter" }),
65
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Twitter, {})
66
- ]
67
- }
68
- ),
69
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
70
- import_link.default,
71
- {
72
- href: `https://facebook.com/sharer/sharer.php?u=${postUrl}`,
73
- target: "_blank",
74
- rel: "noopener noreferrer",
75
- className: "border p-1 rounded flex items-center justify-center w-8 h-8",
76
- children: [
77
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Share on Facebook" }),
78
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Facebook, {})
79
- ]
80
- }
81
- ),
82
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
83
- import_link.default,
84
- {
85
- href: `mailto:?body=${encodeURIComponent(`${post.title}
86
- ${postUrl}`)}`,
87
- className: "border p-1 rounded flex items-center justify-center w-8 h-8",
88
- children: [
89
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Share via Email" }),
90
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Mail, { className: "w-4 h-4" })
91
- ]
92
- }
93
- )
94
- ] });
95
- };
96
- // Annotate the CommonJS export names for ESM import in node:
97
- 0 && (module.exports = {
98
- Share
99
- });
100
- //# sourceMappingURL=share.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/blog-post/_components/share.tsx"],"sourcesContent":["import { Facebook, Linkedin, Mail, Twitter } from \"lucide-react\";\nimport Link from \"next/link\";\nimport { opinlyConfig } from \"../../../utils/sdk-config\";\nimport { BlogPostRes } from \"../_types/blog-post\";\n\nexport const Share = ({ post }: { post: BlogPostRes }) => {\n const postUrl = encodeURIComponent(`${opinlyConfig.blogUrl}/${post.slug}`);\n return (\n <div className=\"flex gap-2 mb-6\">\n <Link\n href={`https://linkedin.com/sharing/share-offsite?url=${postUrl}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"border p-1 rounded flex items-center justify-center w-8 h-8\"\n >\n <span className=\"sr-only\">Share on LinkedIn</span>\n <Linkedin className=\"w-4 h-4\" />\n </Link>\n <Link\n href={`https://twitter.com/intent/tweet?url=${postUrl}&text=${encodeURIComponent(\n `Check out this article by ${post.author?.name}`\n )}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"border p-1 rounded flex items-center justify-center w-8 h-8\"\n >\n <span className=\"sr-only\">Share on Twitter</span>\n <Twitter />\n </Link>\n <Link\n href={`https://facebook.com/sharer/sharer.php?u=${postUrl}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"border p-1 rounded flex items-center justify-center w-8 h-8\"\n >\n <span className=\"sr-only\">Share on Facebook</span>\n <Facebook />\n </Link>\n <Link\n href={`mailto:?body=${encodeURIComponent(`${post.title}\\n${postUrl}`)}`}\n className=\"border p-1 rounded flex items-center justify-center w-8 h-8\"\n >\n <span className=\"sr-only\">Share via Email</span>\n <Mail className=\"w-4 h-4\" />\n </Link>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASM;AATN,0BAAkD;AAClD,kBAAiB;AACjB,wBAA6B;AAGtB,MAAM,QAAQ,CAAC,EAAE,KAAK,MAA6B;AACxD,QAAM,UAAU,mBAAmB,GAAG,+BAAa,OAAO,IAAI,KAAK,IAAI,EAAE;AACzE,SACE,6CAAC,SAAI,WAAU,mBACb;AAAA;AAAA,MAAC,YAAAA;AAAA,MAAA;AAAA,QACC,MAAM,kDAAkD,OAAO;AAAA,QAC/D,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,WAAU;AAAA,QAEV;AAAA,sDAAC,UAAK,WAAU,WAAU,+BAAiB;AAAA,UAC3C,4CAAC,gCAAS,WAAU,WAAU;AAAA;AAAA;AAAA,IAChC;AAAA,IACA;AAAA,MAAC,YAAAA;AAAA,MAAA;AAAA,QACC,MAAM,wCAAwC,OAAO,SAAS;AAAA,UAC5D,6BAA6B,KAAK,QAAQ,IAAI;AAAA,QAChD,CAAC;AAAA,QACD,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,WAAU;AAAA,QAEV;AAAA,sDAAC,UAAK,WAAU,WAAU,8BAAgB;AAAA,UAC1C,4CAAC,+BAAQ;AAAA;AAAA;AAAA,IACX;AAAA,IACA;AAAA,MAAC,YAAAA;AAAA,MAAA;AAAA,QACC,MAAM,4CAA4C,OAAO;AAAA,QACzD,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,WAAU;AAAA,QAEV;AAAA,sDAAC,UAAK,WAAU,WAAU,+BAAiB;AAAA,UAC3C,4CAAC,gCAAS;AAAA;AAAA;AAAA,IACZ;AAAA,IACA;AAAA,MAAC,YAAAA;AAAA,MAAA;AAAA,QACC,MAAM,gBAAgB,mBAAmB,GAAG,KAAK,KAAK;AAAA,EAAK,OAAO,EAAE,CAAC;AAAA,QACrE,WAAU;AAAA,QAEV;AAAA,sDAAC,UAAK,WAAU,WAAU,6BAAe;AAAA,UACzC,4CAAC,4BAAK,WAAU,WAAU;AAAA;AAAA;AAAA,IAC5B;AAAA,KACF;AAEJ;","names":["Link"]}
@@ -1,9 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { BlogPostRes } from '../_types/blog-post.cjs';
3
- import '@opinly/backend';
4
-
5
- declare const Share: ({ post }: {
6
- post: BlogPostRes;
7
- }) => react_jsx_runtime.JSX.Element;
8
-
9
- export { Share };
@@ -1,9 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { BlogPostRes } from '../_types/blog-post.js';
3
- import '@opinly/backend';
4
-
5
- declare const Share: ({ post }: {
6
- post: BlogPostRes;
7
- }) => react_jsx_runtime.JSX.Element;
8
-
9
- export { Share };
@@ -1,66 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Facebook, Linkedin, Mail, Twitter } from "lucide-react";
3
- import Link from "next/link";
4
- import { opinlyConfig } from "../../../utils/sdk-config";
5
- const Share = ({ post }) => {
6
- const postUrl = encodeURIComponent(`${opinlyConfig.blogUrl}/${post.slug}`);
7
- return /* @__PURE__ */ jsxs("div", { className: "flex gap-2 mb-6", children: [
8
- /* @__PURE__ */ jsxs(
9
- Link,
10
- {
11
- href: `https://linkedin.com/sharing/share-offsite?url=${postUrl}`,
12
- target: "_blank",
13
- rel: "noopener noreferrer",
14
- className: "border p-1 rounded flex items-center justify-center w-8 h-8",
15
- children: [
16
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Share on LinkedIn" }),
17
- /* @__PURE__ */ jsx(Linkedin, { className: "w-4 h-4" })
18
- ]
19
- }
20
- ),
21
- /* @__PURE__ */ jsxs(
22
- Link,
23
- {
24
- href: `https://twitter.com/intent/tweet?url=${postUrl}&text=${encodeURIComponent(
25
- `Check out this article by ${post.author?.name}`
26
- )}`,
27
- target: "_blank",
28
- rel: "noopener noreferrer",
29
- className: "border p-1 rounded flex items-center justify-center w-8 h-8",
30
- children: [
31
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Share on Twitter" }),
32
- /* @__PURE__ */ jsx(Twitter, {})
33
- ]
34
- }
35
- ),
36
- /* @__PURE__ */ jsxs(
37
- Link,
38
- {
39
- href: `https://facebook.com/sharer/sharer.php?u=${postUrl}`,
40
- target: "_blank",
41
- rel: "noopener noreferrer",
42
- className: "border p-1 rounded flex items-center justify-center w-8 h-8",
43
- children: [
44
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Share on Facebook" }),
45
- /* @__PURE__ */ jsx(Facebook, {})
46
- ]
47
- }
48
- ),
49
- /* @__PURE__ */ jsxs(
50
- Link,
51
- {
52
- href: `mailto:?body=${encodeURIComponent(`${post.title}
53
- ${postUrl}`)}`,
54
- className: "border p-1 rounded flex items-center justify-center w-8 h-8",
55
- children: [
56
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Share via Email" }),
57
- /* @__PURE__ */ jsx(Mail, { className: "w-4 h-4" })
58
- ]
59
- }
60
- )
61
- ] });
62
- };
63
- export {
64
- Share
65
- };
66
- //# sourceMappingURL=share.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/blog-post/_components/share.tsx"],"sourcesContent":["import { Facebook, Linkedin, Mail, Twitter } from \"lucide-react\";\nimport Link from \"next/link\";\nimport { opinlyConfig } from \"../../../utils/sdk-config\";\nimport { BlogPostRes } from \"../_types/blog-post\";\n\nexport const Share = ({ post }: { post: BlogPostRes }) => {\n const postUrl = encodeURIComponent(`${opinlyConfig.blogUrl}/${post.slug}`);\n return (\n <div className=\"flex gap-2 mb-6\">\n <Link\n href={`https://linkedin.com/sharing/share-offsite?url=${postUrl}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"border p-1 rounded flex items-center justify-center w-8 h-8\"\n >\n <span className=\"sr-only\">Share on LinkedIn</span>\n <Linkedin className=\"w-4 h-4\" />\n </Link>\n <Link\n href={`https://twitter.com/intent/tweet?url=${postUrl}&text=${encodeURIComponent(\n `Check out this article by ${post.author?.name}`\n )}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"border p-1 rounded flex items-center justify-center w-8 h-8\"\n >\n <span className=\"sr-only\">Share on Twitter</span>\n <Twitter />\n </Link>\n <Link\n href={`https://facebook.com/sharer/sharer.php?u=${postUrl}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"border p-1 rounded flex items-center justify-center w-8 h-8\"\n >\n <span className=\"sr-only\">Share on Facebook</span>\n <Facebook />\n </Link>\n <Link\n href={`mailto:?body=${encodeURIComponent(`${post.title}\\n${postUrl}`)}`}\n className=\"border p-1 rounded flex items-center justify-center w-8 h-8\"\n >\n <span className=\"sr-only\">Share via Email</span>\n <Mail className=\"w-4 h-4\" />\n </Link>\n </div>\n );\n};\n"],"mappings":"AASM,SAME,KANF;AATN,SAAS,UAAU,UAAU,MAAM,eAAe;AAClD,OAAO,UAAU;AACjB,SAAS,oBAAoB;AAGtB,MAAM,QAAQ,CAAC,EAAE,KAAK,MAA6B;AACxD,QAAM,UAAU,mBAAmB,GAAG,aAAa,OAAO,IAAI,KAAK,IAAI,EAAE;AACzE,SACE,qBAAC,SAAI,WAAU,mBACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,kDAAkD,OAAO;AAAA,QAC/D,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,WAAU;AAAA,QAEV;AAAA,8BAAC,UAAK,WAAU,WAAU,+BAAiB;AAAA,UAC3C,oBAAC,YAAS,WAAU,WAAU;AAAA;AAAA;AAAA,IAChC;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,wCAAwC,OAAO,SAAS;AAAA,UAC5D,6BAA6B,KAAK,QAAQ,IAAI;AAAA,QAChD,CAAC;AAAA,QACD,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,WAAU;AAAA,QAEV;AAAA,8BAAC,UAAK,WAAU,WAAU,8BAAgB;AAAA,UAC1C,oBAAC,WAAQ;AAAA;AAAA;AAAA,IACX;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,4CAA4C,OAAO;AAAA,QACzD,QAAO;AAAA,QACP,KAAI;AAAA,QACJ,WAAU;AAAA,QAEV;AAAA,8BAAC,UAAK,WAAU,WAAU,+BAAiB;AAAA,UAC3C,oBAAC,YAAS;AAAA;AAAA;AAAA,IACZ;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,gBAAgB,mBAAmB,GAAG,KAAK,KAAK;AAAA,EAAK,OAAO,EAAE,CAAC;AAAA,QACrE,WAAU;AAAA,QAEV;AAAA,8BAAC,UAAK,WAAU,WAAU,6BAAe;AAAA,UACzC,oBAAC,QAAK,WAAU,WAAU;AAAA;AAAA;AAAA,IAC5B;AAAA,KACF;AAEJ;","names":[]}
@@ -1,111 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var table_of_contents_exports = {};
30
- __export(table_of_contents_exports, {
31
- TableOfContents: () => TableOfContents
32
- });
33
- module.exports = __toCommonJS(table_of_contents_exports);
34
- var import_jsx_runtime = require("react/jsx-runtime");
35
- var import_merge = require("../../../utils/merge");
36
- var import_image = __toESM(require("next/image"), 1);
37
- var import_sdk_config = require("../../../utils/sdk-config");
38
- var import_extract_headings = require("../_helpers/extract-headings");
39
- var import_share = require("./share");
40
- var import_link = __toESM(require("next/link"), 1);
41
- const headingColorMap = {
42
- 2: "text-op-heading",
43
- 3: "text-op-body"
44
- };
45
- const TableOfContents = ({
46
- content,
47
- author,
48
- post,
49
- cta
50
- }) => {
51
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_merge.cn)("w-full flex flex-col space-y-4"), children: [
52
- author && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full flex flex-col space-y-2 mb-6 border p-4 rounded-md text-sm", children: [
53
- author.fileKey && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
- import_image.default,
55
- {
56
- unoptimized: import_sdk_config.opinlyConfig.unoptimizedImages,
57
- src: `${import_sdk_config.opinlyConfig.imagesPrefix}/${author.fileKey}`,
58
- alt: author.name,
59
- width: 48,
60
- height: 48,
61
- className: "rounded-full"
62
- }
63
- ),
64
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full flex flex-col space-y-2", children: [
65
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
- import_link.default,
67
- {
68
- href: `${import_sdk_config.opinlyConfig.blogPrefix}/authors/${author.slug}`,
69
- className: "text-lg text-op-heading font-bold",
70
- children: author.name
71
- }
72
- ),
73
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-48 ", children: [
74
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-op-muted text-sm w-56 break-words block md:hidden", children: author.bio && author.bio.length > 40 ? author.bio.slice(0, 40) + "..." : author.bio }),
75
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-op-muted text-sm w-48 hidden md:block", children: author.bio })
76
- ] })
77
- ] })
78
- ] }),
79
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_share.Share, { post }),
80
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "border-l-4 border-op-accent pl-4 mb-4", children: [
81
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-lg font-semibold mb-2", children: "Table of Contents" }),
82
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "text-sm space-y-1", children: ((0, import_extract_headings.extractHeadings)(content) || []).map((heading) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
83
- "li",
84
- {
85
- className: (0, import_merge.cn)(heading.level === 3 && "ml-2"),
86
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
87
- "a",
88
- {
89
- href: `#${heading.slug}`,
90
- className: (0, import_merge.cn)(
91
- headingColorMap[heading.level]
92
- ),
93
- children: [
94
- heading.level === 3 && "-",
95
- " ",
96
- heading.text
97
- ]
98
- }
99
- )
100
- },
101
- heading.slug
102
- )) })
103
- ] }),
104
- cta
105
- ] });
106
- };
107
- // Annotate the CommonJS export names for ESM import in node:
108
- 0 && (module.exports = {
109
- TableOfContents
110
- });
111
- //# sourceMappingURL=table-of-contents.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/blog-post/_components/table-of-contents.tsx"],"sourcesContent":["import { JSONContent } from \"@tiptap/core\";\nimport { BlogPostRes } from \"../_types/blog-post\";\nimport { cn } from \"../../../utils/merge\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../../utils/sdk-config\";\nimport { extractHeadings } from \"../_helpers/extract-headings\";\nimport { Share } from \"./share\";\nimport Link from \"next/link\";\n\ntype TableOfContentsProps = {\n content: JSONContent;\n author: BlogPostRes[\"author\"] | null;\n post: BlogPostRes;\n cta?: React.ReactNode;\n};\n\nconst headingColorMap = {\n 2: \"text-op-heading\",\n 3: \"text-op-body\",\n};\n\nexport const TableOfContents = ({\n content,\n author,\n post,\n cta,\n}: TableOfContentsProps) => {\n return (\n <div className={cn(\"w-full flex flex-col space-y-4\")}>\n {author && (\n <div className=\"w-full flex flex-col space-y-2 mb-6 border p-4 rounded-md text-sm\">\n {author.fileKey && (\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n src={`${opinlyConfig.imagesPrefix}/${author.fileKey}`}\n alt={author.name}\n width={48}\n height={48}\n className=\"rounded-full\"\n />\n )}\n <div className=\"w-full flex flex-col space-y-2\">\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${author.slug}`}\n className=\"text-lg text-op-heading font-bold\"\n >\n {author.name}\n </Link>\n <div className=\"w-48 \">\n {/* Mobile: show truncated bio */}\n <span className=\"text-op-muted text-sm w-56 break-words block md:hidden\">\n {author.bio && author.bio.length > 40\n ? author.bio.slice(0, 40) + \"...\"\n : author.bio}\n </span>\n {/* Desktop: show full bio */}\n <p className=\"text-op-muted text-sm w-48 hidden md:block\">\n {author.bio}\n </p>\n </div>\n </div>\n </div>\n )}\n <Share post={post} />\n <div className=\"border-l-4 border-op-accent pl-4 mb-4\">\n <h2 className=\"text-lg font-semibold mb-2\">Table of Contents</h2>\n <ul className=\"text-sm space-y-1\">\n {(extractHeadings(content) || []).map((heading) => (\n <li\n key={heading.slug}\n className={cn(heading.level === 3 && \"ml-2\")}\n >\n <a\n href={`#${heading.slug}`}\n className={cn(\n headingColorMap[heading.level as keyof typeof headingColorMap]\n )}\n >\n {heading.level === 3 && \"-\"} {heading.text}\n </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C,QAAG,WAAU,qBACV,wDAAgB,OAAO,KAAK,CAAC,GAAG,IAAI,CAAC,YACrC;AAAA,QAAC;AAAA;AAAA,UAEC,eAAW,iBAAG,QAAQ,UAAU,KAAK,MAAM;AAAA,UAE3C;AAAA,YAAC;AAAA;AAAA,cACC,MAAM,IAAI,QAAQ,IAAI;AAAA,cACtB,eAAW;AAAA,gBACT,gBAAgB,QAAQ,KAAqC;AAAA,cAC/D;AAAA,cAEC;AAAA,wBAAQ,UAAU,KAAK;AAAA,gBAAI;AAAA,gBAAE,QAAQ;AAAA;AAAA;AAAA,UACxC;AAAA;AAAA,QAVK,QAAQ;AAAA,MAWf,CACD,GACH;AAAA,OACF;AAAA,IACC;AAAA,KACH;AAEJ;","names":["Image","Link"]}
@@ -1,14 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { JSONContent } from '@tiptap/core';
3
- import { BlogPostRes } from '../_types/blog-post.cjs';
4
- import '@opinly/backend';
5
-
6
- type TableOfContentsProps = {
7
- content: JSONContent;
8
- author: BlogPostRes["author"] | null;
9
- post: BlogPostRes;
10
- cta?: React.ReactNode;
11
- };
12
- declare const TableOfContents: ({ content, author, post, cta, }: TableOfContentsProps) => react_jsx_runtime.JSX.Element;
13
-
14
- export { TableOfContents };
@@ -1,14 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { JSONContent } from '@tiptap/core';
3
- import { BlogPostRes } from '../_types/blog-post.js';
4
- import '@opinly/backend';
5
-
6
- type TableOfContentsProps = {
7
- content: JSONContent;
8
- author: BlogPostRes["author"] | null;
9
- post: BlogPostRes;
10
- cta?: React.ReactNode;
11
- };
12
- declare const TableOfContents: ({ content, author, post, cta, }: TableOfContentsProps) => react_jsx_runtime.JSX.Element;
13
-
14
- export { TableOfContents };