@opinly/next 0.1.14 → 0.1.16
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.js +0 -1
- package/dist/components/author-page/index.cjs +84 -0
- package/dist/components/author-page/{index.mjs.map → index.cjs.map} +1 -1
- package/dist/components/author-page/index.js +23 -57
- package/dist/components/author-page/index.js.map +1 -1
- package/dist/components/authors-page/index.cjs +105 -0
- package/dist/components/authors-page/{index.mjs.map → index.cjs.map} +1 -1
- package/dist/components/authors-page/index.js +29 -63
- package/dist/components/authors-page/index.js.map +1 -1
- package/dist/components/blog-post/_components/content.cjs +160 -0
- package/dist/components/blog-post/_components/{content.mjs.map → content.cjs.map} +1 -1
- package/dist/components/blog-post/_components/content.js +29 -63
- package/dist/components/blog-post/_components/content.js.map +1 -1
- package/dist/components/blog-post/_components/faq.cjs +39 -0
- package/dist/components/blog-post/_components/{faq.mjs.map → faq.cjs.map} +1 -1
- package/dist/components/blog-post/_components/faq.js +8 -32
- package/dist/components/blog-post/_components/faq.js.map +1 -1
- package/dist/components/blog-post/_components/share.cjs +100 -0
- package/dist/components/blog-post/_components/{share.mjs.map → share.cjs.map} +1 -1
- package/dist/components/blog-post/_components/share.js +24 -58
- package/dist/components/blog-post/_components/share.js.map +1 -1
- package/dist/components/blog-post/_components/table-of-contents.cjs +82 -0
- package/dist/components/blog-post/_components/{table-of-contents.mjs.map → table-of-contents.cjs.map} +1 -1
- package/dist/components/blog-post/_components/table-of-contents.js +24 -58
- package/dist/components/blog-post/_components/table-of-contents.js.map +1 -1
- package/dist/components/blog-post/_helpers/calc-reading-time.cjs +2 -0
- package/dist/components/blog-post/_helpers/calc-reading-time.js +0 -1
- package/dist/components/blog-post/_helpers/extract-headings.cjs +44 -0
- package/dist/components/blog-post/_helpers/{extract-headings.mjs.map → extract-headings.cjs.map} +1 -1
- package/dist/components/blog-post/_helpers/extract-headings.js +2 -26
- package/dist/components/blog-post/_helpers/extract-headings.js.map +1 -1
- package/dist/components/blog-post/_helpers/{json-ld.mjs → json-ld.cjs} +39 -12
- package/dist/components/blog-post/_helpers/{json-ld.mjs.map → json-ld.cjs.map} +1 -1
- package/dist/components/blog-post/_helpers/json-ld.js +11 -38
- package/dist/components/blog-post/_helpers/json-ld.js.map +1 -1
- package/dist/components/blog-post/_helpers/reading-time.cjs +50 -0
- package/dist/components/blog-post/_helpers/{reading-time.mjs.map → reading-time.cjs.map} +1 -1
- package/dist/components/blog-post/_helpers/reading-time.js +2 -27
- package/dist/components/blog-post/_helpers/reading-time.js.map +1 -1
- 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.js +0 -16
- package/dist/components/blog-post/_types/blog-post.js.map +1 -1
- 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.js +0 -16
- package/dist/components/blog-post/_types/class-names.js.map +1 -1
- package/dist/components/blog-post/index.cjs +148 -0
- package/dist/components/blog-post/{index.mjs.map → index.cjs.map} +1 -1
- package/dist/components/blog-post/index.js +47 -77
- package/dist/components/blog-post/index.js.map +1 -1
- package/dist/components/bread-crumbs.cjs +60 -0
- package/dist/components/{bread-crumbs.mjs.map → bread-crumbs.cjs.map} +1 -1
- package/dist/components/bread-crumbs.js +13 -47
- package/dist/components/bread-crumbs.js.map +1 -1
- package/dist/components/folder-page/index.cjs +61 -0
- package/dist/components/folder-page/{index.mjs.map → index.cjs.map} +1 -1
- package/dist/components/folder-page/index.js +12 -36
- package/dist/components/folder-page/index.js.map +1 -1
- package/dist/components/home-page/folders.cjs +98 -0
- package/dist/components/home-page/{folders.mjs.map → folders.cjs.map} +1 -1
- package/dist/components/home-page/folders.js +29 -64
- package/dist/components/home-page/folders.js.map +1 -1
- package/dist/components/home-page/index.cjs +44 -0
- package/dist/components/home-page/{index.mjs.map → index.cjs.map} +1 -1
- package/dist/components/home-page/index.js +11 -35
- package/dist/components/home-page/index.js.map +1 -1
- package/dist/components/home-page/pagination.cjs +91 -0
- package/dist/components/home-page/{pagination.mjs.map → pagination.cjs.map} +1 -1
- package/dist/components/home-page/pagination.js +9 -43
- package/dist/components/home-page/pagination.js.map +1 -1
- package/dist/components/home-page/top-posts.cjs +52 -0
- package/dist/components/home-page/{top-posts.mjs.map → top-posts.cjs.map} +1 -1
- package/dist/components/home-page/top-posts.js +10 -34
- package/dist/components/home-page/top-posts.js.map +1 -1
- package/dist/components/not-found.cjs +60 -0
- package/dist/components/{not-found.mjs.map → not-found.cjs.map} +1 -1
- package/dist/components/not-found.js +15 -49
- package/dist/components/not-found.js.map +1 -1
- package/dist/components/opinly-blog.cjs +57 -0
- package/dist/components/{opinly-blog.mjs.map → opinly-blog.cjs.map} +1 -1
- package/dist/components/opinly-blog.js +15 -39
- package/dist/components/opinly-blog.js.map +1 -1
- package/dist/components/post-preview.cjs +112 -0
- package/dist/components/{post-preview.mjs.map → post-preview.cjs.map} +1 -1
- package/dist/components/post-preview.js +42 -77
- package/dist/components/post-preview.js.map +1 -1
- package/dist/index.cjs +25 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -22
- package/dist/index.js.map +1 -1
- package/dist/utils/dates.cjs +33 -0
- package/dist/utils/{dates.mjs.map → dates.cjs.map} +1 -1
- package/dist/utils/dates.js +2 -26
- package/dist/utils/dates.js.map +1 -1
- package/dist/utils/generate-metadata.cjs +62 -0
- package/dist/utils/generate-metadata.cjs.map +1 -0
- package/dist/utils/generate-metadata.js +9 -31
- package/dist/utils/generate-metadata.js.map +1 -1
- package/dist/utils/merge.cjs +33 -0
- package/dist/utils/{merge.mjs.map → merge.cjs.map} +1 -1
- package/dist/utils/merge.js +5 -29
- package/dist/utils/merge.js.map +1 -1
- package/dist/utils/sdk-config.cjs +51 -0
- package/dist/utils/sdk-config.cjs.map +1 -0
- package/dist/utils/sdk-config.d.cts +10 -2
- package/dist/utils/sdk-config.d.ts +10 -2
- package/dist/utils/sdk-config.js +3 -34
- package/dist/utils/sdk-config.js.map +1 -1
- package/dist/utils/with-opinly-config.cjs +115 -0
- package/dist/utils/with-opinly-config.cjs.map +1 -0
- package/dist/utils/with-opinly-config.d.cts +39 -0
- package/dist/utils/with-opinly-config.d.ts +39 -0
- package/dist/utils/with-opinly-config.js +91 -0
- package/dist/utils/with-opinly-config.js.map +1 -0
- package/package.json +3 -2
- package/dist/components/author-page/_helpers/json-ld.mjs +0 -1
- package/dist/components/author-page/index.mjs +0 -50
- package/dist/components/authors-page/index.mjs +0 -71
- package/dist/components/blog-post/_components/content.mjs +0 -126
- package/dist/components/blog-post/_components/faq.mjs +0 -15
- package/dist/components/blog-post/_components/share.mjs +0 -66
- package/dist/components/blog-post/_components/table-of-contents.mjs +0 -48
- package/dist/components/blog-post/_helpers/calc-reading-time.mjs +0 -1
- package/dist/components/blog-post/_helpers/extract-headings.mjs +0 -20
- package/dist/components/blog-post/_helpers/reading-time.mjs +0 -25
- package/dist/components/blog-post/_types/blog-post.mjs +0 -1
- package/dist/components/blog-post/_types/blog-post.mjs.map +0 -1
- package/dist/components/blog-post/_types/class-names.mjs +0 -1
- package/dist/components/blog-post/_types/class-names.mjs.map +0 -1
- package/dist/components/blog-post/index.mjs +0 -118
- package/dist/components/bread-crumbs.mjs +0 -26
- package/dist/components/folder-page/index.mjs +0 -37
- package/dist/components/home-page/folders.mjs +0 -63
- package/dist/components/home-page/index.mjs +0 -20
- package/dist/components/home-page/pagination.mjs +0 -57
- package/dist/components/home-page/top-posts.mjs +0 -28
- package/dist/components/not-found.mjs +0 -26
- package/dist/components/opinly-blog.mjs +0 -33
- package/dist/components/post-preview.mjs +0 -77
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -1
- package/dist/utils/dates.mjs +0 -9
- package/dist/utils/generate-metadata.mjs +0 -36
- package/dist/utils/generate-metadata.mjs.map +0 -1
- package/dist/utils/merge.mjs +0 -9
- package/dist/utils/sdk-config.mjs +0 -32
- package/dist/utils/sdk-config.mjs.map +0 -1
- /package/dist/components/author-page/_helpers/{json-ld.mjs.map → json-ld.cjs.map} +0 -0
- /package/dist/components/blog-post/_helpers/{calc-reading-time.mjs.map → calc-reading-time.cjs.map} +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
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 author_page_exports = {};
|
|
30
|
+
__export(author_page_exports, {
|
|
31
|
+
AuthorPage: () => AuthorPage
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(author_page_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_image = __toESM(require("next/image"), 1);
|
|
36
|
+
var import_sdk_config = require("../../utils/sdk-config");
|
|
37
|
+
var import_post_preview = require("../post-preview");
|
|
38
|
+
var import_bread_crumbs = require("../bread-crumbs");
|
|
39
|
+
const AuthorPage = ({
|
|
40
|
+
author
|
|
41
|
+
}) => {
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-10", children: [
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
+
import_bread_crumbs.BreadCrumbs,
|
|
45
|
+
{
|
|
46
|
+
breadcrumbs: [
|
|
47
|
+
{
|
|
48
|
+
name: "Authors",
|
|
49
|
+
url: `${import_sdk_config.opinlyConfig.blogPrefix}/authors`
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-6 mb-10", children: [
|
|
55
|
+
author.image.fileKey && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
+
import_image.default,
|
|
57
|
+
{
|
|
58
|
+
unoptimized: import_sdk_config.opinlyConfig.unoptimizedImages,
|
|
59
|
+
src: `${import_sdk_config.opinlyConfig.imagesPrefix}/${author.image.fileKey}`,
|
|
60
|
+
alt: author.image.alt || author.name,
|
|
61
|
+
width: 150,
|
|
62
|
+
height: 150,
|
|
63
|
+
className: "rounded-full border"
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-3xl font-bold mb-1", children: author.name }),
|
|
68
|
+
author.bio && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground text-base max-w-2xl", children: author.bio })
|
|
69
|
+
] })
|
|
70
|
+
] }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h2", { className: "text-xl font-semibold mb-6", children: [
|
|
72
|
+
"Posts by ",
|
|
73
|
+
author.name
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8", children: author.posts && author.posts.length > 0 ? author.posts.map(
|
|
76
|
+
(post) => post && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_preview.PostPreview, { post }, post.slug)
|
|
77
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-muted-foreground col-span-full", children: "No posts yet." }) })
|
|
78
|
+
] });
|
|
79
|
+
};
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
AuthorPage
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/author-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\n\nexport const AuthorPage = ({\n author,\n}: {\n author: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"author\" }\n >[\"data\"];\n}) => {\n return (\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: \"Authors\",\n url: `${opinlyConfig.blogPrefix}/authors`,\n },\n ]}\n />\n {/* Author Header */}\n <div className=\"flex items-center gap-6 mb-10\">\n {author.image.fileKey && (\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n src={`${opinlyConfig.imagesPrefix}/${author.image.fileKey}`}\n alt={author.image.alt || author.name}\n width={150}\n height={150}\n className=\"rounded-full border\"\n />\n )}\n <div>\n <h1 className=\"text-3xl font-bold mb-1\">{author.name}</h1>\n {author.bio && (\n <p className=\"text-muted-foreground text-base max-w-2xl\">\n {author.bio}\n </p>\n )}\n </div>\n </div>\n\n {/* Posts Grid */}\n <h2 className=\"text-xl font-semibold mb-6\">Posts by {author.name}</h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8\">\n {author.posts && author.posts.length > 0 ? (\n author.posts.map(\n (post) => post && <PostPreview key={post.slug} post={post} />\n )\n ) : (\n <div className=\"text-muted-foreground col-span-full\">\n No posts yet.\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":"AAgBM
|
|
1
|
+
{"version":3,"sources":["../../../src/components/author-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\n\nexport const AuthorPage = ({\n author,\n}: {\n author: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"author\" }\n >[\"data\"];\n}) => {\n return (\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: \"Authors\",\n url: `${opinlyConfig.blogPrefix}/authors`,\n },\n ]}\n />\n {/* Author Header */}\n <div className=\"flex items-center gap-6 mb-10\">\n {author.image.fileKey && (\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n src={`${opinlyConfig.imagesPrefix}/${author.image.fileKey}`}\n alt={author.image.alt || author.name}\n width={150}\n height={150}\n className=\"rounded-full border\"\n />\n )}\n <div>\n <h1 className=\"text-3xl font-bold mb-1\">{author.name}</h1>\n {author.bio && (\n <p className=\"text-muted-foreground text-base max-w-2xl\">\n {author.bio}\n </p>\n )}\n </div>\n </div>\n\n {/* Posts Grid */}\n <h2 className=\"text-xl font-semibold mb-6\">Posts by {author.name}</h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8\">\n {author.posts && author.posts.length > 0 ? (\n author.posts.map(\n (post) => post && <PostPreview key={post.slug} post={post} />\n )\n ) : (\n <div className=\"text-muted-foreground col-span-full\">\n No posts yet.\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBM;AAfN,mBAAkB;AAClB,wBAA6B;AAC7B,0BAA4B;AAC5B,0BAA4B;AAErB,MAAM,aAAa,CAAC;AAAA,EACzB;AACF,MAKM;AACJ,SACE,6CAAC,SAAI,WAAU,gCACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,aAAa;AAAA,UACX;AAAA,YACE,MAAM;AAAA,YACN,KAAK,GAAG,+BAAa,UAAU;AAAA,UACjC;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IAEA,6CAAC,SAAI,WAAU,iCACZ;AAAA,aAAO,MAAM,WACZ;AAAA,QAAC,aAAAA;AAAA,QAAA;AAAA,UACC,aAAa,+BAAa;AAAA,UAC1B,KAAK,GAAG,+BAAa,YAAY,IAAI,OAAO,MAAM,OAAO;AAAA,UACzD,KAAK,OAAO,MAAM,OAAO,OAAO;AAAA,UAChC,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,WAAU;AAAA;AAAA,MACZ;AAAA,MAEF,6CAAC,SACC;AAAA,oDAAC,QAAG,WAAU,2BAA2B,iBAAO,MAAK;AAAA,QACpD,OAAO,OACN,4CAAC,OAAE,WAAU,6CACV,iBAAO,KACV;AAAA,SAEJ;AAAA,OACF;AAAA,IAGA,6CAAC,QAAG,WAAU,8BAA6B;AAAA;AAAA,MAAU,OAAO;AAAA,OAAK;AAAA,IACjE,4CAAC,SAAI,WAAU,wDACZ,iBAAO,SAAS,OAAO,MAAM,SAAS,IACrC,OAAO,MAAM;AAAA,MACX,CAAC,SAAS,QAAQ,4CAAC,mCAA4B,QAAX,KAAK,IAAkB;AAAA,IAC7D,IAEA,4CAAC,SAAI,WAAU,uCAAsC,2BAErD,GAEJ;AAAA,KACF;AAEJ;","names":["Image"]}
|
|
@@ -1,84 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 author_page_exports = {};
|
|
30
|
-
__export(author_page_exports, {
|
|
31
|
-
AuthorPage: () => AuthorPage
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(author_page_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
-
var import_image = __toESM(require("next/image"), 1);
|
|
36
|
-
var import_sdk_config = require("../../utils/sdk-config");
|
|
37
|
-
var import_post_preview = require("../post-preview");
|
|
38
|
-
var import_bread_crumbs = require("../bread-crumbs");
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image from "next/image";
|
|
3
|
+
import { opinlyConfig } from "../../utils/sdk-config";
|
|
4
|
+
import { PostPreview } from "../post-preview";
|
|
5
|
+
import { BreadCrumbs } from "../bread-crumbs";
|
|
39
6
|
const AuthorPage = ({
|
|
40
7
|
author
|
|
41
8
|
}) => {
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", { className: "max-w-5xl mx-auto px-4 py-10", children: [
|
|
10
|
+
/* @__PURE__ */ jsx(
|
|
11
|
+
BreadCrumbs,
|
|
45
12
|
{
|
|
46
13
|
breadcrumbs: [
|
|
47
14
|
{
|
|
48
15
|
name: "Authors",
|
|
49
|
-
url: `${
|
|
16
|
+
url: `${opinlyConfig.blogPrefix}/authors`
|
|
50
17
|
}
|
|
51
18
|
]
|
|
52
19
|
}
|
|
53
20
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
author.image.fileKey && /* @__PURE__ */
|
|
56
|
-
|
|
21
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-6 mb-10", children: [
|
|
22
|
+
author.image.fileKey && /* @__PURE__ */ jsx(
|
|
23
|
+
Image,
|
|
57
24
|
{
|
|
58
|
-
unoptimized:
|
|
59
|
-
src: `${
|
|
25
|
+
unoptimized: opinlyConfig.unoptimizedImages,
|
|
26
|
+
src: `${opinlyConfig.imagesPrefix}/${author.image.fileKey}`,
|
|
60
27
|
alt: author.image.alt || author.name,
|
|
61
28
|
width: 150,
|
|
62
29
|
height: 150,
|
|
63
30
|
className: "rounded-full border"
|
|
64
31
|
}
|
|
65
32
|
),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
author.bio && /* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
34
|
+
/* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold mb-1", children: author.name }),
|
|
35
|
+
author.bio && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-base max-w-2xl", children: author.bio })
|
|
69
36
|
] })
|
|
70
37
|
] }),
|
|
71
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ jsxs("h2", { className: "text-xl font-semibold mb-6", children: [
|
|
72
39
|
"Posts by ",
|
|
73
40
|
author.name
|
|
74
41
|
] }),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
(post) => post && /* @__PURE__ */
|
|
77
|
-
) : /* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8", children: author.posts && author.posts.length > 0 ? author.posts.map(
|
|
43
|
+
(post) => post && /* @__PURE__ */ jsx(PostPreview, { post }, post.slug)
|
|
44
|
+
) : /* @__PURE__ */ jsx("div", { className: "text-muted-foreground col-span-full", children: "No posts yet." }) })
|
|
78
45
|
] });
|
|
79
46
|
};
|
|
80
|
-
|
|
81
|
-
0 && (module.exports = {
|
|
47
|
+
export {
|
|
82
48
|
AuthorPage
|
|
83
|
-
}
|
|
49
|
+
};
|
|
84
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/author-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\n\nexport const AuthorPage = ({\n author,\n}: {\n author: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"author\" }\n >[\"data\"];\n}) => {\n return (\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: \"Authors\",\n url: `${opinlyConfig.blogPrefix}/authors`,\n },\n ]}\n />\n {/* Author Header */}\n <div className=\"flex items-center gap-6 mb-10\">\n {author.image.fileKey && (\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n src={`${opinlyConfig.imagesPrefix}/${author.image.fileKey}`}\n alt={author.image.alt || author.name}\n width={150}\n height={150}\n className=\"rounded-full border\"\n />\n )}\n <div>\n <h1 className=\"text-3xl font-bold mb-1\">{author.name}</h1>\n {author.bio && (\n <p className=\"text-muted-foreground text-base max-w-2xl\">\n {author.bio}\n </p>\n )}\n </div>\n </div>\n\n {/* Posts Grid */}\n <h2 className=\"text-xl font-semibold mb-6\">Posts by {author.name}</h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8\">\n {author.posts && author.posts.length > 0 ? (\n author.posts.map(\n (post) => post && <PostPreview key={post.slug} post={post} />\n )\n ) : (\n <div className=\"text-muted-foreground col-span-full\">\n No posts yet.\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/author-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\n\nexport const AuthorPage = ({\n author,\n}: {\n author: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"author\" }\n >[\"data\"];\n}) => {\n return (\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: \"Authors\",\n url: `${opinlyConfig.blogPrefix}/authors`,\n },\n ]}\n />\n {/* Author Header */}\n <div className=\"flex items-center gap-6 mb-10\">\n {author.image.fileKey && (\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n src={`${opinlyConfig.imagesPrefix}/${author.image.fileKey}`}\n alt={author.image.alt || author.name}\n width={150}\n height={150}\n className=\"rounded-full border\"\n />\n )}\n <div>\n <h1 className=\"text-3xl font-bold mb-1\">{author.name}</h1>\n {author.bio && (\n <p className=\"text-muted-foreground text-base max-w-2xl\">\n {author.bio}\n </p>\n )}\n </div>\n </div>\n\n {/* Posts Grid */}\n <h2 className=\"text-xl font-semibold mb-6\">Posts by {author.name}</h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8\">\n {author.posts && author.posts.length > 0 ? (\n author.posts.map(\n (post) => post && <PostPreview key={post.slug} post={post} />\n )\n ) : (\n <div className=\"text-muted-foreground col-span-full\">\n No posts yet.\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":"AAgBM,cAoBE,YApBF;AAfN,OAAO,WAAW;AAClB,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAErB,MAAM,aAAa,CAAC;AAAA,EACzB;AACF,MAKM;AACJ,SACE,qBAAC,SAAI,WAAU,gCACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,aAAa;AAAA,UACX;AAAA,YACE,MAAM;AAAA,YACN,KAAK,GAAG,aAAa,UAAU;AAAA,UACjC;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IAEA,qBAAC,SAAI,WAAU,iCACZ;AAAA,aAAO,MAAM,WACZ;AAAA,QAAC;AAAA;AAAA,UACC,aAAa,aAAa;AAAA,UAC1B,KAAK,GAAG,aAAa,YAAY,IAAI,OAAO,MAAM,OAAO;AAAA,UACzD,KAAK,OAAO,MAAM,OAAO,OAAO;AAAA,UAChC,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,WAAU;AAAA;AAAA,MACZ;AAAA,MAEF,qBAAC,SACC;AAAA,4BAAC,QAAG,WAAU,2BAA2B,iBAAO,MAAK;AAAA,QACpD,OAAO,OACN,oBAAC,OAAE,WAAU,6CACV,iBAAO,KACV;AAAA,SAEJ;AAAA,OACF;AAAA,IAGA,qBAAC,QAAG,WAAU,8BAA6B;AAAA;AAAA,MAAU,OAAO;AAAA,OAAK;AAAA,IACjE,oBAAC,SAAI,WAAU,wDACZ,iBAAO,SAAS,OAAO,MAAM,SAAS,IACrC,OAAO,MAAM;AAAA,MACX,CAAC,SAAS,QAAQ,oBAAC,eAA4B,QAAX,KAAK,IAAkB;AAAA,IAC7D,IAEA,oBAAC,SAAI,WAAU,uCAAsC,2BAErD,GAEJ;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,105 @@
|
|
|
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 authors_page_exports = {};
|
|
30
|
+
__export(authors_page_exports, {
|
|
31
|
+
AuthorsPage: () => AuthorsPage
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(authors_page_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_image = __toESM(require("next/image"), 1);
|
|
36
|
+
var import_sdk_config = require("../../utils/sdk-config");
|
|
37
|
+
var import_post_preview = require("../post-preview");
|
|
38
|
+
var import_bread_crumbs = require("../bread-crumbs");
|
|
39
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
40
|
+
const AuthorsPage = ({
|
|
41
|
+
authors
|
|
42
|
+
}) => {
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-10", children: [
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
import_bread_crumbs.BreadCrumbs,
|
|
46
|
+
{
|
|
47
|
+
breadcrumbs: [
|
|
48
|
+
{
|
|
49
|
+
name: "Authors"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-3xl font-bold mb-10", children: "Authors" }),
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-16", children: authors.map((author, idx) => {
|
|
56
|
+
const authorSlug = `${import_sdk_config.opinlyConfig.blogPrefix}/authors/${author.slug}`;
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: "rounded-lg p-6 flex flex-col gap-6",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-6 mb-4", children: [
|
|
63
|
+
author.image?.fileKey && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: authorSlug, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
import_image.default,
|
|
65
|
+
{
|
|
66
|
+
src: `${import_sdk_config.opinlyConfig.imagesPrefix}/${author.image.fileKey}`,
|
|
67
|
+
alt: author.image.alt || author.name,
|
|
68
|
+
width: 100,
|
|
69
|
+
height: 100,
|
|
70
|
+
className: "rounded-full border"
|
|
71
|
+
}
|
|
72
|
+
) }),
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: authorSlug, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-2xl font-semibold mb-1", children: author.name }) }),
|
|
75
|
+
author.bio && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground text-base max-w-2xl", children: author.bio })
|
|
76
|
+
] })
|
|
77
|
+
] }),
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 mb-4", children: author.posts && author.posts.length > 0 ? author.posts.map(
|
|
80
|
+
(post) => post && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_preview.PostPreview, { post }, post.slug)
|
|
81
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-muted-foreground col-span-full", children: "No posts yet." }) }),
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
83
|
+
import_link.default,
|
|
84
|
+
{
|
|
85
|
+
href: `${import_sdk_config.opinlyConfig.blogPrefix}/authors/${author.slug}`,
|
|
86
|
+
className: "text-bold",
|
|
87
|
+
children: [
|
|
88
|
+
"View more posts from ",
|
|
89
|
+
author.name
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
) })
|
|
93
|
+
] })
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
author.name + idx
|
|
97
|
+
);
|
|
98
|
+
}) })
|
|
99
|
+
] });
|
|
100
|
+
};
|
|
101
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
102
|
+
0 && (module.exports = {
|
|
103
|
+
AuthorsPage
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/authors-page/index.tsx"],"sourcesContent":["import type { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\n\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport Link from \"next/link\";\n\nexport const AuthorsPage = ({\n authors,\n}: {\n authors: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"authors\" }\n >[\"data\"];\n}) => {\n return (\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: \"Authors\",\n },\n ]}\n />\n <h1 className=\"text-3xl font-bold mb-10\">Authors</h1>\n <div className=\"space-y-16\">\n {authors.map((author, idx) => {\n const authorSlug = `${opinlyConfig.blogPrefix}/authors/${author.slug}`;\n\n return (\n <div\n key={author.name + idx}\n className=\"rounded-lg p-6 flex flex-col gap-6\"\n >\n <div className=\"flex items-center gap-6 mb-4\">\n {author.image?.fileKey && (\n <Link href={authorSlug}>\n <Image\n src={`${opinlyConfig.imagesPrefix}/${author.image.fileKey}`}\n alt={author.image.alt || author.name}\n width={100}\n height={100}\n className=\"rounded-full border\"\n />\n </Link>\n )}\n <div>\n <Link href={authorSlug}>\n <h2 className=\"text-2xl font-semibold mb-1\">\n {author.name}\n </h2>\n </Link>\n\n {author.bio && (\n <p className=\"text-muted-foreground text-base max-w-2xl\">\n {author.bio}\n </p>\n )}\n </div>\n </div>\n <div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 mb-4\">\n {author.posts && author.posts.length > 0 ? (\n author.posts.map(\n (post) =>\n post && <PostPreview key={post.slug} post={post} />\n )\n ) : (\n <div className=\"text-muted-foreground col-span-full\">\n No posts yet.\n </div>\n )}\n </div>\n <div className=\"flex justify-end\">\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${author.slug}`}\n className=\"text-bold\"\n >\n View more posts from {author.name}\n </Link>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n"],"mappings":"AAkBM
|
|
1
|
+
{"version":3,"sources":["../../../src/components/authors-page/index.tsx"],"sourcesContent":["import type { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\n\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport Link from \"next/link\";\n\nexport const AuthorsPage = ({\n authors,\n}: {\n authors: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"authors\" }\n >[\"data\"];\n}) => {\n return (\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: \"Authors\",\n },\n ]}\n />\n <h1 className=\"text-3xl font-bold mb-10\">Authors</h1>\n <div className=\"space-y-16\">\n {authors.map((author, idx) => {\n const authorSlug = `${opinlyConfig.blogPrefix}/authors/${author.slug}`;\n\n return (\n <div\n key={author.name + idx}\n className=\"rounded-lg p-6 flex flex-col gap-6\"\n >\n <div className=\"flex items-center gap-6 mb-4\">\n {author.image?.fileKey && (\n <Link href={authorSlug}>\n <Image\n src={`${opinlyConfig.imagesPrefix}/${author.image.fileKey}`}\n alt={author.image.alt || author.name}\n width={100}\n height={100}\n className=\"rounded-full border\"\n />\n </Link>\n )}\n <div>\n <Link href={authorSlug}>\n <h2 className=\"text-2xl font-semibold mb-1\">\n {author.name}\n </h2>\n </Link>\n\n {author.bio && (\n <p className=\"text-muted-foreground text-base max-w-2xl\">\n {author.bio}\n </p>\n )}\n </div>\n </div>\n <div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 mb-4\">\n {author.posts && author.posts.length > 0 ? (\n author.posts.map(\n (post) =>\n post && <PostPreview key={post.slug} post={post} />\n )\n ) : (\n <div className=\"text-muted-foreground col-span-full\">\n No posts yet.\n </div>\n )}\n </div>\n <div className=\"flex justify-end\">\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${author.slug}`}\n className=\"text-bold\"\n >\n View more posts from {author.name}\n </Link>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBM;AAjBN,mBAAkB;AAClB,wBAA6B;AAE7B,0BAA4B;AAC5B,0BAA4B;AAC5B,kBAAiB;AAEV,MAAM,cAAc,CAAC;AAAA,EAC1B;AACF,MAKM;AACJ,SACE,6CAAC,SAAI,WAAU,gCACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,aAAa;AAAA,UACX;AAAA,YACE,MAAM;AAAA,UACR;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IACA,4CAAC,QAAG,WAAU,4BAA2B,qBAAO;AAAA,IAChD,4CAAC,SAAI,WAAU,cACZ,kBAAQ,IAAI,CAAC,QAAQ,QAAQ;AAC5B,YAAM,aAAa,GAAG,+BAAa,UAAU,YAAY,OAAO,IAAI;AAEpE,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,WAAU;AAAA,UAEV;AAAA,yDAAC,SAAI,WAAU,gCACZ;AAAA,qBAAO,OAAO,WACb,4CAAC,YAAAA,SAAA,EAAK,MAAM,YACV;AAAA,gBAAC,aAAAC;AAAA,gBAAA;AAAA,kBACC,KAAK,GAAG,+BAAa,YAAY,IAAI,OAAO,MAAM,OAAO;AAAA,kBACzD,KAAK,OAAO,MAAM,OAAO,OAAO;AAAA,kBAChC,OAAO;AAAA,kBACP,QAAQ;AAAA,kBACR,WAAU;AAAA;AAAA,cACZ,GACF;AAAA,cAEF,6CAAC,SACC;AAAA,4DAAC,YAAAD,SAAA,EAAK,MAAM,YACV,sDAAC,QAAG,WAAU,+BACX,iBAAO,MACV,GACF;AAAA,gBAEC,OAAO,OACN,4CAAC,OAAE,WAAU,6CACV,iBAAO,KACV;AAAA,iBAEJ;AAAA,eACF;AAAA,YACA,6CAAC,SACC;AAAA,0DAAC,SAAI,WAAU,6DACZ,iBAAO,SAAS,OAAO,MAAM,SAAS,IACrC,OAAO,MAAM;AAAA,gBACX,CAAC,SACC,QAAQ,4CAAC,mCAA4B,QAAX,KAAK,IAAkB;AAAA,cACrD,IAEA,4CAAC,SAAI,WAAU,uCAAsC,2BAErD,GAEJ;AAAA,cACA,4CAAC,SAAI,WAAU,oBACb;AAAA,gBAAC,YAAAA;AAAA,gBAAA;AAAA,kBACC,MAAM,GAAG,+BAAa,UAAU,YAAY,OAAO,IAAI;AAAA,kBACvD,WAAU;AAAA,kBACX;AAAA;AAAA,oBACuB,OAAO;AAAA;AAAA;AAAA,cAC/B,GACF;AAAA,eACF;AAAA;AAAA;AAAA,QAlDK,OAAO,OAAO;AAAA,MAmDrB;AAAA,IAEJ,CAAC,GACH;AAAA,KACF;AAEJ;","names":["Link","Image"]}
|
|
@@ -1,48 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 authors_page_exports = {};
|
|
30
|
-
__export(authors_page_exports, {
|
|
31
|
-
AuthorsPage: () => AuthorsPage
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(authors_page_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
-
var import_image = __toESM(require("next/image"), 1);
|
|
36
|
-
var import_sdk_config = require("../../utils/sdk-config");
|
|
37
|
-
var import_post_preview = require("../post-preview");
|
|
38
|
-
var import_bread_crumbs = require("../bread-crumbs");
|
|
39
|
-
var import_link = __toESM(require("next/link"), 1);
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image from "next/image";
|
|
3
|
+
import { opinlyConfig } from "../../utils/sdk-config";
|
|
4
|
+
import { PostPreview } from "../post-preview";
|
|
5
|
+
import { BreadCrumbs } from "../bread-crumbs";
|
|
6
|
+
import Link from "next/link";
|
|
40
7
|
const AuthorsPage = ({
|
|
41
8
|
authors
|
|
42
9
|
}) => {
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", { className: "max-w-5xl mx-auto px-4 py-10", children: [
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
BreadCrumbs,
|
|
46
13
|
{
|
|
47
14
|
breadcrumbs: [
|
|
48
15
|
{
|
|
@@ -51,38 +18,38 @@ const AuthorsPage = ({
|
|
|
51
18
|
]
|
|
52
19
|
}
|
|
53
20
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
const authorSlug = `${
|
|
57
|
-
return /* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold mb-10", children: "Authors" }),
|
|
22
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-16", children: authors.map((author, idx) => {
|
|
23
|
+
const authorSlug = `${opinlyConfig.blogPrefix}/authors/${author.slug}`;
|
|
24
|
+
return /* @__PURE__ */ jsxs(
|
|
58
25
|
"div",
|
|
59
26
|
{
|
|
60
27
|
className: "rounded-lg p-6 flex flex-col gap-6",
|
|
61
28
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
author.image?.fileKey && /* @__PURE__ */
|
|
64
|
-
|
|
29
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-6 mb-4", children: [
|
|
30
|
+
author.image?.fileKey && /* @__PURE__ */ jsx(Link, { href: authorSlug, children: /* @__PURE__ */ jsx(
|
|
31
|
+
Image,
|
|
65
32
|
{
|
|
66
|
-
src: `${
|
|
33
|
+
src: `${opinlyConfig.imagesPrefix}/${author.image.fileKey}`,
|
|
67
34
|
alt: author.image.alt || author.name,
|
|
68
35
|
width: 100,
|
|
69
36
|
height: 100,
|
|
70
37
|
className: "rounded-full border"
|
|
71
38
|
}
|
|
72
39
|
) }),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
author.bio && /* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
41
|
+
/* @__PURE__ */ jsx(Link, { href: authorSlug, children: /* @__PURE__ */ jsx("h2", { className: "text-2xl font-semibold mb-1", children: author.name }) }),
|
|
42
|
+
author.bio && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-base max-w-2xl", children: author.bio })
|
|
76
43
|
] })
|
|
77
44
|
] }),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
(post) => post && /* @__PURE__ */
|
|
81
|
-
) : /* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
|
|
45
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
46
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 mb-4", children: author.posts && author.posts.length > 0 ? author.posts.map(
|
|
47
|
+
(post) => post && /* @__PURE__ */ jsx(PostPreview, { post }, post.slug)
|
|
48
|
+
) : /* @__PURE__ */ jsx("div", { className: "text-muted-foreground col-span-full", children: "No posts yet." }) }),
|
|
49
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs(
|
|
50
|
+
Link,
|
|
84
51
|
{
|
|
85
|
-
href: `${
|
|
52
|
+
href: `${opinlyConfig.blogPrefix}/authors/${author.slug}`,
|
|
86
53
|
className: "text-bold",
|
|
87
54
|
children: [
|
|
88
55
|
"View more posts from ",
|
|
@@ -98,8 +65,7 @@ const AuthorsPage = ({
|
|
|
98
65
|
}) })
|
|
99
66
|
] });
|
|
100
67
|
};
|
|
101
|
-
|
|
102
|
-
0 && (module.exports = {
|
|
68
|
+
export {
|
|
103
69
|
AuthorsPage
|
|
104
|
-
}
|
|
70
|
+
};
|
|
105
71
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/authors-page/index.tsx"],"sourcesContent":["import type { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\n\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport Link from \"next/link\";\n\nexport const AuthorsPage = ({\n authors,\n}: {\n authors: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"authors\" }\n >[\"data\"];\n}) => {\n return (\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: \"Authors\",\n },\n ]}\n />\n <h1 className=\"text-3xl font-bold mb-10\">Authors</h1>\n <div className=\"space-y-16\">\n {authors.map((author, idx) => {\n const authorSlug = `${opinlyConfig.blogPrefix}/authors/${author.slug}`;\n\n return (\n <div\n key={author.name + idx}\n className=\"rounded-lg p-6 flex flex-col gap-6\"\n >\n <div className=\"flex items-center gap-6 mb-4\">\n {author.image?.fileKey && (\n <Link href={authorSlug}>\n <Image\n src={`${opinlyConfig.imagesPrefix}/${author.image.fileKey}`}\n alt={author.image.alt || author.name}\n width={100}\n height={100}\n className=\"rounded-full border\"\n />\n </Link>\n )}\n <div>\n <Link href={authorSlug}>\n <h2 className=\"text-2xl font-semibold mb-1\">\n {author.name}\n </h2>\n </Link>\n\n {author.bio && (\n <p className=\"text-muted-foreground text-base max-w-2xl\">\n {author.bio}\n </p>\n )}\n </div>\n </div>\n <div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 mb-4\">\n {author.posts && author.posts.length > 0 ? (\n author.posts.map(\n (post) =>\n post && <PostPreview key={post.slug} post={post} />\n )\n ) : (\n <div className=\"text-muted-foreground col-span-full\">\n No posts yet.\n </div>\n )}\n </div>\n <div className=\"flex justify-end\">\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${author.slug}`}\n className=\"text-bold\"\n >\n View more posts from {author.name}\n </Link>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/authors-page/index.tsx"],"sourcesContent":["import type { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\n\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport Link from \"next/link\";\n\nexport const AuthorsPage = ({\n authors,\n}: {\n authors: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"authors\" }\n >[\"data\"];\n}) => {\n return (\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: \"Authors\",\n },\n ]}\n />\n <h1 className=\"text-3xl font-bold mb-10\">Authors</h1>\n <div className=\"space-y-16\">\n {authors.map((author, idx) => {\n const authorSlug = `${opinlyConfig.blogPrefix}/authors/${author.slug}`;\n\n return (\n <div\n key={author.name + idx}\n className=\"rounded-lg p-6 flex flex-col gap-6\"\n >\n <div className=\"flex items-center gap-6 mb-4\">\n {author.image?.fileKey && (\n <Link href={authorSlug}>\n <Image\n src={`${opinlyConfig.imagesPrefix}/${author.image.fileKey}`}\n alt={author.image.alt || author.name}\n width={100}\n height={100}\n className=\"rounded-full border\"\n />\n </Link>\n )}\n <div>\n <Link href={authorSlug}>\n <h2 className=\"text-2xl font-semibold mb-1\">\n {author.name}\n </h2>\n </Link>\n\n {author.bio && (\n <p className=\"text-muted-foreground text-base max-w-2xl\">\n {author.bio}\n </p>\n )}\n </div>\n </div>\n <div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 mb-4\">\n {author.posts && author.posts.length > 0 ? (\n author.posts.map(\n (post) =>\n post && <PostPreview key={post.slug} post={post} />\n )\n ) : (\n <div className=\"text-muted-foreground col-span-full\">\n No posts yet.\n </div>\n )}\n </div>\n <div className=\"flex justify-end\">\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${author.slug}`}\n className=\"text-bold\"\n >\n View more posts from {author.name}\n </Link>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n"],"mappings":"AAkBM,cA6BU,YA7BV;AAjBN,OAAO,WAAW;AAClB,SAAS,oBAAoB;AAE7B,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,OAAO,UAAU;AAEV,MAAM,cAAc,CAAC;AAAA,EAC1B;AACF,MAKM;AACJ,SACE,qBAAC,SAAI,WAAU,gCACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,aAAa;AAAA,UACX;AAAA,YACE,MAAM;AAAA,UACR;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IACA,oBAAC,QAAG,WAAU,4BAA2B,qBAAO;AAAA,IAChD,oBAAC,SAAI,WAAU,cACZ,kBAAQ,IAAI,CAAC,QAAQ,QAAQ;AAC5B,YAAM,aAAa,GAAG,aAAa,UAAU,YAAY,OAAO,IAAI;AAEpE,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,WAAU;AAAA,UAEV;AAAA,iCAAC,SAAI,WAAU,gCACZ;AAAA,qBAAO,OAAO,WACb,oBAAC,QAAK,MAAM,YACV;AAAA,gBAAC;AAAA;AAAA,kBACC,KAAK,GAAG,aAAa,YAAY,IAAI,OAAO,MAAM,OAAO;AAAA,kBACzD,KAAK,OAAO,MAAM,OAAO,OAAO;AAAA,kBAChC,OAAO;AAAA,kBACP,QAAQ;AAAA,kBACR,WAAU;AAAA;AAAA,cACZ,GACF;AAAA,cAEF,qBAAC,SACC;AAAA,oCAAC,QAAK,MAAM,YACV,8BAAC,QAAG,WAAU,+BACX,iBAAO,MACV,GACF;AAAA,gBAEC,OAAO,OACN,oBAAC,OAAE,WAAU,6CACV,iBAAO,KACV;AAAA,iBAEJ;AAAA,eACF;AAAA,YACA,qBAAC,SACC;AAAA,kCAAC,SAAI,WAAU,6DACZ,iBAAO,SAAS,OAAO,MAAM,SAAS,IACrC,OAAO,MAAM;AAAA,gBACX,CAAC,SACC,QAAQ,oBAAC,eAA4B,QAAX,KAAK,IAAkB;AAAA,cACrD,IAEA,oBAAC,SAAI,WAAU,uCAAsC,2BAErD,GAEJ;AAAA,cACA,oBAAC,SAAI,WAAU,oBACb;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAM,GAAG,aAAa,UAAU,YAAY,OAAO,IAAI;AAAA,kBACvD,WAAU;AAAA,kBACX;AAAA;AAAA,oBACuB,OAAO;AAAA;AAAA;AAAA,cAC/B,GACF;AAAA,eACF;AAAA;AAAA;AAAA,QAlDK,OAAO,OAAO;AAAA,MAmDrB;AAAA,IAEJ,CAAC,GACH;AAAA,KACF;AAEJ;","names":[]}
|