@chiselandco/nexus 2.5.1 → 2.5.2
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/README.md +3 -2
- package/dist/ProjectDetail.d.ts +4 -2
- package/dist/ProjectDetail.d.ts.map +1 -1
- package/dist/ProjectDetail.js +8 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Self-contained project portfolio components for Next.js App Router. Pass a `clientSlug`, `apiBase`, and `apiKey` — each component fetches, caches, and renders everything it needs with no client-side waterfall requests.
|
|
4
4
|
|
|
5
|
-
**Version:** 2.5.
|
|
5
|
+
**Version:** 2.5.1
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -247,7 +247,8 @@ Both the stats bar and specs sidebar are fully schema-driven — fields not pres
|
|
|
247
247
|
|
|
248
248
|
| Prop | Type | Required | Default | Description |
|
|
249
249
|
|---|---|---|---|---|
|
|
250
|
-
| `slug` | `string` | Yes | — | The project slug to load |
|
|
250
|
+
| `slug` | `string` | Yes* | — | The project slug to load |
|
|
251
|
+
| `projectSlug` | `string` | Yes* | — | Alias for `slug` — either one is accepted |
|
|
251
252
|
| `clientSlug` | `string` | Yes | — | The client slug that owns this project |
|
|
252
253
|
| `apiBase` | `string` | Yes | — | Base URL of the projects API |
|
|
253
254
|
| `apiKey` | `string` | Yes | — | Client API key — always pass via environment variable, never hardcode |
|
package/dist/ProjectDetail.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface ProjectDetailProps {
|
|
2
2
|
/** The project slug to load */
|
|
3
|
-
slug
|
|
3
|
+
slug?: string;
|
|
4
|
+
/** Alias for slug — either one is accepted */
|
|
5
|
+
projectSlug?: string;
|
|
4
6
|
/** The client slug identifying which client owns this project */
|
|
5
7
|
clientSlug: string;
|
|
6
8
|
/** Base URL of the projects API */
|
|
@@ -23,5 +25,5 @@ export interface ProjectDetailProps {
|
|
|
23
25
|
*/
|
|
24
26
|
noCache?: boolean;
|
|
25
27
|
}
|
|
26
|
-
export declare function ProjectDetail({ slug, clientSlug, apiBase, apiKey, backPath, backLabel, revalidate, noCache, }: ProjectDetailProps): Promise<import("react").JSX.Element>;
|
|
28
|
+
export declare function ProjectDetail({ slug: slugProp, projectSlug, clientSlug, apiBase, apiKey, backPath, backLabel, revalidate, noCache, }: ProjectDetailProps): Promise<import("react").JSX.Element>;
|
|
27
29
|
//# sourceMappingURL=ProjectDetail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectDetail.d.ts","sourceRoot":"","sources":["../src/ProjectDetail.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"ProjectDetail.d.ts","sourceRoot":"","sources":["../src/ProjectDetail.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAA;IAClB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;IACd,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAsFD,wBAAsB,aAAa,CAAC,EAClC,IAAI,EAAE,QAAQ,EACd,WAAW,EACX,UAAU,EACV,OAAO,EACP,MAAM,EACN,QAAsB,EACtB,SAA0B,EAC1B,UAAe,EACf,OAAe,GAChB,EAAE,kBAAkB,wCAiRpB"}
|
package/dist/ProjectDetail.js
CHANGED
|
@@ -69,23 +69,24 @@ async function fetchProjectDetail(apiBase, clientSlug, slug, apiKey, revalidate,
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
// ─── Component ───────────────────────────────────────────────────────────────
|
|
72
|
-
export async function ProjectDetail({ slug, clientSlug, apiBase, apiKey, backPath = "/projects", backLabel = "All Projects", revalidate = 60, noCache = false, }) {
|
|
73
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
72
|
+
export async function ProjectDetail({ slug: slugProp, projectSlug, clientSlug, apiBase, apiKey, backPath = "/projects", backLabel = "All Projects", revalidate = 60, noCache = false, }) {
|
|
73
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
74
|
+
const slug = (_a = slugProp !== null && slugProp !== void 0 ? slugProp : projectSlug) !== null && _a !== void 0 ? _a : "";
|
|
74
75
|
const { project, schema, fieldOptionsMap } = await fetchProjectDetail(apiBase, clientSlug, slug, apiKey, revalidate, noCache);
|
|
75
76
|
if (!project) {
|
|
76
77
|
return (_jsx("div", { style: { textAlign: "center", padding: "6rem 1.5rem", fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" }, children: _jsx("p", { style: { color: "#71717a", fontSize: "18px" }, children: "Project not found." }) }));
|
|
77
78
|
}
|
|
78
|
-
const imageUrl = (
|
|
79
|
+
const imageUrl = (_e = (_b = project.image_url) !== null && _b !== void 0 ? _b : (_d = (_c = project.media) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.url) !== null && _e !== void 0 ? _e : null;
|
|
79
80
|
// Always use all media items for the gallery — never exclude media[0] even if image_url is set,
|
|
80
81
|
// since media items carry custom_field_values (tags) that must be preserved.
|
|
81
|
-
const galleryImages = (
|
|
82
|
+
const galleryImages = (_f = project.media) !== null && _f !== void 0 ? _f : [];
|
|
82
83
|
const badgeField = schema.find((f) => f.display_position === "badge_overlay");
|
|
83
84
|
const locationField = schema.find((f) => f.type === "location");
|
|
84
85
|
const badgeRaw = badgeField
|
|
85
|
-
? ((
|
|
86
|
+
? ((_g = parseMultiValue(project.custom_field_values[badgeField.key])[0]) !== null && _g !== void 0 ? _g : null)
|
|
86
87
|
: null;
|
|
87
|
-
const badgeOptMap = badgeField ? ((
|
|
88
|
-
const badgeValue = badgeRaw ? ((
|
|
88
|
+
const badgeOptMap = badgeField ? ((_h = fieldOptionsMap[badgeField.key]) !== null && _h !== void 0 ? _h : {}) : {};
|
|
89
|
+
const badgeValue = badgeRaw ? ((_j = badgeOptMap[badgeRaw]) !== null && _j !== void 0 ? _j : badgeRaw) : null;
|
|
89
90
|
const locationValue = locationField
|
|
90
91
|
? project.custom_field_values[locationField.key]
|
|
91
92
|
: null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chiselandco/nexus",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"description": "Self-contained project portfolio components for Next.js App Router. Includes ProjectPortfolio, ProjectPortfolioClient, ProjectDetail, SimilarProjects, ProjectMenu, ProjectMenuClient, GalleryCarousel, FilterSidebar, and FilteredPortfolio. Pass a clientSlug and apiBase — done.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nextjs",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react-dom": ">=18.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/node": "^
|
|
40
|
+
"@types/node": "^20.19.43",
|
|
41
41
|
"@types/react": "^18.0.0",
|
|
42
42
|
"@types/react-dom": "^18.0.0",
|
|
43
43
|
"next": "^15.0.0",
|