@cbjk_iris/schema 0.0.0-stage → 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 lf-kali
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,52 @@
1
+ Iris (cbjk_iris)
2
+ Copyright (c) 2026 lf-kali
3
+ Licenciado sob a MIT License (ver LICENSE).
4
+
5
+ Este projeto redistribui material de terceiros sob outras licenças, listado abaixo.
6
+
7
+ --------------------------------------------------------------------------------
8
+ Temas do tweakcn
9
+ --------------------------------------------------------------------------------
10
+
11
+ Os arquivos abaixo foram gerados a partir dos temas do tweakcn
12
+ (https://tweakcn.com, código-fonte em https://github.com/jnsahaj/tweakcn),
13
+ licenciados sob a Apache License, Version 2.0:
14
+
15
+ packages/engine/themes/caffeine.css (https://tweakcn.com/r/themes/caffeine.json)
16
+ packages/engine/themes/elegant-luxury.css (https://tweakcn.com/r/themes/elegant-luxury.json)
17
+ packages/engine/themes/modern-minimal.css (https://tweakcn.com/r/themes/modern-minimal.json)
18
+ packages/engine/themes/ocean-breeze.css (https://tweakcn.com/r/themes/ocean-breeze.json)
19
+
20
+ No pacote publicado @cbjk_iris/engine, os mesmos arquivos ficam em themes/.
21
+
22
+ Modificação feita: os valores do JSON do registro do tweakcn foram convertidos
23
+ para CSS (blocos :root e .dark) pelo script de importação de temas do Iris, com
24
+ um comentário de origem no topo de cada arquivo.
25
+
26
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
27
+ these files except in compliance with the License. You may obtain a copy of the
28
+ License at
29
+
30
+ http://www.apache.org/licenses/LICENSE-2.0
31
+
32
+ Unless required by applicable law or agreed to in writing, software distributed
33
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
34
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
35
+ specific language governing permissions and limitations under the License.
36
+
37
+ Os outros 6 temas de packages/engine/themes/ (gray, neutral, slate, stone, taupe, zinc) são
38
+ paletas do shadcn/ui (https://ui.shadcn.com), sob a MIT License, e não entram
39
+ neste aviso.
40
+
41
+ --------------------------------------------------------------------------------
42
+ CSS do pacote shadcn
43
+ --------------------------------------------------------------------------------
44
+
45
+ packages/core/styles/shadcn-tailwind.css
46
+
47
+ Cópia sem alterações de dist/tailwind.css do pacote npm shadcn 4.15.0
48
+ (https://github.com/shadcn-ui/ui), sob a MIT License. O aviso de copyright e a
49
+ licença completa estão no comentário do topo do próprio arquivo, que vai junto
50
+ no pacote publicado @cbjk_iris/core (styles/shadcn-tailwind.css).
51
+
52
+ MIT License, Copyright (c) 2023 shadcn
@@ -0,0 +1,116 @@
1
+ //#region src/constants.ts
2
+ /** Plataformas de compra, na ordem nativa (Q-07). */
3
+ const PURCHASE_PLATFORMS = [
4
+ "whatsapp",
5
+ "mercadoLivre",
6
+ "shopee",
7
+ "amazon",
8
+ "external"
9
+ ];
10
+ /** Ordem padrão dos botões de compra; vale quando commerce.buttonOrder está ausente. */
11
+ const DEFAULT_BUTTON_ORDER = Object.freeze([...PURCHASE_PLATFORMS]);
12
+ /**
13
+ * Completa commerce.buttonOrder: as plataformas que faltam vão para o fim, na ordem de
14
+ * DEFAULT_BUTTON_ORDER. Não confere repetição (isso é validação do siteConfigSchema).
15
+ */
16
+ function completeButtonOrder(order) {
17
+ const list = order ?? [];
18
+ return [...list, ...DEFAULT_BUTTON_ORDER.filter((p) => !list.includes(p))];
19
+ }
20
+ /** Ícones disponíveis para benefícios (lista fixa do lucide, ver core/src/sections/icons.ts). */
21
+ const SECTION_ICONS = [
22
+ "shield-check",
23
+ "badge-check",
24
+ "award",
25
+ "star",
26
+ "thumbs-up",
27
+ "heart",
28
+ "gem",
29
+ "clock",
30
+ "timer",
31
+ "calendar",
32
+ "truck",
33
+ "package",
34
+ "credit-card",
35
+ "hand-coins",
36
+ "wrench",
37
+ "hammer",
38
+ "ruler",
39
+ "paint-roller",
40
+ "house",
41
+ "zap",
42
+ "droplets",
43
+ "lightbulb",
44
+ "leaf",
45
+ "recycle",
46
+ "users",
47
+ "headset",
48
+ "phone",
49
+ "message-circle",
50
+ "map-pin",
51
+ "sparkles"
52
+ ];
53
+ /** Campos do formulário de lead. */
54
+ const LEAD_FIELDS = [
55
+ "name",
56
+ "phone",
57
+ "email",
58
+ "message"
59
+ ];
60
+ const SOCIAL_NETWORKS = [
61
+ "instagram",
62
+ "facebook",
63
+ "youtube",
64
+ "tiktok",
65
+ "whatsapp",
66
+ "x",
67
+ "pinterest",
68
+ "threads",
69
+ "linkedin"
70
+ ];
71
+ /** Variáveis de cor do tema (formato do shadcn/tweakcn). */
72
+ const COLOR_TOKENS = [
73
+ "background",
74
+ "foreground",
75
+ "card",
76
+ "card-foreground",
77
+ "popover",
78
+ "popover-foreground",
79
+ "primary",
80
+ "primary-foreground",
81
+ "cta",
82
+ "cta-foreground",
83
+ "highlight",
84
+ "highlight-foreground",
85
+ "secondary",
86
+ "secondary-foreground",
87
+ "muted",
88
+ "muted-foreground",
89
+ "accent",
90
+ "accent-foreground",
91
+ "destructive",
92
+ "border",
93
+ "input",
94
+ "ring",
95
+ "chart-1",
96
+ "chart-2",
97
+ "chart-3",
98
+ "chart-4",
99
+ "chart-5",
100
+ "sidebar",
101
+ "sidebar-foreground",
102
+ "sidebar-primary",
103
+ "sidebar-primary-foreground",
104
+ "sidebar-accent",
105
+ "sidebar-accent-foreground",
106
+ "sidebar-border",
107
+ "sidebar-ring"
108
+ ];
109
+ /** "system": começa pelo tema do sistema e mostra o botão de troca. "light" | "dark": fixo. */
110
+ const COLOR_MODES = [
111
+ "system",
112
+ "light",
113
+ "dark"
114
+ ];
115
+ //#endregion
116
+ export { PURCHASE_PLATFORMS as a, completeButtonOrder as c, LEAD_FIELDS as i, COLOR_TOKENS as n, SECTION_ICONS as o, DEFAULT_BUTTON_ORDER as r, SOCIAL_NETWORKS as s, COLOR_MODES as t };
@@ -0,0 +1,160 @@
1
+ import { c as completeButtonOrder } from "./constants-C4TYxqGV.mjs";
2
+ //#region src/modules.ts
3
+ const MODULES = [
4
+ {
5
+ id: "products",
6
+ name: "Produtos",
7
+ routes: ["produtos", "produto/[slug]"],
8
+ menu: ["/produtos"],
9
+ contentDir: "content/products"
10
+ },
11
+ {
12
+ id: "services",
13
+ name: "Serviços",
14
+ routes: ["servicos", "servico/[slug]"],
15
+ menu: ["/servicos"],
16
+ contentDir: "content/services"
17
+ },
18
+ {
19
+ id: "gallery",
20
+ name: "Últimos projetos",
21
+ routes: ["ultimos-projetos"],
22
+ menu: ["/ultimos-projetos"],
23
+ contentDir: "public/ultimos_projetos"
24
+ }
25
+ ];
26
+ const MODULE_IDS = Object.freeze(MODULES.map((m) => m.id));
27
+ /** Módulos ativos quando siteConfig.modules está ausente (o comportamento de antes). */
28
+ const DEFAULT_MODULES = MODULE_IDS;
29
+ //#endregion
30
+ //#region src/texts-defaults.ts
31
+ function deepFreeze(value) {
32
+ if (value && typeof value === "object") {
33
+ Object.values(value).forEach(deepFreeze);
34
+ Object.freeze(value);
35
+ }
36
+ return value;
37
+ }
38
+ const DEFAULT_TEXTS = deepFreeze({
39
+ headerCta: "Faça seu orçamento!",
40
+ products: {
41
+ title: "Produtos",
42
+ count: "{count} produtos disponíveis",
43
+ notFound: "Produto não encontrado",
44
+ buy: "Comprar agora",
45
+ whatsappNotice: "Você será direcionado ao WhatsApp da {business} com uma mensagem já preenchida para fechar os detalhes da compra.",
46
+ onSale: "Oferta",
47
+ madeToOrder: "Sob encomenda",
48
+ installment: "ou {count}x de {value}",
49
+ interestFree: "sem juros",
50
+ paymentMethods: "Pix, Débito ou Crédito",
51
+ noImage: "Sem imagem",
52
+ buttons: {
53
+ whatsapp: "Comprar pelo WhatsApp",
54
+ mercadoLivre: "Comprar no Mercado Livre",
55
+ shopee: "Comprar na Shopee",
56
+ amazon: "Comprar na Amazon",
57
+ external: "Comprar no site"
58
+ },
59
+ cardLabel: "{buy} ({platform})",
60
+ platforms: {
61
+ whatsapp: "WhatsApp",
62
+ mercadoLivre: "Mercado Livre",
63
+ shopee: "Shopee",
64
+ amazon: "Amazon",
65
+ external: "site"
66
+ }
67
+ },
68
+ services: {
69
+ title: "Serviços",
70
+ count: "{count} serviços disponíveis",
71
+ notFound: "Serviço não encontrado",
72
+ quote: "Peça seu orçamento",
73
+ whatsappNotice: "Você será direcionado ao WhatsApp da {business} com uma mensagem já preenchida para pedir seu orçamento.",
74
+ cardLink: "Ver detalhes e pedir orçamento →"
75
+ },
76
+ detail: {
77
+ description: "Descrição",
78
+ specs: "Especificações"
79
+ },
80
+ gallery: {
81
+ title: "Últimos projetos",
82
+ empty: "Em breve, fotos dos nossos projetos."
83
+ },
84
+ sections: {
85
+ seeAll: "Ver todos",
86
+ contact: {
87
+ phone: "Telefone",
88
+ email: "E-mail",
89
+ address: "Endereço",
90
+ hours: "Horário de atendimento",
91
+ whatsapp: "Falar no WhatsApp",
92
+ mapTitle: "Mapa com a nossa localização"
93
+ }
94
+ },
95
+ leadForm: {
96
+ name: "Nome",
97
+ phone: "Telefone / WhatsApp",
98
+ email: "E-mail",
99
+ message: "Mensagem",
100
+ submit: "Enviar",
101
+ sending: "Enviando...",
102
+ success: "Recebemos sua mensagem! Entraremos em contato em breve.",
103
+ error: "Não foi possível enviar agora. Tente de novo ou fale com a gente pelo WhatsApp.",
104
+ whatsappIntro: "Olá! Vim pelo site e gostaria de um orçamento."
105
+ },
106
+ footer: {
107
+ menu: "Navegação",
108
+ contact: "Contato",
109
+ copyright: "© {year} {name}. Todos os direitos reservados."
110
+ }
111
+ });
112
+ const isPlain = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
113
+ function merge(base, patch) {
114
+ const out = {};
115
+ for (const [key, value] of Object.entries(base)) {
116
+ const next = patch?.[key];
117
+ out[key] = isPlain(value) ? merge(value, isPlain(next) ? next : void 0) : next === void 0 ? value : next;
118
+ }
119
+ return out;
120
+ }
121
+ /**
122
+ * Mescla os textos do cliente com DEFAULT_TEXTS. Fallback obsoleto: products.buyOnWhatsapp vale
123
+ * como products.buttons.whatsapp quando este falta; na saída, buyOnWhatsapp é sempre igual a ele.
124
+ */
125
+ function resolveTexts(partial) {
126
+ const merged = merge(DEFAULT_TEXTS, partial);
127
+ const legacy = partial?.products?.buyOnWhatsapp;
128
+ const whatsapp = partial?.products?.buttons?.whatsapp ?? legacy ?? merged.products.buttons.whatsapp;
129
+ return {
130
+ ...merged,
131
+ products: {
132
+ ...merged.products,
133
+ buttons: {
134
+ ...merged.products.buttons,
135
+ whatsapp
136
+ },
137
+ buyOnWhatsapp: whatsapp
138
+ }
139
+ };
140
+ }
141
+ //#endregion
142
+ //#region src/defaults.ts
143
+ /**
144
+ * Preenche os padrões de um config JÁ VALIDADO, sem validar. Dá o mesmo resultado de
145
+ * siteConfigSchema.parse para um config válido (teste de equivalência em site-config.test.ts).
146
+ * Não muta a entrada.
147
+ */
148
+ function applySiteConfigDefaults(input) {
149
+ return {
150
+ ...input,
151
+ modules: [...input.modules ?? DEFAULT_MODULES],
152
+ commerce: {
153
+ ...input.commerce,
154
+ buttonOrder: completeButtonOrder(input.commerce?.buttonOrder)
155
+ },
156
+ texts: resolveTexts(input.texts)
157
+ };
158
+ }
159
+ //#endregion
160
+ export { MODULES as a, DEFAULT_MODULES as i, DEFAULT_TEXTS as n, MODULE_IDS as o, resolveTexts as r, applySiteConfigDefaults as t };