@pixelated-tech/components 3.11.5 → 3.11.6
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/general/global-error.js +2 -2
- package/dist/components/general/humanstxt.js +81 -0
- package/dist/components/general/styleguide.js +35 -0
- package/dist/config/pixelated.config.json.enc +1 -1
- package/dist/index.js +1 -0
- package/dist/index.server.js +1 -0
- package/dist/scripts/create-pixelated-app.js +1 -1
- package/dist/scripts/create-pixelated-app.json +21 -11
- package/dist/types/components/general/global-error.d.ts +3 -3
- package/dist/types/components/general/global-error.d.ts.map +1 -1
- package/dist/types/components/general/humanstxt.d.ts +37 -0
- package/dist/types/components/general/humanstxt.d.ts.map +1 -0
- package/dist/types/components/general/styleguide.d.ts +9 -0
- package/dist/types/components/general/styleguide.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.server.d.ts +1 -0
- package/dist/types/stories/general/global-error.stories.d.ts +2 -2
- package/dist/types/stories/general/global-error.stories.d.ts.map +1 -1
- package/dist/types/stories/general/humans.stories.d.ts +8 -0
- package/dist/types/stories/general/humans.stories.d.ts.map +1 -0
- package/dist/types/stories/general/styleguide.stories.d.ts +8 -0
- package/dist/types/stories/general/styleguide.stories.d.ts.map +1 -0
- package/dist/types/tests/humanstxt.test.d.ts +2 -0
- package/dist/types/tests/humanstxt.test.d.ts.map +1 -0
- package/dist/types/tests/sitemap.test.d.ts.map +1 -1
- package/dist/types/tests/styleguide.test.d.ts +2 -0
- package/dist/types/tests/styleguide.test.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/types/tests/components/general/sitemap.test.d.ts +0 -2
- package/dist/types/tests/components/general/sitemap.test.d.ts.map +0 -1
|
@@ -3,13 +3,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import './global-error.css';
|
|
6
|
-
|
|
6
|
+
GlobalErrorUI.propTypes = {
|
|
7
7
|
error: PropTypes.any,
|
|
8
8
|
reset: PropTypes.func,
|
|
9
9
|
siteInfo: PropTypes.object,
|
|
10
10
|
className: PropTypes.string,
|
|
11
11
|
};
|
|
12
|
-
export function
|
|
12
|
+
export function GlobalErrorUI({ error = null, reset, siteInfo, className = '' }) {
|
|
13
13
|
const [showDetails, setShowDetails] = useState(false);
|
|
14
14
|
const si = siteInfo;
|
|
15
15
|
const contactHref = typeof si?.email === 'string'
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { readFile } from 'fs/promises';
|
|
2
|
+
import crypto from 'crypto';
|
|
3
|
+
import { NextResponse } from 'next/server';
|
|
4
|
+
import { flattenRoutes } from './sitemap';
|
|
5
|
+
/**
|
|
6
|
+
* Read JSON from disk safely — returns null on error.
|
|
7
|
+
* Exported for testing.
|
|
8
|
+
*/
|
|
9
|
+
export async function safeJSON(path) {
|
|
10
|
+
try {
|
|
11
|
+
const raw = await readFile(path, 'utf8');
|
|
12
|
+
return JSON.parse(raw);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Normalize a value into a single-line trimmed string (safe for humans.txt).
|
|
20
|
+
* Exported for testing.
|
|
21
|
+
*/
|
|
22
|
+
export function sanitizeString(v) {
|
|
23
|
+
return v == null ? '' : String(v).replace(/\s+/g, ' ').trim();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Generate the humans.txt body + metadata. Pure function when pkg/routesJson are provided —
|
|
27
|
+
* otherwise will attempt to read from disk (runtime apps).
|
|
28
|
+
*/
|
|
29
|
+
export async function generateHumansTxt(opts = {}) {
|
|
30
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
31
|
+
const pkg = opts.pkg ?? (await safeJSON(cwd + '/package.json')) ?? {};
|
|
32
|
+
const data = opts.routesJson ?? (await safeJSON(cwd + '/src/app/data/routes.json')) ?? {};
|
|
33
|
+
const site = data.siteInfo ?? {};
|
|
34
|
+
const routes = Array.isArray(data.routes) ? data.routes : [];
|
|
35
|
+
const lines = [
|
|
36
|
+
'/* HUMAN-READABLE SITE INFORMATION - generated at runtime */',
|
|
37
|
+
'',
|
|
38
|
+
` Site name: ${sanitizeString(site.name ?? '')}`,
|
|
39
|
+
` Site Package Name: ${sanitizeString(pkg.name ?? '')}`,
|
|
40
|
+
` Site Package Version: ${sanitizeString(pkg.version ?? '')}`,
|
|
41
|
+
` Site URL: ${sanitizeString(site.url ?? '')}`,
|
|
42
|
+
` Author: ${sanitizeString(site.author ?? '')}`,
|
|
43
|
+
` Address: ${sanitizeString(site.address
|
|
44
|
+
? [
|
|
45
|
+
site.address.streetAddress,
|
|
46
|
+
site.address.addressLocality,
|
|
47
|
+
site.address.addressRegion,
|
|
48
|
+
site.address.postalCode,
|
|
49
|
+
site.address.addressCountry,
|
|
50
|
+
]
|
|
51
|
+
.filter(Boolean)
|
|
52
|
+
.join(' ')
|
|
53
|
+
: '')}`,
|
|
54
|
+
` Email: ${sanitizeString(site.email ?? '')}`,
|
|
55
|
+
` Telephone: ${sanitizeString(site.telephone ?? '')}`,
|
|
56
|
+
` Pages: (${routes.length})`,
|
|
57
|
+
];
|
|
58
|
+
const limit = typeof opts.maxRoutes === 'number' ? opts.maxRoutes : 50;
|
|
59
|
+
for (const r of flattenRoutes(routes).slice(0, limit)) {
|
|
60
|
+
lines.push(` - ${sanitizeString(r.path ?? r.pathname ?? r.url ?? '')} - ${sanitizeString(r.title ?? '')}`);
|
|
61
|
+
}
|
|
62
|
+
const body = lines.join('\n');
|
|
63
|
+
const etag = crypto.createHash('sha1').update(body).digest('hex');
|
|
64
|
+
const headers = {
|
|
65
|
+
'Content-Type': 'text/plain; charset=utf-8',
|
|
66
|
+
'Cache-Control': 'public, max-age=60, stale-while-revalidate=3600',
|
|
67
|
+
ETag: etag,
|
|
68
|
+
};
|
|
69
|
+
return { body, etag, headers };
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Next.js convenience: return a NextResponse for a humans.txt request.
|
|
73
|
+
* Accepts the same options as `generateHumansTxt` (pass `pkg`/`routesJson` in tests).
|
|
74
|
+
*/
|
|
75
|
+
export async function createHumansTxtResponse(req, opts = {}) {
|
|
76
|
+
const { body, etag, headers } = await generateHumansTxt(opts);
|
|
77
|
+
if (req?.headers?.get && req.headers.get('if-none-match') === etag) {
|
|
78
|
+
return new NextResponse(null, { status: 304, headers });
|
|
79
|
+
}
|
|
80
|
+
return new NextResponse(body, { status: 200, headers });
|
|
81
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { PageTitleHeader, PageSection } from "@pixelated-tech/components";
|
|
5
|
+
import { flattenRoutes } from "@pixelated-tech/components";
|
|
6
|
+
import routesData from '../../data/routes.json';
|
|
7
|
+
const routes = routesData.routes;
|
|
8
|
+
StyleGuideUI.propTypes = {
|
|
9
|
+
routes: PropTypes.array,
|
|
10
|
+
};
|
|
11
|
+
export function StyleGuideUI(props) {
|
|
12
|
+
const { routes } = props;
|
|
13
|
+
let primaryHeaderFont = "N/A";
|
|
14
|
+
let primaryBodyFont = "N/A";
|
|
15
|
+
if (typeof document != 'undefined') {
|
|
16
|
+
const headerFonts = getComputedStyle(document.documentElement).getPropertyValue("--header-font").trim();
|
|
17
|
+
primaryHeaderFont = headerFonts.split(',')[0].replaceAll('"', '').replaceAll("'", '');
|
|
18
|
+
const bodyFonts = getComputedStyle(document.documentElement).getPropertyValue("--body-font").trim();
|
|
19
|
+
primaryBodyFont = bodyFonts.split(',')[0].replaceAll('"', '').replaceAll("'", '');
|
|
20
|
+
}
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx(PageTitleHeader, { title: "Style Guide" }), _jsxs(PageSection, { columns: 1, maxWidth: "1024px", padding: "20px", id: "colors-section", children: [_jsx("h2", { children: "Color Palette" }), _jsxs("div", { style: { display: 'flex', gap: '10px', flexWrap: 'wrap' }, children: [_jsx("div", { style: { backgroundColor: 'var(--primary-color)', color: '#fff' }, className: "colorSwatch", children: "Primary Color" }), _jsx("div", { style: { backgroundColor: 'var(--secondary-color)' }, className: "colorSwatch", children: "Secondary Color" }), _jsx("div", { style: { backgroundColor: 'var(--accent1-color)' }, className: "colorSwatch", children: "Accent 1 Color" }), _jsx("div", { style: { backgroundColor: 'var(--accent2-color)' }, className: "colorSwatch", children: "Accent 2 Color" }), _jsx("div", { style: { backgroundColor: 'var(--bg-color)' }, className: "colorSwatch", children: "Background Color" }), _jsx("div", { style: { backgroundColor: 'var(--text-color)' }, className: "colorSwatch", children: "Text Color" })] })] }), _jsx("style", { children: `
|
|
22
|
+
.colorSwatch {
|
|
23
|
+
color: #000;
|
|
24
|
+
border: 1px solid #ccc;
|
|
25
|
+
padding: 10px;
|
|
26
|
+
flex: 1 0 150px;
|
|
27
|
+
text-align: center;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
display: flex;
|
|
31
|
+
}
|
|
32
|
+
` }), _jsxs(PageSection, { columns: 1, maxWidth: "1024px", padding: "20px", id: "fonts-section", children: [_jsxs("h1", { children: ["H1 - ", primaryHeaderFont, " font"] }), _jsxs("h2", { children: ["H2 - ", primaryHeaderFont, " font"] }), _jsxs("h3", { children: ["H3 - ", primaryHeaderFont, " font"] }), _jsxs("h4", { children: ["H4 - ", primaryHeaderFont, " font"] }), _jsxs("h5", { children: ["H5 - ", primaryHeaderFont, " font"] }), _jsxs("h6", { children: ["H6 - ", primaryHeaderFont, " font"] }), _jsxs("p", { children: [primaryBodyFont, " font. This is a paragraph of text to demonstrate the body font style. "] }), _jsxs("p", { children: [primaryBodyFont, " font. The quick brown fox jumps over the lazy dog. "] }), _jsxs("p", { children: [primaryBodyFont, " font. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."] })] }), _jsxs(PageSection, { columns: 1, maxWidth: "1024px", padding: "20px", id: "fonts-section", children: [_jsx("h2", { children: "Information Architecture" }), _jsx("ul", { children: flattenRoutes(routes).map((r, index) => {
|
|
33
|
+
return _jsxs("li", { children: [r.name, " - ", r.path] }, index);
|
|
34
|
+
}) })] })] }));
|
|
35
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
pxl:v1:
|
|
1
|
+
pxl:v1:86e04f735168062824d413b1:5883875e524643b505d95e27e0585c0b:4a30ff9a7cbae3d6cd92119a3b521164bb8b4709e3d6695b3763d78c64a78809438af73c24208c4ec78b2dba8764201be7538cb15a29810c27e668768d7a4da4f731503be4fe91a5b20b91d74b042d472819ffdfb18e98c81c07323e867df49eed4c76a332a0750dba738304b225d8f2c37cded9360ea8ac6de7847f6ab2ed45ccab108f895462893c6d32d6fa83e11e865895db16d00b889ca610486f1e9d4e109de0b22f530dec3f2405075d60fe23eb4a842b3672a50d4de3860476c9a372e268ca060e41812f5573c10449e8cec75fbbdb48babe445840d025c8f9af2d8edb9ca3afd8c699e8afeb5dddb6777d9acbf9874c6f3ec49085e9540345ae94790ed3f1a9c2ebee2b3d03a38ae0494c1233603c6e27827a21a49a13f8923c8af4e6b37492560bdbbc4f1ad0a7e792f043ee32b60b9ef142c87481478ebd43f44050be1779b6c2589fb77c35cfb430154452300bb7c4cb7a3777437312d14c3f10a63e70c065a2b7c7040a68656cdebca6174f2db508816585d84038071db0c65ec1deb7a1c7207c6e65212b74dbf90a8ec3b2cf6d09a85e8b7e9966ed1fa1d850df088a964a58daf96c6d0b2a3666ae4fc709c5b9d4e5bfa59d613eb40eaeb7147ffebab606f59c3b7b756b0e1301c021c37f393cb26767f3d026f77f0f7adfc9bb566ee81eeb2362d0246bff02a722a9f266e8f1cb0210ce804b824bec262ec0a24c286f59032aac1f848eee54020a090c075cb167b3e30aabdcc94cb8fb06095be0b51b67c029500259a1f5ed62afa8a46f7d36586b72bdb9b01cbcbfd4818d7ec9418b81ae601217043bc398fc8b297a3b4d6b034ce6bb98854fe69f66c752f6db2b85b9699443b331422be76f12ad7b7fb72f2f02639f515c627afa9edbf1ab564551af5dae519de9d10885218b249436cd754fcc268a1b455f2dc4ea4d1b480abea0cbf696d7835070df8c9a88a586728a70486f180455da58761f175951d2e22a16efe489941348c341c56a790abe8774bd4d5fcedbcde98ed388ce93bc27dec35d0e914d0fd30c214a25a9662f3fe4da265cdaf6c5447317a2985c1be0225ac30c1ecc78cc0193b144ac1a543b11d3689ef57b4dee0b29be6d24712ddabe850c70e20e69eda3776bfcc2d1a176747d1cf8b38e3a5317ffee831acc8d440fd47aa46ec7cda7031c2d07d8883e123c61ee34f37b8bc958ad2ad46fbb83718a7ece98e670a7bb155132c765bbf067062565e7ebdf372a02cb7ddbc8f080fc5ff15163d73fec5152b066a043a27d33579e97734d327ab65996f834de43d6c218fdbf100a4a1e6e4d5fb72e430fb049061da47f43f88faf9fb79ee186b103172b9a39f7e5747a646e45975e326103296d2ce7a6f6313b3d9372641c04c162a075500987460c7d24fd94fec51b049d624d44620215fd737d88632ac9121c6bd017c34d47e7b9ca6494e5592350d0b817d25301d79284133bd4093fd5bd1d1ee92f10acef720c56e0166cb2993d7724c76feb9fa9f72ff1f03fcdb75149f943f0c333377f4599a53ae967390f9f7c13c40762412014a362791debb4fbb297b125cfc206c9420ef08154bab3aa5238115f957ec8047a2d480be647b6a6e07b5a3c16483cf0207a3755bbb82e66d932c2b042d3ec36325a29332fbbcd1342d246bb4cc13053c216e7fb5098eb5b645fd86cc13cd2ada7a35c77e40a2033c742f960e289ddd5ff6c9b53843e7e13abaf198fc5bea355f1c9386b0962a8c1aad7bf93739665e25a9e86aa94c589470dc0d410769a89ca8d0750fbc9b279557a32044ddccf3def258cfb114dea6d5ce74bd0acd56c58dab994e3dfd625f92885136b4d60a7b30a12cd7866b5cd349e7f23d4b125d66e5a0b4f33da610d13733409e68f0e7dcebf2d7f4489b66fffb74004424542c248e92dd5e8f970bfb49362b714c4dc4371337619a78c678fb7baa6deabda32b232adc9e606bad082c3a50ab28dfa021707e037ead5fd94e8da859693d5e539b577b21bb47bdaf0426111a0ac1398a1c00865c92c95c2cdabfbd672e26b788f22aef43cc98f7a3e1077a87d20ee653b6ac33335693c0b017e1c586552175f3f58d327a828f4da3e5fbf06a58a55ec88e7293c6be1c04ce0b09d0f7675065862fe15b08141912ae619cf9bd592332b69b992af229a3e098b7fa383015abf089742541ca90c66a3b313522575899b489fdafc873418de9c825518162a54fd6777a755144f7e4fed278d732980bd3685c40499b203aece3ca222e911b144858c59f70c4d413ec4b965dbbfee16ea1934d9933f5f5e11ce3d4803c41e14479674d46d16815b33b14a3f4f5f4ce95ebcf3259be268e02a39bae72149a47d099f34412a688e03164d6fae85c5844c2e75cc8c99174ce31396e26a24ddaacc09c39943b92f8e989bd13c999387e4592afc0a2338b850f1ce4955bb650d6a92f717e4a13a09b18802418432fd4c14fa166710d3bd16b0cb3c145f069db82fc8d0a95219e930b0a072b33cacde6579a0273987688f7e1f573cf889b79dee69a0d28a9be9f15e610ce3a036ebf7515e12aaf08226dc67a73387d28cb025a6815a58886933951a463d4a67395e4d28d8975732aa795273406f591af4f4acf0c9e1b37c8c9e2d69e2955b1ec951c4b3cf1c241880e715dda9a4d2230a2c0413a54220714c7380d8d76f292b6bdbefa818b1ed19202514cad31893cffb112ad9abf673e9a98ad2805e42ee0449095fe23a26b39643b3cfef51131705195e5105cefc3de50cf8dfe1c6c3590699d629c17269d86c08c5058ad3996d8f0a964de42011876b06b928c4fbb8428167cf3edc11485922378d61b93e0ac552a8eaa0cce772e9d34793c70315ca8897264ca831a6e161dd782badc9121c27db9af4884f1714194355b7913dc5eb433f803391f440526105890ed5fe3ceb5be2b5c9e2aea9b9991b4d2f7acd8bb95da3f62914ca740a63b452b336ea75963b497388ea66a662a3a66656a8086bfca9461a414e6de0c8d282efcc4fadbc0d89195daa2bcd521d58f686d8c84e5144bf582e7cbf30f693ad274d2f0f1cc531f80fb5f6f7665e2a7b92b2edd8659a85d9ee266e70aa5770ac6a0eb346c30ce201bd347c33b86895794e71c4a95ac57c3ec92cd1a0bd5e44f731e8123865292acd4aced3ad1d59739d825d285d4d5142b5eb22be03c91496c7795674105d183970dfac2c8b297c19cf1ed05f4c9715efe78f3f519a8bc1c4f71574b67d7d2714e6f8a7ddded7a5981938424895f24c3f7c0b2b0e245c9e9c2c31122b2466043bcf999f3fe8a229f9da21dee1ddc4046a6d254d310e094c3abd7ec685087ef3b7b9bc0a2535a11906db45f3629f2b350ed5a98992721a23e31b4d0eab62dfa249b10f282d826a666ea42392505451dcea3354e5b31025c43244eb821c32d56b7d2967c0b95e4277a225cd0efcd03bb76f2f1b89c8ac48a05c5ff893a7d5074dcf0eb294edd615a4bed33c640b1cdec104757a1f06301b754bf23b9fd83b098d7b7f9a9e7fb4fc92d31b0151dd2fc04b7e9fa9d06fc0552b3fd00e865c179302972069c61b5db2a07893596a6a924f5fb9bee377e21ee4362a73fbfadd9d8e45c0d4e8352495e386d6175ac4a8440a89d22b09792054f2b21ab8c9a294211d5c2f134ee453110d137b6fcdc5a4ffd362cea86a3df6c79c6c2ffdc56ca32bf2d80133dc8f191a0f1dab2a111ff5a15447daabbf8eedcc078150e5b79bfd256c6de64e9c8e7f30a3a2d6a39fe0bd99ae460a82607102b9d2a95c048be7dfcb59a31281c9f7281b3ca456c51c90a4b4da346311b469b2ce37b07a793dfafb4aa0729d81375a077beb60ddf07c0c199bc872a7bb645e57b87ea3e45bec30bbd10083ed19c74a5267cb304bbdc0f7da47b420a0e73a9208946784f02c766b58a509774409b29c67783a51af2fcf19a91fbc5b8893346f404b31f71d182b8374b773f9f00925585722b991d468a8c03626d85925f363046f49c49b92be7735dcaa1e21e917812068e2d4c76ac53e9eb5ae22fb267bc2c8f870d5810f104c927cd7ffe7b0e5cee47b0c8d7ce420208f1f69dc763d205f52e049480e8efd85d66561ec4f7f2e224632d39a0d314437870d75c6a1856796e21c3ae8fa75484971424bf1057bd5cb8725c1a05dc8b5d5bedac3ad2c1aefca2dd8a4a59ade6161e70614115cdff44796a60e547c734f2fada381ba4449e3cddc44a6cde33256d39398afc8b2b1b2ecfc3760801cc3de1a0fd57c90e8154bb277a3c9596d64fa4dbc5ff3e38ae1b592698e7b61c403b86567bc06dc343c685bf4f985d4a8f8c9d6ca91e51472edaf661bfbf9d29e6b4882e27d59a73a809cb7628d4c899095dec997d1858a1921659ccc5f19e41d30f76355bdf9deed80faafcc586501c64b005fe98ff6ad8d21ae016a29c0c63e8aaeef018015936eebddeaa342107b8c342c217ebd8b6c56c2278434d14d90728816f38b7c05072a2315d9e1c82fa9efbd097170f7879049700e15ab688b66e23c205c44022085e03220d100ef84318cf63b38e63a17f53165212171d34f2de945a24102fc7907d2a883ce47e5ebe5683497ebe2bf64a69010e7a84e1c30da50d02f07df34695e8b536c5d8c817ab25b5dbbb3c1e39766179c657a388370e4f35a283b8b8580ee8ddd183548d132fe32c8ab618c1c02cb337310e5316a3bd780e6f7aa550ce1d4aa4900c2e55915d482fc9c3e6dcb79dec1e17d77f2e6603e478efcb1df4507a8430f508ec798ee39cd0140c6dc1d5e734ca8803e5cb241cd259795f63ac13b2bba29053fe2fdf765f4892b1bc779bff577b5e22d2b3e2a94d2d9ec5860f03479c0be7334277815e8475cdb6801810e0ad35bdead9a04e5f3783921246a996d91ed2a66bfc9191fce6e5af08a689881b732e28ad08878465d791e2d93332e3421c12a6b8dd42e13300e4a78f801f0b1785b408d844a58f7d754f2c183cd1a74de05a29abd7b17a576ec85d63507c8ecb12780f829617adede0f8fa50881f36b5c9f4411013e0ed2d42855092bc40ee97aacd0ad578c4459c389a72f8639f001e37567a4087d3179f01f5b2bbdbb866e2ee2bc5ac7d212c9aeacc16c3755ff2c50505b8a679fba9e35283c0a474f935b96a2172467fff97bff97
|
package/dist/index.js
CHANGED
|
@@ -42,6 +42,7 @@ export * from './components/general/semantic';
|
|
|
42
42
|
export * from './components/general/sidepanel';
|
|
43
43
|
export * from './components/general/sitemap';
|
|
44
44
|
export * from './components/general/smartimage';
|
|
45
|
+
export * from './components/general/styleguide';
|
|
45
46
|
export * from './components/general/global-error';
|
|
46
47
|
export * from './components/general/tab';
|
|
47
48
|
export * from './components/general/table';
|
package/dist/index.server.js
CHANGED
|
@@ -21,6 +21,7 @@ export * from './components/general/schema-recipe';
|
|
|
21
21
|
export * from './components/general/schema-services';
|
|
22
22
|
export * from './components/general/schema-website';
|
|
23
23
|
export * from './components/general/sitemap';
|
|
24
|
+
export * from './components/general/humanstxt';
|
|
24
25
|
export * from './components/general/utilities';
|
|
25
26
|
export * from './components/general/skeleton';
|
|
26
27
|
export * from './components/integrations/contentful.delivery';
|
|
@@ -558,7 +558,7 @@ async function main() {
|
|
|
558
558
|
}
|
|
559
559
|
const pagesInput = (await rl.question('Pages to create (comma-separated, e.g. about,contact) [leave blank to skip]: ')).trim();
|
|
560
560
|
let pagesToCreate = [];
|
|
561
|
-
let existingPages = [];
|
|
561
|
+
let existingPages = ['humans.txt', 'styleguide'];
|
|
562
562
|
if (pagesInput) {
|
|
563
563
|
const raw = pagesInput.split(',').map(s => s.trim()).filter(Boolean);
|
|
564
564
|
// sanitize and normalize
|
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"templates": [
|
|
3
|
+
{
|
|
4
|
+
"name": "About",
|
|
5
|
+
"aliases": ["about", "about-us", "company", "our-company", "team", "our-team", "about-us-page"],
|
|
6
|
+
"src": "../../pixelated-template/src/app/(pages)/about"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "Contact",
|
|
10
|
+
"aliases": ["contact", "contact-us", "contact-us-page", "contactus", "support", "get-in-touch", "reach-out", "get-in-touch"],
|
|
11
|
+
"src": "../../pixelated-template/src/app/(pages)/contact",
|
|
12
|
+
"associated_files": ["src/app/data/contactform.json"]
|
|
13
|
+
},
|
|
3
14
|
{
|
|
4
15
|
"name": "FAQs",
|
|
5
16
|
"aliases": ["faq", "faqs", "qa", "q-and-a", "frequently-asked-question", "frequently-asked-questions"],
|
|
6
17
|
"src": "../../pixelated-template/src/app/(pages)/faqs",
|
|
7
18
|
"associated_files": ["src/app/data/faqs.json"]
|
|
8
19
|
},
|
|
20
|
+
{
|
|
21
|
+
"name": "Humans.txt",
|
|
22
|
+
"aliases": ["humans", "humans-txt", "humans.txt", "humansfile", "humansfile.txt", "humanstext"],
|
|
23
|
+
"src": "../../pixelated-template/src/app/(pages)/humans"
|
|
24
|
+
},
|
|
9
25
|
{
|
|
10
26
|
"name": "Projects",
|
|
11
27
|
"aliases": ["gallery", "project", "projects", "portfolio", "work", "our-work",
|
|
12
28
|
"our-projects", "our-project", "case-studies", "examples", "showcase", "samples"],
|
|
13
29
|
"src": "../../pixelated-template/src/app/(pages)/projects"
|
|
14
30
|
},
|
|
15
|
-
{
|
|
16
|
-
"name": "About",
|
|
17
|
-
"aliases": ["about", "about-us", "company", "our-company", "team", "our-team", "about-us-page"],
|
|
18
|
-
"src": "../../pixelated-template/src/app/(pages)/about"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "Contact",
|
|
22
|
-
"aliases": ["contact", "contact-us", "contact-us-page", "contactus", "support", "get-in-touch", "reach-out", "get-in-touch"],
|
|
23
|
-
"src": "../../pixelated-template/src/app/(pages)/contact",
|
|
24
|
-
"associated_files": ["src/app/data/contactform.json"]
|
|
25
|
-
},
|
|
26
31
|
{
|
|
27
32
|
"name": "Services",
|
|
28
33
|
"aliases": ["services", "service", "our-services", "services-page", "offerings", "solutions", "products"],
|
|
29
34
|
"src": "../../pixelated-template/src/app/(pages)/services"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "Style Guide",
|
|
38
|
+
"aliases": ["styleguide", "style-guide", "design-system", "ui-kit", "pattern-library"],
|
|
39
|
+
"src": "../../pixelated-template/src/app/(pages)/styleguide"
|
|
30
40
|
}
|
|
31
41
|
]
|
|
32
42
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import PropTypes, { InferProps } from 'prop-types';
|
|
2
2
|
import './global-error.css';
|
|
3
|
-
export type
|
|
4
|
-
export declare function
|
|
5
|
-
export declare namespace
|
|
3
|
+
export type GlobalErrorUIType = InferProps<typeof GlobalErrorUI.propTypes>;
|
|
4
|
+
export declare function GlobalErrorUI({ error, reset, siteInfo, className }: GlobalErrorUIType): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare namespace GlobalErrorUI {
|
|
6
6
|
var propTypes: {
|
|
7
7
|
error: PropTypes.Requireable<any>;
|
|
8
8
|
reset: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-error.d.ts","sourceRoot":"","sources":["../../../../src/components/general/global-error.tsx"],"names":[],"mappings":"AAGA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,oBAAoB,CAAC;AAQ5B,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"global-error.d.ts","sourceRoot":"","sources":["../../../../src/components/general/global-error.tsx"],"names":[],"mappings":"AAGA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,oBAAoB,CAAC;AAQ5B,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;AAC3E,wBAAgB,aAAa,CAAC,EAAE,KAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAc,EAAE,EAAG,iBAAiB,2CA2ClG;yBA3Ce,aAAa"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { NextRequest } from 'next/server';
|
|
2
|
+
import { NextResponse } from 'next/server';
|
|
3
|
+
/**
|
|
4
|
+
* Read JSON from disk safely — returns null on error.
|
|
5
|
+
* Exported for testing.
|
|
6
|
+
*/
|
|
7
|
+
export declare function safeJSON(path: string): Promise<any>;
|
|
8
|
+
/**
|
|
9
|
+
* Normalize a value into a single-line trimmed string (safe for humans.txt).
|
|
10
|
+
* Exported for testing.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sanitizeString(v: unknown): string;
|
|
13
|
+
export type GenerateHumansOpts = {
|
|
14
|
+
/** base directory to read package.json / routes.json from (defaults to process.cwd()) */
|
|
15
|
+
cwd?: string;
|
|
16
|
+
/** optional package.json object (if provided, fs is not used) */
|
|
17
|
+
pkg?: Record<string, any> | null;
|
|
18
|
+
/** optional routes.json object (if provided, fs is not used) */
|
|
19
|
+
routesJson?: any;
|
|
20
|
+
/** limit how many routes to include (default 50) */
|
|
21
|
+
maxRoutes?: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Generate the humans.txt body + metadata. Pure function when pkg/routesJson are provided —
|
|
25
|
+
* otherwise will attempt to read from disk (runtime apps).
|
|
26
|
+
*/
|
|
27
|
+
export declare function generateHumansTxt(opts?: GenerateHumansOpts): Promise<{
|
|
28
|
+
body: string;
|
|
29
|
+
etag: string;
|
|
30
|
+
headers: Record<string, string>;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Next.js convenience: return a NextResponse for a humans.txt request.
|
|
34
|
+
* Accepts the same options as `generateHumansTxt` (pass `pkg`/`routesJson` in tests).
|
|
35
|
+
*/
|
|
36
|
+
export declare function createHumansTxtResponse(req?: NextRequest, opts?: GenerateHumansOpts): Promise<NextResponse<unknown>>;
|
|
37
|
+
//# sourceMappingURL=humanstxt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humanstxt.d.ts","sourceRoot":"","sources":["../../../../src/components/general/humanstxt.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,gBAO1C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,UAExC;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,yFAAyF;IACzF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACjC,gEAAgE;IAChE,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,GAAE,kBAAuB;;;;GA+CpE;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,IAAI,GAAE,kBAAuB,kCAM7F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import PropTypes, { InferProps } from "prop-types";
|
|
2
|
+
export type StyleGuideUIType = InferProps<typeof StyleGuideUI.propTypes>;
|
|
3
|
+
export declare function StyleGuideUI(props: StyleGuideUIType): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare namespace StyleGuideUI {
|
|
5
|
+
var propTypes: {
|
|
6
|
+
routes: PropTypes.Requireable<any[]>;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=styleguide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleguide.d.ts","sourceRoot":"","sources":["../../../../src/components/general/styleguide.tsx"],"names":[],"mappings":"AAGA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AASnD,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,gBAAgB,2CAiEnD;yBAjEe,YAAY"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export * from "./components/general/semantic";
|
|
|
41
41
|
export * from "./components/general/sidepanel";
|
|
42
42
|
export * from "./components/general/sitemap";
|
|
43
43
|
export * from "./components/general/smartimage";
|
|
44
|
+
export * from "./components/general/styleguide";
|
|
44
45
|
export * from "./components/general/global-error";
|
|
45
46
|
export * from "./components/general/tab";
|
|
46
47
|
export * from "./components/general/table";
|
|
@@ -17,6 +17,7 @@ export * from "./components/general/schema-recipe";
|
|
|
17
17
|
export * from "./components/general/schema-services";
|
|
18
18
|
export * from "./components/general/schema-website";
|
|
19
19
|
export * from "./components/general/sitemap";
|
|
20
|
+
export * from "./components/general/humanstxt";
|
|
20
21
|
export * from "./components/general/utilities";
|
|
21
22
|
export * from "./components/general/skeleton";
|
|
22
23
|
export * from "./components/integrations/contentful.delivery";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GlobalErrorUI } from '@/components/general/global-error';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: typeof
|
|
4
|
+
component: typeof GlobalErrorUI;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
export declare const Default: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-error.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/general/global-error.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"global-error.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/general/global-error.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;;;;;AAElE,wBAA0E;AAE1E,eAAO,MAAM,OAAO;WAAU,GAAG;;;;;;;CAAgC,CAAC;AAGlE,eAAO,MAAM,SAAS,+CAA0D,CAAC;AAEjF,eAAO,MAAM,aAAa;WAAU,GAAG;;;;4BAEQ;QAAE,aAAa,EAAE,WAAW,CAAA;KAAE;CAFN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humans.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/general/humans.stories.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,IAAI;;CAEA,CAAC;AACX,eAAe,IAAI,CAAC;AAuBpB,eAAO,MAAM,OAAO;mBAAoB,GAAG;CAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleguide.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/general/styleguide.stories.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,IAAI;;CAEA,CAAC;AACX,eAAe,IAAI,CAAC;AAqBpB,eAAO,MAAM,OAAO;mBAAoB,GAAG;CAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humanstxt.test.d.ts","sourceRoot":"","sources":["../../../src/tests/humanstxt.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sitemap.test.d.ts","sourceRoot":"","sources":["../../../src/tests/sitemap.test.
|
|
1
|
+
{"version":3,"file":"sitemap.test.d.ts","sourceRoot":"","sources":["../../../src/tests/sitemap.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleguide.test.d.ts","sourceRoot":"","sources":["../../../src/tests/styleguide.test.tsx"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sitemap.test.d.ts","sourceRoot":"","sources":["../../../../../src/tests/components/general/sitemap.test.ts"],"names":[],"mappings":""}
|