@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,67 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Scan the consumer's `src/components/` and `src/layouts/` directories and
|
|
6
|
+
* produce Vite `resolve.alias` entries that redirect `@documental-xyz/core`
|
|
7
|
+
* bare-specifier imports to the consumer's local files.
|
|
8
|
+
*
|
|
9
|
+
* This is the override mechanism documented in T2 POC finding #3: a consumer
|
|
10
|
+
* can drop a local `.astro` file with the same name as a core component/layout
|
|
11
|
+
* and have it shadow the core's version. Only files that EXIST locally are
|
|
12
|
+
* aliased — missing files fall through to the core package via `exports`.
|
|
13
|
+
*
|
|
14
|
+
* Key constraint (T2 POC): the alias `find` string MUST be the exact full
|
|
15
|
+
* subpath including the `.astro` extension. A vague `@documental-xyz/core`
|
|
16
|
+
* → dir alias is insufficient and breaks resolution.
|
|
17
|
+
*
|
|
18
|
+
* @param consumerRoot Absolute path to the consumer project root
|
|
19
|
+
* (defaults to `process.cwd()`).
|
|
20
|
+
* @returns Array of Vite alias entries `{ find, replacement }`.
|
|
21
|
+
*/
|
|
22
|
+
export function overrideAliases(
|
|
23
|
+
consumerRoot: string = process.cwd()
|
|
24
|
+
): Array<{ find: string; replacement: string }> {
|
|
25
|
+
const aliases: Array<{ find: string; replacement: string }> = [];
|
|
26
|
+
const coreName = '@documental-xyz/core';
|
|
27
|
+
|
|
28
|
+
// 1. Components — flat directory, one .astro file per override.
|
|
29
|
+
const localComponentsDir = path.resolve(consumerRoot, 'src/components');
|
|
30
|
+
if (fs.existsSync(localComponentsDir)) {
|
|
31
|
+
for (const file of fs.readdirSync(localComponentsDir)) {
|
|
32
|
+
if (file.endsWith('.astro')) {
|
|
33
|
+
const localPath = path.resolve(localComponentsDir, file);
|
|
34
|
+
aliases.push({
|
|
35
|
+
find: `${coreName}/components/${file}`,
|
|
36
|
+
replacement: localPath,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// 2. Layouts — recursive walk (src/layouts/components/, src/layouts/pages/, etc).
|
|
43
|
+
const localLayoutsDir = path.resolve(consumerRoot, 'src/layouts');
|
|
44
|
+
if (fs.existsSync(localLayoutsDir)) {
|
|
45
|
+
const scanLayouts = (dir: string, prefix: string = '') => {
|
|
46
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
47
|
+
if (entry.isDirectory()) {
|
|
48
|
+
scanLayouts(
|
|
49
|
+
path.resolve(dir, entry.name),
|
|
50
|
+
`${prefix}${entry.name}/`
|
|
51
|
+
);
|
|
52
|
+
} else if (entry.name.endsWith('.astro')) {
|
|
53
|
+
const localPath = path.resolve(dir, entry.name);
|
|
54
|
+
aliases.push({
|
|
55
|
+
find: `${coreName}/layouts/${prefix}${entry.name}`,
|
|
56
|
+
replacement: localPath,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
scanLayouts(localLayoutsDir);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return aliases;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default overrideAliases;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from '../../components/AnimationToggle.astro';
|
|
3
|
+
import Group from '../../components/Group.astro';
|
|
4
|
+
|
|
5
|
+
const { Component, props } = Astro.props;
|
|
6
|
+
const { cardsCallArr = []} = props;
|
|
7
|
+
|
|
8
|
+
// Atualiza o array de cards substituindo a imagem original por `thumb` localizada em public/uploads
|
|
9
|
+
const updatedCardsCallArr = cardsCallArr.map(card => {
|
|
10
|
+
let updatedImg = { ...card.img };
|
|
11
|
+
if (updatedImg.src) {
|
|
12
|
+
updatedImg.src = /^https?:\/\//i.test(card.img.src) ? card.img.src : new URL(card.img.src.replace(/^\/+/, ''), new URL(import.meta.env.BASE_URL, 'http://local')).pathname;
|
|
13
|
+
updatedImg.alt = `${card.img.alt}`
|
|
14
|
+
updatedImg.width = '100%';
|
|
15
|
+
updatedImg.height = '100%';
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
...card,
|
|
19
|
+
img: updatedImg
|
|
20
|
+
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
---
|
|
24
|
+
<AnimationToggle>
|
|
25
|
+
<Component cards={updatedCardsCallArr} />
|
|
26
|
+
</AnimationToggle>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from '../../components/AnimationToggle.astro';
|
|
3
|
+
import Group from '../../components/Group.astro';
|
|
4
|
+
|
|
5
|
+
const { Component, props } = Astro.props;
|
|
6
|
+
const { cardsArr = []} = props;
|
|
7
|
+
|
|
8
|
+
const cards = cardsArr.map(cardItem => cardItem.Card || cardItem);
|
|
9
|
+
|
|
10
|
+
//console.log("CardsArr: ", cards[0].text)
|
|
11
|
+
---
|
|
12
|
+
<AnimationToggle>
|
|
13
|
+
<Component cards={cards} />
|
|
14
|
+
</AnimationToggle>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from "../../components/AnimationToggle.astro";
|
|
3
|
+
|
|
4
|
+
const { Component, props } = Astro.props;
|
|
5
|
+
const { chartTitle, chartNotes, chartBars } = props;
|
|
6
|
+
//console.log("ChartBar props:", Astro.props.chartBars);
|
|
7
|
+
|
|
8
|
+
// Ensure chartBars is always a valid array
|
|
9
|
+
const validChartBars = chartBars && Array.isArray(chartBars) ? chartBars : [];
|
|
10
|
+
|
|
11
|
+
const componentData = {
|
|
12
|
+
title: chartTitle,
|
|
13
|
+
notes: chartNotes,
|
|
14
|
+
values: validChartBars
|
|
15
|
+
};
|
|
16
|
+
---
|
|
17
|
+
<AnimationToggle>
|
|
18
|
+
<Component {...componentData}>
|
|
19
|
+
<slot />
|
|
20
|
+
</Component>
|
|
21
|
+
</AnimationToggle>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from "../../components/AnimationToggle.astro";
|
|
3
|
+
|
|
4
|
+
const { Component, props } = Astro.props;
|
|
5
|
+
const { chartPercentageTitle, chartPercentageNotes, chartPercentageValues = [] } = props;
|
|
6
|
+
|
|
7
|
+
const componentData = {
|
|
8
|
+
title: chartPercentageTitle,
|
|
9
|
+
notes: chartPercentageNotes,
|
|
10
|
+
values: chartPercentageValues
|
|
11
|
+
};
|
|
12
|
+
---
|
|
13
|
+
<AnimationToggle>
|
|
14
|
+
<Component {...componentData}>
|
|
15
|
+
<slot />
|
|
16
|
+
</Component>
|
|
17
|
+
</AnimationToggle>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
const { Component, props } = Astro.props;
|
|
3
|
+
const { txtColor, bgColor, paddingTop, paddingBottom, layout, title, body, ...otherProps } = props;
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<Component paddingTop={paddingTop} paddingBottom={paddingBottom} layout={layout} txtColor={txtColor} bgColor={bgColor} {...otherProps}>
|
|
7
|
+
{title && <h1 slot="title"><Fragment set:html={title} /></h1>}
|
|
8
|
+
|
|
9
|
+
<slot />
|
|
10
|
+
</Component>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from "../../components/AnimationToggle.astro";
|
|
3
|
+
|
|
4
|
+
const { Component, props } = Astro.props;
|
|
5
|
+
const { imageLeft, imageRight, caption } = props;
|
|
6
|
+
|
|
7
|
+
let imageLeftSrc;
|
|
8
|
+
let imageRightSrc;
|
|
9
|
+
|
|
10
|
+
if (imageLeft) {
|
|
11
|
+
imageLeftSrc = /^https?:\/\//i.test(imageLeft) ? imageLeft : new URL(imageLeft.replace(/^\/+/, ''), new URL(import.meta.env.BASE_URL, 'http://local')).pathname;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (imageRight) {
|
|
15
|
+
imageRightSrc = /^https?:\/\//i.test(imageRight) ? imageRight : new URL(imageRight.replace(/^\/+/, ''), new URL(import.meta.env.BASE_URL, 'http://local')).pathname;
|
|
16
|
+
}
|
|
17
|
+
---
|
|
18
|
+
<AnimationToggle>
|
|
19
|
+
<Component imageLeft={imageLeftSrc} imageRight={imageRightSrc} caption={caption} >
|
|
20
|
+
<slot />
|
|
21
|
+
</Component>
|
|
22
|
+
</AnimationToggle>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from '../../components/AnimationToggle.astro';
|
|
3
|
+
|
|
4
|
+
const { Component, props, pageSettings } = Astro.props;
|
|
5
|
+
const {
|
|
6
|
+
id,
|
|
7
|
+
highlightedText,
|
|
8
|
+
ctaMedia,
|
|
9
|
+
txtColor,
|
|
10
|
+
bgColor,
|
|
11
|
+
ctaText,
|
|
12
|
+
link,
|
|
13
|
+
backgroundMedia,
|
|
14
|
+
overlay,
|
|
15
|
+
body,
|
|
16
|
+
animations = true
|
|
17
|
+
} = props;
|
|
18
|
+
|
|
19
|
+
const globalAnimationMode = pageSettings?.animations || 'enable_all';
|
|
20
|
+
|
|
21
|
+
let shouldDisableAnimations;
|
|
22
|
+
|
|
23
|
+
switch (globalAnimationMode) {
|
|
24
|
+
case 'enable_all':
|
|
25
|
+
shouldDisableAnimations = false;
|
|
26
|
+
break;
|
|
27
|
+
case 'disable_all':
|
|
28
|
+
shouldDisableAnimations = true;
|
|
29
|
+
break;
|
|
30
|
+
case 'custom':
|
|
31
|
+
shouldDisableAnimations = !animations;
|
|
32
|
+
break;
|
|
33
|
+
default:
|
|
34
|
+
shouldDisableAnimations = false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const hasMedia = ctaMedia && ctaMedia.length > 0;
|
|
38
|
+
const resolvedLayout = hasMedia ? 'media' : 'text';
|
|
39
|
+
|
|
40
|
+
let resolvedMediaType;
|
|
41
|
+
let resolvedMedia;
|
|
42
|
+
|
|
43
|
+
if (hasMedia) {
|
|
44
|
+
const item = ctaMedia[0];
|
|
45
|
+
const src = item.externalUrl || item.src;
|
|
46
|
+
|
|
47
|
+
if (item.type === 'ctaImage' && src) {
|
|
48
|
+
resolvedMediaType = 'image';
|
|
49
|
+
resolvedMedia = /^https?:\/\//i.test(src)
|
|
50
|
+
? src
|
|
51
|
+
: new URL(src.replace(/^\/+/, ''), new URL(import.meta.env.BASE_URL, 'http://local')).pathname;
|
|
52
|
+
} else if (item.type === 'ctaVideo' && src) {
|
|
53
|
+
resolvedMediaType = 'video';
|
|
54
|
+
resolvedMedia = src;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
let imgBg;
|
|
59
|
+
let videoBg;
|
|
60
|
+
|
|
61
|
+
if (backgroundMedia && backgroundMedia.length > 0) {
|
|
62
|
+
const bgMedia = backgroundMedia[0];
|
|
63
|
+
if (bgMedia.type === 'backgroundImage' && bgMedia.imgSrc) {
|
|
64
|
+
imgBg = bgMedia.imgSrc;
|
|
65
|
+
imgBg = /^https?:\/\//i.test(imgBg) ? imgBg : new URL(imgBg.replace(/^\/+/, ''), new URL(import.meta.env.BASE_URL, 'http://local')).pathname;
|
|
66
|
+
} else if (bgMedia.type === 'backgroundVideo' && bgMedia.videoSrc) {
|
|
67
|
+
videoBg = bgMedia.videoSrc;
|
|
68
|
+
videoBg = /^https?:\/\//i.test(videoBg) ? videoBg : new URL(videoBg.replace(/^\/+/, ''), new URL(import.meta.env.BASE_URL, 'http://local')).pathname;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
---
|
|
72
|
+
<AnimationToggle disabled={shouldDisableAnimations}>
|
|
73
|
+
<section id={id} style={`background-color: var(--clr-bg);`}>
|
|
74
|
+
<Component
|
|
75
|
+
layout={resolvedLayout}
|
|
76
|
+
highlightedText={highlightedText}
|
|
77
|
+
media={resolvedMedia}
|
|
78
|
+
mediaType={resolvedMediaType}
|
|
79
|
+
text={ctaText}
|
|
80
|
+
link={link}
|
|
81
|
+
imgBg={imgBg}
|
|
82
|
+
videoBg={videoBg}
|
|
83
|
+
txtColor={txtColor}
|
|
84
|
+
bgColor={bgColor}
|
|
85
|
+
overlay={overlay}
|
|
86
|
+
>
|
|
87
|
+
{body && <Fragment set:html={body} />}
|
|
88
|
+
<slot />
|
|
89
|
+
</Component>
|
|
90
|
+
</section>
|
|
91
|
+
</AnimationToggle>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from '../../components/AnimationToggle.astro';
|
|
3
|
+
import Group from '../../components/Group.astro';
|
|
4
|
+
|
|
5
|
+
const { Component, props } = Astro.props;
|
|
6
|
+
const { ...gallery } = props;
|
|
7
|
+
|
|
8
|
+
// Atualiza o array de imagens substituindo a imagem original por `thumb` localizada em public/uploads
|
|
9
|
+
let updatedImages = gallery.images.map(img => {
|
|
10
|
+
let updatedImg = { ...img };
|
|
11
|
+
if (updatedImg.image) {
|
|
12
|
+
updatedImg.image = /^https?:\/\//i.test(img.image) ? img.image : new URL(img.image.replace(/^\/+/, ''), new URL(import.meta.env.BASE_URL, 'http://local')).pathname;
|
|
13
|
+
}
|
|
14
|
+
return updatedImg;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const updatedGallery = {
|
|
18
|
+
...gallery,
|
|
19
|
+
images: updatedImages
|
|
20
|
+
};
|
|
21
|
+
---
|
|
22
|
+
<AnimationToggle>
|
|
23
|
+
<Component {...updatedGallery} />
|
|
24
|
+
</AnimationToggle>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from '../../components/AnimationToggle.astro';
|
|
3
|
+
|
|
4
|
+
const { Component, props, pageSettings } = Astro.props;
|
|
5
|
+
const { id, txtColor, bgColor, backgroundMedia, overlay, animations = true } = props;
|
|
6
|
+
|
|
7
|
+
// Nova lógica com 3 opções: enable_all, disable_all, custom
|
|
8
|
+
const globalAnimationMode = pageSettings?.animations || 'enable_all';
|
|
9
|
+
|
|
10
|
+
let shouldDisableAnimations;
|
|
11
|
+
|
|
12
|
+
switch (globalAnimationMode) {
|
|
13
|
+
case 'enable_all':
|
|
14
|
+
shouldDisableAnimations = false; // Sempre habilitado
|
|
15
|
+
break;
|
|
16
|
+
case 'disable_all':
|
|
17
|
+
shouldDisableAnimations = true; // Sempre desabilitado
|
|
18
|
+
break;
|
|
19
|
+
case 'custom':
|
|
20
|
+
shouldDisableAnimations = !animations; // Segue configuração individual
|
|
21
|
+
break;
|
|
22
|
+
default:
|
|
23
|
+
shouldDisableAnimations = false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let imgBg;
|
|
27
|
+
let videoBg;
|
|
28
|
+
|
|
29
|
+
if (backgroundMedia && backgroundMedia.length > 0) {
|
|
30
|
+
const media = backgroundMedia[0];
|
|
31
|
+
if (media.type === 'backgroundImage' && media.imgSrc) {
|
|
32
|
+
imgBg = media.imgSrc;
|
|
33
|
+
imgBg = /^https?:\/\//i.test(imgBg) ? imgBg : new URL(imgBg.replace(/^\/+/, ''), new URL(import.meta.env.BASE_URL, 'http://local')).pathname;
|
|
34
|
+
} else if (media.type === 'backgroundVideo' && media.videoSrc) {
|
|
35
|
+
videoBg = media.videoSrc;
|
|
36
|
+
videoBg = /^https?:\/\//i.test(videoBg) ? videoBg : new URL(videoBg.replace(/^\/+/, ''), new URL(import.meta.env.BASE_URL, 'http://local')).pathname;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
<section id={id}>
|
|
42
|
+
<AnimationToggle disabled={shouldDisableAnimations}>
|
|
43
|
+
<Component
|
|
44
|
+
txtColor={txtColor}
|
|
45
|
+
bgColor={bgColor}
|
|
46
|
+
imgBg={imgBg}
|
|
47
|
+
videoBg={videoBg}
|
|
48
|
+
overlay={overlay}
|
|
49
|
+
>
|
|
50
|
+
<slot />
|
|
51
|
+
</Component>
|
|
52
|
+
</AnimationToggle>
|
|
53
|
+
</section>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from "../../components/AnimationToggle.astro";
|
|
3
|
+
|
|
4
|
+
const { Component, props } = Astro.props;
|
|
5
|
+
const { htmlCode, htmlCaption, wideHtml } = props;
|
|
6
|
+
|
|
7
|
+
const componentData = {
|
|
8
|
+
wide: wideHtml || false
|
|
9
|
+
};
|
|
10
|
+
---
|
|
11
|
+
<AnimationToggle>
|
|
12
|
+
<Component {...componentData}>
|
|
13
|
+
<div set:html={htmlCode}></div>
|
|
14
|
+
<Fragment slot="caption">
|
|
15
|
+
{htmlCaption}
|
|
16
|
+
</Fragment>
|
|
17
|
+
</Component>
|
|
18
|
+
</AnimationToggle>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from "../../components/AnimationToggle.astro";
|
|
3
|
+
|
|
4
|
+
const { Component, props } = Astro.props;
|
|
5
|
+
const { src, alt, wideImage, description } = props;
|
|
6
|
+
|
|
7
|
+
const componentData = {
|
|
8
|
+
//src: src.startsWith('http') ? src : `${import.meta.env.BASE_URL}${src}`,
|
|
9
|
+
src: /^https?:\/\//i.test(src) ? src : new URL(src.replace(/^\/+/, ''), new URL(import.meta.env.BASE_URL, 'http://local')).pathname,
|
|
10
|
+
alt: alt || "",
|
|
11
|
+
wide: wideImage || false,
|
|
12
|
+
description: description
|
|
13
|
+
};
|
|
14
|
+
---
|
|
15
|
+
<AnimationToggle>
|
|
16
|
+
<Component {...componentData}>
|
|
17
|
+
<slot />
|
|
18
|
+
{description}
|
|
19
|
+
</Component>
|
|
20
|
+
</AnimationToggle>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from "../../components/AnimationToggle.astro";
|
|
3
|
+
|
|
4
|
+
const { Component, props } = Astro.props;
|
|
5
|
+
const { logos = []} = props;
|
|
6
|
+
|
|
7
|
+
// Atualiza o array de logos substituindo a imagem original por `thumb` localizada em public/uploads
|
|
8
|
+
const updatedLogos = logos.map(logo => {
|
|
9
|
+
let updatedImg = { ...logo.image };
|
|
10
|
+
if (updatedImg) {
|
|
11
|
+
updatedImg = /^https?:\/\//i.test(logo.image) ? logo.image : new URL(logo.image.replace(/^\/+/, ''), new URL(import.meta.env.BASE_URL, 'http://local')).pathname;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
...logo,
|
|
15
|
+
image: updatedImg
|
|
16
|
+
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
---
|
|
20
|
+
<AnimationToggle>
|
|
21
|
+
<Component logos={updatedLogos} />
|
|
22
|
+
</AnimationToggle>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimationToggle from '../../components/AnimationToggle.astro';
|
|
3
|
+
|
|
4
|
+
const { Component, props, pageSettings } = Astro.props;
|
|
5
|
+
const { id, columnAlign, floatingText, txtColor, bgColor, mapView, components, animations = true, ...otherProps } = props;
|
|
6
|
+
|
|
7
|
+
// Nova lógica com 3 opções: enable_all, disable_all, custom
|
|
8
|
+
const globalAnimationMode = pageSettings?.animations || 'enable_all';
|
|
9
|
+
|
|
10
|
+
let shouldDisableAnimations;
|
|
11
|
+
|
|
12
|
+
switch (globalAnimationMode) {
|
|
13
|
+
case 'enable_all':
|
|
14
|
+
shouldDisableAnimations = false; // Sempre habilitado
|
|
15
|
+
break;
|
|
16
|
+
case 'disable_all':
|
|
17
|
+
shouldDisableAnimations = true; // Sempre desabilitado
|
|
18
|
+
break;
|
|
19
|
+
case 'custom':
|
|
20
|
+
shouldDisableAnimations = !animations; // Segue configuração individual
|
|
21
|
+
break;
|
|
22
|
+
default:
|
|
23
|
+
shouldDisableAnimations = false;
|
|
24
|
+
}
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<section id={id} style={{ backgroundColor: 'var(--clr-bg, transparent)' }}>
|
|
28
|
+
<AnimationToggle disabled={shouldDisableAnimations}>
|
|
29
|
+
<Component
|
|
30
|
+
columnAlign={columnAlign}
|
|
31
|
+
floatingText={floatingText}
|
|
32
|
+
txtColor={txtColor}
|
|
33
|
+
bgColor={bgColor}
|
|
34
|
+
mapView={mapView}
|
|
35
|
+
components={components}
|
|
36
|
+
{...otherProps}
|
|
37
|
+
>
|
|
38
|
+
<slot />
|
|
39
|
+
</Component>
|
|
40
|
+
</AnimationToggle>
|
|
41
|
+
</section>
|