@uptrademedia/site-kit 1.0.28 → 1.0.29
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/{chunk-FRSN2JKU.js → chunk-6NTMCSHP.js} +15 -18
- package/dist/chunk-6NTMCSHP.js.map +1 -0
- package/dist/{chunk-WMOA3332.js → chunk-FOBATMSH.js} +70 -55
- package/dist/chunk-FOBATMSH.js.map +1 -0
- package/dist/{chunk-K2PERQLP.mjs → chunk-MLY7AWHG.mjs} +70 -55
- package/dist/chunk-MLY7AWHG.mjs.map +1 -0
- package/dist/{chunk-HHAJAANV.mjs → chunk-QY7CDW6P.mjs} +189 -34
- package/dist/chunk-QY7CDW6P.mjs.map +1 -0
- package/dist/{chunk-JOAULVQB.mjs → chunk-WG2SI2UN.mjs} +15 -18
- package/dist/chunk-WG2SI2UN.mjs.map +1 -0
- package/dist/{chunk-RM4XFDE6.js → chunk-ZGT5ZYQ5.js} +189 -34
- package/dist/chunk-ZGT5ZYQ5.js.map +1 -0
- package/dist/commerce/index.d.mts +1 -1
- package/dist/commerce/index.d.ts +1 -1
- package/dist/commerce/index.js +39 -39
- package/dist/commerce/index.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +39 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -11
- package/dist/index.mjs.map +1 -1
- package/dist/{routing-D6bSzuw-.d.ts → routing-CHmSC8p0.d.ts} +1 -1
- package/dist/{routing-nObgWX16.d.mts → routing-Cy9vtQq8.d.mts} +1 -1
- package/dist/seo/index.d.mts +28 -28
- package/dist/seo/index.d.ts +28 -28
- package/dist/seo/index.js +96 -245
- package/dist/seo/index.js.map +1 -1
- package/dist/seo/index.mjs +25 -224
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo/register-sitemap-cli.js +3 -3
- package/dist/seo/register-sitemap-cli.mjs +2 -2
- package/dist/seo/server.d.mts +2 -2
- package/dist/seo/server.d.ts +2 -2
- package/dist/seo/server.js +185 -44
- package/dist/seo/server.js.map +1 -1
- package/dist/seo/server.mjs +183 -2
- package/dist/seo/server.mjs.map +1 -1
- package/dist/{api-EXKDAYGB.mjs → server-api-3HJLLZB7.mjs} +3 -3
- package/dist/server-api-3HJLLZB7.mjs.map +1 -0
- package/dist/{api-HBENRDUH.js → server-api-RM25RPFH.js} +20 -20
- package/dist/server-api-RM25RPFH.js.map +1 -0
- package/dist/{types-Cb9d3lkc.d.mts → types-CwyWiHtq.d.mts} +22 -11
- package/dist/{types-Cb9d3lkc.d.ts → types-CwyWiHtq.d.ts} +22 -11
- package/package.json +1 -1
- package/dist/api-EXKDAYGB.mjs.map +0 -1
- package/dist/api-HBENRDUH.js.map +0 -1
- package/dist/chunk-FRSN2JKU.js.map +0 -1
- package/dist/chunk-HHAJAANV.mjs.map +0 -1
- package/dist/chunk-JOAULVQB.mjs.map +0 -1
- package/dist/chunk-K2PERQLP.mjs.map +0 -1
- package/dist/chunk-RM4XFDE6.js.map +0 -1
- package/dist/chunk-WMOA3332.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getRedirectData, getRobotsData, getSitemapEntries } from './chunk-
|
|
1
|
+
import { getRedirectData, getRobotsData, getSitemapEntries } from './chunk-MLY7AWHG.mjs';
|
|
2
2
|
|
|
3
3
|
// src/seo/routing.ts
|
|
4
4
|
async function getRedirect(options) {
|
|
5
|
-
const {
|
|
6
|
-
const redirect = await getRedirectData(
|
|
5
|
+
const { path } = options;
|
|
6
|
+
const redirect = await getRedirectData(path);
|
|
7
7
|
if (!redirect) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
@@ -44,27 +44,27 @@ function parseRobotsString(robots) {
|
|
|
44
44
|
return directive;
|
|
45
45
|
}
|
|
46
46
|
async function getRobotsDirective(options) {
|
|
47
|
-
const {
|
|
48
|
-
const robotsString = await getRobotsData(
|
|
47
|
+
const { path } = options;
|
|
48
|
+
const robotsString = await getRobotsData(path);
|
|
49
49
|
if (!robotsString) {
|
|
50
50
|
return { index: true, follow: true };
|
|
51
51
|
}
|
|
52
52
|
return parseRobotsString(robotsString);
|
|
53
53
|
}
|
|
54
54
|
async function generateSitemap(options) {
|
|
55
|
-
const {
|
|
56
|
-
const pages = await getSitemapEntries(
|
|
55
|
+
const { baseUrl, publishedOnly = true } = options;
|
|
56
|
+
const pages = await getSitemapEntries({ publishedOnly });
|
|
57
57
|
const normalizedBase = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
|
|
58
58
|
return pages.map((page) => ({
|
|
59
59
|
path: page.path,
|
|
60
60
|
url: `${normalizedBase}${page.path}`,
|
|
61
|
-
lastmod: page.
|
|
62
|
-
changefreq: page.
|
|
63
|
-
priority: page.
|
|
61
|
+
lastmod: page.lastmod,
|
|
62
|
+
changefreq: page.changefreq || "weekly",
|
|
63
|
+
priority: page.priority ?? 0.5
|
|
64
64
|
}));
|
|
65
65
|
}
|
|
66
66
|
async function registerLocalSitemap(options) {
|
|
67
|
-
const { registerSitemap } = await import('./api-
|
|
67
|
+
const { registerSitemap } = await import('./server-api-3HJLLZB7.mjs');
|
|
68
68
|
let entries = options.entries || [];
|
|
69
69
|
if (options.autoDiscover && entries.length === 0) {
|
|
70
70
|
try {
|
|
@@ -84,10 +84,7 @@ async function registerLocalSitemap(options) {
|
|
|
84
84
|
return { success: true, created: 0, updated: 0 };
|
|
85
85
|
}
|
|
86
86
|
console.log(`[Uptrade] Registering ${entries.length} sitemap entries...`);
|
|
87
|
-
const result = await registerSitemap(entries
|
|
88
|
-
optimize_meta: options.optimize_meta !== false
|
|
89
|
-
// Default to true
|
|
90
|
-
});
|
|
87
|
+
const result = await registerSitemap(entries);
|
|
91
88
|
if (result.success) {
|
|
92
89
|
console.log(`[Uptrade] Sitemap registered: ${result.created} new, ${result.updated} updated`);
|
|
93
90
|
}
|
|
@@ -128,10 +125,10 @@ function discoverNextJsRoutes(appDir, fs, path, basePath = "") {
|
|
|
128
125
|
return entries;
|
|
129
126
|
}
|
|
130
127
|
async function isIndexable(projectId, path) {
|
|
131
|
-
const directive = await getRobotsDirective({
|
|
128
|
+
const directive = await getRobotsDirective({ path });
|
|
132
129
|
return directive.index;
|
|
133
130
|
}
|
|
134
131
|
|
|
135
132
|
export { generateSitemap, getRedirect, getRobotsDirective, isIndexable, registerLocalSitemap };
|
|
136
|
-
//# sourceMappingURL=chunk-
|
|
137
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-WG2SI2UN.mjs.map
|
|
134
|
+
//# sourceMappingURL=chunk-WG2SI2UN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/seo/routing.ts"],"names":[],"mappings":";;;AAgCA,eAAsB,YACpB,OAAA,EACgC;AAChC,EAAA,MAAM,EAAE,MAAK,GAAI,OAAA;AAEjB,EAAA,MAAM,QAAA,GAAW,MAAM,eAAA,CAAgB,IAAI,CAAA;AAE3C,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO,IAAA;AAAA,EACT;AAGA,EAAA,IAAI,QAAA,CAAS,cAAc,IAAI,IAAA,CAAK,SAAS,UAAU,CAAA,mBAAI,IAAI,IAAA,EAAK,EAAG;AACrE,IAAA,OAAO,IAAA;AAAA,EACT;AAGA,EAAA,MAAM,WAAA,GAAc,QAAA,CAAS,eAAA,IAAmB,QAAA,CAAS,gBAAA;AACzD,EAAA,MAAM,aAAa,WAAA,CAAY,UAAA,CAAW,SAAS,CAAA,IAAK,WAAA,CAAY,WAAW,UAAU,CAAA;AAEzF,EAAA,OAAO;AAAA,IACL,WAAA;AAAA,IACA,YAAY,QAAA,CAAS,WAAA;AAAA,IACrB;AAAA,GACF;AACF;AAKA,SAAS,kBAAkB,MAAA,EAAiC;AAC1D,EAAA,MAAM,SAAA,GAA6B;AAAA,IACjC,KAAA,EAAO,IAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAEA,EAAA,MAAM,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K,EAAE,IAAA,EAAM,SAAA,IAAa,GAAA,EAAK,UAAU,CAAA;AAAA,MACnD;AAGA,MAAA,IAAI,CAAC,SAAA,EAAW;AACd,QAAA,MAAM,aAAa,oBAAA,CAAqB,QAAA,EAAU,IAAI,IAAA,EAAM,YAAA,GAAe,WAAW,SAAS,CAAA;AAC/F,QAAA,OAAA,CAAQ,IAAA,CAAK,GAAG,UAAU,CAAA;AAAA,MAC5B;AAAA,IACF;AAAA,EACF;AAGA,EAAA,IAAI,aAAa,EAAA,EAAI;AACnB,IAAA,MAAM,WAAA,GAAc,GAAG,UAAA,CAAW,IAAA,CAAK,KAAK,MAAA,EAAQ,UAAU,CAAC,CAAA,IAC3C,EAAA,CAAG,UAAA,CAAW,KAAK,IAAA,CAAK,MAAA,EAAQ,SAAS,CAAC,CAAA,IAC1C,EAAA,CAAG,WAAW,IAAA,CAAK,IAAA,CAAK,MAAA,EAAQ,UAAU,CAAC,CAAA;AAC/D,IAAA,IAAI,WAAA,EAAa;AACf,MAAA,OAAA,CAAQ,QAAQ,EAAE,IAAA,EAAM,GAAA,EAAK,QAAA,EAAU,GAAK,CAAA;AAAA,IAC9C;AAAA,EACF;AAEA,EAAA,OAAO,OAAA;AACT;AAOA,eAAsB,WAAA,CACpB,WACA,IAAA,EACkB;AAClB,EAAA,MAAM,YAAY,MAAM,kBAAA,CAAmB,EAAa,MAAM,CAAA;AAC9D,EAAA,OAAO,SAAA,CAAU,KAAA;AACnB","file":"chunk-WG2SI2UN.mjs","sourcesContent":["import { getRedirectData, getRobotsData, getSitemapEntries } from './server-api'\nimport type { \n GetRedirectOptions, \n RedirectResult, \n GetRobotsOptions, \n RobotsDirective,\n GetSitemapEntriesOptions,\n SitemapEntry \n} from './types'\n\n/**\n * Get redirect for a path if one exists\n * \n * Use in Next.js middleware to handle managed redirects\n * \n * @example\n * ```tsx\n * // middleware.ts\n * import { getRedirect } from '@uptrade/seo'\n * \n * export async function middleware(request) {\n * const redirect = await getRedirect({\n * projectId: process.env.UPTRADE_PROJECT_ID!,\n * path: request.nextUrl.pathname\n * })\n * \n * if (redirect) {\n * return NextResponse.redirect(redirect.destination, redirect.statusCode)\n * }\n * }\n * ```\n */\nexport async function getRedirect(\n options: GetRedirectOptions\n): Promise<RedirectResult | null> {\n const { path } = options\n\n const redirect = await getRedirectData(path)\n\n if (!redirect) {\n return null\n }\n\n // Check if expired\n if (redirect.expires_at && new Date(redirect.expires_at) < new Date()) {\n return null\n }\n\n // Determine destination\n const destination = redirect.destination_url || redirect.destination_path\n const isExternal = destination.startsWith('http://') || destination.startsWith('https://')\n\n return {\n destination,\n statusCode: redirect.status_code,\n isExternal,\n }\n}\n\n/**\n * Parse robots directive string into structured object\n */\nfunction parseRobotsString(robots: string): RobotsDirective {\n const directive: RobotsDirective = {\n index: true,\n follow: true,\n }\n\n const parts = robots.toLowerCase().split(',').map(p => p.trim())\n\n for (const part of parts) {\n if (part === 'noindex') directive.index = false\n if (part === 'nofollow') directive.follow = false\n if (part === 'noarchive') directive.noarchive = true\n if (part === 'nosnippet') directive.nosnippet = true\n if (part === 'noimageindex') directive.noimageindex = true\n if (part.startsWith('max-snippet:')) {\n directive.max_snippet = parseInt(part.split(':')[1], 10)\n }\n if (part.startsWith('max-image-preview:')) {\n const value = part.split(':')[1] as 'none' | 'standard' | 'large'\n directive.max_image_preview = value\n }\n if (part.startsWith('max-video-preview:')) {\n directive.max_video_preview = parseInt(part.split(':')[1], 10)\n }\n }\n\n return directive\n}\n\n/**\n * Get robots directive for a page\n * \n * @example\n * ```tsx\n * const robots = await getRobotsDirective({\n * projectId: process.env.UPTRADE_PROJECT_ID!,\n * path: '/private-page'\n * })\n * \n * if (!robots.index) {\n * // Page should not be indexed\n * }\n * ```\n */\nexport async function getRobotsDirective(\n options: GetRobotsOptions\n): Promise<RobotsDirective> {\n const { path } = options\n\n const robotsString = await getRobotsData(path)\n\n if (!robotsString) {\n // Default: index and follow\n return { index: true, follow: true }\n }\n\n return parseRobotsString(robotsString)\n}\n\n/**\n * Get sitemap entries for a project\n * \n * Use in sitemap.ts to generate dynamic sitemap\n * \n * @example\n * ```tsx\n * // app/sitemap.ts\n * import { generateSitemap } from '@uptrade/seo'\n * \n * export default async function sitemap() {\n * return generateSitemap({\n * projectId: process.env.UPTRADE_PROJECT_ID!,\n * baseUrl: 'https://example.com',\n * publishedOnly: true\n * })\n * }\n * ```\n */\nexport async function generateSitemap(\n options: GetSitemapEntriesOptions\n): Promise<SitemapEntry[]> {\n const { baseUrl, publishedOnly = true } = options\n\n const pages = await getSitemapEntries({ publishedOnly })\n\n const normalizedBase = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl\n\n return pages.map((page: { path: string; lastmod?: string; changefreq?: string; priority?: number }) => ({\n path: page.path,\n url: `${normalizedBase}${page.path}`,\n lastmod: page.lastmod,\n changefreq: (page.changefreq || 'weekly') as SitemapEntry['changefreq'],\n priority: page.priority ?? 0.5,\n }))\n}\n\n/**\n * Register local sitemap entries with Uptrade Portal\n * \n * Call this at build time to sync your local routes to seo_pages.\n * This ensures analytics only tracks real pages.\n * \n * After registration, Signal AI will generate optimized meta titles\n * and descriptions for pages that don't have managed meta yet.\n * \n * @example\n * ```ts\n * // scripts/register-sitemap.ts\n * import { registerLocalSitemap } from '@uptrade/seo'\n * \n * // Option 1: Provide entries directly\n * await registerLocalSitemap({\n * entries: [\n * { path: '/', title: 'Home', priority: 1.0 },\n * { path: '/about', title: 'About Us', priority: 0.8 },\n * ]\n * })\n * \n * // Option 2: Auto-discover from Next.js app directory\n * await registerLocalSitemap({ autoDiscover: true })\n * \n * // Option 3: Skip Signal AI meta optimization\n * await registerLocalSitemap({ autoDiscover: true, optimize_meta: false })\n * ```\n */\nexport async function registerLocalSitemap(options: {\n entries?: Array<{\n path: string\n title?: string\n priority?: number\n changefreq?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never'\n }>\n autoDiscover?: boolean\n /** Trigger Signal AI to generate optimized meta titles/descriptions (default: true) */\n optimize_meta?: boolean\n}): Promise<{ \n success: boolean\n created: number\n updated: number\n removed?: number\n meta_optimization?: {\n triggered: boolean\n pages_queued: number\n } | null\n}> {\n const { registerSitemap } = await import('./server-api')\n \n let entries = options.entries || []\n \n // Auto-discover from Next.js app directory if requested\n if (options.autoDiscover && entries.length === 0) {\n try {\n const fs = await import('fs')\n const path = await import('path')\n \n const appDir = path.join(process.cwd(), 'app')\n if (fs.existsSync(appDir)) {\n entries = discoverNextJsRoutes(appDir, fs, path)\n console.log(`[Uptrade] Auto-discovered ${entries.length} routes from app directory`)\n }\n } catch (error) {\n console.error('[Uptrade] Auto-discovery failed:', error)\n }\n }\n \n if (entries.length === 0) {\n console.warn('[Uptrade] No sitemap entries to register')\n return { success: true, created: 0, updated: 0 }\n }\n \n console.log(`[Uptrade] Registering ${entries.length} sitemap entries...`)\n const result = await registerSitemap(entries)\n \n if (result.success) {\n console.log(`[Uptrade] Sitemap registered: ${result.created} new, ${result.updated} updated`)\n }\n \n return result\n}\n\n/**\n * Discover routes from Next.js app directory\n */\nfunction discoverNextJsRoutes(\n appDir: string,\n fs: typeof import('fs'),\n path: typeof import('path'),\n basePath: string = ''\n): Array<{ path: string; priority: number }> {\n const entries: Array<{ path: string; priority: number }> = []\n \n const items = fs.readdirSync(appDir, { withFileTypes: true })\n \n for (const item of items) {\n // Skip private folders, api routes, and special files\n if (item.name.startsWith('_') || item.name.startsWith('.')) continue\n if (item.name === 'api') continue\n if (item.name === 'node_modules') continue\n \n const itemPath = path.join(appDir, item.name)\n \n if (item.isDirectory()) {\n // Check for page.tsx/page.js in this directory\n const hasPage = fs.existsSync(path.join(itemPath, 'page.tsx')) ||\n fs.existsSync(path.join(itemPath, 'page.js')) ||\n fs.existsSync(path.join(itemPath, 'page.jsx'))\n \n // Handle route groups (parentheses)\n const isRouteGroup = item.name.startsWith('(') && item.name.endsWith(')')\n \n // Handle dynamic segments [slug]\n const isDynamic = item.name.startsWith('[') && item.name.endsWith(']')\n \n let routePath = basePath\n if (!isRouteGroup && !isDynamic) {\n routePath = `${basePath}/${item.name}`\n }\n \n if (hasPage && !isDynamic) {\n const priority = routePath === '' ? 1.0 : 0.8\n entries.push({ path: routePath || '/', priority })\n }\n \n // Recurse into subdirectories (but not dynamic ones)\n if (!isDynamic) {\n const subEntries = discoverNextJsRoutes(itemPath, fs, path, isRouteGroup ? basePath : routePath)\n entries.push(...subEntries)\n }\n }\n }\n \n // Add root if app/page.tsx exists and we're at root\n if (basePath === '') {\n const hasRootPage = fs.existsSync(path.join(appDir, 'page.tsx')) ||\n fs.existsSync(path.join(appDir, 'page.js')) ||\n fs.existsSync(path.join(appDir, 'page.jsx'))\n if (hasRootPage) {\n entries.unshift({ path: '/', priority: 1.0 })\n }\n }\n \n return entries\n}\n\n/**\n * Check if a path should be indexed\n * \n * Quick helper to check indexability without full directive parsing\n */\nexport async function isIndexable(\n projectId: string,\n path: string\n): Promise<boolean> {\n const directive = await getRobotsDirective({ projectId, path })\n return directive.index\n}\n"]}
|
|
@@ -3356,6 +3356,12 @@ var ListIcon = () => /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www
|
|
|
3356
3356
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "12", x2: "3.01", y2: "12" }),
|
|
3357
3357
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "18", x2: "3.01", y2: "18" })
|
|
3358
3358
|
] });
|
|
3359
|
+
var GridIcon = () => /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3360
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "7", height: "7" }),
|
|
3361
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "14", y: "3", width: "7", height: "7" }),
|
|
3362
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "14", y: "14", width: "7", height: "7" }),
|
|
3363
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "14", width: "7", height: "7" })
|
|
3364
|
+
] });
|
|
3359
3365
|
var ClockIcon = () => /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3360
3366
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
3361
3367
|
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "12 6 12 12 16 14" })
|
|
@@ -3510,7 +3516,7 @@ function EventsWidget({
|
|
|
3510
3516
|
] })
|
|
3511
3517
|
] });
|
|
3512
3518
|
}
|
|
3513
|
-
const displayEvents = viewMode === "list" ? events.slice(0, limit) : events;
|
|
3519
|
+
const displayEvents = viewMode === "list" || viewMode === "grid" ? events.slice(0, limit) : events;
|
|
3514
3520
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `site-kit-events-widget ${className}`, children: [
|
|
3515
3521
|
(title || subtitle || showViewToggle) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3516
3522
|
"div",
|
|
@@ -3566,6 +3572,31 @@ function EventsWidget({
|
|
|
3566
3572
|
]
|
|
3567
3573
|
}
|
|
3568
3574
|
),
|
|
3575
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3576
|
+
"button",
|
|
3577
|
+
{
|
|
3578
|
+
onClick: () => setViewMode("grid"),
|
|
3579
|
+
style: {
|
|
3580
|
+
display: "flex",
|
|
3581
|
+
alignItems: "center",
|
|
3582
|
+
gap: "0.5rem",
|
|
3583
|
+
padding: "0.5rem 1rem",
|
|
3584
|
+
border: "none",
|
|
3585
|
+
borderRadius: "0.375rem",
|
|
3586
|
+
background: viewMode === "grid" ? "#fff" : "transparent",
|
|
3587
|
+
color: viewMode === "grid" ? "#1f2937" : "#6b7280",
|
|
3588
|
+
fontWeight: 500,
|
|
3589
|
+
fontSize: "0.875rem",
|
|
3590
|
+
cursor: "pointer",
|
|
3591
|
+
boxShadow: viewMode === "grid" ? "0 1px 2px rgba(0,0,0,0.05)" : "none",
|
|
3592
|
+
transition: "all 150ms"
|
|
3593
|
+
},
|
|
3594
|
+
children: [
|
|
3595
|
+
/* @__PURE__ */ jsxRuntime.jsx(GridIcon, {}),
|
|
3596
|
+
"Grid"
|
|
3597
|
+
]
|
|
3598
|
+
}
|
|
3599
|
+
),
|
|
3569
3600
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3570
3601
|
"button",
|
|
3571
3602
|
{
|
|
@@ -3601,6 +3632,7 @@ function EventsWidget({
|
|
|
3601
3632
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: displayEvents.map((eventItem) => {
|
|
3602
3633
|
const nextSchedule = eventItem.next_schedule || eventItem.schedules?.[0];
|
|
3603
3634
|
const isFree = !eventItem.price || eventItem.price === 0;
|
|
3635
|
+
const imageUrl = eventItem.featured_image_url;
|
|
3604
3636
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3605
3637
|
"div",
|
|
3606
3638
|
{
|
|
@@ -3608,14 +3640,15 @@ function EventsWidget({
|
|
|
3608
3640
|
onClick: () => nextSchedule && handleEventClick(eventItem, nextSchedule),
|
|
3609
3641
|
style: {
|
|
3610
3642
|
display: "flex",
|
|
3611
|
-
flexDirection: "
|
|
3612
|
-
gap:
|
|
3613
|
-
padding:
|
|
3643
|
+
flexDirection: "row",
|
|
3644
|
+
gap: 0,
|
|
3645
|
+
padding: 0,
|
|
3614
3646
|
background: "#fff",
|
|
3615
3647
|
border: "1px solid #e5e7eb",
|
|
3616
3648
|
borderRadius: "0.75rem",
|
|
3617
3649
|
cursor: nextSchedule ? "pointer" : "default",
|
|
3618
|
-
transition: "all 150ms"
|
|
3650
|
+
transition: "all 150ms",
|
|
3651
|
+
overflow: "hidden"
|
|
3619
3652
|
},
|
|
3620
3653
|
onMouseEnter: (e) => {
|
|
3621
3654
|
if (nextSchedule) {
|
|
@@ -3628,38 +3661,160 @@ function EventsWidget({
|
|
|
3628
3661
|
e.currentTarget.style.boxShadow = "none";
|
|
3629
3662
|
},
|
|
3630
3663
|
children: [
|
|
3631
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3664
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
3665
|
+
width: "160px",
|
|
3666
|
+
minWidth: "160px",
|
|
3667
|
+
flexShrink: 0,
|
|
3668
|
+
background: "#f3f4f6"
|
|
3669
|
+
}, children: imageUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3670
|
+
"img",
|
|
3671
|
+
{
|
|
3672
|
+
src: imageUrl,
|
|
3673
|
+
alt: eventItem.name,
|
|
3674
|
+
style: {
|
|
3675
|
+
width: "100%",
|
|
3676
|
+
height: "100%",
|
|
3677
|
+
minHeight: "120px",
|
|
3678
|
+
objectFit: "cover",
|
|
3679
|
+
display: "block"
|
|
3680
|
+
}
|
|
3681
|
+
}
|
|
3682
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
3683
|
+
width: "100%",
|
|
3684
|
+
minHeight: "120px",
|
|
3685
|
+
display: "flex",
|
|
3686
|
+
alignItems: "center",
|
|
3687
|
+
justifyContent: "center",
|
|
3688
|
+
color: "#9ca3af"
|
|
3689
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, {}) }) }),
|
|
3690
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "0.75rem", padding: "1.25rem" }, children: [
|
|
3691
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: "1rem" }, children: [
|
|
3692
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1 }, children: [
|
|
3693
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: 0, fontSize: "1.125rem", fontWeight: 600, color: "#1f2937" }, children: eventItem.name }),
|
|
3694
|
+
eventItem.short_description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0.5rem 0 0", color: "#6b7280", fontSize: "0.875rem", lineHeight: 1.5 }, children: eventItem.short_description })
|
|
3695
|
+
] }),
|
|
3696
|
+
eventItem.price_is_public && /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
3697
|
+
padding: "0.375rem 0.75rem",
|
|
3698
|
+
background: isFree ? "#dcfce7" : "#dbeafe",
|
|
3699
|
+
color: isFree ? "#166534" : "#1e40af",
|
|
3700
|
+
borderRadius: "9999px",
|
|
3701
|
+
fontSize: "0.875rem",
|
|
3702
|
+
fontWeight: 600,
|
|
3703
|
+
whiteSpace: "nowrap"
|
|
3704
|
+
}, children: isFree ? "Free" : formatPrice(eventItem.price ?? 0, eventItem.currency) })
|
|
3705
|
+
] }),
|
|
3706
|
+
nextSchedule && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexWrap: "wrap", gap: "1rem", fontSize: "0.875rem", color: "#6b7280" }, children: [
|
|
3707
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "0.375rem" }, children: [
|
|
3708
|
+
/* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, {}),
|
|
3709
|
+
formatDate(nextSchedule.starts_at)
|
|
3710
|
+
] }),
|
|
3711
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "0.375rem" }, children: [
|
|
3712
|
+
/* @__PURE__ */ jsxRuntime.jsx(ClockIcon, {}),
|
|
3713
|
+
formatTime(nextSchedule.starts_at)
|
|
3714
|
+
] }),
|
|
3715
|
+
eventItem.location && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "0.375rem" }, children: [
|
|
3716
|
+
/* @__PURE__ */ jsxRuntime.jsx(LocationIcon, {}),
|
|
3717
|
+
eventItem.location
|
|
3718
|
+
] }),
|
|
3719
|
+
nextSchedule.spots_remaining !== null && nextSchedule.spots_remaining !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { style: {
|
|
3720
|
+
color: nextSchedule.spots_remaining < 5 ? "#dc2626" : "#6b7280",
|
|
3721
|
+
fontWeight: nextSchedule.spots_remaining < 5 ? 500 : 400
|
|
3722
|
+
}, children: nextSchedule.spots_remaining === 0 ? "Sold Out" : `${nextSchedule.spots_remaining} spots left` })
|
|
3723
|
+
] })
|
|
3724
|
+
] })
|
|
3725
|
+
]
|
|
3726
|
+
},
|
|
3727
|
+
eventItem.id
|
|
3728
|
+
);
|
|
3729
|
+
}) }),
|
|
3730
|
+
showViewAll && events.length > limit && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3731
|
+
"a",
|
|
3732
|
+
{
|
|
3733
|
+
href: viewAllUrl,
|
|
3734
|
+
style: {
|
|
3735
|
+
display: "inline-block",
|
|
3736
|
+
padding: "0.75rem 1.5rem",
|
|
3737
|
+
background: "#f3f4f6",
|
|
3738
|
+
color: "#1f2937",
|
|
3739
|
+
borderRadius: "0.5rem",
|
|
3740
|
+
textDecoration: "none",
|
|
3741
|
+
fontWeight: 500,
|
|
3742
|
+
fontSize: "0.875rem",
|
|
3743
|
+
transition: "all 150ms"
|
|
3744
|
+
},
|
|
3745
|
+
children: viewAllText
|
|
3746
|
+
}
|
|
3747
|
+
) })
|
|
3748
|
+
] }) : viewMode === "grid" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `site-kit-events-grid ${listClassName}`, children: [
|
|
3749
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
3750
|
+
display: "grid",
|
|
3751
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))",
|
|
3752
|
+
gap: "1.25rem"
|
|
3753
|
+
}, children: displayEvents.map((eventItem) => {
|
|
3754
|
+
const nextSchedule = eventItem.next_schedule || eventItem.schedules?.[0];
|
|
3755
|
+
const isFree = !eventItem.price || eventItem.price === 0;
|
|
3756
|
+
const imageUrl = eventItem.featured_image_url;
|
|
3757
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3758
|
+
"div",
|
|
3759
|
+
{
|
|
3760
|
+
className: `site-kit-event-card site-kit-event-card--grid ${eventCardClassName}`,
|
|
3761
|
+
onClick: () => nextSchedule && handleEventClick(eventItem, nextSchedule),
|
|
3762
|
+
style: {
|
|
3763
|
+
position: "relative",
|
|
3764
|
+
minHeight: "220px",
|
|
3765
|
+
borderRadius: "0.75rem",
|
|
3766
|
+
overflow: "hidden",
|
|
3767
|
+
cursor: nextSchedule ? "pointer" : "default",
|
|
3768
|
+
transition: "all 150ms",
|
|
3769
|
+
border: "1px solid #e5e7eb"
|
|
3770
|
+
},
|
|
3771
|
+
onMouseEnter: (e) => {
|
|
3772
|
+
if (nextSchedule) {
|
|
3773
|
+
e.currentTarget.style.boxShadow = "0 10px 25px -5px rgba(0, 0, 0, 0.15)";
|
|
3774
|
+
e.currentTarget.style.transform = "translateY(-2px)";
|
|
3775
|
+
}
|
|
3776
|
+
},
|
|
3777
|
+
onMouseLeave: (e) => {
|
|
3778
|
+
e.currentTarget.style.boxShadow = "none";
|
|
3779
|
+
e.currentTarget.style.transform = "none";
|
|
3780
|
+
},
|
|
3781
|
+
children: [
|
|
3782
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
3783
|
+
position: "absolute",
|
|
3784
|
+
inset: 0,
|
|
3785
|
+
background: imageUrl ? `linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0.15) 70%), url(${imageUrl}) center/cover` : "linear-gradient(135deg, #4b5563 0%, #6b7280 100%)"
|
|
3786
|
+
} }),
|
|
3787
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
|
|
3788
|
+
position: "relative",
|
|
3789
|
+
height: "100%",
|
|
3790
|
+
display: "flex",
|
|
3791
|
+
flexDirection: "column",
|
|
3792
|
+
justifyContent: "flex-end",
|
|
3793
|
+
padding: "1.25rem",
|
|
3794
|
+
color: "#fff"
|
|
3795
|
+
}, children: [
|
|
3796
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: 0, fontSize: "1.125rem", fontWeight: 600, color: "#fff", textShadow: "0 1px 2px rgba(0,0,0,0.5)" }, children: eventItem.name }),
|
|
3797
|
+
eventItem.short_description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0.25rem 0 0", fontSize: "0.8125rem", opacity: 0.95, lineHeight: 1.4, overflow: "hidden", textOverflow: "ellipsis", maxHeight: "2.8em" }, children: eventItem.short_description }),
|
|
3798
|
+
nextSchedule && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.75rem", marginTop: "0.75rem", fontSize: "0.8125rem", opacity: 0.95 }, children: [
|
|
3799
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "0.25rem" }, children: [
|
|
3800
|
+
/* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, {}),
|
|
3801
|
+
formatDate(nextSchedule.starts_at)
|
|
3802
|
+
] }),
|
|
3803
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "0.25rem" }, children: [
|
|
3804
|
+
/* @__PURE__ */ jsxRuntime.jsx(ClockIcon, {}),
|
|
3805
|
+
formatTime(nextSchedule.starts_at)
|
|
3806
|
+
] }),
|
|
3807
|
+
nextSchedule.spots_remaining !== null && nextSchedule.spots_remaining !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { children: nextSchedule.spots_remaining === 0 ? "Sold Out" : `${nextSchedule.spots_remaining} spots left` })
|
|
3635
3808
|
] }),
|
|
3636
3809
|
eventItem.price_is_public && /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3810
|
+
marginTop: "0.5rem",
|
|
3811
|
+
display: "inline-block",
|
|
3812
|
+
padding: "0.25rem 0.5rem",
|
|
3813
|
+
background: "rgba(255,255,255,0.2)",
|
|
3640
3814
|
borderRadius: "9999px",
|
|
3641
3815
|
fontSize: "0.875rem",
|
|
3642
|
-
fontWeight: 600
|
|
3643
|
-
whiteSpace: "nowrap"
|
|
3816
|
+
fontWeight: 600
|
|
3644
3817
|
}, children: isFree ? "Free" : formatPrice(eventItem.price ?? 0, eventItem.currency) })
|
|
3645
|
-
] }),
|
|
3646
|
-
nextSchedule && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexWrap: "wrap", gap: "1rem", fontSize: "0.875rem", color: "#6b7280" }, children: [
|
|
3647
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "0.375rem" }, children: [
|
|
3648
|
-
/* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, {}),
|
|
3649
|
-
formatDate(nextSchedule.starts_at)
|
|
3650
|
-
] }),
|
|
3651
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "0.375rem" }, children: [
|
|
3652
|
-
/* @__PURE__ */ jsxRuntime.jsx(ClockIcon, {}),
|
|
3653
|
-
formatTime(nextSchedule.starts_at)
|
|
3654
|
-
] }),
|
|
3655
|
-
eventItem.location && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "0.375rem" }, children: [
|
|
3656
|
-
/* @__PURE__ */ jsxRuntime.jsx(LocationIcon, {}),
|
|
3657
|
-
eventItem.location
|
|
3658
|
-
] }),
|
|
3659
|
-
nextSchedule.spots_remaining !== null && nextSchedule.spots_remaining !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { style: {
|
|
3660
|
-
color: nextSchedule.spots_remaining < 5 ? "#dc2626" : "#6b7280",
|
|
3661
|
-
fontWeight: nextSchedule.spots_remaining < 5 ? 500 : 400
|
|
3662
|
-
}, children: nextSchedule.spots_remaining === 0 ? "Sold Out" : `${nextSchedule.spots_remaining} spots left` })
|
|
3663
3818
|
] })
|
|
3664
3819
|
]
|
|
3665
3820
|
},
|
|
@@ -3760,5 +3915,5 @@ exports.getSpotsRemaining = getSpotsRemaining;
|
|
|
3760
3915
|
exports.isEventSoldOut = isEventSoldOut;
|
|
3761
3916
|
exports.registerForEvent = registerForEvent;
|
|
3762
3917
|
exports.useEventModal = useEventModal;
|
|
3763
|
-
//# sourceMappingURL=chunk-
|
|
3764
|
-
//# sourceMappingURL=chunk-
|
|
3918
|
+
//# sourceMappingURL=chunk-ZGT5ZYQ5.js.map
|
|
3919
|
+
//# sourceMappingURL=chunk-ZGT5ZYQ5.js.map
|