@documental-xyz/core 0.1.0
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 +424 -0
- package/integration.ts +113 -0
- package/package.json +83 -0
- package/src/admin/admin.astro +29 -0
- package/src/assets/scripts/App.js +70 -0
- package/src/assets/scripts/EnteringAnimations.js +34 -0
- package/src/assets/scripts/MapBoxHandler.js +680 -0
- package/src/assets/scripts/ScrollProgressionBar.js +24 -0
- package/src/assets/scripts/utils/ScrollObserver.js +166 -0
- package/src/assets/styles/config/_breakpoints.scss +37 -0
- package/src/assets/styles/config/_colors.scss +8 -0
- package/src/assets/styles/config/_config.scss +5 -0
- package/src/assets/styles/config/_functions.scss +90 -0
- package/src/assets/styles/config/_grrr.configs.scss +7 -0
- package/src/assets/styles/config/_mixins.scss +207 -0
- package/src/assets/styles/config/_type.scss +175 -0
- package/src/assets/styles/config/_vars.scss +16 -0
- package/src/assets/styles/globals/_content.scss +47 -0
- package/src/assets/styles/globals/_grrr.scss +18 -0
- package/src/assets/styles/globals/_html.scss +25 -0
- package/src/assets/styles/globals/_lists.scss +19 -0
- package/src/assets/styles/globals/_map-anchors.scss +32 -0
- package/src/assets/styles/globals/_reset.scss +240 -0
- package/src/assets/styles/globals/_reveal-animations.scss +104 -0
- package/src/assets/styles/globals/_root.scss +6 -0
- package/src/assets/styles/globals/_scroll-progression-bar.scss +8 -0
- package/src/assets/styles/main.scss +17 -0
- package/src/assets/styles/utils/.gitkeep +0 -0
- package/src/assets/styles/utils/grrr/_grrr.scss +433 -0
- package/src/assets/styles/utils/list-styles/_list-styles.scss +190 -0
- package/src/components/AnimationToggle.astro +19 -0
- package/src/components/BigNumbers.astro +83 -0
- package/src/components/Button.astro +49 -0
- package/src/components/Caption.astro +15 -0
- package/src/components/Card.astro +68 -0
- package/src/components/Cards.astro +66 -0
- package/src/components/CardsCall.astro +125 -0
- package/src/components/ChartBar.astro +217 -0
- package/src/components/ChartPercentage.astro +137 -0
- package/src/components/Column.astro +54 -0
- package/src/components/ColumnSticky.astro +129 -0
- package/src/components/Columns.astro +139 -0
- package/src/components/Compare.astro +266 -0
- package/src/components/Cta.astro +242 -0
- package/src/components/Gallery.astro +594 -0
- package/src/components/Group.astro +140 -0
- package/src/components/HtmlEmbed.astro +98 -0
- package/src/components/ImageBlock.astro +134 -0
- package/src/components/InnerColumns.astro +54 -0
- package/src/components/LogosGroup.astro +102 -0
- package/src/components/Map.astro +321 -0
- package/src/components/MapBox.astro +96 -0
- package/src/components/MapView.astro +30 -0
- package/src/components/Menu.astro +278 -0
- package/src/components/Pullquote.astro +46 -0
- package/src/components/Slider.astro +223 -0
- package/src/components/Spacer.astro +25 -0
- package/src/components/Text.astro +173 -0
- package/src/components/TextPlaceholder.astro +98 -0
- package/src/components/Timeline.astro +73 -0
- package/src/components/TimelineBullet.astro +67 -0
- package/src/components/VideoEmbed.astro +99 -0
- package/src/content/loader.ts +29 -0
- package/src/content/pages/alter-ameacada.md +80 -0
- package/src/content/pages/expulsions.md +1447 -0
- package/src/content/pages/home.md +346 -0
- package/src/content/pages/nhanderekoa-studio-autonoma.md +3113 -0
- package/src/content/pages/nhanderekoa-terra-ind/303/255gena-jaragu/303/241.md +3806 -0
- package/src/content/pages/nova-landing-page.md +546 -0
- package/src/content/pages/territ/303/263rios-de-exce/303/247/303/243o.md +2199 -0
- package/src/content/pages/teste-alter-do-chao.md +955 -0
- package/src/content/pages/teste-layout.md +1484 -0
- package/src/content/pages/thiago.md +93 -0
- package/src/content/schema/blog.ts +11 -0
- package/src/content/schema/geostorys.ts +13 -0
- package/src/content/schema/index.ts +3 -0
- package/src/content/schema/pages.ts +494 -0
- package/src/content.config.ts +49 -0
- package/src/env.d.ts +1 -0
- package/src/integration/override-aliases.ts +67 -0
- package/src/layouts/components/ButtonLayout.astro +8 -0
- package/src/layouts/components/CardLayout.astro +8 -0
- package/src/layouts/components/CardsCallLayout.astro +26 -0
- package/src/layouts/components/CardsLayout.astro +14 -0
- package/src/layouts/components/ChartBarLayout.astro +21 -0
- package/src/layouts/components/ChartPercentageLayout.astro +17 -0
- package/src/layouts/components/ColumnLayout.astro +11 -0
- package/src/layouts/components/ColumnStickyLayout.astro +10 -0
- package/src/layouts/components/ColumnsLayout.astro +13 -0
- package/src/layouts/components/CompareLayout.astro +22 -0
- package/src/layouts/components/CtaLayout.astro +91 -0
- package/src/layouts/components/GalleryLayout.astro +24 -0
- package/src/layouts/components/GroupLayout.astro +53 -0
- package/src/layouts/components/HtmlEmbedLayout.astro +18 -0
- package/src/layouts/components/ImageBlockLayout.astro +20 -0
- package/src/layouts/components/InnerColumnsLayout.astro +14 -0
- package/src/layouts/components/LogosGroupLayout.astro +22 -0
- package/src/layouts/components/MapLayout.astro +41 -0
- package/src/layouts/components/MapViewLayout.astro +8 -0
- package/src/layouts/components/MapboxLayout.astro +248 -0
- package/src/layouts/components/PullquoteLayout.astro +13 -0
- package/src/layouts/components/SliderLayout.astro +18 -0
- package/src/layouts/components/SpacerLayout.astro +8 -0
- package/src/layouts/components/TextLayout.astro +17 -0
- package/src/layouts/components/TextPlaceholderLayout.astro +7 -0
- package/src/layouts/components/TimelineBulletLayout.astro +14 -0
- package/src/layouts/components/TimelineLayout.astro +10 -0
- package/src/layouts/components/VideoEmbedLayout.astro +28 -0
- package/src/layouts/pages/Layout.astro +90 -0
- package/src/layouts/pages/PageLayout.astro +200 -0
- package/src/lib/collections.ts +1 -0
- package/src/routes/[slug].astro +17 -0
- package/src/routes/index.astro +5 -0
- package/src/vite/yaml-merge-plugin.ts +234 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: thiago
|
|
3
|
+
slug: thiago
|
|
4
|
+
pageSettings:
|
|
5
|
+
language: pt-BR
|
|
6
|
+
link_pt_br: '#'
|
|
7
|
+
link_en: '#'
|
|
8
|
+
link_es: '#'
|
|
9
|
+
animations: enable_all
|
|
10
|
+
direction: left
|
|
11
|
+
seoTitle: ''
|
|
12
|
+
seoDescription: ''
|
|
13
|
+
seoKeywords: []
|
|
14
|
+
pageTheme:
|
|
15
|
+
displayFont: ''
|
|
16
|
+
textFont: ''
|
|
17
|
+
spacingPatterns:
|
|
18
|
+
- name: OK
|
|
19
|
+
mobile: 100px
|
|
20
|
+
tablet: 100px
|
|
21
|
+
desktop: 100px
|
|
22
|
+
mapbox:
|
|
23
|
+
type: MapBox
|
|
24
|
+
style: fdsf
|
|
25
|
+
token: fdsfsd
|
|
26
|
+
centerLng: '4324324'
|
|
27
|
+
centerLat: '4324324'
|
|
28
|
+
zoom: '2'
|
|
29
|
+
bearing: '0'
|
|
30
|
+
pitch: '0'
|
|
31
|
+
layers: ''
|
|
32
|
+
columnAlign: left
|
|
33
|
+
floatingText: false
|
|
34
|
+
views: []
|
|
35
|
+
components:
|
|
36
|
+
- type: Cta
|
|
37
|
+
id: teste
|
|
38
|
+
shortTitle: Teste!!!!!!!!
|
|
39
|
+
longTitle: ''
|
|
40
|
+
description: ''
|
|
41
|
+
showInMenu: false
|
|
42
|
+
animations: true
|
|
43
|
+
txtColor: Primary
|
|
44
|
+
customTxtColor: ''
|
|
45
|
+
bgColor: Custom
|
|
46
|
+
customBgColor: '#a41313ff'
|
|
47
|
+
backgroundMedia:
|
|
48
|
+
- type: backgroundImage
|
|
49
|
+
imgSrc: /uploads/arqueological-remains_03.jpg
|
|
50
|
+
overlay: ''
|
|
51
|
+
ctaMedia:
|
|
52
|
+
- type: ctaImage
|
|
53
|
+
src: /uploads/arqueological-remains_01.jpg
|
|
54
|
+
ctaText: MUDANÇA DE CONTEÚDO!
|
|
55
|
+
highlightedText: TESTE!
|
|
56
|
+
link:
|
|
57
|
+
url: '#'
|
|
58
|
+
target: _self
|
|
59
|
+
text: OK
|
|
60
|
+
- type: Group
|
|
61
|
+
id: novo
|
|
62
|
+
shortTitle: novo
|
|
63
|
+
longTitle: ''
|
|
64
|
+
description: ''
|
|
65
|
+
showInMenu: false
|
|
66
|
+
animations: true
|
|
67
|
+
txtColor: Primary
|
|
68
|
+
customTxtColor: ''
|
|
69
|
+
bgColor: Secondary
|
|
70
|
+
customBgColor: ''
|
|
71
|
+
backgroundMedia: []
|
|
72
|
+
overlay: ''
|
|
73
|
+
components:
|
|
74
|
+
- type: Text
|
|
75
|
+
hasDropCap: false
|
|
76
|
+
content: NOVO Deploy teste PREVIEW!
|
|
77
|
+
- type: ImageBlock
|
|
78
|
+
wideImage: false
|
|
79
|
+
src: /uploads/brazil-map.jpg
|
|
80
|
+
alt: ''
|
|
81
|
+
description: ''
|
|
82
|
+
- type: ImageBlock
|
|
83
|
+
wideImage: false
|
|
84
|
+
src: /uploads/mapa-do-brasil.jpg
|
|
85
|
+
alt: ''
|
|
86
|
+
description: ''
|
|
87
|
+
- type: ImageBlock
|
|
88
|
+
wideImage: false
|
|
89
|
+
src: /uploads/floresta_teste.jpg
|
|
90
|
+
alt: ''
|
|
91
|
+
description: ''
|
|
92
|
+
---
|
|
93
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'astro:content';
|
|
2
|
+
|
|
3
|
+
// Schema para GeoStories
|
|
4
|
+
export const geoStorySchema = z.object({
|
|
5
|
+
title: z.string(),
|
|
6
|
+
date: z.date(),
|
|
7
|
+
coverImage: z.string(),
|
|
8
|
+
location: z.object({
|
|
9
|
+
lat: z.number(),
|
|
10
|
+
lng: z.number(),
|
|
11
|
+
}),
|
|
12
|
+
description: z.string(),
|
|
13
|
+
});
|
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
import { z } from 'astro:content';
|
|
2
|
+
import { marked } from 'marked';
|
|
3
|
+
|
|
4
|
+
// Função para processar markdown e HTML
|
|
5
|
+
function processMarkdown(text: string) {
|
|
6
|
+
if (!text) return '';
|
|
7
|
+
return marked.parse(text);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Schemas comuns
|
|
11
|
+
const linkSchema = z.object({
|
|
12
|
+
url: z.string(),
|
|
13
|
+
target: z.string().optional(),
|
|
14
|
+
customTarget: z.string().optional(),
|
|
15
|
+
text: z.string().optional(),
|
|
16
|
+
title: z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
// Schema para cada card do CardsCall
|
|
20
|
+
const cardCallSchema = z.object({
|
|
21
|
+
link: linkSchema.optional(),
|
|
22
|
+
img: z
|
|
23
|
+
.object({
|
|
24
|
+
src: z.string(),
|
|
25
|
+
alt: z.string().optional(),
|
|
26
|
+
})
|
|
27
|
+
.optional(),
|
|
28
|
+
title: z.string().optional().transform(processMarkdown),
|
|
29
|
+
text: z.string().optional().transform(processMarkdown),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Schema para cada card do Cards
|
|
33
|
+
const cardSchema = z.object({
|
|
34
|
+
link: linkSchema.optional(),
|
|
35
|
+
title: z.string().optional().transform(processMarkdown),
|
|
36
|
+
text: z.string().optional().transform(processMarkdown),
|
|
37
|
+
icon: z.string().optional(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Schema para logos
|
|
41
|
+
const logoSchema = z.object({
|
|
42
|
+
image: z.string(),
|
|
43
|
+
link: linkSchema,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Schema para barras do gráfico
|
|
47
|
+
const chartBarSchema = z.object({
|
|
48
|
+
label: z.string().transform(processMarkdown),
|
|
49
|
+
color: z.string().optional(),
|
|
50
|
+
number: z.number().min(0).optional(),
|
|
51
|
+
numberPercent: z.number().min(0).max(100).optional(),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Schema para barras do gráfico de porcentagem
|
|
55
|
+
const chartPercentageBarSchema = z.object({
|
|
56
|
+
label: z.string().transform(processMarkdown),
|
|
57
|
+
color: z.string().optional(),
|
|
58
|
+
number: z.number().min(0).optional(),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// Schema para layers do MapBox - suporte a formato string e objeto
|
|
62
|
+
const mapBoxLayerSchema = z.union([
|
|
63
|
+
z.string(), // Formato novo: "layerName" ou "layerName[property==value]"
|
|
64
|
+
z.object({
|
|
65
|
+
// Formato antigo (compatibilidade)
|
|
66
|
+
name: z.string(),
|
|
67
|
+
filterKey: z.string().optional(),
|
|
68
|
+
comparison: z
|
|
69
|
+
.enum(['==', '!=', '<', '>', '<=', '>=', 'in', '!in', 'has', '!has'])
|
|
70
|
+
.optional(),
|
|
71
|
+
filterValue: z.string().optional(),
|
|
72
|
+
}),
|
|
73
|
+
]);
|
|
74
|
+
|
|
75
|
+
// Schema para items do BigNumbers
|
|
76
|
+
const bigNumberItemSchema = z.object({
|
|
77
|
+
number: z.string().optional(),
|
|
78
|
+
caption: z.string().optional(),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// Schema para slides do Slider
|
|
82
|
+
const slideSchema = z.object({
|
|
83
|
+
image: z.string().optional(),
|
|
84
|
+
caption: z.string().optional(),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Schema para images do Gallery
|
|
88
|
+
const galleryImageSchema = z.object({
|
|
89
|
+
image: z.string().optional(),
|
|
90
|
+
caption: z.string().optional().transform(processMarkdown),
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Schema para TimelineBullet
|
|
94
|
+
const timelineBulletSchema = z.object({
|
|
95
|
+
type: z.literal('TimelineBullet'),
|
|
96
|
+
text: z.string().optional(),
|
|
97
|
+
content: z.string().optional().transform(processMarkdown),
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// Função para converter string para número
|
|
101
|
+
function stringToNumber(val: string | number | undefined): number | undefined {
|
|
102
|
+
if (val === undefined || val === null) return undefined;
|
|
103
|
+
if (typeof val === 'number') return val;
|
|
104
|
+
const parsed = parseFloat(val);
|
|
105
|
+
return isNaN(parsed) ? undefined : parsed;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Função para processar layers de texto (uma por linha)
|
|
109
|
+
function processLayersText(
|
|
110
|
+
text: string | string[] | undefined
|
|
111
|
+
): string[] | undefined {
|
|
112
|
+
if (!text) return undefined;
|
|
113
|
+
if (Array.isArray(text)) return text; // Compatibilidade com formato antigo
|
|
114
|
+
return text
|
|
115
|
+
.split('\n')
|
|
116
|
+
.map((line) => line.trim())
|
|
117
|
+
.filter((line) => line.length > 0);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Schema para MapBox no nível da página
|
|
121
|
+
const mapboxSchema = z.object({
|
|
122
|
+
type: z.literal('MapBox').optional(),
|
|
123
|
+
columnAlign: z.enum(['left', 'center', 'right']).optional(),
|
|
124
|
+
floatingText: z.boolean().optional(),
|
|
125
|
+
style: z.string().optional(),
|
|
126
|
+
// Suporte para formato novo (centerLng/centerLat) e antigo (center.lng/center.lat)
|
|
127
|
+
centerLng: z
|
|
128
|
+
.union([z.string(), z.number()])
|
|
129
|
+
.transform(stringToNumber)
|
|
130
|
+
.optional(),
|
|
131
|
+
centerLat: z
|
|
132
|
+
.union([z.string(), z.number()])
|
|
133
|
+
.transform(stringToNumber)
|
|
134
|
+
.optional(),
|
|
135
|
+
center: z
|
|
136
|
+
.object({
|
|
137
|
+
lng: z.union([z.string(), z.number()]).transform(stringToNumber),
|
|
138
|
+
lat: z.union([z.string(), z.number()]).transform(stringToNumber),
|
|
139
|
+
})
|
|
140
|
+
.optional(),
|
|
141
|
+
zoom: z.union([z.string(), z.number()]).transform(stringToNumber).optional(),
|
|
142
|
+
bearing: z
|
|
143
|
+
.union([z.string(), z.number()])
|
|
144
|
+
.transform(stringToNumber)
|
|
145
|
+
.optional(),
|
|
146
|
+
pitch: z.union([z.string(), z.number()]).transform(stringToNumber).optional(),
|
|
147
|
+
layers: z
|
|
148
|
+
.union([
|
|
149
|
+
z.string().transform(processLayersText),
|
|
150
|
+
z.array(z.union([z.string(), mapBoxLayerSchema])),
|
|
151
|
+
])
|
|
152
|
+
.optional(),
|
|
153
|
+
token: z.string().optional(),
|
|
154
|
+
views: z
|
|
155
|
+
.array(
|
|
156
|
+
z.object({
|
|
157
|
+
id: z.string(),
|
|
158
|
+
// Suporte para formato novo (centerLng/centerLat) e antigo (center.lng/center.lat)
|
|
159
|
+
centerLng: z
|
|
160
|
+
.union([z.string(), z.number()])
|
|
161
|
+
.transform(stringToNumber)
|
|
162
|
+
.optional(),
|
|
163
|
+
centerLat: z
|
|
164
|
+
.union([z.string(), z.number()])
|
|
165
|
+
.transform(stringToNumber)
|
|
166
|
+
.optional(),
|
|
167
|
+
center: z
|
|
168
|
+
.object({
|
|
169
|
+
lng: z.union([z.string(), z.number()]).transform(stringToNumber),
|
|
170
|
+
lat: z.union([z.string(), z.number()]).transform(stringToNumber),
|
|
171
|
+
})
|
|
172
|
+
.optional(),
|
|
173
|
+
duration: z
|
|
174
|
+
.union([z.string(), z.number()])
|
|
175
|
+
.transform(stringToNumber)
|
|
176
|
+
.optional(),
|
|
177
|
+
zoom: z
|
|
178
|
+
.union([z.string(), z.number()])
|
|
179
|
+
.transform(stringToNumber)
|
|
180
|
+
.optional(),
|
|
181
|
+
bearing: z
|
|
182
|
+
.union([z.string(), z.number()])
|
|
183
|
+
.transform(stringToNumber)
|
|
184
|
+
.optional(),
|
|
185
|
+
pitch: z
|
|
186
|
+
.union([z.string(), z.number()])
|
|
187
|
+
.transform(stringToNumber)
|
|
188
|
+
.optional(),
|
|
189
|
+
layers: z
|
|
190
|
+
.union([
|
|
191
|
+
z.string().transform(processLayersText),
|
|
192
|
+
z.array(z.union([z.string(), mapBoxLayerSchema])),
|
|
193
|
+
])
|
|
194
|
+
.optional(),
|
|
195
|
+
// Mobile zoom agora é um campo direto
|
|
196
|
+
mobileZoom: z
|
|
197
|
+
.union([z.string(), z.number()])
|
|
198
|
+
.transform(stringToNumber)
|
|
199
|
+
.optional(),
|
|
200
|
+
// Campos de caption agora são diretos (não dentro de objeto captions)
|
|
201
|
+
title: z.string().optional(),
|
|
202
|
+
notes: z.string().optional(),
|
|
203
|
+
items: z
|
|
204
|
+
.array(
|
|
205
|
+
z.object({
|
|
206
|
+
icon: z.string().optional(),
|
|
207
|
+
colorIcon: z.string().optional(),
|
|
208
|
+
typeIcon: z.enum(['outlined', 'rounded', 'sharp']).optional(),
|
|
209
|
+
iconFill: z.boolean().optional(),
|
|
210
|
+
text: z.string().optional(),
|
|
211
|
+
})
|
|
212
|
+
)
|
|
213
|
+
.optional(),
|
|
214
|
+
})
|
|
215
|
+
)
|
|
216
|
+
.optional(),
|
|
217
|
+
mapView: z.string().optional(),
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
const componentSchema = z.object({
|
|
221
|
+
hasDropCap: z.boolean().optional(),
|
|
222
|
+
type: z.string(),
|
|
223
|
+
layout: z
|
|
224
|
+
.enum(['default', 'media', 'text', 'text-bigger', 'title-bottom'])
|
|
225
|
+
.optional(),
|
|
226
|
+
txtColor: z.string().optional(),
|
|
227
|
+
customTxtColor: z.string().optional(),
|
|
228
|
+
bgColor: z.string().optional(),
|
|
229
|
+
customBgColor: z.string().optional(),
|
|
230
|
+
backgroundImage: z.string().optional(),
|
|
231
|
+
content: z.string().optional().transform(processMarkdown),
|
|
232
|
+
title: z.string().optional().transform(processMarkdown),
|
|
233
|
+
body: z.string().optional().transform(processMarkdown),
|
|
234
|
+
paddingTop: z.boolean().optional(),
|
|
235
|
+
paddingBottom: z.boolean().optional(),
|
|
236
|
+
hasByline: z.boolean().optional(),
|
|
237
|
+
byline: z.string().optional(),
|
|
238
|
+
shortTitle: z.string().optional(),
|
|
239
|
+
longTitle: z.string().optional(),
|
|
240
|
+
description: z.string().optional(),
|
|
241
|
+
showInMenu: z.boolean().optional(),
|
|
242
|
+
animations: z.boolean().optional().default(true),
|
|
243
|
+
id: z.string().optional(),
|
|
244
|
+
|
|
245
|
+
// Atributos específicos do CTA
|
|
246
|
+
highlightedText: z.string().optional(),
|
|
247
|
+
ctaMedia: z
|
|
248
|
+
.array(
|
|
249
|
+
z.discriminatedUnion('type', [
|
|
250
|
+
z.object({
|
|
251
|
+
type: z.literal('ctaImage'),
|
|
252
|
+
src: z.string().optional(),
|
|
253
|
+
externalUrl: z.string().optional(),
|
|
254
|
+
}),
|
|
255
|
+
z.object({
|
|
256
|
+
type: z.literal('ctaVideo'),
|
|
257
|
+
src: z.string().optional(),
|
|
258
|
+
externalUrl: z.string().optional(),
|
|
259
|
+
}),
|
|
260
|
+
])
|
|
261
|
+
)
|
|
262
|
+
.optional(),
|
|
263
|
+
ctaText: z.string().optional().transform(processMarkdown),
|
|
264
|
+
link: linkSchema.nullable().optional(),
|
|
265
|
+
imgBg: z.string().optional(),
|
|
266
|
+
videoBg: z.string().optional(),
|
|
267
|
+
overlay: z.string().optional().nullable(),
|
|
268
|
+
backgroundMedia: z
|
|
269
|
+
.array(
|
|
270
|
+
z.discriminatedUnion('type', [
|
|
271
|
+
z.object({
|
|
272
|
+
type: z.literal('backgroundImage'),
|
|
273
|
+
imgSrc: z.string().optional(),
|
|
274
|
+
}),
|
|
275
|
+
z.object({
|
|
276
|
+
type: z.literal('backgroundVideo'),
|
|
277
|
+
videoSrc: z.string().optional(),
|
|
278
|
+
}),
|
|
279
|
+
])
|
|
280
|
+
)
|
|
281
|
+
.optional(),
|
|
282
|
+
|
|
283
|
+
// Atributos do CardsCall
|
|
284
|
+
cardsCallArr: z.array(cardCallSchema).optional(),
|
|
285
|
+
|
|
286
|
+
// Atributos do Cards
|
|
287
|
+
cardsArr: z.array(cardSchema).optional(),
|
|
288
|
+
|
|
289
|
+
// Atributos do ChartBar
|
|
290
|
+
chartTitle: z.string().optional().transform(processMarkdown),
|
|
291
|
+
chartNotes: z.string().optional().transform(processMarkdown),
|
|
292
|
+
chartBars: z.array(chartBarSchema).optional(),
|
|
293
|
+
chartPercentageTitle: z.string().optional().transform(processMarkdown),
|
|
294
|
+
chartPercentageNotes: z.string().optional().transform(processMarkdown),
|
|
295
|
+
chartPercentageValues: z.array(chartPercentageBarSchema).optional(),
|
|
296
|
+
|
|
297
|
+
// Atributos do ImageBlock
|
|
298
|
+
src: z.string().optional(),
|
|
299
|
+
alt: z.string().optional(),
|
|
300
|
+
wideImage: z.boolean().optional(),
|
|
301
|
+
|
|
302
|
+
// Atributos do LogosGroup
|
|
303
|
+
logos: z.array(logoSchema).optional(),
|
|
304
|
+
|
|
305
|
+
// Atributos do VideoEmbed
|
|
306
|
+
videoUrl: z.string().optional(),
|
|
307
|
+
videoCaption: z.string().optional().transform(processMarkdown),
|
|
308
|
+
wideVideo: z.boolean().optional(),
|
|
309
|
+
|
|
310
|
+
// Atributos do HtmlEmbed
|
|
311
|
+
htmlCode: z.string().optional(),
|
|
312
|
+
htmlCaption: z.string().optional().transform(processMarkdown),
|
|
313
|
+
wideHtml: z.boolean().optional(),
|
|
314
|
+
|
|
315
|
+
// Atributos do InnerColumns
|
|
316
|
+
column1: z
|
|
317
|
+
.any()
|
|
318
|
+
.optional()
|
|
319
|
+
.transform((val) => (val === null ? undefined : val)),
|
|
320
|
+
column2: z
|
|
321
|
+
.any()
|
|
322
|
+
.optional()
|
|
323
|
+
.transform((val) => (val === null ? undefined : val)),
|
|
324
|
+
|
|
325
|
+
// Atributos do Timeline
|
|
326
|
+
// timelineItems: z.array(z.any()).optional(),
|
|
327
|
+
|
|
328
|
+
// Atributos do Columns
|
|
329
|
+
invertOnMobile: z.boolean().optional(),
|
|
330
|
+
columnsAlign: z.enum(['33-66', '66-33']).optional(),
|
|
331
|
+
|
|
332
|
+
// Atributos do Map
|
|
333
|
+
columnAlign: z.enum(['left', 'center', 'right']).optional(),
|
|
334
|
+
floatingText: z.boolean().optional(),
|
|
335
|
+
mapView: z.string().optional(),
|
|
336
|
+
style: z.string().optional(),
|
|
337
|
+
center: z
|
|
338
|
+
.object({
|
|
339
|
+
lng: z.number(),
|
|
340
|
+
lat: z.number(),
|
|
341
|
+
})
|
|
342
|
+
.optional(),
|
|
343
|
+
zoom: z.number().optional(),
|
|
344
|
+
bearing: z.number().optional(),
|
|
345
|
+
pitch: z.number().optional(),
|
|
346
|
+
token: z.string().optional(),
|
|
347
|
+
views: z
|
|
348
|
+
.array(
|
|
349
|
+
z.object({
|
|
350
|
+
id: z.string().optional(),
|
|
351
|
+
center: z
|
|
352
|
+
.object({
|
|
353
|
+
lng: z.number(),
|
|
354
|
+
lat: z.number(),
|
|
355
|
+
})
|
|
356
|
+
.optional(),
|
|
357
|
+
duration: z.number().optional(),
|
|
358
|
+
zoom: z.number().optional(),
|
|
359
|
+
bearing: z.number().optional(),
|
|
360
|
+
pitch: z.number().optional(),
|
|
361
|
+
layers: z.array(z.string()).optional(),
|
|
362
|
+
// Mobile zoom agora é um campo direto
|
|
363
|
+
mobileZoom: z.number().optional(),
|
|
364
|
+
// Campos de caption agora são diretos (não dentro de objeto captions)
|
|
365
|
+
title: z.string().optional(),
|
|
366
|
+
notes: z.string().optional(),
|
|
367
|
+
items: z
|
|
368
|
+
.array(
|
|
369
|
+
z.object({
|
|
370
|
+
icon: z.string().optional(),
|
|
371
|
+
colorIcon: z.string().optional(),
|
|
372
|
+
typeIcon: z.enum(['outlined', 'rounded', 'sharp']).optional(),
|
|
373
|
+
iconFill: z.boolean().optional(),
|
|
374
|
+
text: z.string().optional(),
|
|
375
|
+
})
|
|
376
|
+
)
|
|
377
|
+
.optional(),
|
|
378
|
+
})
|
|
379
|
+
)
|
|
380
|
+
.optional(),
|
|
381
|
+
|
|
382
|
+
// Atributos do BigNumbers
|
|
383
|
+
alignment: z.enum(['caption-bottom', 'caption-top']).optional(),
|
|
384
|
+
items: z
|
|
385
|
+
.array(
|
|
386
|
+
z.object({
|
|
387
|
+
number: z.string().optional(),
|
|
388
|
+
caption: z.string().optional().transform(processMarkdown),
|
|
389
|
+
})
|
|
390
|
+
)
|
|
391
|
+
.optional(),
|
|
392
|
+
|
|
393
|
+
// Atributos do Spacer
|
|
394
|
+
desktop: z.string().optional(),
|
|
395
|
+
tablet: z.string().optional(),
|
|
396
|
+
mobile: z.string().optional(),
|
|
397
|
+
|
|
398
|
+
// Atributos do Button
|
|
399
|
+
//link: linkSchema.optional(),
|
|
400
|
+
icon: z.string().optional(),
|
|
401
|
+
size: z.string().optional(),
|
|
402
|
+
|
|
403
|
+
// Atributos do Gallery
|
|
404
|
+
uniqid: z.string().optional(),
|
|
405
|
+
images: z
|
|
406
|
+
.array(
|
|
407
|
+
z.object({
|
|
408
|
+
image: z.string().optional(),
|
|
409
|
+
caption: z.string().optional().transform(processMarkdown),
|
|
410
|
+
})
|
|
411
|
+
)
|
|
412
|
+
.optional(),
|
|
413
|
+
|
|
414
|
+
// Atributos do Slider
|
|
415
|
+
slides: z
|
|
416
|
+
.array(
|
|
417
|
+
z.object({
|
|
418
|
+
image: z.string().optional(),
|
|
419
|
+
caption: z.string().optional(),
|
|
420
|
+
})
|
|
421
|
+
)
|
|
422
|
+
.optional(),
|
|
423
|
+
|
|
424
|
+
// Atributos do Compare
|
|
425
|
+
caption: z.string().optional().transform(processMarkdown),
|
|
426
|
+
|
|
427
|
+
// Atributos do TimelineBullet
|
|
428
|
+
text: z.string().optional(),
|
|
429
|
+
|
|
430
|
+
// Caso possua subcomponentes
|
|
431
|
+
components: z.array(z.any()).optional(),
|
|
432
|
+
imageLeft: z.string().optional(),
|
|
433
|
+
imageRight: z.string().optional(),
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
export const pagesSchema = z.object({
|
|
437
|
+
title: z.string().optional(),
|
|
438
|
+
mapbox: mapboxSchema.optional(),
|
|
439
|
+
components: z.array(componentSchema).optional(),
|
|
440
|
+
pageSettings: z
|
|
441
|
+
.object({
|
|
442
|
+
type: z.string().optional(),
|
|
443
|
+
language: z.enum(['pt-BR', 'en', 'es']).optional(),
|
|
444
|
+
link_pt_br: z.string().optional(),
|
|
445
|
+
link_en: z.string().optional(),
|
|
446
|
+
link_es: z.string().optional(),
|
|
447
|
+
direction: z.enum(['left', 'right']).optional(),
|
|
448
|
+
seoTitle: z.string().optional(),
|
|
449
|
+
seoDescription: z.string().optional(),
|
|
450
|
+
seoKeywords: z.array(z.object({ keyword: z.string() })).optional(),
|
|
451
|
+
seoImage: z.string().optional(),
|
|
452
|
+
animations: z.enum(['enable_all', 'disable_all', 'custom']).optional().default('enable_all'),
|
|
453
|
+
})
|
|
454
|
+
.optional(),
|
|
455
|
+
pageTheme: z
|
|
456
|
+
.object({
|
|
457
|
+
primaryColor: z.string().optional(),
|
|
458
|
+
secondaryColor: z.string().optional(),
|
|
459
|
+
highlightColor: z.string().optional(),
|
|
460
|
+
auxiliaryColor: z.string().optional(),
|
|
461
|
+
displayFont: z.string().optional(),
|
|
462
|
+
textFont: z.string().optional(),
|
|
463
|
+
spacingPatterns: z
|
|
464
|
+
.array(
|
|
465
|
+
z.object({
|
|
466
|
+
name: z.string(),
|
|
467
|
+
mobile: z.string(),
|
|
468
|
+
tablet: z.string(),
|
|
469
|
+
desktop: z.string(),
|
|
470
|
+
})
|
|
471
|
+
)
|
|
472
|
+
.optional(),
|
|
473
|
+
})
|
|
474
|
+
.optional(),
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
export {
|
|
478
|
+
processMarkdown,
|
|
479
|
+
stringToNumber,
|
|
480
|
+
processLayersText,
|
|
481
|
+
linkSchema,
|
|
482
|
+
cardCallSchema,
|
|
483
|
+
cardSchema,
|
|
484
|
+
logoSchema,
|
|
485
|
+
chartBarSchema,
|
|
486
|
+
chartPercentageBarSchema,
|
|
487
|
+
mapBoxLayerSchema,
|
|
488
|
+
mapboxSchema,
|
|
489
|
+
componentSchema,
|
|
490
|
+
bigNumberItemSchema,
|
|
491
|
+
slideSchema,
|
|
492
|
+
galleryImageSchema,
|
|
493
|
+
timelineBulletSchema,
|
|
494
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineCollection, z } from 'astro:content';
|
|
2
|
+
import { glob } from 'astro/loaders';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import matter from 'gray-matter';
|
|
6
|
+
import {
|
|
7
|
+
createPagesLoader,
|
|
8
|
+
pagesSchema,
|
|
9
|
+
blogSchema,
|
|
10
|
+
geoStorySchema,
|
|
11
|
+
} from './content/loader';
|
|
12
|
+
|
|
13
|
+
function readFrontmatterSlug(entry, base) {
|
|
14
|
+
try {
|
|
15
|
+
const filePath = fileURLToPath(new URL(entry, base));
|
|
16
|
+
const raw = readFileSync(filePath, 'utf-8');
|
|
17
|
+
const parsed = matter(raw);
|
|
18
|
+
return parsed.data.slug ? String(parsed.data.slug) : undefined;
|
|
19
|
+
} catch {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const pagesCollection = defineCollection({
|
|
25
|
+
loader: createPagesLoader({
|
|
26
|
+
base: './src/content/pages',
|
|
27
|
+
generateId: ({ entry, base, data }) => {
|
|
28
|
+
// Preserve Astro 4 behaviour: frontmatter `slug` overrides filename-derived id.
|
|
29
|
+
// Astro 5's glob loader fails to parse frontmatter for non-ASCII filenames
|
|
30
|
+
// (data comes back empty), so we re-read the file as a fallback.
|
|
31
|
+
const slug = (data && data.slug) || readFrontmatterSlug(entry, base);
|
|
32
|
+
if (slug) return String(slug);
|
|
33
|
+
return entry.replace(/\.md$/, '').replace(/[^a-zA-Z0-9-]/g, '');
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
schema: pagesSchema,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const collections = {
|
|
40
|
+
pages: pagesCollection,
|
|
41
|
+
blog: defineCollection({
|
|
42
|
+
loader: glob({ pattern: '**/*.md', base: './src/content/blog' }),
|
|
43
|
+
schema: blogSchema,
|
|
44
|
+
}),
|
|
45
|
+
geostorys: defineCollection({
|
|
46
|
+
loader: glob({ pattern: '**/*.md', base: './src/content/geostorys' }),
|
|
47
|
+
schema: geoStorySchema,
|
|
48
|
+
}),
|
|
49
|
+
};
|
package/src/env.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference path="../.astro/types.d.ts" />
|