@brunoalz/smartgesti-site-editor 1.4.0 → 1.4.2
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/editor/BlockSelector.js +4 -2
- package/dist/editor/BlockSelector.js.map +1 -1
- package/dist/engine/export/exportHtml.d.ts +5 -1
- package/dist/engine/export/exportHtml.d.ts.map +1 -1
- package/dist/engine/export/exportHtml.js +69 -51
- package/dist/engine/export/exportHtml.js.map +1 -1
- package/dist/engine/export/exporters/sections/BlogPostExporters.d.ts +2 -0
- package/dist/engine/export/exporters/sections/BlogPostExporters.d.ts.map +1 -1
- package/dist/engine/export/exporters/sections/BlogPostExporters.js +137 -80
- package/dist/engine/export/exporters/sections/BlogPostExporters.js.map +1 -1
- package/dist/engine/export/exporters/sections/index.d.ts.map +1 -1
- package/dist/engine/export/exporters/sections/index.js +40 -38
- package/dist/engine/export/exporters/sections/index.js.map +1 -1
- package/dist/engine/index.js +97 -95
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/plugins/builtin/blog/manifest.d.ts.map +1 -1
- package/dist/engine/plugins/builtin/blog/manifest.js +103 -53
- package/dist/engine/plugins/builtin/blog/manifest.js.map +1 -1
- package/dist/engine/plugins/builtin/blog/mockContentProvider.d.ts.map +1 -1
- package/dist/engine/plugins/builtin/blog/mockContentProvider.js +13 -9
- package/dist/engine/plugins/builtin/blog/mockContentProvider.js.map +1 -1
- package/dist/engine/plugins/contentHydration.d.ts.map +1 -1
- package/dist/engine/plugins/contentHydration.js +119 -79
- package/dist/engine/plugins/contentHydration.js.map +1 -1
- package/dist/engine/plugins/types.d.ts +5 -0
- package/dist/engine/plugins/types.d.ts.map +1 -1
- package/dist/engine/registry/blocks/sections/blogCategoryFilter.d.ts +3 -0
- package/dist/engine/registry/blocks/sections/blogCategoryFilter.d.ts.map +1 -0
- package/dist/engine/registry/blocks/sections/blogCategoryFilter.js +53 -0
- package/dist/engine/registry/blocks/sections/blogCategoryFilter.js.map +1 -0
- package/dist/engine/registry/blocks/sections/blogPostDetail.d.ts.map +1 -1
- package/dist/engine/registry/blocks/sections/blogPostDetail.js +4 -1
- package/dist/engine/registry/blocks/sections/blogPostDetail.js.map +1 -1
- package/dist/engine/registry/blocks/sections/blogPostGrid.js +4 -4
- package/dist/engine/registry/blocks/sections/blogPostGrid.js.map +1 -1
- package/dist/engine/registry/blocks/sections/blogSearchBar.d.ts +3 -0
- package/dist/engine/registry/blocks/sections/blogSearchBar.d.ts.map +1 -0
- package/dist/engine/registry/blocks/sections/blogSearchBar.js +56 -0
- package/dist/engine/registry/blocks/sections/blogSearchBar.js.map +1 -0
- package/dist/engine/registry/blocks/sections/index.d.ts +2 -0
- package/dist/engine/registry/blocks/sections/index.d.ts.map +1 -1
- package/dist/engine/render/renderers/sections/BlogCategoryFilterRenderer.d.ts +3 -0
- package/dist/engine/render/renderers/sections/BlogCategoryFilterRenderer.d.ts.map +1 -0
- package/dist/engine/render/renderers/sections/BlogCategoryFilterRenderer.js +213 -0
- package/dist/engine/render/renderers/sections/BlogCategoryFilterRenderer.js.map +1 -0
- package/dist/engine/render/renderers/sections/BlogSearchBarRenderer.d.ts +3 -0
- package/dist/engine/render/renderers/sections/BlogSearchBarRenderer.d.ts.map +1 -0
- package/dist/engine/render/renderers/sections/BlogSearchBarRenderer.js +138 -0
- package/dist/engine/render/renderers/sections/BlogSearchBarRenderer.js.map +1 -0
- package/dist/engine/render/renderers/sections/index.js +28 -24
- package/dist/engine/render/renderers/sections/index.js.map +1 -1
- package/dist/engine/schema/siteDocument.d.ts +66 -2
- package/dist/engine/schema/siteDocument.d.ts.map +1 -1
- package/dist/engine/schema/siteDocument.js.map +1 -1
- package/dist/hooks/useNavbarAutoSync.d.ts.map +1 -1
- package/dist/hooks/useNavbarAutoSync.js +27 -15
- package/dist/hooks/useNavbarAutoSync.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +108 -106
- package/dist/index.js.map +1 -1
- package/dist/utils/blockIcons.d.ts.map +1 -1
- package/dist/utils/blockIcons.js +2 -0
- package/dist/utils/blockIcons.js.map +1 -1
- package/dist/utils/navbarSync.d.ts +3 -1
- package/dist/utils/navbarSync.d.ts.map +1 -1
- package/dist/utils/navbarSync.js +3 -3
- package/dist/utils/navbarSync.js.map +1 -1
- package/dist/viewer/LandingPageViewer.d.ts +7 -2
- package/dist/viewer/LandingPageViewer.d.ts.map +1 -1
- package/dist/viewer/LandingPageViewer.js +106 -92
- package/dist/viewer/LandingPageViewer.js.map +1 -1
- package/package.json +1 -1
package/dist/engine/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createEmptySiteDocument as
|
|
2
|
-
import { corporateThemeTokens as
|
|
3
|
-
import { componentRegistry as
|
|
1
|
+
import { createEmptySiteDocument as ae } from "./schema/siteDocument.js";
|
|
2
|
+
import { corporateThemeTokens as ie, darkThemeTokens as pe, defaultComponentTokens as se, defaultEffectTokens as ne, defaultLayoutTokens as le, defaultThemeTokens as ce, generateThemeCSSVariables as ge, gradientDirectionMap as de, gradientThemeTokens as fe, playfulThemeTokens as he, radiusScaleMap as Pe, shadowScaleMap as Te, spacingScaleMap as xe } from "./schema/themeTokens.js";
|
|
3
|
+
import { componentRegistry as ke } from "./registry/registry.js";
|
|
4
4
|
import "./registry/blocks/layout/container.js";
|
|
5
5
|
import "./registry/blocks/layout/stack.js";
|
|
6
6
|
import "./registry/blocks/layout/grid.js";
|
|
@@ -45,6 +45,8 @@ import "./registry/blocks/sections/categoryCardGrid.js";
|
|
|
45
45
|
import "./registry/blocks/sections/blogPostCard.js";
|
|
46
46
|
import "./registry/blocks/sections/blogPostGrid.js";
|
|
47
47
|
import "./registry/blocks/sections/blogPostDetail.js";
|
|
48
|
+
import "./registry/blocks/sections/blogCategoryFilter.js";
|
|
49
|
+
import "./registry/blocks/sections/blogSearchBar.js";
|
|
48
50
|
import "./registry/blocks/sections/productShowcase.js";
|
|
49
51
|
import "./registry/blocks/sections/aboutSection.js";
|
|
50
52
|
import "./registry/blocks/sections/contactSection.js";
|
|
@@ -52,99 +54,99 @@ import "./registry/blocks/forms/form.js";
|
|
|
52
54
|
import "./registry/blocks/forms/input.js";
|
|
53
55
|
import "./registry/blocks/forms/textarea.js";
|
|
54
56
|
import "./registry/blocks/forms/select.js";
|
|
55
|
-
import { RenderNode as
|
|
56
|
-
import { RenderPage as
|
|
57
|
-
import { clearHtmlCache as
|
|
58
|
-
import { isSafeUrl as
|
|
59
|
-
import { Preview as
|
|
60
|
-
import { applyPatch as
|
|
61
|
-
import { HistoryManager as
|
|
62
|
-
import { PatchBuilder as
|
|
63
|
-
import { applyOverrides as
|
|
64
|
-
import { HERO_IMAGE_NAMES as
|
|
65
|
-
import { getNavbarVariation as
|
|
66
|
-
import { generateCompleteLandingPage as
|
|
57
|
+
import { RenderNode as ye } from "./render/renderNode.js";
|
|
58
|
+
import { RenderPage as Ce, renderPage as Ve } from "./render/renderPage.js";
|
|
59
|
+
import { clearHtmlCache as He, exportBlockToHtml as ve, exportDocumentToHtml as Re, exportPageToHtml as Ee, generateAssetsManifest as Ae } from "./export/exportHtml.js";
|
|
60
|
+
import { isSafeUrl as Le, sanitizeHtml as Ie } from "./export/sanitizeHtml.js";
|
|
61
|
+
import { Preview as ee } from "./preview/Preview.js";
|
|
62
|
+
import { applyPatch as Oe, createAddPatch as _e, createCopyPatch as we, createMovePatch as Be, createRemovePatch as Ge, createReplacePatch as je } from "./patch/applyPatch.js";
|
|
63
|
+
import { HistoryManager as We, createHistoryManager as ze } from "./patch/history.js";
|
|
64
|
+
import { PatchBuilder as Ke } from "./patch/PatchBuilder.js";
|
|
65
|
+
import { applyOverrides as Je, classicPreset as Qe, cleanPreset as Xe, corporatePreset as Ye, getAllPresets as Ze, getPreset as $e, glassPreset as er, minimalPreset as rr, neonPreset as tr, pastelPreset as or, playfulKidsPreset as ar, themePresets as mr, validateContrast as ir } from "./presets/themePresets.js";
|
|
66
|
+
import { HERO_IMAGE_NAMES as sr, PLACEHOLDER_IMAGE_URL as nr, getHeroVariation as lr, heroVariationIds as cr, heroVariations as gr } from "./presets/heroVariations.js";
|
|
67
|
+
import { getNavbarVariation as fr, navbarVariationIds as hr, navbarVariations as Pr } from "./presets/navbarVariations.js";
|
|
68
|
+
import { generateCompleteLandingPage as xr, generateModernLandingPage as Sr, generatePatchesForLandingPage as kr } from "./generators/generateLandingPage.js";
|
|
67
69
|
import "./plugins/builtin/blog/manifest.js";
|
|
68
|
-
import { evaluateShowWhen as
|
|
69
|
-
import { createThemeStyle as
|
|
70
|
-
import { gridPresetMap as
|
|
71
|
-
import { hydratePageWithContent as
|
|
72
|
-
import { matchDynamicPage as
|
|
73
|
-
import { pluginRegistry as
|
|
74
|
-
import { renderBlockNode as
|
|
75
|
-
import { darkTheme as
|
|
70
|
+
import { evaluateShowWhen as yr } from "./shared/showWhen.js";
|
|
71
|
+
import { createThemeStyle as Cr, generateCSSVariables as Vr, generateCSSVariablesObject as br, mergeThemeTokens as Hr } from "./theme/generateCSSVariables.js";
|
|
72
|
+
import { gridPresetMap as Rr, imageGridPresetIds as Er } from "./shared/imageGrid/presets.js";
|
|
73
|
+
import { hydratePageWithContent as Dr } from "./plugins/contentHydration.js";
|
|
74
|
+
import { matchDynamicPage as Ir } from "./plugins/dynamicPageResolver.js";
|
|
75
|
+
import { pluginRegistry as Or } from "./plugins/pluginRegistry.js";
|
|
76
|
+
import { renderBlockNode as wr } from "./render/renderNodeImpl.js";
|
|
77
|
+
import { darkTheme as Gr, defaultTheme as jr } from "./theme/defaultTheme.js";
|
|
76
78
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
79
|
+
sr as HERO_IMAGE_NAMES,
|
|
80
|
+
We as HistoryManager,
|
|
81
|
+
nr as PLACEHOLDER_IMAGE_URL,
|
|
82
|
+
Ke as PatchBuilder,
|
|
83
|
+
ee as Preview,
|
|
84
|
+
ye as RenderNode,
|
|
85
|
+
Ce as RenderPage,
|
|
86
|
+
Je as applyOverrides,
|
|
87
|
+
Oe as applyPatch,
|
|
88
|
+
Qe as classicPreset,
|
|
89
|
+
Xe as cleanPreset,
|
|
90
|
+
He as clearHtmlCache,
|
|
91
|
+
ke as componentRegistry,
|
|
92
|
+
Ye as corporatePreset,
|
|
93
|
+
ie as corporateThemeTokens,
|
|
94
|
+
_e as createAddPatch,
|
|
95
|
+
we as createCopyPatch,
|
|
96
|
+
ae as createEmptySiteDocument,
|
|
97
|
+
ze as createHistoryManager,
|
|
98
|
+
Be as createMovePatch,
|
|
99
|
+
Ge as createRemovePatch,
|
|
100
|
+
je as createReplacePatch,
|
|
101
|
+
Cr as createSiteThemeStyle,
|
|
102
|
+
pe as darkThemeTokens,
|
|
103
|
+
se as defaultComponentTokens,
|
|
104
|
+
ne as defaultEffectTokens,
|
|
105
|
+
le as defaultLayoutTokens,
|
|
106
|
+
ce as defaultThemeTokens,
|
|
107
|
+
yr as evaluateShowWhen,
|
|
108
|
+
ve as exportBlockToHtml,
|
|
109
|
+
Re as exportDocumentToHtml,
|
|
110
|
+
Ee as exportPageToHtml,
|
|
111
|
+
Ae as generateAssetsManifest,
|
|
112
|
+
xr as generateCompleteLandingPage,
|
|
113
|
+
Sr as generateModernLandingPage,
|
|
114
|
+
kr as generatePatchesForLandingPage,
|
|
115
|
+
Vr as generateSiteCSSVariables,
|
|
116
|
+
br as generateSiteCSSVariablesObject,
|
|
117
|
+
ge as generateThemeCSSVariables,
|
|
118
|
+
Ze as getAllPresets,
|
|
119
|
+
lr as getHeroVariation,
|
|
120
|
+
fr as getNavbarVariation,
|
|
121
|
+
$e as getPreset,
|
|
122
|
+
er as glassPreset,
|
|
123
|
+
de as gradientDirectionMap,
|
|
124
|
+
fe as gradientThemeTokens,
|
|
125
|
+
Rr as gridPresetMap,
|
|
126
|
+
cr as heroVariationIds,
|
|
127
|
+
gr as heroVariations,
|
|
128
|
+
Dr as hydratePageWithContent,
|
|
129
|
+
Er as imageGridPresetIds,
|
|
130
|
+
Le as isSafeUrl,
|
|
131
|
+
Ir as matchDynamicPage,
|
|
132
|
+
Hr as mergeSiteThemeTokens,
|
|
133
|
+
rr as minimalPreset,
|
|
134
|
+
hr as navbarVariationIds,
|
|
135
|
+
Pr as navbarVariations,
|
|
136
|
+
tr as neonPreset,
|
|
137
|
+
or as pastelPreset,
|
|
138
|
+
ar as playfulKidsPreset,
|
|
139
|
+
he as playfulThemeTokens,
|
|
140
|
+
Or as pluginRegistry,
|
|
141
|
+
Pe as radiusScaleMap,
|
|
142
|
+
wr as renderNode,
|
|
143
|
+
Ve as renderPage,
|
|
144
|
+
Ie as sanitizeHtml,
|
|
145
|
+
Te as shadowScaleMap,
|
|
146
|
+
Gr as siteDarkTheme,
|
|
147
|
+
jr as siteDefaultTheme,
|
|
148
|
+
xe as spacingScaleMap,
|
|
149
|
+
mr as themePresets,
|
|
150
|
+
ir as validateContrast
|
|
149
151
|
};
|
|
150
152
|
//# sourceMappingURL=index.js.map
|
package/dist/engine/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../../src/engine/plugins/builtin/blog/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAqFtD,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../../src/engine/plugins/builtin/blog/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAqFtD,eAAO,MAAM,UAAU,EAAE,kBA0XxB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { pluginRegistry as
|
|
2
|
-
import { logger as
|
|
3
|
-
const
|
|
1
|
+
import { pluginRegistry as f } from "../../pluginRegistry.js";
|
|
2
|
+
import { logger as d } from "../../../../utils/logger.js";
|
|
3
|
+
const u = "plugin-blog-home-grid", h = [
|
|
4
4
|
{
|
|
5
5
|
title: "Feira de Ciências 2026: Inovação e Criatividade",
|
|
6
6
|
excerpt: "Nossos alunos apresentaram projetos incríveis na Feira de Ciências deste ano. Confira os destaques e premiações!",
|
|
@@ -58,10 +58,10 @@ const g = "plugin-blog-home-grid", c = [
|
|
|
58
58
|
<p>Os três projetos finalistas representarão nossa escola na <strong>Feira Regional de Ciências</strong>, que acontecerá em março na capital. Os alunos já estão se preparando para levar suas apresentações a um público ainda maior.</p>
|
|
59
59
|
<p>Parabéns a todos os participantes, professores orientadores e famílias que apoiaram essa jornada de descobertas!</p>
|
|
60
60
|
`.trim();
|
|
61
|
-
function
|
|
62
|
-
return { ...JSON.parse(JSON.stringify(
|
|
61
|
+
function m(s, l) {
|
|
62
|
+
return { ...JSON.parse(JSON.stringify(s)), id: l };
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const y = {
|
|
65
65
|
manifest: {
|
|
66
66
|
id: "blog",
|
|
67
67
|
version: "1.0.0",
|
|
@@ -69,7 +69,7 @@ const f = {
|
|
|
69
69
|
description: "Blog com posts, categorias e tags",
|
|
70
70
|
icon: "FileText",
|
|
71
71
|
capabilities: {
|
|
72
|
-
blocks: ["blogPostCard", "blogPostGrid", "blogPostDetail"],
|
|
72
|
+
blocks: ["blogPostCard", "blogPostGrid", "blogPostDetail", "blogCategoryFilter", "blogSearchBar"],
|
|
73
73
|
pageTemplates: [
|
|
74
74
|
{
|
|
75
75
|
id: "blog-listing",
|
|
@@ -112,7 +112,10 @@ const f = {
|
|
|
112
112
|
{ name: "category", type: "string", label: "Category" },
|
|
113
113
|
{ name: "tags", type: "array", label: "Tags" },
|
|
114
114
|
{ name: "authorVariant", type: "string", label: "Author Variant" },
|
|
115
|
-
{ name: "readingTime", type: "number", label: "Reading Time" }
|
|
115
|
+
{ name: "readingTime", type: "number", label: "Reading Time" },
|
|
116
|
+
{ name: "metaTitle", type: "string", label: "Meta Title (SEO)" },
|
|
117
|
+
{ name: "metaDescription", type: "string", label: "Meta Description (SEO)" },
|
|
118
|
+
{ name: "ogImage", type: "image", label: "Open Graph Image" }
|
|
116
119
|
]
|
|
117
120
|
}
|
|
118
121
|
],
|
|
@@ -125,39 +128,53 @@ const f = {
|
|
|
125
128
|
requiredPages: ["blog-listing", "blog-post"]
|
|
126
129
|
}
|
|
127
130
|
},
|
|
128
|
-
onActivate(
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
const e =
|
|
133
|
-
|
|
131
|
+
onActivate(s) {
|
|
132
|
+
d.debug("Blog plugin activating...");
|
|
133
|
+
const l = new Set(s.pages.map((e) => e.id)), o = [...s.pages], t = s.pages.find((e) => e.slug === "home") || s.pages[0], n = t?.structure.find((e) => e.type === "navbar"), i = t?.structure.find((e) => e.type === "footer");
|
|
134
|
+
if (t && n) {
|
|
135
|
+
const e = o.findIndex((r) => r.id === t.id);
|
|
136
|
+
if (e >= 0) {
|
|
137
|
+
const r = n.props, a = Array.isArray(r.links) ? [...r.links] : [];
|
|
138
|
+
if (!a.some(
|
|
139
|
+
(p) => p.href === "/p/blog"
|
|
140
|
+
)) {
|
|
141
|
+
const p = a.length > 0 ? a.length - 1 : 0;
|
|
142
|
+
a.splice(p, 0, { text: "Blog", href: "/p/blog" });
|
|
143
|
+
const b = o[e].structure.map((c) => c.id === n.id ? { ...c, props: { ...c.props, links: a } } : c);
|
|
144
|
+
o[e] = { ...o[e], structure: b }, d.debug("Blog link added to home navbar"), n.props = { ...r, links: a };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (t) {
|
|
149
|
+
const e = o.findIndex((a) => a.id === t.id), r = t.structure.some(
|
|
150
|
+
(a) => a.id === u
|
|
134
151
|
);
|
|
135
|
-
if (e >= 0 && !
|
|
136
|
-
const
|
|
137
|
-
id:
|
|
152
|
+
if (e >= 0 && !r) {
|
|
153
|
+
const a = {
|
|
154
|
+
id: u,
|
|
138
155
|
type: "blogPostGrid",
|
|
139
156
|
props: {
|
|
140
157
|
title: "Blog",
|
|
141
158
|
subtitle: "Últimas publicações",
|
|
142
159
|
columns: 3,
|
|
143
|
-
cards:
|
|
160
|
+
cards: h,
|
|
144
161
|
variant: "default",
|
|
145
162
|
showViewAll: !0,
|
|
146
163
|
viewAllText: "Ver todos os posts",
|
|
147
164
|
viewAllHref: "/site/p/blog"
|
|
148
165
|
}
|
|
149
|
-
},
|
|
166
|
+
}, g = [...o[e].structure], p = g.findIndex(
|
|
150
167
|
(b) => b.type === "footer"
|
|
151
168
|
);
|
|
152
|
-
|
|
153
|
-
...
|
|
154
|
-
structure:
|
|
155
|
-
},
|
|
169
|
+
p >= 0 ? g.splice(p, 0, a) : g.push(a), o[e] = {
|
|
170
|
+
...o[e],
|
|
171
|
+
structure: g
|
|
172
|
+
}, d.debug("Blog section injected into home page");
|
|
156
173
|
}
|
|
157
174
|
}
|
|
158
|
-
if (!
|
|
175
|
+
if (!l.has("blog")) {
|
|
159
176
|
const e = [];
|
|
160
|
-
|
|
177
|
+
n && e.push(m(n, "blog-page-navbar")), e.push({
|
|
161
178
|
id: "blog-page-hero",
|
|
162
179
|
type: "hero",
|
|
163
180
|
props: {
|
|
@@ -171,6 +188,31 @@ const f = {
|
|
|
171
188
|
background: "#4f46e5",
|
|
172
189
|
minHeight: "280px"
|
|
173
190
|
}
|
|
191
|
+
}), e.push({
|
|
192
|
+
id: "blog-search-bar",
|
|
193
|
+
type: "blogSearchBar",
|
|
194
|
+
props: {
|
|
195
|
+
placeholder: "Buscar posts...",
|
|
196
|
+
variant: "simple",
|
|
197
|
+
showIcon: !0,
|
|
198
|
+
searchUrl: "/site/p/blog"
|
|
199
|
+
}
|
|
200
|
+
}), e.push({
|
|
201
|
+
id: "blog-category-filter",
|
|
202
|
+
type: "blogCategoryFilter",
|
|
203
|
+
props: {
|
|
204
|
+
title: "",
|
|
205
|
+
categories: h.map((r) => ({
|
|
206
|
+
name: r.category,
|
|
207
|
+
slug: r.category.toLowerCase().replace(/\s+/g, "-"),
|
|
208
|
+
count: 1
|
|
209
|
+
})),
|
|
210
|
+
variant: "chips",
|
|
211
|
+
showCount: !1,
|
|
212
|
+
showAll: !0,
|
|
213
|
+
allLabel: "Todas",
|
|
214
|
+
filterUrl: "/site/p/blog"
|
|
215
|
+
}
|
|
174
216
|
}), e.push({
|
|
175
217
|
id: "blog-grid-main",
|
|
176
218
|
type: "blogPostGrid",
|
|
@@ -178,13 +220,13 @@ const f = {
|
|
|
178
220
|
title: "",
|
|
179
221
|
subtitle: "",
|
|
180
222
|
columns: 3,
|
|
181
|
-
cards:
|
|
223
|
+
cards: h,
|
|
182
224
|
variant: "default",
|
|
183
225
|
showViewAll: !1,
|
|
184
226
|
viewAllText: "Ver todos",
|
|
185
|
-
viewAllHref: "/blog"
|
|
227
|
+
viewAllHref: "/site/p/blog"
|
|
186
228
|
}
|
|
187
|
-
}),
|
|
229
|
+
}), i && e.push(m(i, "blog-page-footer")), o.push({
|
|
188
230
|
id: "blog",
|
|
189
231
|
name: "Blog",
|
|
190
232
|
slug: "blog",
|
|
@@ -195,11 +237,11 @@ const f = {
|
|
|
195
237
|
provider: "blog-posts",
|
|
196
238
|
mode: "list"
|
|
197
239
|
}
|
|
198
|
-
}),
|
|
240
|
+
}), d.debug("Blog listing page created");
|
|
199
241
|
}
|
|
200
|
-
if (!
|
|
242
|
+
if (!l.has("blog-post")) {
|
|
201
243
|
const e = [];
|
|
202
|
-
|
|
244
|
+
n && e.push(m(n, "post-page-navbar")), e.push({
|
|
203
245
|
id: "blog-detail-main",
|
|
204
246
|
type: "blogPostDetail",
|
|
205
247
|
props: {
|
|
@@ -218,7 +260,7 @@ const f = {
|
|
|
218
260
|
showReadingTime: !0,
|
|
219
261
|
contentMaxWidth: "720px"
|
|
220
262
|
}
|
|
221
|
-
}),
|
|
263
|
+
}), i && e.push(m(i, "post-page-footer")), o.push({
|
|
222
264
|
id: "blog-post",
|
|
223
265
|
name: "Post",
|
|
224
266
|
slug: "blog/:slug",
|
|
@@ -235,39 +277,47 @@ const f = {
|
|
|
235
277
|
lockedStructure: !0,
|
|
236
278
|
nonRemovable: !0
|
|
237
279
|
}
|
|
238
|
-
}),
|
|
280
|
+
}), d.debug("Blog post detail page created");
|
|
239
281
|
}
|
|
240
282
|
return {
|
|
241
|
-
...
|
|
242
|
-
pages:
|
|
283
|
+
...s,
|
|
284
|
+
pages: o
|
|
243
285
|
};
|
|
244
286
|
},
|
|
245
|
-
onDeactivate(
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
(
|
|
253
|
-
)
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
287
|
+
onDeactivate(s) {
|
|
288
|
+
d.debug("Blog plugin deactivating...");
|
|
289
|
+
const l = s.pages.filter((o) => o.pluginId !== "blog").map((o) => {
|
|
290
|
+
let t = o.structure;
|
|
291
|
+
return t.some(
|
|
292
|
+
(i) => i.id === u
|
|
293
|
+
) && (t = t.filter(
|
|
294
|
+
(i) => i.id !== u
|
|
295
|
+
)), t = t.map((i) => {
|
|
296
|
+
if (i.type !== "navbar") return i;
|
|
297
|
+
const e = i.props, r = Array.isArray(e.links) ? e.links : [], a = r.filter((g) => g.href !== "/p/blog");
|
|
298
|
+
return a.length !== r.length ? { ...i, props: { ...e, links: a } } : i;
|
|
299
|
+
}), t !== o.structure ? { ...o, structure: t } : o;
|
|
300
|
+
});
|
|
301
|
+
return d.debug(
|
|
302
|
+
`Removed ${s.pages.length - l.length} blog page(s) and injected section`
|
|
257
303
|
), {
|
|
258
|
-
...
|
|
259
|
-
pages:
|
|
304
|
+
...s,
|
|
305
|
+
pages: l
|
|
260
306
|
};
|
|
261
307
|
},
|
|
262
|
-
getEditorRestrictions(
|
|
263
|
-
if (
|
|
308
|
+
getEditorRestrictions(s) {
|
|
309
|
+
if (s === "blogPostDetail")
|
|
264
310
|
return {
|
|
265
311
|
lockedFields: ["content", "date"]
|
|
266
312
|
};
|
|
313
|
+
if (s === "blogCategoryFilter")
|
|
314
|
+
return {
|
|
315
|
+
lockedFields: ["categories"]
|
|
316
|
+
};
|
|
267
317
|
}
|
|
268
318
|
};
|
|
269
|
-
|
|
319
|
+
f.register(y);
|
|
270
320
|
export {
|
|
271
|
-
|
|
321
|
+
y as blogPlugin
|
|
272
322
|
};
|
|
273
323
|
//# sourceMappingURL=manifest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sources":["../../../../../src/engine/plugins/builtin/blog/manifest.ts"],"sourcesContent":["/**\n * Blog Plugin Manifest\n * Plugin para blog com posts, categorias e tags.\n *\n * onActivate:\n * 1. Injeta seção blogPostGrid na home page (antes do footer)\n * 2. Cria página \"Blog\" com navbar + grid de posts + footer\n * 3. Cria página \"Post\" com navbar + detalhe do post + footer\n *\n * onDeactivate:\n * 1. Remove a seção injetada na home page\n * 2. Remove as páginas do plugin\n */\n\nimport type { PluginRegistration } from \"../../types\";\nimport type { SiteDocument, Block, BlockType } from \"../../../schema/siteDocument\";\nimport { pluginRegistry } from \"../../pluginRegistry\";\nimport { logger } from \"../../../../utils/logger\";\n\n// ─── ID usado para a seção de blog injetada na home page ───\nconst BLOG_HOME_SECTION_ID = \"plugin-blog-home-grid\";\n\n// ─── Sample blog cards para preview ───\nconst SAMPLE_BLOG_CARDS = [\n {\n title: \"Feira de Ciências 2026: Inovação e Criatividade\",\n excerpt:\n \"Nossos alunos apresentaram projetos incríveis na Feira de Ciências deste ano. Confira os destaques e premiações!\",\n image:\n \"https://images.unsplash.com/photo-1567168544230-3b9e5ec47659?w=800&h=400&fit=crop\",\n category: \"Eventos\",\n date: \"05 Fev 2026\",\n linkHref: \"/site/p/blog/feira-de-ciencias-2026\",\n linkText: \"Ler mais\",\n },\n {\n title: \"Matrículas Abertas para o Segundo Semestre\",\n excerpt:\n \"Garanta a vaga do seu filho na melhor escola da região. Condições especiais para matrículas antecipadas.\",\n image:\n \"https://images.unsplash.com/photo-1523050854058-8df90110c9f1?w=800&h=400&fit=crop\",\n category: \"Institucional\",\n date: \"01 Fev 2026\",\n linkHref: \"/site/p/blog/matriculas-segundo-semestre\",\n linkText: \"Ler mais\",\n },\n {\n title: \"5 Dicas para Preparar seu Filho para o Ano Letivo\",\n excerpt:\n \"Dicas práticas para uma transição tranquila e um início de ano produtivo para toda a família.\",\n image:\n \"https://images.unsplash.com/photo-1503676260728-1c00da094a0b?w=800&h=400&fit=crop\",\n category: \"Educação\",\n date: \"28 Jan 2026\",\n linkHref: \"/site/p/blog/dicas-preparar-ano-letivo\",\n linkText: \"Ler mais\",\n },\n];\n\n// ─── Conteúdo HTML rico para o post de exemplo ───\nconst SAMPLE_POST_CONTENT = `\n<h2>O que é a Feira de Ciências?</h2>\n<p>A Feira de Ciências é um evento anual que celebra a curiosidade, a pesquisa e a criatividade dos nossos alunos. Nesta edição especial de 2026, recebemos mais de <strong>500 visitantes</strong> e contamos com a participação de todas as turmas do Ensino Fundamental e Médio.</p>\n<p>Este ano, o tema central foi <em>\"Ciência e Sustentabilidade\"</em>, incentivando os estudantes a desenvolverem projetos que aliassem inovação tecnológica com responsabilidade ambiental.</p>\n\n<h2>Destaques da Edição 2026</h2>\n<p>Entre os mais de 50 projetos apresentados, alguns se destacaram pela originalidade e impacto:</p>\n<ul>\n <li><strong>Jardim Sustentável Inteligente</strong> — Alunos do 5º ano desenvolveram um sistema de irrigação automática usando sensores de umidade e placa Arduino.</li>\n <li><strong>Robótica Educacional</strong> — A turma do 8º ano criou um robô que auxilia no ensino de matemática para crianças do 1º ao 3º ano.</li>\n <li><strong>Energia Solar na Escola</strong> — Projeto do 2º ano do Ensino Médio demonstrou como painéis solares poderiam reduzir em 40% o consumo de energia da escola.</li>\n</ul>\n\n<blockquote>\n <p>\"A Feira de Ciências é um dos momentos mais importantes do nosso calendário escolar. Ver a dedicação e o brilho nos olhos dos alunos ao apresentarem seus projetos nos enche de orgulho e nos motiva a continuar investindo em educação de qualidade.\"</p>\n <p><strong>— Prof. Maria Silva, Coordenadora Pedagógica</strong></p>\n</blockquote>\n\n<h2>Premiações</h2>\n<p>O júri, composto por professores universitários e profissionais da área de tecnologia, selecionou os três melhores projetos:</p>\n<ol>\n <li><strong>1º Lugar:</strong> Jardim Sustentável Inteligente (5º ano)</li>\n <li><strong>2º Lugar:</strong> Energia Solar na Escola (2º EM)</li>\n <li><strong>3º Lugar:</strong> Robótica Educacional (8º ano)</li>\n</ol>\n\n<h2>Próximos Passos</h2>\n<p>Os três projetos finalistas representarão nossa escola na <strong>Feira Regional de Ciências</strong>, que acontecerá em março na capital. Os alunos já estão se preparando para levar suas apresentações a um público ainda maior.</p>\n<p>Parabéns a todos os participantes, professores orientadores e famílias que apoiaram essa jornada de descobertas!</p>\n`.trim();\n\n/**\n * Deep-clone um bloco com novo ID\n */\nfunction cloneBlock(block: Block, newId: string): Block {\n const cloned: Block = JSON.parse(JSON.stringify(block));\n return { ...cloned, id: newId };\n}\n\nexport const blogPlugin: PluginRegistration = {\n manifest: {\n id: \"blog\",\n version: \"1.0.0\",\n name: \"Blog\",\n description: \"Blog com posts, categorias e tags\",\n icon: \"FileText\",\n\n capabilities: {\n blocks: [\"blogPostCard\", \"blogPostGrid\", \"blogPostDetail\"],\n\n pageTemplates: [\n {\n id: \"blog-listing\",\n name: \"Blog\",\n slug: \"blog\",\n pluginId: \"blog\",\n structure: [],\n dataSource: {\n provider: \"blog-posts\",\n mode: \"list\",\n },\n },\n {\n id: \"blog-post\",\n name: \"Post\",\n slug: \"blog/:slug\",\n pluginId: \"blog\",\n structure: [],\n dataSource: {\n provider: \"blog-posts\",\n mode: \"single\",\n paramMapping: { slug: \":slug\" },\n },\n editRestrictions: {\n lockedStructure: true,\n nonRemovable: true,\n },\n },\n ],\n\n dataSchemas: [\n {\n type: \"blog-post\",\n label: \"Blog Post\",\n fields: [\n { name: \"title\", type: \"string\", required: true, label: \"Title\" },\n { name: \"slug\", type: \"string\", required: true, label: \"Slug\" },\n { name: \"excerpt\", type: \"string\", label: \"Excerpt\" },\n { name: \"content\", type: \"richtext\", required: true, label: \"Content\" },\n { name: \"featuredImage\", type: \"image\", label: \"Featured Image\" },\n { name: \"category\", type: \"string\", label: \"Category\" },\n { name: \"tags\", type: \"array\", label: \"Tags\" },\n { name: \"authorVariant\", type: \"string\", label: \"Author Variant\" },\n { name: \"readingTime\", type: \"number\", label: \"Reading Time\" },\n ],\n },\n ],\n\n contentProviders: [\"blog-posts\", \"blog-categories\"],\n },\n\n restrictions: {\n lockedFields: {\n blogPostDetail: [\"content\", \"date\"],\n },\n requiredPages: [\"blog-listing\", \"blog-post\"],\n },\n },\n\n onActivate(document: SiteDocument): SiteDocument {\n logger.debug(\"Blog plugin activating...\");\n\n const existingPageIds = new Set(document.pages.map((p) => p.id));\n const newPages = [...document.pages];\n\n // ── Encontrar home page para clonar navbar/footer ──\n const homePage =\n document.pages.find((p) => p.slug === \"home\") || document.pages[0];\n\n const homeNavbar = homePage?.structure.find((b) => b.type === \"navbar\");\n const homeFooter = homePage?.structure.find((b) => b.type === \"footer\");\n\n // ── 1. Injetar seção de blog na home page (antes do footer) ──\n if (homePage) {\n const homeIdx = newPages.findIndex((p) => p.id === homePage.id);\n const alreadyInjected = homePage.structure.some(\n (b) => b.id === BLOG_HOME_SECTION_ID,\n );\n\n if (homeIdx >= 0 && !alreadyInjected) {\n const blogHomeSection: Block = {\n id: BLOG_HOME_SECTION_ID,\n type: \"blogPostGrid\",\n props: {\n title: \"Blog\",\n subtitle: \"Últimas publicações\",\n columns: 3,\n cards: SAMPLE_BLOG_CARDS,\n variant: \"default\",\n showViewAll: true,\n viewAllText: \"Ver todos os posts\",\n viewAllHref: \"/site/p/blog\",\n },\n } as Block;\n\n const updatedStructure = [...newPages[homeIdx].structure];\n const footerIdx = updatedStructure.findIndex(\n (b) => b.type === \"footer\",\n );\n\n if (footerIdx >= 0) {\n updatedStructure.splice(footerIdx, 0, blogHomeSection);\n } else {\n updatedStructure.push(blogHomeSection);\n }\n\n newPages[homeIdx] = {\n ...newPages[homeIdx],\n structure: updatedStructure,\n };\n logger.debug(\"Blog section injected into home page\");\n }\n }\n\n // ── 2. Criar página \"Blog\" (listagem completa) ──\n if (!existingPageIds.has(\"blog\")) {\n const blogPageStructure: Block[] = [];\n\n // Navbar clonada da home\n if (homeNavbar) {\n blogPageStructure.push(cloneBlock(homeNavbar, \"blog-page-navbar\"));\n }\n\n // Hero banner do blog\n blogPageStructure.push({\n id: \"blog-page-hero\",\n type: \"hero\",\n props: {\n title: \"Blog\",\n subtitle: \"Novidades & Publicações\",\n description:\n \"Acompanhe as últimas novidades, eventos e conquistas da nossa comunidade escolar.\",\n variant: \"centered\",\n align: \"center\",\n overlay: true,\n overlayColor: \"rgba(79, 70, 229, 0.9)\",\n background: \"#4f46e5\",\n minHeight: \"280px\",\n },\n } as Block);\n\n // Grid de posts\n blogPageStructure.push({\n id: \"blog-grid-main\",\n type: \"blogPostGrid\",\n props: {\n title: \"\",\n subtitle: \"\",\n columns: 3,\n cards: SAMPLE_BLOG_CARDS,\n variant: \"default\",\n showViewAll: false,\n viewAllText: \"Ver todos\",\n viewAllHref: \"/blog\",\n },\n } as Block);\n\n // Footer clonado da home\n if (homeFooter) {\n blogPageStructure.push(cloneBlock(homeFooter, \"blog-page-footer\"));\n }\n\n newPages.push({\n id: \"blog\",\n name: \"Blog\",\n slug: \"blog\",\n pluginId: \"blog\",\n pageTemplateId: \"blog-listing\",\n structure: blogPageStructure,\n dataSource: {\n provider: \"blog-posts\",\n mode: \"list\",\n },\n });\n logger.debug(\"Blog listing page created\");\n }\n\n // ── 3. Criar página \"Post\" (detalhe) ──\n if (!existingPageIds.has(\"blog-post\")) {\n const postPageStructure: Block[] = [];\n\n if (homeNavbar) {\n postPageStructure.push(cloneBlock(homeNavbar, \"post-page-navbar\"));\n }\n\n postPageStructure.push({\n id: \"blog-detail-main\",\n type: \"blogPostDetail\",\n props: {\n title: \"Feira de Ciências 2026: Inovação e Criatividade\",\n content: SAMPLE_POST_CONTENT,\n featuredImage:\n \"https://images.unsplash.com/photo-1567168544230-3b9e5ec47659?w=1200&h=600&fit=crop\",\n date: \"05 Fev 2026\",\n category: \"Eventos\",\n authorVariant: \"inline\",\n readingTime: \"5 min de leitura\",\n tags: [\"Feira de Ciências\", \"Eventos\", \"Sustentabilidade\", \"Projetos\"],\n showFeaturedImage: true,\n showAuthor: true,\n showDate: true,\n showTags: true,\n showReadingTime: true,\n contentMaxWidth: \"720px\",\n },\n } as Block);\n\n if (homeFooter) {\n postPageStructure.push(cloneBlock(homeFooter, \"post-page-footer\"));\n }\n\n newPages.push({\n id: \"blog-post\",\n name: \"Post\",\n slug: \"blog/:slug\",\n pluginId: \"blog\",\n pageTemplateId: \"blog-post\",\n isDynamic: true,\n structure: postPageStructure,\n dataSource: {\n provider: \"blog-posts\",\n mode: \"single\",\n paramMapping: { slug: \":slug\" },\n },\n editRestrictions: {\n lockedStructure: true,\n nonRemovable: true,\n },\n });\n logger.debug(\"Blog post detail page created\");\n }\n\n return {\n ...document,\n pages: newPages,\n };\n },\n\n onDeactivate(document: SiteDocument): SiteDocument {\n logger.debug(\"Blog plugin deactivating...\");\n\n const newPages = document.pages\n // Remover páginas do plugin\n .filter((page) => page.pluginId !== \"blog\")\n // Remover seção de blog injetada na home page\n .map((page) => {\n const hasInjected = page.structure.some(\n (b) => b.id === BLOG_HOME_SECTION_ID,\n );\n if (hasInjected) {\n return {\n ...page,\n structure: page.structure.filter(\n (b) => b.id !== BLOG_HOME_SECTION_ID,\n ),\n };\n }\n return page;\n });\n\n logger.debug(\n `Removed ${document.pages.length - newPages.length} blog page(s) and injected section`,\n );\n\n return {\n ...document,\n pages: newPages,\n };\n },\n\n getEditorRestrictions(blockType: BlockType) {\n if (blockType === \"blogPostDetail\") {\n return {\n lockedFields: [\"content\", \"date\"],\n };\n }\n return undefined;\n },\n};\n\n// Auto-registrar o plugin (side effect — como os blocos fazem com componentRegistry)\npluginRegistry.register(blogPlugin);\n"],"names":["BLOG_HOME_SECTION_ID","SAMPLE_BLOG_CARDS","SAMPLE_POST_CONTENT","cloneBlock","block","newId","blogPlugin","document","logger","existingPageIds","p","newPages","homePage","homeNavbar","b","homeFooter","homeIdx","alreadyInjected","blogHomeSection","updatedStructure","footerIdx","blogPageStructure","postPageStructure","page","blockType","pluginRegistry"],"mappings":";;AAoBA,MAAMA,IAAuB,yBAGvBC,IAAoB;AAAA,EACxB;AAAA,IACE,OAAO;AAAA,IACP,SACE;AAAA,IACF,OACE;AAAA,IACF,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EAAA;AAAA,EAEZ;AAAA,IACE,OAAO;AAAA,IACP,SACE;AAAA,IACF,OACE;AAAA,IACF,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EAAA;AAAA,EAEZ;AAAA,IACE,OAAO;AAAA,IACP,SACE;AAAA,IACF,OACE;AAAA,IACF,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EAAA;AAEd,GAGMC,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B1B,KAAA;AAKF,SAASC,EAAWC,GAAcC,GAAsB;AAEtD,SAAO,EAAE,GADa,KAAK,MAAM,KAAK,UAAUD,CAAK,CAAC,GAClC,IAAIC,EAAA;AAC1B;AAEO,MAAMC,IAAiC;AAAA,EAC5C,UAAU;AAAA,IACR,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM;AAAA,IAEN,cAAc;AAAA,MACZ,QAAQ,CAAC,gBAAgB,gBAAgB,gBAAgB;AAAA,MAEzD,eAAe;AAAA,QACb;AAAA,UACE,IAAI;AAAA,UACJ,MAAM;AAAA,UACN,MAAM;AAAA,UACN,UAAU;AAAA,UACV,WAAW,CAAA;AAAA,UACX,YAAY;AAAA,YAC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A,QACL,cAAc,CAAC,WAAW,MAAM;AAAA,MAAA;AAAA,EAItC;AACF;AAGAC,EAAe,SAASnB,CAAU;"}
|
|
1
|
+
{"version":3,"file":"manifest.js","sources":["../../../../../src/engine/plugins/builtin/blog/manifest.ts"],"sourcesContent":["/**\n * Blog Plugin Manifest\n * Plugin para blog com posts, categorias e tags.\n *\n * onActivate:\n * 1. Injeta seção blogPostGrid na home page (antes do footer)\n * 2. Cria página \"Blog\" com navbar + grid de posts + footer\n * 3. Cria página \"Post\" com navbar + detalhe do post + footer\n *\n * onDeactivate:\n * 1. Remove a seção injetada na home page\n * 2. Remove as páginas do plugin\n */\n\nimport type { PluginRegistration } from \"../../types\";\nimport type { SiteDocument, Block, BlockType } from \"../../../schema/siteDocument\";\nimport { pluginRegistry } from \"../../pluginRegistry\";\nimport { logger } from \"../../../../utils/logger\";\n\n// ─── ID usado para a seção de blog injetada na home page ───\nconst BLOG_HOME_SECTION_ID = \"plugin-blog-home-grid\";\n\n// ─── Sample blog cards para preview ───\nconst SAMPLE_BLOG_CARDS = [\n {\n title: \"Feira de Ciências 2026: Inovação e Criatividade\",\n excerpt:\n \"Nossos alunos apresentaram projetos incríveis na Feira de Ciências deste ano. Confira os destaques e premiações!\",\n image:\n \"https://images.unsplash.com/photo-1567168544230-3b9e5ec47659?w=800&h=400&fit=crop\",\n category: \"Eventos\",\n date: \"05 Fev 2026\",\n linkHref: \"/site/p/blog/feira-de-ciencias-2026\",\n linkText: \"Ler mais\",\n },\n {\n title: \"Matrículas Abertas para o Segundo Semestre\",\n excerpt:\n \"Garanta a vaga do seu filho na melhor escola da região. Condições especiais para matrículas antecipadas.\",\n image:\n \"https://images.unsplash.com/photo-1523050854058-8df90110c9f1?w=800&h=400&fit=crop\",\n category: \"Institucional\",\n date: \"01 Fev 2026\",\n linkHref: \"/site/p/blog/matriculas-segundo-semestre\",\n linkText: \"Ler mais\",\n },\n {\n title: \"5 Dicas para Preparar seu Filho para o Ano Letivo\",\n excerpt:\n \"Dicas práticas para uma transição tranquila e um início de ano produtivo para toda a família.\",\n image:\n \"https://images.unsplash.com/photo-1503676260728-1c00da094a0b?w=800&h=400&fit=crop\",\n category: \"Educação\",\n date: \"28 Jan 2026\",\n linkHref: \"/site/p/blog/dicas-preparar-ano-letivo\",\n linkText: \"Ler mais\",\n },\n];\n\n// ─── Conteúdo HTML rico para o post de exemplo ───\nconst SAMPLE_POST_CONTENT = `\n<h2>O que é a Feira de Ciências?</h2>\n<p>A Feira de Ciências é um evento anual que celebra a curiosidade, a pesquisa e a criatividade dos nossos alunos. Nesta edição especial de 2026, recebemos mais de <strong>500 visitantes</strong> e contamos com a participação de todas as turmas do Ensino Fundamental e Médio.</p>\n<p>Este ano, o tema central foi <em>\"Ciência e Sustentabilidade\"</em>, incentivando os estudantes a desenvolverem projetos que aliassem inovação tecnológica com responsabilidade ambiental.</p>\n\n<h2>Destaques da Edição 2026</h2>\n<p>Entre os mais de 50 projetos apresentados, alguns se destacaram pela originalidade e impacto:</p>\n<ul>\n <li><strong>Jardim Sustentável Inteligente</strong> — Alunos do 5º ano desenvolveram um sistema de irrigação automática usando sensores de umidade e placa Arduino.</li>\n <li><strong>Robótica Educacional</strong> — A turma do 8º ano criou um robô que auxilia no ensino de matemática para crianças do 1º ao 3º ano.</li>\n <li><strong>Energia Solar na Escola</strong> — Projeto do 2º ano do Ensino Médio demonstrou como painéis solares poderiam reduzir em 40% o consumo de energia da escola.</li>\n</ul>\n\n<blockquote>\n <p>\"A Feira de Ciências é um dos momentos mais importantes do nosso calendário escolar. Ver a dedicação e o brilho nos olhos dos alunos ao apresentarem seus projetos nos enche de orgulho e nos motiva a continuar investindo em educação de qualidade.\"</p>\n <p><strong>— Prof. Maria Silva, Coordenadora Pedagógica</strong></p>\n</blockquote>\n\n<h2>Premiações</h2>\n<p>O júri, composto por professores universitários e profissionais da área de tecnologia, selecionou os três melhores projetos:</p>\n<ol>\n <li><strong>1º Lugar:</strong> Jardim Sustentável Inteligente (5º ano)</li>\n <li><strong>2º Lugar:</strong> Energia Solar na Escola (2º EM)</li>\n <li><strong>3º Lugar:</strong> Robótica Educacional (8º ano)</li>\n</ol>\n\n<h2>Próximos Passos</h2>\n<p>Os três projetos finalistas representarão nossa escola na <strong>Feira Regional de Ciências</strong>, que acontecerá em março na capital. Os alunos já estão se preparando para levar suas apresentações a um público ainda maior.</p>\n<p>Parabéns a todos os participantes, professores orientadores e famílias que apoiaram essa jornada de descobertas!</p>\n`.trim();\n\n/**\n * Deep-clone um bloco com novo ID\n */\nfunction cloneBlock(block: Block, newId: string): Block {\n const cloned: Block = JSON.parse(JSON.stringify(block));\n return { ...cloned, id: newId };\n}\n\nexport const blogPlugin: PluginRegistration = {\n manifest: {\n id: \"blog\",\n version: \"1.0.0\",\n name: \"Blog\",\n description: \"Blog com posts, categorias e tags\",\n icon: \"FileText\",\n\n capabilities: {\n blocks: [\"blogPostCard\", \"blogPostGrid\", \"blogPostDetail\", \"blogCategoryFilter\", \"blogSearchBar\"],\n\n pageTemplates: [\n {\n id: \"blog-listing\",\n name: \"Blog\",\n slug: \"blog\",\n pluginId: \"blog\",\n structure: [],\n dataSource: {\n provider: \"blog-posts\",\n mode: \"list\",\n },\n },\n {\n id: \"blog-post\",\n name: \"Post\",\n slug: \"blog/:slug\",\n pluginId: \"blog\",\n structure: [],\n dataSource: {\n provider: \"blog-posts\",\n mode: \"single\",\n paramMapping: { slug: \":slug\" },\n },\n editRestrictions: {\n lockedStructure: true,\n nonRemovable: true,\n },\n },\n ],\n\n dataSchemas: [\n {\n type: \"blog-post\",\n label: \"Blog Post\",\n fields: [\n { name: \"title\", type: \"string\", required: true, label: \"Title\" },\n { name: \"slug\", type: \"string\", required: true, label: \"Slug\" },\n { name: \"excerpt\", type: \"string\", label: \"Excerpt\" },\n { name: \"content\", type: \"richtext\", required: true, label: \"Content\" },\n { name: \"featuredImage\", type: \"image\", label: \"Featured Image\" },\n { name: \"category\", type: \"string\", label: \"Category\" },\n { name: \"tags\", type: \"array\", label: \"Tags\" },\n { name: \"authorVariant\", type: \"string\", label: \"Author Variant\" },\n { name: \"readingTime\", type: \"number\", label: \"Reading Time\" },\n { name: \"metaTitle\", type: \"string\", label: \"Meta Title (SEO)\" },\n { name: \"metaDescription\", type: \"string\", label: \"Meta Description (SEO)\" },\n { name: \"ogImage\", type: \"image\", label: \"Open Graph Image\" },\n ],\n },\n ],\n\n contentProviders: [\"blog-posts\", \"blog-categories\"],\n },\n\n restrictions: {\n lockedFields: {\n blogPostDetail: [\"content\", \"date\"],\n },\n requiredPages: [\"blog-listing\", \"blog-post\"],\n },\n },\n\n onActivate(document: SiteDocument): SiteDocument {\n logger.debug(\"Blog plugin activating...\");\n\n const existingPageIds = new Set(document.pages.map((p) => p.id));\n const newPages = [...document.pages];\n\n // ── Encontrar home page para clonar navbar/footer ──\n const homePage =\n document.pages.find((p) => p.slug === \"home\") || document.pages[0];\n\n const homeNavbar = homePage?.structure.find((b) => b.type === \"navbar\");\n const homeFooter = homePage?.structure.find((b) => b.type === \"footer\");\n\n // ── 1. Adicionar link \"Blog\" à navbar da home page ──\n // Preserva os links existentes e apenas insere \"Blog\" antes do último item.\n if (homePage && homeNavbar) {\n const homeIdx = newPages.findIndex((p) => p.id === homePage.id);\n if (homeIdx >= 0) {\n const navbarProps = homeNavbar.props as Record<string, any>;\n const existingLinks: Array<{ text: string; href: string }> =\n Array.isArray(navbarProps.links) ? [...navbarProps.links] : [];\n const hasBlogLink = existingLinks.some(\n (l) => l.href === \"/p/blog\",\n );\n\n if (!hasBlogLink) {\n // Inserir \"Blog\" antes do último link (geralmente \"Contato\")\n const insertIdx = existingLinks.length > 0 ? existingLinks.length - 1 : 0;\n existingLinks.splice(insertIdx, 0, { text: \"Blog\", href: \"/p/blog\" });\n\n // Atualizar navbar na home page com o novo link\n const updatedStructure = newPages[homeIdx].structure.map((b) => {\n if (b.id === homeNavbar.id) {\n return { ...b, props: { ...b.props, links: existingLinks } } as Block;\n }\n return b;\n });\n newPages[homeIdx] = { ...newPages[homeIdx], structure: updatedStructure };\n logger.debug(\"Blog link added to home navbar\");\n\n // Atualizar referência para que clones nas páginas do blog usem navbar com link\n // (homeNavbar é const, então criamos a versão atualizada para uso nos clones)\n (homeNavbar as any).props = { ...navbarProps, links: existingLinks };\n }\n }\n }\n\n // ── 2. Injetar seção de blog na home page (antes do footer) ──\n if (homePage) {\n const homeIdx = newPages.findIndex((p) => p.id === homePage.id);\n const alreadyInjected = homePage.structure.some(\n (b) => b.id === BLOG_HOME_SECTION_ID,\n );\n\n if (homeIdx >= 0 && !alreadyInjected) {\n const blogHomeSection: Block = {\n id: BLOG_HOME_SECTION_ID,\n type: \"blogPostGrid\",\n props: {\n title: \"Blog\",\n subtitle: \"Últimas publicações\",\n columns: 3,\n cards: SAMPLE_BLOG_CARDS,\n variant: \"default\",\n showViewAll: true,\n viewAllText: \"Ver todos os posts\",\n viewAllHref: \"/site/p/blog\",\n },\n } as Block;\n\n const updatedStructure = [...newPages[homeIdx].structure];\n const footerIdx = updatedStructure.findIndex(\n (b) => b.type === \"footer\",\n );\n\n if (footerIdx >= 0) {\n updatedStructure.splice(footerIdx, 0, blogHomeSection);\n } else {\n updatedStructure.push(blogHomeSection);\n }\n\n newPages[homeIdx] = {\n ...newPages[homeIdx],\n structure: updatedStructure,\n };\n logger.debug(\"Blog section injected into home page\");\n }\n }\n\n // ── 3. Criar página \"Blog\" (listagem completa) ──\n if (!existingPageIds.has(\"blog\")) {\n const blogPageStructure: Block[] = [];\n\n // Navbar clonada da home\n if (homeNavbar) {\n blogPageStructure.push(cloneBlock(homeNavbar, \"blog-page-navbar\"));\n }\n\n // Hero banner do blog\n blogPageStructure.push({\n id: \"blog-page-hero\",\n type: \"hero\",\n props: {\n title: \"Blog\",\n subtitle: \"Novidades & Publicações\",\n description:\n \"Acompanhe as últimas novidades, eventos e conquistas da nossa comunidade escolar.\",\n variant: \"centered\",\n align: \"center\",\n overlay: true,\n overlayColor: \"rgba(79, 70, 229, 0.9)\",\n background: \"#4f46e5\",\n minHeight: \"280px\",\n },\n } as Block);\n\n // Search bar\n blogPageStructure.push({\n id: \"blog-search-bar\",\n type: \"blogSearchBar\",\n props: {\n placeholder: \"Buscar posts...\",\n variant: \"simple\",\n showIcon: true,\n searchUrl: \"/site/p/blog\",\n },\n } as Block);\n\n // Category filter\n blogPageStructure.push({\n id: \"blog-category-filter\",\n type: \"blogCategoryFilter\",\n props: {\n title: \"\",\n categories: SAMPLE_BLOG_CARDS.map((c) => ({\n name: c.category,\n slug: c.category.toLowerCase().replace(/\\s+/g, \"-\"),\n count: 1,\n })),\n variant: \"chips\",\n showCount: false,\n showAll: true,\n allLabel: \"Todas\",\n filterUrl: \"/site/p/blog\",\n },\n } as Block);\n\n // Grid de posts\n blogPageStructure.push({\n id: \"blog-grid-main\",\n type: \"blogPostGrid\",\n props: {\n title: \"\",\n subtitle: \"\",\n columns: 3,\n cards: SAMPLE_BLOG_CARDS,\n variant: \"default\",\n showViewAll: false,\n viewAllText: \"Ver todos\",\n viewAllHref: \"/site/p/blog\",\n },\n } as Block);\n\n // Footer clonado da home\n if (homeFooter) {\n blogPageStructure.push(cloneBlock(homeFooter, \"blog-page-footer\"));\n }\n\n newPages.push({\n id: \"blog\",\n name: \"Blog\",\n slug: \"blog\",\n pluginId: \"blog\",\n pageTemplateId: \"blog-listing\",\n structure: blogPageStructure,\n dataSource: {\n provider: \"blog-posts\",\n mode: \"list\",\n },\n });\n logger.debug(\"Blog listing page created\");\n }\n\n // ── 4. Criar página \"Post\" (detalhe) ──\n if (!existingPageIds.has(\"blog-post\")) {\n const postPageStructure: Block[] = [];\n\n if (homeNavbar) {\n postPageStructure.push(cloneBlock(homeNavbar, \"post-page-navbar\"));\n }\n\n postPageStructure.push({\n id: \"blog-detail-main\",\n type: \"blogPostDetail\",\n props: {\n title: \"Feira de Ciências 2026: Inovação e Criatividade\",\n content: SAMPLE_POST_CONTENT,\n featuredImage:\n \"https://images.unsplash.com/photo-1567168544230-3b9e5ec47659?w=1200&h=600&fit=crop\",\n date: \"05 Fev 2026\",\n category: \"Eventos\",\n authorVariant: \"inline\",\n readingTime: \"5 min de leitura\",\n tags: [\"Feira de Ciências\", \"Eventos\", \"Sustentabilidade\", \"Projetos\"],\n showFeaturedImage: true,\n showAuthor: true,\n showDate: true,\n showTags: true,\n showReadingTime: true,\n contentMaxWidth: \"720px\",\n },\n } as Block);\n\n if (homeFooter) {\n postPageStructure.push(cloneBlock(homeFooter, \"post-page-footer\"));\n }\n\n newPages.push({\n id: \"blog-post\",\n name: \"Post\",\n slug: \"blog/:slug\",\n pluginId: \"blog\",\n pageTemplateId: \"blog-post\",\n isDynamic: true,\n structure: postPageStructure,\n dataSource: {\n provider: \"blog-posts\",\n mode: \"single\",\n paramMapping: { slug: \":slug\" },\n },\n editRestrictions: {\n lockedStructure: true,\n nonRemovable: true,\n },\n });\n logger.debug(\"Blog post detail page created\");\n }\n\n return {\n ...document,\n pages: newPages,\n };\n },\n\n onDeactivate(document: SiteDocument): SiteDocument {\n logger.debug(\"Blog plugin deactivating...\");\n\n const newPages = document.pages\n // Remover páginas do plugin\n .filter((page) => page.pluginId !== \"blog\")\n // Remover seção de blog injetada + link \"Blog\" da navbar\n .map((page) => {\n let structure = page.structure;\n\n // Remover seção de blog injetada\n const hasInjected = structure.some(\n (b) => b.id === BLOG_HOME_SECTION_ID,\n );\n if (hasInjected) {\n structure = structure.filter(\n (b) => b.id !== BLOG_HOME_SECTION_ID,\n );\n }\n\n // Remover link \"Blog\" (/p/blog) da navbar\n structure = structure.map((b) => {\n if (b.type !== \"navbar\") return b;\n const props = b.props as Record<string, any>;\n const links: Array<{ text: string; href: string }> = Array.isArray(props.links) ? props.links : [];\n const filtered = links.filter((l) => l.href !== \"/p/blog\");\n if (filtered.length !== links.length) {\n return { ...b, props: { ...props, links: filtered } } as Block;\n }\n return b;\n });\n\n if (structure !== page.structure) {\n return { ...page, structure };\n }\n return page;\n });\n\n logger.debug(\n `Removed ${document.pages.length - newPages.length} blog page(s) and injected section`,\n );\n\n return {\n ...document,\n pages: newPages,\n };\n },\n\n getEditorRestrictions(blockType: BlockType) {\n if (blockType === \"blogPostDetail\") {\n return {\n lockedFields: [\"content\", \"date\"],\n };\n }\n if (blockType === \"blogCategoryFilter\") {\n return {\n lockedFields: [\"categories\"],\n };\n }\n return undefined;\n },\n};\n\n// Auto-registrar o plugin (side effect — como os blocos fazem com componentRegistry)\npluginRegistry.register(blogPlugin);\n"],"names":["BLOG_HOME_SECTION_ID","SAMPLE_BLOG_CARDS","SAMPLE_POST_CONTENT","cloneBlock","block","newId","blogPlugin","document","logger","existingPageIds","p","newPages","homePage","homeNavbar","b","homeFooter","homeIdx","navbarProps","existingLinks","l","insertIdx","updatedStructure","alreadyInjected","blogHomeSection","footerIdx","blogPageStructure","c","postPageStructure","page","structure","props","links","filtered","blockType","pluginRegistry"],"mappings":";;AAoBA,MAAMA,IAAuB,yBAGvBC,IAAoB;AAAA,EACxB;AAAA,IACE,OAAO;AAAA,IACP,SACE;AAAA,IACF,OACE;AAAA,IACF,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EAAA;AAAA,EAEZ;AAAA,IACE,OAAO;AAAA,IACP,SACE;AAAA,IACF,OACE;AAAA,IACF,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EAAA;AAAA,EAEZ;AAAA,IACE,OAAO;AAAA,IACP,SACE;AAAA,IACF,OACE;AAAA,IACF,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EAAA;AAEd,GAGMC,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6B1B,KAAA;AAKF,SAASC,EAAWC,GAAcC,GAAs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AAA,QACL,cAAc,CAAC,YAAY;AAAA,MAAA;AAAA,EAIjC;AACF;AAGAC,EAAe,SAAS5B,CAAU;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockContentProvider.d.ts","sourceRoot":"","sources":["../../../../../src/engine/plugins/builtin/blog/mockContentProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EAKhB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"mockContentProvider.d.ts","sourceRoot":"","sources":["../../../../../src/engine/plugins/builtin/blog/mockContentProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EAKhB,MAAM,aAAa,CAAC;AAqHrB;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,eAiDrC,CAAC"}
|