@opinly/next 0.1.6 → 0.1.7
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/components/author-page/_helpers/json-ld.cjs +2 -0
- package/dist/components/author-page/_helpers/json-ld.cjs.map +1 -0
- package/dist/components/author-page/_helpers/json-ld.d.cts +2 -0
- package/dist/components/author-page/_helpers/json-ld.d.ts +2 -0
- package/dist/components/author-page/_helpers/json-ld.js +1 -0
- package/dist/components/author-page/_helpers/json-ld.js.map +1 -0
- package/dist/components/author-page/index.cjs +84 -0
- package/dist/components/author-page/index.cjs.map +1 -0
- package/dist/components/author-page/index.d.cts +10 -0
- package/dist/components/author-page/index.d.ts +10 -0
- package/dist/components/author-page/index.js +50 -0
- package/dist/components/author-page/index.js.map +1 -0
- package/dist/components/authors-page/index.cjs +106 -0
- package/dist/components/authors-page/index.cjs.map +1 -0
- package/dist/components/authors-page/index.d.cts +10 -0
- package/dist/components/authors-page/index.d.ts +10 -0
- package/dist/components/authors-page/index.js +72 -0
- package/dist/components/authors-page/index.js.map +1 -0
- package/dist/components/blog-post/_components/content.cjs +130 -0
- package/dist/components/blog-post/_components/content.cjs.map +1 -0
- package/dist/components/blog-post/_components/content.d.cts +10 -0
- package/dist/components/blog-post/_components/content.d.ts +10 -0
- package/dist/components/blog-post/_components/content.js +96 -0
- package/dist/components/blog-post/_components/content.js.map +1 -0
- package/dist/components/blog-post/_components/faq.cjs +39 -0
- package/dist/components/blog-post/_components/faq.cjs.map +1 -0
- package/dist/components/blog-post/_components/faq.d.cts +9 -0
- package/dist/components/blog-post/_components/faq.d.ts +9 -0
- package/dist/components/blog-post/_components/faq.js +15 -0
- package/dist/components/blog-post/_components/faq.js.map +1 -0
- package/dist/components/blog-post/_components/share.cjs +100 -0
- package/dist/components/blog-post/_components/share.cjs.map +1 -0
- package/dist/components/blog-post/_components/share.d.cts +9 -0
- package/dist/components/blog-post/_components/share.d.ts +9 -0
- package/dist/components/blog-post/_components/share.js +66 -0
- package/dist/components/blog-post/_components/share.js.map +1 -0
- package/dist/components/blog-post/_components/table-of-contents.cjs +82 -0
- package/dist/components/blog-post/_components/table-of-contents.cjs.map +1 -0
- package/dist/components/blog-post/_components/table-of-contents.d.cts +13 -0
- package/dist/components/blog-post/_components/table-of-contents.d.ts +13 -0
- package/dist/components/blog-post/_components/table-of-contents.js +48 -0
- package/dist/components/blog-post/_components/table-of-contents.js.map +1 -0
- package/dist/components/blog-post/_helpers/calc-reading-time.cjs +2 -0
- package/dist/components/blog-post/_helpers/calc-reading-time.cjs.map +1 -0
- package/dist/components/blog-post/_helpers/calc-reading-time.d.cts +2 -0
- package/dist/components/blog-post/_helpers/calc-reading-time.d.ts +2 -0
- package/dist/components/blog-post/_helpers/calc-reading-time.js +1 -0
- package/dist/components/blog-post/_helpers/calc-reading-time.js.map +1 -0
- package/dist/components/blog-post/_helpers/extract-headings.cjs +44 -0
- package/dist/components/blog-post/_helpers/extract-headings.cjs.map +1 -0
- package/dist/components/blog-post/_helpers/extract-headings.d.cts +8 -0
- package/dist/components/blog-post/_helpers/extract-headings.d.ts +8 -0
- package/dist/components/blog-post/_helpers/extract-headings.js +20 -0
- package/dist/components/blog-post/_helpers/extract-headings.js.map +1 -0
- package/dist/components/blog-post/_helpers/json-ld.cjs +170 -0
- package/dist/components/blog-post/_helpers/json-ld.cjs.map +1 -0
- package/dist/components/blog-post/_helpers/json-ld.d.cts +11 -0
- package/dist/components/blog-post/_helpers/json-ld.d.ts +11 -0
- package/dist/components/blog-post/_helpers/json-ld.js +143 -0
- package/dist/components/blog-post/_helpers/json-ld.js.map +1 -0
- package/dist/components/blog-post/_helpers/reading-time.cjs +50 -0
- package/dist/components/blog-post/_helpers/reading-time.cjs.map +1 -0
- package/dist/components/blog-post/_helpers/reading-time.d.cts +6 -0
- package/dist/components/blog-post/_helpers/reading-time.d.ts +6 -0
- package/dist/components/blog-post/_helpers/reading-time.js +25 -0
- package/dist/components/blog-post/_helpers/reading-time.js.map +1 -0
- package/dist/components/blog-post/_types/blog-post.cjs +17 -0
- package/dist/components/blog-post/_types/blog-post.cjs.map +1 -0
- package/dist/components/blog-post/_types/blog-post.d.cts +7 -0
- package/dist/components/blog-post/_types/blog-post.d.ts +7 -0
- package/dist/components/blog-post/_types/blog-post.js +1 -0
- package/dist/components/blog-post/_types/blog-post.js.map +1 -0
- package/dist/components/blog-post/_types/class-names.cjs +17 -0
- package/dist/components/blog-post/_types/class-names.cjs.map +1 -0
- package/dist/components/blog-post/_types/class-names.d.cts +12 -0
- package/dist/components/blog-post/_types/class-names.d.ts +12 -0
- package/dist/components/blog-post/_types/class-names.js +1 -0
- package/dist/components/blog-post/_types/class-names.js.map +1 -0
- package/dist/components/blog-post/index.cjs +149 -0
- package/dist/components/blog-post/index.cjs.map +1 -0
- package/dist/components/blog-post/index.d.cts +13 -0
- package/dist/components/blog-post/index.d.ts +13 -0
- package/dist/components/blog-post/index.js +119 -0
- package/dist/components/blog-post/index.js.map +1 -0
- package/dist/components/bread-crumbs.cjs +60 -0
- package/dist/components/bread-crumbs.cjs.map +1 -0
- package/dist/components/bread-crumbs.d.cts +10 -0
- package/dist/components/bread-crumbs.d.ts +10 -0
- package/dist/components/bread-crumbs.js +26 -0
- package/dist/components/bread-crumbs.js.map +1 -0
- package/dist/components/folder-page/index.cjs +61 -0
- package/dist/components/folder-page/index.cjs.map +1 -0
- package/dist/components/folder-page/index.d.cts +10 -0
- package/dist/components/folder-page/index.d.ts +10 -0
- package/dist/components/folder-page/index.js +37 -0
- package/dist/components/folder-page/index.js.map +1 -0
- package/dist/components/home-page.cjs +71 -0
- package/dist/components/home-page.cjs.map +1 -0
- package/dist/components/home-page.d.cts +12 -0
- package/dist/components/home-page.d.ts +12 -0
- package/dist/components/home-page.js +37 -0
- package/dist/components/home-page.js.map +1 -0
- package/dist/components/not-found.cjs +60 -0
- package/dist/components/not-found.cjs.map +1 -0
- package/dist/components/not-found.d.cts +5 -0
- package/dist/components/not-found.d.ts +5 -0
- package/dist/components/not-found.js +26 -0
- package/dist/components/not-found.js.map +1 -0
- package/dist/components/opinly-blog.cjs +56 -0
- package/dist/components/opinly-blog.cjs.map +1 -0
- package/dist/components/opinly-blog.d.cts +9 -0
- package/dist/components/opinly-blog.d.ts +9 -0
- package/dist/components/opinly-blog.js +32 -0
- package/dist/components/opinly-blog.js.map +1 -0
- package/dist/components/post-preview.cjs +93 -0
- package/dist/components/post-preview.cjs.map +1 -0
- package/dist/components/post-preview.d.cts +10 -0
- package/dist/components/post-preview.d.ts +10 -0
- package/dist/components/post-preview.js +59 -0
- package/dist/components/post-preview.js.map +1 -0
- package/dist/index.d.cts +4 -17
- package/dist/index.d.ts +4 -17
- package/package.json +21 -2
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/merge";
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
function renderTiptapContent(content, classNames) {
|
|
5
|
+
if (!content?.content) return [];
|
|
6
|
+
return content.content.map((node, index) => {
|
|
7
|
+
switch (node.type) {
|
|
8
|
+
case "paragraph":
|
|
9
|
+
return /* @__PURE__ */ jsx("p", { className: classNames.paragraph || "mb-4", children: renderChildren(node.content, classNames) }, index);
|
|
10
|
+
case "heading": {
|
|
11
|
+
const text = node.content?.[0]?.text ?? "";
|
|
12
|
+
const slug = text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
13
|
+
const Tag = `h${node.attrs?.level || 1}`;
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Tag,
|
|
16
|
+
{
|
|
17
|
+
id: slug,
|
|
18
|
+
className: classNames.heading || "mt-8 mb-4 font-bold text-gray-800",
|
|
19
|
+
children: renderChildren(node.content, classNames)
|
|
20
|
+
},
|
|
21
|
+
index
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
case "image":
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: cn(
|
|
29
|
+
"relative w-full max-w-[800px] my-6",
|
|
30
|
+
classNames.image
|
|
31
|
+
),
|
|
32
|
+
style: { aspectRatio: "2 / 1" }
|
|
33
|
+
},
|
|
34
|
+
index
|
|
35
|
+
);
|
|
36
|
+
case "bulletList":
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
"ul",
|
|
39
|
+
{
|
|
40
|
+
className: classNames.bulletList || "list-disc pl-6 my-4",
|
|
41
|
+
children: renderChildren(node.content, classNames)
|
|
42
|
+
},
|
|
43
|
+
index
|
|
44
|
+
);
|
|
45
|
+
case "orderedList":
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
"ol",
|
|
48
|
+
{
|
|
49
|
+
className: classNames.orderedList || "list-decimal pl-6 my-4",
|
|
50
|
+
children: renderChildren(node.content, classNames)
|
|
51
|
+
},
|
|
52
|
+
index
|
|
53
|
+
);
|
|
54
|
+
case "listItem":
|
|
55
|
+
return /* @__PURE__ */ jsx("li", { className: classNames.listItem || "my-1", children: renderChildren(node.content, classNames) }, index);
|
|
56
|
+
default:
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}).filter(Boolean);
|
|
60
|
+
}
|
|
61
|
+
const Content = ({
|
|
62
|
+
content,
|
|
63
|
+
classNames
|
|
64
|
+
}) => {
|
|
65
|
+
return /* @__PURE__ */ jsx("div", { className: "prose min-w-full", children: renderTiptapContent(content, classNames) });
|
|
66
|
+
};
|
|
67
|
+
function renderChildren(nodes, classNames) {
|
|
68
|
+
if (!nodes) return [];
|
|
69
|
+
return nodes.map((child, idx) => {
|
|
70
|
+
if (child.type === "text") {
|
|
71
|
+
let text = child.text;
|
|
72
|
+
if (child.marks) {
|
|
73
|
+
child.marks.forEach((mark) => {
|
|
74
|
+
if (mark.type === "bold") text = /* @__PURE__ */ jsx("strong", { children: text }, idx);
|
|
75
|
+
if (mark.type === "italic") text = /* @__PURE__ */ jsx("em", { children: text }, idx);
|
|
76
|
+
if (mark.type === "link")
|
|
77
|
+
text = /* @__PURE__ */ jsx(
|
|
78
|
+
Link,
|
|
79
|
+
{
|
|
80
|
+
href: mark.attrs?.href,
|
|
81
|
+
className: classNames.link || "text-blue-600 underline",
|
|
82
|
+
children: text
|
|
83
|
+
},
|
|
84
|
+
idx
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return /* @__PURE__ */ jsx("span", { children: text }, idx);
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}).filter(Boolean);
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
Content
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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\";\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-gray-800\"\n }\n >\n {renderChildren(node.content, classNames)}\n </Tag>\n );\n }\n case \"image\":\n return (\n <div\n key={index}\n className={cn(\n \"relative w-full max-w-[800px] my-6\",\n classNames.image\n )}\n style={{ aspectRatio: \"2 / 1\" }}\n >\n {/* <Image\n src={replaceImageHostname(\n node.attrs?.src || \"\",\n opinlyConfig.imagesPrefix\n )}\n alt={node.attrs?.alt || \"\"}\n fill\n className=\"object-contain rounded-lg\"\n sizes=\"(max-width: 800px) 100vw, 800px\"\n /> */}\n </div>\n );\n case \"bulletList\":\n return (\n <ul\n key={index}\n className={classNames.bulletList || \"list-disc pl-6 my-4\"}\n >\n {renderChildren(node.content, classNames)}\n </ul>\n );\n case \"orderedList\":\n return (\n <ol\n key={index}\n className={classNames.orderedList || \"list-decimal pl-6 my-4\"}\n >\n {renderChildren(node.content, classNames)}\n </ol>\n );\n case \"listItem\":\n return (\n <li key={index} className={classNames.listItem || \"my-1\"}>\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) return [];\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 }\n return null;\n })\n .filter(Boolean) as JSX.Element[];\n}\n"],"mappings":"AAiBY;AAfZ,SAAS,UAAU;AACnB,OAAO,UAAU;AAGjB,SAAS,oBACP,SACA,YACmB;AACnB,MAAI,CAAC,SAAS,QAAS,QAAO,CAAC;AAE/B,SAAO,QAAQ,QACZ,IAAI,CAAC,MAAM,UAAU;AACpB,YAAQ,KAAK,MAAM;AAAA,MACjB,KAAK;AACH,eACE,oBAAC,OAAc,WAAW,WAAW,aAAa,QAC/C,yBAAe,KAAK,SAAS,UAAU,KADlC,KAER;AAAA,MAEJ,KAAK,WAAW;AACd,cAAM,OAAO,KAAK,UAAU,CAAC,GAAG,QAAQ;AACxC,cAAM,OAAO,KACV,YAAY,EACZ,QAAQ,eAAe,GAAG,EAC1B,QAAQ,YAAY,EAAE;AACzB,cAAM,MAAM,IACV,KAAK,OAAO,SAAS,CACvB;AACA,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,IAAI;AAAA,YACJ,WACE,WAAW,WAAW;AAAA,YAGvB,yBAAe,KAAK,SAAS,UAAU;AAAA;AAAA,UANnC;AAAA,QAOP;AAAA,MAEJ;AAAA,MACA,KAAK;AACH,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAW;AAAA,cACT;AAAA,cACA,WAAW;AAAA,YACb;AAAA,YACA,OAAO,EAAE,aAAa,QAAQ;AAAA;AAAA,UALzB;AAAA,QAiBP;AAAA,MAEJ,KAAK;AACH,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAW,WAAW,cAAc;AAAA,YAEnC,yBAAe,KAAK,SAAS,UAAU;AAAA;AAAA,UAHnC;AAAA,QAIP;AAAA,MAEJ,KAAK;AACH,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAW,WAAW,eAAe;AAAA,YAEpC,yBAAe,KAAK,SAAS,UAAU;AAAA;AAAA,UAHnC;AAAA,QAIP;AAAA,MAEJ,KAAK;AACH,eACE,oBAAC,QAAe,WAAW,WAAW,YAAY,QAC/C,yBAAe,KAAK,SAAS,UAAU,KADjC,KAET;AAAA,MAEJ;AACE,eAAO;AAAA,IACX;AAAA,EACF,CAAC,EACA,OAAO,OAAO;AACnB;AAEO,MAAM,UAAU,CAAC;AAAA,EACtB;AAAA,EACA;AACF,MAGM;AACJ,SACE,oBAAC,SAAI,WAAU,oBACZ,8BAAoB,SAAS,UAAU,GAC1C;AAEJ;AAEA,SAAS,eACP,OACA,YACe;AACf,MAAI,CAAC,MAAO,QAAO,CAAC;AAEpB,SAAO,MACJ,IAAI,CAAC,OAAO,QAAQ;AACnB,QAAI,MAAM,SAAS,QAAQ;AACzB,UAAI,OAAwB,MAAM;AAClC,UAAI,MAAM,OAAO;AACf,cAAM,MAAM,QAAQ,CAAC,SAAS;AAC5B,cAAI,KAAK,SAAS,OAAQ,QAAO,oBAAC,YAAkB,kBAAN,GAAW;AACzD,cAAI,KAAK,SAAS,SAAU,QAAO,oBAAC,QAAc,kBAAN,GAAW;AACvD,cAAI,KAAK,SAAS;AAChB,mBACE;AAAA,cAAC;AAAA;AAAA,gBAEC,MAAM,KAAK,OAAO;AAAA,gBAClB,WAAW,WAAW,QAAQ;AAAA,gBAE7B;AAAA;AAAA,cAJI;AAAA,YAKP;AAAA,QAEN,CAAC;AAAA,MACH;AACA,aAAO,oBAAC,UAAgB,kBAAN,GAAW;AAAA,IAC/B;AACA,WAAO;AAAA,EACT,CAAC,EACA,OAAO,OAAO;AACnB;","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 font-semibold mb-2", children: faq.question }),
|
|
31
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-gray-700", 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
|
|
@@ -0,0 +1 @@
|
|
|
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 font-semibold mb-2\">{faq.question}</h3>\n <p className=\"text-sm text-gray-700\">{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,8BAA8B,cAAI,UAAS;AAAA,MACzD,4CAAC,OAAE,WAAU,yBAAyB,cAAI,QAAO;AAAA,SAF1C,IAAI,QAGb,CACD,GACH;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
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 };
|
|
@@ -0,0 +1,9 @@
|
|
|
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 };
|
|
@@ -0,0 +1,15 @@
|
|
|
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 font-semibold mb-2", children: faq.question }),
|
|
8
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-gray-700", children: faq.answer })
|
|
9
|
+
] }, faq.question)) })
|
|
10
|
+
] });
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
FAQS
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=faq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 font-semibold mb-2\">{faq.question}</h3>\n <p className=\"text-sm text-gray-700\">{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,8BAA8B,cAAI,UAAS;AAAA,MACzD,oBAAC,OAAE,WAAU,yBAAyB,cAAI,QAAO;AAAA,SAF1C,IAAI,QAGb,CACD,GACH;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
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("../../../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
|
|
@@ -0,0 +1 @@
|
|
|
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 \"../../../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"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
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 "../../../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
|
|
@@ -0,0 +1 @@
|
|
|
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 \"../../../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":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
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("../../../sdk-config");
|
|
38
|
+
var import_images = require("../../../utils/images");
|
|
39
|
+
var import_extract_headings = require("../_helpers/extract-headings");
|
|
40
|
+
var import_share = require("./share");
|
|
41
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
42
|
+
const TableOfContents = ({
|
|
43
|
+
content,
|
|
44
|
+
author,
|
|
45
|
+
post
|
|
46
|
+
}) => {
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("aside", { className: (0, import_merge.cn)("w-full lg:w-1/3 lg:sticky lg:top-20 lg:self-start"), children: [
|
|
48
|
+
author && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full mb-6 border p-4 rounded-md text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 mb-3", children: [
|
|
49
|
+
author.fileKey && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
import_image.default,
|
|
51
|
+
{
|
|
52
|
+
src: `${import_sdk_config.opinlyConfig.imagesPrefix}/${(0, import_images.replaceImageNameSpace)(author.fileKey)}`,
|
|
53
|
+
alt: author.name,
|
|
54
|
+
width: 48,
|
|
55
|
+
height: 48,
|
|
56
|
+
className: "rounded-full"
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
import_link.default,
|
|
62
|
+
{
|
|
63
|
+
href: `${import_sdk_config.opinlyConfig.blogPrefix}/authors/${author.slug}`,
|
|
64
|
+
className: "text-xs uppercase text-muted-foreground font-medium",
|
|
65
|
+
children: author.name
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-muted-foreground text-sm", children: author.bio })
|
|
69
|
+
] })
|
|
70
|
+
] }) }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_share.Share, { post }),
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "border-l-4 border-opinlyAccent pl-4 mb-4", children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-lg font-semibold mb-2", children: "TABLE OF CONTENTS" }),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "text-sm text-gray-700 space-y-1", children: ((0, import_extract_headings.extractHeadings)(content) || []).map((heading) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { href: `#${heading.slug}`, className: "hover:underline", children: heading.text }) }, heading.slug)) })
|
|
75
|
+
] })
|
|
76
|
+
] });
|
|
77
|
+
};
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
TableOfContents
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=table-of-contents.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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 \"../../../sdk-config\";\nimport { replaceImageNameSpace } from \"../../../utils/images\";\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};\n\nexport const TableOfContents = ({\n content,\n author,\n post,\n}: TableOfContentsProps) => {\n return (\n <aside className={cn(\"w-full lg:w-1/3 lg:sticky lg:top-20 lg:self-start\")}>\n {author && (\n <div className=\"w-full mb-6 border p-4 rounded-md text-sm\">\n <div className=\"flex items-center gap-3 mb-3\">\n {author.fileKey && (\n <Image\n src={`${opinlyConfig.imagesPrefix}/${replaceImageNameSpace(author.fileKey)}`}\n alt={author.name}\n width={48}\n height={48}\n className=\"rounded-full\"\n />\n )}\n <div>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${author.slug}`}\n className=\"text-xs uppercase text-muted-foreground font-medium\"\n >\n {author.name}\n </Link>\n <div className=\"text-muted-foreground text-sm\">{author.bio}</div>\n </div>\n </div>\n </div>\n )}\n <Share post={post} />\n <div className=\"border-l-4 border-opinlyAccent pl-4 mb-4\">\n <h2 className=\"text-lg font-semibold mb-2\">TABLE OF CONTENTS</h2>\n <ul className=\"text-sm text-gray-700 space-y-1\">\n {(extractHeadings(content) || []).map((heading) => (\n <li key={heading.slug}>\n <a href={`#${heading.slug}`} className=\"hover:underline\">\n {heading.text}\n </a>\n </li>\n ))}\n </ul>\n </div>\n </aside>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2Bc;AAzBd,mBAAmB;AACnB,mBAAkB;AAClB,wBAA6B;AAC7B,oBAAsC;AACtC,8BAAgC;AAChC,mBAAsB;AACtB,kBAAiB;AAQV,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF,MAA4B;AAC1B,SACE,6CAAC,WAAM,eAAW,iBAAG,mDAAmD,GACrE;AAAA,cACC,4CAAC,SAAI,WAAU,6CACb,uDAAC,SAAI,WAAU,gCACZ;AAAA,aAAO,WACN;AAAA,QAAC,aAAAA;AAAA,QAAA;AAAA,UACC,KAAK,GAAG,+BAAa,YAAY,QAAI,qCAAsB,OAAO,OAAO,CAAC;AAAA,UAC1E,KAAK,OAAO;AAAA,UACZ,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,WAAU;AAAA;AAAA,MACZ;AAAA,MAEF,6CAAC,SACC;AAAA;AAAA,UAAC,YAAAC;AAAA,UAAA;AAAA,YACC,MAAM,GAAG,+BAAa,UAAU,YAAY,OAAO,IAAI;AAAA,YACvD,WAAU;AAAA,YAET,iBAAO;AAAA;AAAA,QACV;AAAA,QACA,4CAAC,SAAI,WAAU,iCAAiC,iBAAO,KAAI;AAAA,SAC7D;AAAA,OACF,GACF;AAAA,IAEF,4CAAC,sBAAM,MAAY;AAAA,IACnB,6CAAC,SAAI,WAAU,4CACb;AAAA,kDAAC,QAAG,WAAU,8BAA6B,+BAAiB;AAAA,MAC5D,4CAAC,QAAG,WAAU,mCACV,wDAAgB,OAAO,KAAK,CAAC,GAAG,IAAI,CAAC,YACrC,4CAAC,QACC,sDAAC,OAAE,MAAM,IAAI,QAAQ,IAAI,IAAI,WAAU,mBACpC,kBAAQ,MACX,KAHO,QAAQ,IAIjB,CACD,GACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":["Image","Link"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
};
|
|
11
|
+
declare const TableOfContents: ({ content, author, post, }: TableOfContentsProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { TableOfContents };
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
};
|
|
11
|
+
declare const TableOfContents: ({ content, author, post, }: TableOfContentsProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { TableOfContents };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/merge";
|
|
3
|
+
import Image from "next/image";
|
|
4
|
+
import { opinlyConfig } from "../../../sdk-config";
|
|
5
|
+
import { replaceImageNameSpace } from "../../../utils/images";
|
|
6
|
+
import { extractHeadings } from "../_helpers/extract-headings";
|
|
7
|
+
import { Share } from "./share";
|
|
8
|
+
import Link from "next/link";
|
|
9
|
+
const TableOfContents = ({
|
|
10
|
+
content,
|
|
11
|
+
author,
|
|
12
|
+
post
|
|
13
|
+
}) => {
|
|
14
|
+
return /* @__PURE__ */ jsxs("aside", { className: cn("w-full lg:w-1/3 lg:sticky lg:top-20 lg:self-start"), children: [
|
|
15
|
+
author && /* @__PURE__ */ jsx("div", { className: "w-full mb-6 border p-4 rounded-md text-sm", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-3", children: [
|
|
16
|
+
author.fileKey && /* @__PURE__ */ jsx(
|
|
17
|
+
Image,
|
|
18
|
+
{
|
|
19
|
+
src: `${opinlyConfig.imagesPrefix}/${replaceImageNameSpace(author.fileKey)}`,
|
|
20
|
+
alt: author.name,
|
|
21
|
+
width: 48,
|
|
22
|
+
height: 48,
|
|
23
|
+
className: "rounded-full"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
Link,
|
|
29
|
+
{
|
|
30
|
+
href: `${opinlyConfig.blogPrefix}/authors/${author.slug}`,
|
|
31
|
+
className: "text-xs uppercase text-muted-foreground font-medium",
|
|
32
|
+
children: author.name
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ jsx("div", { className: "text-muted-foreground text-sm", children: author.bio })
|
|
36
|
+
] })
|
|
37
|
+
] }) }),
|
|
38
|
+
/* @__PURE__ */ jsx(Share, { post }),
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: "border-l-4 border-opinlyAccent pl-4 mb-4", children: [
|
|
40
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold mb-2", children: "TABLE OF CONTENTS" }),
|
|
41
|
+
/* @__PURE__ */ jsx("ul", { className: "text-sm text-gray-700 space-y-1", children: (extractHeadings(content) || []).map((heading) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href: `#${heading.slug}`, className: "hover:underline", children: heading.text }) }, heading.slug)) })
|
|
42
|
+
] })
|
|
43
|
+
] });
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
TableOfContents
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=table-of-contents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 \"../../../sdk-config\";\nimport { replaceImageNameSpace } from \"../../../utils/images\";\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};\n\nexport const TableOfContents = ({\n content,\n author,\n post,\n}: TableOfContentsProps) => {\n return (\n <aside className={cn(\"w-full lg:w-1/3 lg:sticky lg:top-20 lg:self-start\")}>\n {author && (\n <div className=\"w-full mb-6 border p-4 rounded-md text-sm\">\n <div className=\"flex items-center gap-3 mb-3\">\n {author.fileKey && (\n <Image\n src={`${opinlyConfig.imagesPrefix}/${replaceImageNameSpace(author.fileKey)}`}\n alt={author.name}\n width={48}\n height={48}\n className=\"rounded-full\"\n />\n )}\n <div>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${author.slug}`}\n className=\"text-xs uppercase text-muted-foreground font-medium\"\n >\n {author.name}\n </Link>\n <div className=\"text-muted-foreground text-sm\">{author.bio}</div>\n </div>\n </div>\n </div>\n )}\n <Share post={post} />\n <div className=\"border-l-4 border-opinlyAccent pl-4 mb-4\">\n <h2 className=\"text-lg font-semibold mb-2\">TABLE OF CONTENTS</h2>\n <ul className=\"text-sm text-gray-700 space-y-1\">\n {(extractHeadings(content) || []).map((heading) => (\n <li key={heading.slug}>\n <a href={`#${heading.slug}`} className=\"hover:underline\">\n {heading.text}\n </a>\n </li>\n ))}\n </ul>\n </div>\n </aside>\n );\n};\n"],"mappings":"AA2Bc,cAQF,YARE;AAzBd,SAAS,UAAU;AACnB,OAAO,WAAW;AAClB,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,OAAO,UAAU;AAQV,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF,MAA4B;AAC1B,SACE,qBAAC,WAAM,WAAW,GAAG,mDAAmD,GACrE;AAAA,cACC,oBAAC,SAAI,WAAU,6CACb,+BAAC,SAAI,WAAU,gCACZ;AAAA,aAAO,WACN;AAAA,QAAC;AAAA;AAAA,UACC,KAAK,GAAG,aAAa,YAAY,IAAI,sBAAsB,OAAO,OAAO,CAAC;AAAA,UAC1E,KAAK,OAAO;AAAA,UACZ,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,WAAU;AAAA;AAAA,MACZ;AAAA,MAEF,qBAAC,SACC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,MAAM,GAAG,aAAa,UAAU,YAAY,OAAO,IAAI;AAAA,YACvD,WAAU;AAAA,YAET,iBAAO;AAAA;AAAA,QACV;AAAA,QACA,oBAAC,SAAI,WAAU,iCAAiC,iBAAO,KAAI;AAAA,SAC7D;AAAA,OACF,GACF;AAAA,IAEF,oBAAC,SAAM,MAAY;AAAA,IACnB,qBAAC,SAAI,WAAU,4CACb;AAAA,0BAAC,QAAG,WAAU,8BAA6B,+BAAiB;AAAA,MAC5D,oBAAC,QAAG,WAAU,mCACV,2BAAgB,OAAO,KAAK,CAAC,GAAG,IAAI,CAAC,YACrC,oBAAC,QACC,8BAAC,OAAE,MAAM,IAAI,QAAQ,IAAI,IAAI,WAAU,mBACpC,kBAAQ,MACX,KAHO,QAAQ,IAIjB,CACD,GACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=calc-reading-time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|