@brightsideoy/kama 1.0.0-alpha.17 → 1.0.0-alpha.19
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/bin/cli.js +69 -43
- package/content/definitions/block-kama-forms.yaml +5 -0
- package/content/definitions/blocks/node-list.yaml +8 -0
- package/content/forms/contact.yaml +44 -0
- package/content/forms/subscription.yaml +32 -0
- package/dist/assets/AssetEditor-CY9SjGaJ.js +1 -0
- package/dist/assets/CmsBadge-BNsgxyyB.css +1 -0
- package/dist/assets/CmsBadge-D0Ob9qPU.js +1 -0
- package/dist/assets/CmsButton-BQ85-YXn.css +1 -0
- package/dist/assets/CmsButton-CbOfxvjr.js +1 -0
- package/dist/assets/CmsDataRow--H4iI_u_.js +1 -0
- package/dist/assets/CmsDataRow-CYNxfVaZ.css +1 -0
- package/dist/assets/CmsHelp-DJSdFYVH.js +1 -0
- package/dist/assets/CmsImagePreview-CujwG8r_.css +1 -0
- package/dist/assets/CmsImagePreview-DuHPBzml.js +1 -0
- package/dist/assets/CmsPaneResizer-B62ZqsnE.js +1 -0
- package/dist/assets/CmsPaneResizer-Dkidd4pI.css +1 -0
- package/dist/assets/CmsPublisher-DBcCz-AD.js +3 -0
- package/dist/assets/CmsUserCenter-D3XDzKDC.js +1 -0
- package/dist/assets/EditorSplitPreview-wCnwVnnb.js +1 -0
- package/dist/assets/NodeContextMenu-BYeWzmQ5.css +1 -0
- package/dist/assets/NodeContextMenu-C_HWBGeb.js +1 -0
- package/dist/assets/NodeEditor-D3tAGViP.js +147 -0
- package/dist/assets/NodeEditor-DlfAHtiG.css +1 -0
- package/dist/assets/StatusPill-CbeW5SMT.js +1 -0
- package/dist/assets/StatusPill-Dlm6uvGe.css +1 -0
- package/dist/assets/TrashWorkspace--uFsWt53.js +1 -0
- package/dist/assets/{_plugin-vue_export-helper-CTn6xl4w.js → _plugin-vue_export-helper-CQxWhVtr.js} +1 -1
- package/dist/assets/circle-check-A-QeFqt3.js +1 -0
- package/dist/assets/database-hg5SqKLG.js +1 -0
- package/dist/assets/folder-tree-BWYot72H.js +1 -0
- package/dist/assets/globe-BraoljaN.js +1 -0
- package/dist/assets/{history-XvWNE5zO.js → history-pqIbKK9u.js} +1 -1
- package/dist/assets/index-BIES-eB_.js +14 -0
- package/dist/assets/index-DcKiaRjI.css +1 -0
- package/dist/assets/{layers-D0DLWjff.js → layers-B6RgfpPR.js} +1 -1
- package/dist/assets/loader-circle-BoUkhDjq.js +1 -0
- package/dist/assets/monitor-CrpvInqG.js +1 -0
- package/dist/assets/panel-left-close-CVFakVaA.js +1 -0
- package/dist/assets/plus-mqZr4I1D.js +1 -0
- package/dist/assets/rotate-ccw-CWE4pOjs.js +1 -0
- package/dist/assets/{save-C8e-QRkP.js → save-Ctv8vW9H.js} +1 -1
- package/dist/assets/schema-helpers-1UXlO0Ye.js +1 -0
- package/dist/assets/send-F-mJeL54.js +1 -0
- package/dist/assets/{smartphone-Wy6xQi_i.js → smartphone-EPce6VdP.js} +1 -1
- package/dist/assets/trash-2-CAUF1KtI.js +1 -0
- package/dist/assets/useLocalStorage-C805uplI.js +1 -0
- package/dist/assets/useNodes-W5j_uxdQ.js +1 -0
- package/dist/assets/user-IFlT6mYq.js +1 -0
- package/dist/{dist-BGv2bzzF.js → dist-Bta0OpXl.js} +145 -30
- package/dist/index.html +34 -3
- package/dist/index.js +145 -30
- package/dist/schema-compiler.js +1 -1
- package/documentation/EXTENSIONS.md +204 -0
- package/extension-registry.js +5 -0
- package/package.json +3 -1
- package/templates/astro-starter/old_src/components/blocks/BlockRenderer.astro +143 -0
- package/templates/astro-starter/old_src/components/blocks/ColumnLayout.astro +67 -0
- package/templates/astro-starter/old_src/components/blocks/HeaderImage.astro +126 -0
- package/templates/astro-starter/old_src/components/blocks/Hero.astro +218 -0
- package/templates/astro-starter/old_src/components/blocks/HtmlBlock.astro +25 -0
- package/templates/astro-starter/old_src/components/blocks/ImageBlock.astro +91 -0
- package/templates/astro-starter/old_src/components/blocks/NodeList.astro +274 -0
- package/templates/astro-starter/old_src/components/blocks/TextBlock.astro +15 -0
- package/templates/astro-starter/old_src/components/global/Breadcrumb.astro +108 -0
- package/templates/astro-starter/old_src/components/global/Footer.astro +50 -0
- package/templates/astro-starter/old_src/components/global/Header.astro +171 -0
- package/templates/astro-starter/old_src/components/global/MetaHead.astro +266 -0
- package/templates/astro-starter/old_src/components/global/NavigationMenu.astro +413 -0
- package/templates/astro-starter/old_src/components/ui/KamaImage.astro +180 -0
- package/templates/astro-starter/old_src/layouts/SkeletonLayout.astro +56 -0
- package/templates/astro-starter/old_src/layouts/StandardLayout.astro +63 -0
- package/templates/astro-starter/old_src/lib/cms.ts +219 -0
- package/templates/astro-starter/old_src/lib/media/kama-image-service.ts +67 -0
- package/templates/astro-starter/old_src/lib/media/media-proxy.ts +148 -0
- package/templates/astro-starter/old_src/lib/media/media-url.ts +112 -0
- package/templates/astro-starter/old_src/middleware.ts +536 -0
- package/templates/astro-starter/old_src/pages/404.astro +46 -0
- package/templates/astro-starter/old_src/pages/[...slug].astro +311 -0
- package/templates/astro-starter/old_src/pages/api/load-nodes.ts +68 -0
- package/templates/astro-starter/old_src/pages/api/partials/node-cards.astro +101 -0
- package/templates/astro-starter/old_src/pages/llms-full.txt.ts +171 -0
- package/templates/astro-starter/old_src/pages/llms.txt.ts +113 -0
- package/templates/astro-starter/old_src/pages/media/[...path].ts +14 -0
- package/templates/astro-starter/old_src/pages/partials/footer.astro +69 -0
- package/templates/astro-starter/old_src/pages/partials/nav.astro +141 -0
- package/templates/astro-starter/old_src/styles/standard-theme.css +157 -0
- package/templates/astro-starter/old_src/utils/tiptap.ts +113 -0
- package/templates/astro-starter/src/components/blocks/Form.astro +143 -0
- package/templates/kama-worker/index.js +35 -12
- package/templates/kama-worker/server.js +2 -0
- package/dist/assets/AssetEditor-CCNDGlQ_.js +0 -1
- package/dist/assets/CmsHelp-m9EOY_nE.js +0 -1
- package/dist/assets/CmsPublisher-Cs_ys68V.js +0 -3
- package/dist/assets/CmsUserCenter-D-T6HyWF.js +0 -1
- package/dist/assets/EditorSplitPreview-CnWpXZWQ.js +0 -1
- package/dist/assets/NodeEditor-B1TvB2eW.css +0 -1
- package/dist/assets/NodeEditor-CZGnkwvf.js +0 -147
- package/dist/assets/TrashWorkspace-CERX58Ek.js +0 -1
- package/dist/assets/index-BpOAL4tE.js +0 -14
- package/dist/assets/index-C-EkPNvq.css +0 -1
- package/dist/assets/link-Bs_SUS0O.js +0 -1
- package/dist/assets/rotate-ccw-CvD7yNQj.js +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
// src/components/blocks/ColumnLayout.astro
|
|
3
|
+
|
|
4
|
+
import BlockRenderer from "@/components/blocks/BlockRenderer.astro";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
blockId: string;
|
|
8
|
+
contentMap: Record<string, any[]>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { blockId, contentMap } = Astro.props;
|
|
12
|
+
|
|
13
|
+
const order = ["left", "middle", "right", "col1", "col2", "col3", "col4"];
|
|
14
|
+
|
|
15
|
+
// 1. Find all sub-regions belonging to this specific layout instance
|
|
16
|
+
const regionKeys = Object.keys(contentMap).filter(
|
|
17
|
+
key => blockId && key.startsWith(`${blockId}_`),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// 2. Sort keys logically (left -> middle -> right or col1 -> col2 -> col3)
|
|
21
|
+
const sortedKeys = regionKeys.sort((a, b) => {
|
|
22
|
+
const suffixA = a.replace(`${blockId}_`, "");
|
|
23
|
+
const suffixB = b.replace(`${blockId}_`, "");
|
|
24
|
+
const idxA = order.indexOf(suffixA);
|
|
25
|
+
const idxB = order.indexOf(suffixB);
|
|
26
|
+
|
|
27
|
+
if (idxA === -1 && idxB === -1) return a.localeCompare(b);
|
|
28
|
+
if (idxA === -1) return 1;
|
|
29
|
+
if (idxB === -1) return -1;
|
|
30
|
+
return idxA - idxB;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const columnCount = Math.max(sortedKeys.length, 1);
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
<div class="cms-column-layout" style={`--col-count: ${columnCount}`}>
|
|
37
|
+
{
|
|
38
|
+
sortedKeys.map(key => {
|
|
39
|
+
const columnBlocks = contentMap[key] || [];
|
|
40
|
+
return (
|
|
41
|
+
<div class="column">
|
|
42
|
+
<!-- 🎯 Passes region={key} down to BlockRenderer -->
|
|
43
|
+
<BlockRenderer
|
|
44
|
+
blocks={columnBlocks}
|
|
45
|
+
contentMap={contentMap}
|
|
46
|
+
region={key}
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<style>
|
|
55
|
+
.cms-column-layout {
|
|
56
|
+
display: grid;
|
|
57
|
+
gap: 2rem;
|
|
58
|
+
margin-bottom: 1.5rem;
|
|
59
|
+
grid-template-columns: 1fr;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (min-width: 768px) {
|
|
63
|
+
.cms-column-layout {
|
|
64
|
+
grid-template-columns: repeat(var(--col-count, 1), 1fr);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
// src/components/blocks/HeaderImage.astro
|
|
3
|
+
|
|
4
|
+
import KamaImage from "@/components/ui/KamaImage.astro";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
data: {
|
|
8
|
+
image?: any;
|
|
9
|
+
image_meta?: any;
|
|
10
|
+
width?: number | string;
|
|
11
|
+
height?: number | string;
|
|
12
|
+
};
|
|
13
|
+
region?: string;
|
|
14
|
+
isFirst?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const { data, region = "main", isFirst = false } = Astro.props;
|
|
18
|
+
|
|
19
|
+
const img = data?.image;
|
|
20
|
+
|
|
21
|
+
if (!img) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Determine if this image is likely to be the Largest Contentful Paint.
|
|
27
|
+
*/
|
|
28
|
+
const isLcp = region === "header" || (region === "main" && isFirst);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Determine grid column count from the region name.
|
|
32
|
+
*/
|
|
33
|
+
let columnCount = 1;
|
|
34
|
+
|
|
35
|
+
if (region.includes("_")) {
|
|
36
|
+
columnCount = 2;
|
|
37
|
+
|
|
38
|
+
if (region.includes("_middle") || region.includes("_col3")) {
|
|
39
|
+
columnCount = 3;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (region.includes("_col4")) {
|
|
43
|
+
columnCount = 4;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Default single-column layout (aligned to backend CDN buckets).
|
|
49
|
+
*/
|
|
50
|
+
let maxWidth = "1352";
|
|
51
|
+
let targetColumnWidth = 1352;
|
|
52
|
+
|
|
53
|
+
// 1-col: 1x/2x desktop and retina buckets
|
|
54
|
+
let optimizedWidths = [768, 1352, 1920, 2560];
|
|
55
|
+
let sizes = "(max-width: 1399px) calc(100vw - 48px), 1352px";
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Two-column layout.
|
|
59
|
+
*/
|
|
60
|
+
if (columnCount === 2) {
|
|
61
|
+
maxWidth = "660";
|
|
62
|
+
targetColumnWidth = 660;
|
|
63
|
+
|
|
64
|
+
optimizedWidths = [640, 768, 1024, 1352];
|
|
65
|
+
sizes =
|
|
66
|
+
"(max-width: 767px) calc(100vw - 48px), " +
|
|
67
|
+
"(max-width: 1399px) calc((100vw - 80px) / 2), " +
|
|
68
|
+
"660px";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Three-column layout.
|
|
73
|
+
*/
|
|
74
|
+
else if (columnCount === 3) {
|
|
75
|
+
maxWidth = "429";
|
|
76
|
+
targetColumnWidth = 429;
|
|
77
|
+
|
|
78
|
+
optimizedWidths = [320, 640, 768, 1024];
|
|
79
|
+
sizes =
|
|
80
|
+
"(max-width: 767px) calc(100vw - 48px), " +
|
|
81
|
+
"(max-width: 1399px) calc((100vw - 112px) / 3), " +
|
|
82
|
+
"429px";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Four-column layout.
|
|
87
|
+
*/
|
|
88
|
+
else if (columnCount === 4) {
|
|
89
|
+
maxWidth = "314";
|
|
90
|
+
targetColumnWidth = 314;
|
|
91
|
+
|
|
92
|
+
optimizedWidths = [320, 640, 768];
|
|
93
|
+
sizes =
|
|
94
|
+
"(max-width: 767px) calc(100vw - 48px), " +
|
|
95
|
+
"(max-width: 1399px) calc((100vw - 144px) / 4), " +
|
|
96
|
+
"314px";
|
|
97
|
+
}
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
<div class="cms-block cms-block-header-image" style={`--max-w: ${maxWidth}px;`}>
|
|
101
|
+
<KamaImage
|
|
102
|
+
image={img}
|
|
103
|
+
sizes={sizes}
|
|
104
|
+
desktopWidths={optimizedWidths}
|
|
105
|
+
idealWidth={targetColumnWidth}
|
|
106
|
+
class="responsive-header-image"
|
|
107
|
+
loading={isLcp ? "eager" : "lazy"}
|
|
108
|
+
fetchpriority={isLcp ? "high" : "auto"}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<style>
|
|
113
|
+
.cms-block-header-image {
|
|
114
|
+
width: 100%;
|
|
115
|
+
max-width: var(--max-w, 1352px);
|
|
116
|
+
margin: 0 auto 1.5rem auto;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:global(.responsive-header-image) {
|
|
120
|
+
width: 100%;
|
|
121
|
+
height: auto;
|
|
122
|
+
display: block;
|
|
123
|
+
border-radius: var(--cms-radius-md, 0.5rem);
|
|
124
|
+
max-width: 100%;
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
---
|
|
2
|
+
// src/components/blocks/Hero.astro
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<section class="hero-container">
|
|
6
|
+
<div class="hero-content">
|
|
7
|
+
<!-- Sub-badge -->
|
|
8
|
+
<div class="hero-badge">
|
|
9
|
+
<span class="badge-dot"></span>
|
|
10
|
+
Freeware for Education & NGOs
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<!-- H1 Title with Slogan -->
|
|
14
|
+
<h1 class="hero-title">KAMA – Headless CMS on Edge</h1>
|
|
15
|
+
|
|
16
|
+
<!-- Subtitle -->
|
|
17
|
+
<p class="hero-subtitle">
|
|
18
|
+
Deploy sub-millisecond corporate web experiences with zero infrastructure
|
|
19
|
+
overhead. Built natively on Astro, Hono, and Cloudflare Workers (D1/R2).
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<!-- Call to Action Buttons -->
|
|
23
|
+
<div class="hero-actions">
|
|
24
|
+
<a href="/docs/quick-start" class="btn btn-primary">
|
|
25
|
+
Get Started
|
|
26
|
+
<svg
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
width="16"
|
|
29
|
+
height="16"
|
|
30
|
+
viewBox="0 0 24 24"
|
|
31
|
+
fill="none"
|
|
32
|
+
stroke="currentColor"
|
|
33
|
+
stroke-width="2"
|
|
34
|
+
stroke-linecap="round"
|
|
35
|
+
stroke-linejoin="round"
|
|
36
|
+
class="btn-icon"
|
|
37
|
+
><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg
|
|
38
|
+
>
|
|
39
|
+
</a>
|
|
40
|
+
<a
|
|
41
|
+
href="https://github.com/brightside-ou/kama"
|
|
42
|
+
target="_blank"
|
|
43
|
+
rel="noopener noreferrer"
|
|
44
|
+
class="btn btn-secondary"
|
|
45
|
+
>
|
|
46
|
+
View on GitHub
|
|
47
|
+
</a>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<!-- Tech Stack Highlights -->
|
|
51
|
+
<div class="hero-stack">
|
|
52
|
+
<span class="stack-label">Powered by edge infrastructure:</span>
|
|
53
|
+
<div class="stack-tags">
|
|
54
|
+
<span class="tag">Cloudflare Workers</span>
|
|
55
|
+
<span class="tag">D1 SQL</span>
|
|
56
|
+
<span class="tag">R2 Storage</span>
|
|
57
|
+
<span class="tag">Astro</span>
|
|
58
|
+
<span class="tag">Hono</span>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</section>
|
|
63
|
+
|
|
64
|
+
<style>
|
|
65
|
+
.hero-container {
|
|
66
|
+
padding: 64px 0 48px;
|
|
67
|
+
background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
|
|
68
|
+
border-bottom: 1px solid #e2e8f0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.hero-content {
|
|
72
|
+
max-width: 860px;
|
|
73
|
+
margin: 0 auto;
|
|
74
|
+
text-align: center;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.hero-badge {
|
|
78
|
+
display: inline-flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
gap: 8px;
|
|
81
|
+
padding: 6px 14px;
|
|
82
|
+
background-color: #f0f9ff;
|
|
83
|
+
border: 1px solid #bae6fd;
|
|
84
|
+
color: #0369a1;
|
|
85
|
+
font-size: 0.875rem;
|
|
86
|
+
font-weight: 600;
|
|
87
|
+
margin-bottom: 24px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.badge-dot {
|
|
91
|
+
width: 8px;
|
|
92
|
+
height: 8px;
|
|
93
|
+
background-color: #0284c7;
|
|
94
|
+
border-radius: 50% !important;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.hero-title {
|
|
98
|
+
font-size: 3rem;
|
|
99
|
+
font-weight: 800;
|
|
100
|
+
line-height: 1.15;
|
|
101
|
+
color: #0f172a;
|
|
102
|
+
letter-spacing: -0.03em;
|
|
103
|
+
margin-top: 0;
|
|
104
|
+
margin-bottom: 20px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.hero-subtitle {
|
|
108
|
+
font-size: 1.25rem;
|
|
109
|
+
line-height: 1.6;
|
|
110
|
+
color: #475569;
|
|
111
|
+
max-width: 720px;
|
|
112
|
+
margin: 0 auto 36px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.hero-actions {
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
gap: 16px;
|
|
120
|
+
margin-bottom: 48px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.btn {
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
gap: 8px;
|
|
128
|
+
padding: 12px 28px;
|
|
129
|
+
font-size: 1rem;
|
|
130
|
+
font-weight: 600;
|
|
131
|
+
text-decoration: none;
|
|
132
|
+
transition: all 0.15s ease-in-out;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.btn-primary {
|
|
136
|
+
background-color: #0284c7;
|
|
137
|
+
color: #ffffff;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.btn-primary:hover {
|
|
141
|
+
background-color: #0369a1;
|
|
142
|
+
color: #ffffff;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.btn-secondary {
|
|
146
|
+
background-color: #ffffff;
|
|
147
|
+
color: #334155;
|
|
148
|
+
border: 1px solid #cbd5e1;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.btn-secondary:hover {
|
|
152
|
+
background-color: #f8fafc;
|
|
153
|
+
color: #0f172a;
|
|
154
|
+
border-color: #94a3b8;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.btn-icon {
|
|
158
|
+
transition: transform 0.15s ease;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.btn-primary:hover .btn-icon {
|
|
162
|
+
transform: translateX(4px);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.hero-stack {
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
align-items: center;
|
|
169
|
+
gap: 12px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.stack-label {
|
|
173
|
+
font-size: 0.8125rem;
|
|
174
|
+
text-transform: uppercase;
|
|
175
|
+
letter-spacing: 0.05em;
|
|
176
|
+
color: #64748b;
|
|
177
|
+
font-weight: 600;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.stack-tags {
|
|
181
|
+
display: flex;
|
|
182
|
+
flex-wrap: wrap;
|
|
183
|
+
justify-content: center;
|
|
184
|
+
gap: 8px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.tag {
|
|
188
|
+
padding: 4px 10px;
|
|
189
|
+
background-color: #f1f5f9;
|
|
190
|
+
color: #334155;
|
|
191
|
+
font-size: 0.8125rem;
|
|
192
|
+
font-weight: 500;
|
|
193
|
+
border: 1px solid #e2e8f0;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@media (max-width: 768px) {
|
|
197
|
+
.hero-container {
|
|
198
|
+
padding: 40px 0 32px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.hero-title {
|
|
202
|
+
font-size: 2.125rem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.hero-subtitle {
|
|
206
|
+
font-size: 1.05rem;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.hero-actions {
|
|
210
|
+
flex-direction: column;
|
|
211
|
+
width: 100%;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.btn {
|
|
215
|
+
width: 100%;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
// src/components/blocks/HtmlBlock.astro
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
data: {
|
|
6
|
+
body?: string;
|
|
7
|
+
html?: string;
|
|
8
|
+
content?: string;
|
|
9
|
+
text?: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { data } = Astro.props;
|
|
14
|
+
|
|
15
|
+
// Fallback chain matching your schema's HTML field key ('body') and legacy aliases
|
|
16
|
+
const rawHtml = data?.body || data?.html || data?.content || data?.text || "";
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
{
|
|
20
|
+
rawHtml && (
|
|
21
|
+
<div class="cms-block cms-block-html">
|
|
22
|
+
<Fragment set:html={rawHtml} />
|
|
23
|
+
</div>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
// src/components/blocks/ImageBlock.astro
|
|
3
|
+
|
|
4
|
+
import KamaImage from "@/components/ui/KamaImage.astro";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
data: {
|
|
8
|
+
image?: any;
|
|
9
|
+
width?: number | string;
|
|
10
|
+
height?: number | string;
|
|
11
|
+
};
|
|
12
|
+
region?: string;
|
|
13
|
+
isFirst?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { data, region = "main", isFirst = false } = Astro.props;
|
|
17
|
+
|
|
18
|
+
const img = data?.image;
|
|
19
|
+
const isLcp = region === "header" || (region === "main" && isFirst);
|
|
20
|
+
|
|
21
|
+
// 🎯 Detect column layout based on CMS region names
|
|
22
|
+
let columnCount = 1;
|
|
23
|
+
if (region.includes("_")) {
|
|
24
|
+
columnCount = 2;
|
|
25
|
+
if (region.includes("_middle") || region.includes("_col3")) columnCount = 3;
|
|
26
|
+
if (region.includes("_col4")) columnCount = 4;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 🎯 Column Config Lookup (Target width, aligned CDN breakpoint widths, sizes)
|
|
30
|
+
const COLUMN_CONFIGS: Record<
|
|
31
|
+
number,
|
|
32
|
+
{ targetWidth: number; widths: number[]; sizes: string }
|
|
33
|
+
> = {
|
|
34
|
+
1: {
|
|
35
|
+
targetWidth: 1352,
|
|
36
|
+
widths: [768, 1352, 1920, 2560],
|
|
37
|
+
sizes: "(max-width: 1399px) calc(100vw - 48px), 1352px",
|
|
38
|
+
},
|
|
39
|
+
2: {
|
|
40
|
+
targetWidth: 660,
|
|
41
|
+
widths: [640, 768, 1024, 1352],
|
|
42
|
+
sizes:
|
|
43
|
+
"(max-width: 767px) calc(100vw - 48px), (max-width: 1399px) calc((100vw - 80px) / 2), 660px",
|
|
44
|
+
},
|
|
45
|
+
3: {
|
|
46
|
+
targetWidth: 429,
|
|
47
|
+
widths: [320, 640, 768, 1024],
|
|
48
|
+
sizes:
|
|
49
|
+
"(max-width: 767px) calc(100vw - 48px), (max-width: 1399px) calc((100vw - 112px) / 3), 429px",
|
|
50
|
+
},
|
|
51
|
+
4: {
|
|
52
|
+
targetWidth: 314,
|
|
53
|
+
widths: [320, 640, 768],
|
|
54
|
+
sizes:
|
|
55
|
+
"(max-width: 767px) calc(100vw - 48px), (max-width: 1399px) calc((100vw - 144px) / 4), 314px",
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const layout = COLUMN_CONFIGS[columnCount] || COLUMN_CONFIGS[1];
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
{
|
|
63
|
+
img && (
|
|
64
|
+
<div class="cms-block cms-block-image">
|
|
65
|
+
<KamaImage
|
|
66
|
+
image={img}
|
|
67
|
+
sizes={layout.sizes}
|
|
68
|
+
desktopWidths={layout.widths}
|
|
69
|
+
idealWidth={layout.targetWidth}
|
|
70
|
+
class="free-crop-image"
|
|
71
|
+
loading={isLcp ? "eager" : "lazy"}
|
|
72
|
+
fetchpriority={isLcp ? "high" : "auto"}
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
<style>
|
|
79
|
+
.cms-block-image {
|
|
80
|
+
width: 100%;
|
|
81
|
+
margin: 0 auto 1.5rem auto;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:global(.free-crop-image) {
|
|
85
|
+
width: 100%;
|
|
86
|
+
height: auto;
|
|
87
|
+
object-fit: contain;
|
|
88
|
+
display: block;
|
|
89
|
+
border-radius: var(--cms-radius-md, 0.5rem);
|
|
90
|
+
}
|
|
91
|
+
</style>
|