create-rubrica 2.0.0 → 2.1.1

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.
Files changed (2) hide show
  1. package/dist/index.js +555 -75
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -496,7 +496,7 @@ var init_telemetry = __esm({
496
496
  TELEMETRY_DOCS = "https://userubrica.vercel.app/docs/guia/telemetria";
497
497
  TELEMETRY_TIMEOUT_MS = 2e3;
498
498
  FORMAT_VERSION = 1;
499
- CLI_VERSION = true ? "2.0.0" : "0.0.0";
499
+ CLI_VERSION = true ? "2.1.1" : "0.0.0";
500
500
  OFF_VALUES = ["0", "false", "nao", "n\xE3o", "off", "desligada", "desligado"];
501
501
  isOn = (value) => value !== void 0 && value !== "" && !["0", "false"].includes(value.toLowerCase());
502
502
  NOTICE = `O Rubrica manda, sem dados pessoais, as escolhas feitas no CLI (tipo, tema, cores, plugins) para saber o que as pessoas mais usam.
@@ -586,17 +586,18 @@ async function evaluateInProject(projectDir, code) {
586
586
  }
587
587
  }
588
588
  function findPackageDir(fromDir, pkg) {
589
+ let dir = fromDir;
590
+ for (; ; ) {
591
+ const candidate = join3(dir, "node_modules", pkg);
592
+ if (existsSync2(join3(candidate, "package.json"))) return candidate;
593
+ const parent = dirname2(dir);
594
+ if (parent === dir) break;
595
+ dir = parent;
596
+ }
589
597
  try {
590
598
  return dirname2(createRequire(join3(fromDir, "package.json")).resolve(`${pkg}/package.json`));
591
599
  } catch {
592
- let dir = fromDir;
593
- for (; ; ) {
594
- const candidate = join3(dir, "node_modules", pkg);
595
- if (existsSync2(join3(candidate, "package.json"))) return candidate;
596
- const parent = dirname2(dir);
597
- if (parent === dir) return null;
598
- dir = parent;
599
- }
600
+ return null;
600
601
  }
601
602
  }
602
603
  function installedVersion(projectDir, pkg) {
@@ -933,7 +934,7 @@ var init_package = __esm({
933
934
  "../core/package.json"() {
934
935
  package_default = {
935
936
  name: "@rubrica/core",
936
- version: "2.0.0",
937
+ version: "2.1.1",
937
938
  description: "N\xFAcleo do Rubrica: contrato de blocos e temas, idiomas, integra\xE7\xE3o Astro, backend Convex, painel e MCP.",
938
939
  type: "module",
939
940
  license: "GPL-3.0-only",
@@ -996,7 +997,7 @@ var init_package = __esm({
996
997
  "@types/node": "^22.0.0",
997
998
  "@types/react": "^19.2.0",
998
999
  "@types/react-dom": "^19.2.0",
999
- astro: "^7.4.7",
1000
+ astro: "^7.4.11",
1000
1001
  convex: "^1.49.0",
1001
1002
  "convex-test": "^0.0.67",
1002
1003
  "happy-dom": "^21.0.4",
@@ -1032,7 +1033,7 @@ var init_package2 = __esm({
1032
1033
  "../mcp/package.json"() {
1033
1034
  package_default2 = {
1034
1035
  name: "@rubrica/mcp",
1035
- version: "2.0.0",
1036
+ version: "2.0.2",
1036
1037
  description: "Servidor MCP local do Rubrica: o agente edita p\xE1ginas, blocos e cole\xE7\xF5es do site pelo Convex do projeto, com o login de um usu\xE1rio do painel.",
1037
1038
  type: "module",
1038
1039
  license: "GPL-3.0-only",
@@ -1062,6 +1063,7 @@ var init_package2 = __esm({
1062
1063
  },
1063
1064
  scripts: {
1064
1065
  build: "tsup",
1066
+ prepublishOnly: "pnpm run build",
1065
1067
  check: "tsc --noEmit -p tsconfig.json",
1066
1068
  test: "vitest run"
1067
1069
  },
@@ -1103,7 +1105,13 @@ var init_i18n = __esm({
1103
1105
  });
1104
1106
 
1105
1107
  // ../core/src/i18n/ui-texts.ts
1106
- var APP_UI_TEXTS, DEFAULT_UI_TEXTS;
1108
+ function defaultUiText(key, locale, kind) {
1109
+ const entry = kind === "empresa" && EMPRESA_UI_TEXTS[key] || DEFAULT_UI_TEXTS[key];
1110
+ if (!entry) return void 0;
1111
+ const base3 = locale.split("-")[0].toLowerCase();
1112
+ return entry[locale] ?? entry[base3] ?? entry.en;
1113
+ }
1114
+ var APP_UI_TEXTS, DEFAULT_UI_TEXTS, EMPRESA_UI_TEXTS;
1107
1115
  var init_ui_texts = __esm({
1108
1116
  "../core/src/i18n/ui-texts.ts"() {
1109
1117
  "use strict";
@@ -1309,24 +1317,64 @@ var init_ui_texts = __esm({
1309
1317
  "nav.menu": { pt: "Menu", en: "Menu", es: "Men\xFA" },
1310
1318
  "sidebar.contact": { pt: "Contato", en: "Contact", es: "Contacto" },
1311
1319
  "sidebar.talk": { pt: "Fale comigo", en: "Talk to me", es: "Hablemos" },
1320
+ "sidebar.downloadCV": { pt: "Baixar CV", en: "Download CV", es: "Descargar CV" },
1312
1321
  "nav.language": { pt: "Idioma", en: "Language", es: "Idioma" },
1313
1322
  "theme.toggle": { pt: "Alternar tema claro e escuro", en: "Toggle light and dark theme", es: "Cambiar tema claro y oscuro" },
1314
1323
  "common.readMore": { pt: "Ler mais", en: "Read more", es: "Leer m\xE1s" },
1315
1324
  "common.back": { pt: "Voltar", en: "Back", es: "Volver" },
1325
+ "common.close": { pt: "Fechar", en: "Close", es: "Cerrar" },
1316
1326
  "blog.readingTime": { pt: "{minutes} min de leitura", en: "{minutes} min read", es: "{minutes} min de lectura" },
1317
1327
  "blog.publishedAt": { pt: "Publicado em {date}", en: "Published on {date}", es: "Publicado el {date}" },
1318
1328
  "blog.related": { pt: "Leia tamb\xE9m", en: "Read next", es: "Lee tambi\xE9n" },
1319
1329
  "blog.allTags": { pt: "Todos", en: "All", es: "Todos" },
1330
+ // Lista e post do blog como na v1 (busca, destaques, RSS, autor e case relacionado).
1331
+ "blog.search": { pt: "Buscar artigos...", en: "Search articles...", es: "Buscar art\xEDculos..." },
1332
+ "blog.searchEmpty": { pt: "Nenhum artigo encontrado.", en: "No articles found.", es: "No se encontraron art\xEDculos." },
1333
+ "blog.featured": { pt: "Em destaque", en: "Featured", es: "Destacados" },
1334
+ "blog.featuredPrev": { pt: "Destaque anterior", en: "Previous featured post", es: "Destacado anterior" },
1335
+ "blog.featuredNext": { pt: "Pr\xF3ximo destaque", en: "Next featured post", es: "Siguiente destacado" },
1336
+ "blog.readNow": { pt: "Ler agora", en: "Read now", es: "Leer ahora" },
1337
+ "blog.rss": { pt: "RSS", en: "RSS", es: "RSS" },
1338
+ "blog.rssSubscribe": { pt: "Assinar o feed RSS", en: "Subscribe to the RSS feed", es: "Suscribirse al feed RSS" },
1339
+ "blog.back": { pt: "Voltar para o blog", en: "Back to the blog", es: "Volver al blog" },
1340
+ "blog.authorLine": { pt: "Escrevo sobre o que construo e lidero na pr\xE1tica.", en: "I write about what I build and lead in practice.", es: "Escribo sobre lo que construyo y lidero en la pr\xE1ctica." },
1341
+ "blog.authorCta": { pt: "Fale comigo", en: "Get in touch", es: "Hablemos" },
1342
+ "blog.relatedCase": { pt: "Case relacionado", en: "Related case study", es: "Caso relacionado" },
1343
+ "blog.readCase": { pt: "Ler o case", en: "Read the case study", es: "Leer el caso" },
1320
1344
  "case.related": { pt: "Outros projetos", en: "More projects", es: "Otros proyectos" },
1321
1345
  "case.client": { pt: "Cliente", en: "Client", es: "Cliente" },
1322
1346
  "case.year": { pt: "Ano", en: "Year", es: "A\xF1o" },
1323
1347
  "case.role": { pt: "Papel", en: "Role", es: "Rol" },
1348
+ "case.myRole": { pt: "Meu papel", en: "My role", es: "Mi rol" },
1349
+ "case.back": { pt: "Voltar ao portf\xF3lio", en: "Back to the portfolio", es: "Volver al portafolio" },
1350
+ "case.gallery": { pt: "Imagens do projeto", en: "Project images", es: "Im\xE1genes del proyecto" },
1351
+ "case.metrics": { pt: "Resultados em n\xFAmeros", en: "Results by the numbers", es: "Resultados en n\xFAmeros" },
1352
+ "case.details": { pt: "Ver detalhes", en: "View details", es: "Ver detalles" },
1353
+ "case.next": { pt: "Pr\xF3ximo case", en: "Next case study", es: "Siguiente caso" },
1354
+ "case.ctaTitle": { pt: "Precisa de algo parecido?", en: "Need something similar?", es: "\xBFNecesitas algo parecido?" },
1355
+ "case.ctaBody": {
1356
+ pt: "Conte o contexto do seu projeto e eu respondo com os pr\xF3ximos passos.",
1357
+ en: "Share your project context and I'll reply with the next steps.",
1358
+ es: "Cu\xE9ntame el contexto de tu proyecto y te respondo con los pr\xF3ximos pasos."
1359
+ },
1360
+ "case.ctaButton": { pt: "Falar sobre um projeto", en: "Talk about a project", es: "Hablar de un proyecto" },
1361
+ "cases.filter": { pt: "Filtrar por categoria", en: "Filter by category", es: "Filtrar por categor\xEDa" },
1362
+ "cases.all": { pt: "Todos", en: "All", es: "Todos" },
1363
+ "gallery.expand": { pt: "Expandir imagem", en: "Expand image", es: "Ampliar imagen" },
1364
+ "gallery.prev": { pt: "Imagem anterior", en: "Previous image", es: "Imagen anterior" },
1365
+ "gallery.next": { pt: "Pr\xF3xima imagem", en: "Next image", es: "Imagen siguiente" },
1366
+ "gallery.position": { pt: "{current} de {total}", en: "{current} of {total}", es: "{current} de {total}" },
1367
+ "gallery.close": { pt: "Fechar", en: "Close", es: "Cerrar" },
1324
1368
  "resume.download": { pt: "Baixar curr\xEDculo em PDF", en: "Download r\xE9sum\xE9 (PDF)", es: "Descargar CV en PDF" },
1325
1369
  "resume.experience": { pt: "Experi\xEAncia", en: "Experience", es: "Experiencia" },
1326
1370
  "resume.education": { pt: "Forma\xE7\xE3o", en: "Education", es: "Formaci\xF3n" },
1327
1371
  "resume.skill": { pt: "Compet\xEAncias", en: "Skills", es: "Habilidades" },
1328
1372
  "resume.certification": { pt: "Certifica\xE7\xF5es", en: "Certifications", es: "Certificaciones" },
1329
1373
  "resume.language": { pt: "Idiomas", en: "Languages", es: "Idiomas" },
1374
+ "resume.volunteer": { pt: "Voluntariado", en: "Volunteer work", es: "Voluntariado" },
1375
+ "resume.soft-skill": { pt: "Compet\xEAncias comportamentais", en: "Soft skills", es: "Habilidades blandas" },
1376
+ "resume.showOlder": { pt: "Ver experi\xEAncias anteriores ({count})", en: "Show earlier experience ({count})", es: "Ver experiencias anteriores ({count})" },
1377
+ "resume.hideOlder": { pt: "Ocultar experi\xEAncias anteriores", en: "Hide earlier experience", es: "Ocultar experiencias anteriores" },
1330
1378
  "resume.present": { pt: "atual", en: "present", es: "actual" },
1331
1379
  "pricing.highlighted": { pt: "Mais escolhido", en: "Most popular", es: "M\xE1s elegido" },
1332
1380
  "location.hours": { pt: "Hor\xE1rio", en: "Opening hours", es: "Horario" },
@@ -1342,6 +1390,9 @@ var init_ui_texts = __esm({
1342
1390
  "case.view": { pt: "Ver case", en: "View case study", es: "Ver caso" },
1343
1391
  "blog.filter": { pt: "Filtrar por etiqueta", en: "Filter by tag", es: "Filtrar por etiqueta" },
1344
1392
  "testimonials.send": { pt: "Enviar um depoimento", en: "Send a testimonial", es: "Enviar un testimonio" },
1393
+ /** Quantos depoimentos a lista mostra ("(7 depoimentos)" ao lado do apoio, na v1). */
1394
+ "testimonials.count": { pt: "{count} depoimentos", en: "{count} testimonials", es: "{count} testimonios" },
1395
+ "testimonials.countOne": { pt: "1 depoimento", en: "1 testimonial", es: "1 testimonio" },
1345
1396
  "contact.phone": { pt: "Telefone", en: "Phone", es: "Tel\xE9fono" },
1346
1397
  "contact.channels": { pt: "Outros canais", en: "Other channels", es: "Otros canales" },
1347
1398
  "contact.social": { pt: "Redes", en: "Social", es: "Redes" },
@@ -1390,6 +1441,12 @@ var init_ui_texts = __esm({
1390
1441
  "contactForm.topic.job": { pt: "Tenho uma vaga", en: "I have a job opening", es: "Tengo una vacante" },
1391
1442
  "contactForm.topic.talk": { pt: "Quero trocar uma ideia", en: "I'd like to chat", es: "Quiero conversar" },
1392
1443
  "contactForm.topic.other": { pt: "Outro assunto", en: "Something else", es: "Otro asunto" },
1444
+ "contactForm.close": { pt: "Fechar", en: "Close", es: "Cerrar" },
1445
+ "contactForm.summary": { pt: "Revise e envie", en: "Review and send", es: "Revisa y env\xEDa" },
1446
+ "contactForm.summaryTopic": { pt: "Assunto", en: "Topic", es: "Asunto" },
1447
+ "contactForm.summaryContact": { pt: "Contato", en: "Contact", es: "Contacto" },
1448
+ "contactForm.linkedin": { pt: "LinkedIn", en: "LinkedIn", es: "LinkedIn" },
1449
+ "contactForm.company": { pt: "Empresa", en: "Company", es: "Empresa" },
1393
1450
  "contactForm.success": { pt: "Mensagem enviada.", en: "Message sent.", es: "Mensaje enviado." },
1394
1451
  "contactForm.successBody": { pt: "Obrigado pelo contato. Respondo assim que poss\xEDvel.", en: "Thanks for reaching out. I'll reply as soon as I can.", es: "Gracias por escribir. Responder\xE9 lo antes posible." },
1395
1452
  "testimonialForm.open": { pt: "Enviar um depoimento", en: "Send a testimonial", es: "Enviar un testimonio" },
@@ -1409,8 +1466,37 @@ var init_ui_texts = __esm({
1409
1466
  es: "La direcci\xF3n puede haber cambiado o la p\xE1gina no existe en este idioma."
1410
1467
  },
1411
1468
  "notFound.home": { pt: "Ir para a p\xE1gina inicial", en: "Go to the home page", es: "Ir a la p\xE1gina de inicio" },
1469
+ /** Rótulo e código de erro da tela de 404 em terminal (temas padrão e cyberpunk, como a v1). */
1470
+ "notFound.label": { pt: "Erro do sistema", en: "System error", es: "Error del sistema" },
1471
+ "notFound.code": { pt: "ERR_ROTA_NAO_ENCONTRADA", en: "ERR_ROUTE_NOT_FOUND", es: "ERR_RUTA_NO_ENCONTRADA" },
1412
1472
  ...APP_UI_TEXTS
1413
1473
  };
1474
+ EMPRESA_UI_TEXTS = {
1475
+ "sidebar.talk": { pt: "Fale conosco", en: "Talk to us", es: "Hablemos" },
1476
+ "case.myRole": { pt: "Nosso papel", en: "Our role", es: "Nuestro rol" },
1477
+ "case.back": { pt: "Voltar aos cases", en: "Back to the case studies", es: "Volver a los casos" },
1478
+ "case.ctaBody": {
1479
+ pt: "Conte o contexto do seu projeto e respondemos com os pr\xF3ximos passos.",
1480
+ en: "Share your project context and we'll reply with the next steps.",
1481
+ es: "Cu\xE9ntanos el contexto de tu proyecto y te respondemos con los pr\xF3ximos pasos."
1482
+ },
1483
+ "blog.authorLine": { pt: "Escrevemos sobre o que constru\xEDmos na pr\xE1tica.", en: "We write about what we build in practice.", es: "Escribimos sobre lo que construimos en la pr\xE1ctica." },
1484
+ "blog.authorCta": { pt: "Fale conosco", en: "Talk to us", es: "Hablemos" },
1485
+ "whatsapp.float": { pt: "Fale conosco no WhatsApp", en: "Chat with us on WhatsApp", es: "Habla con nosotros por WhatsApp" },
1486
+ "contactForm.message": { pt: "Conte um pouco mais", en: "Tell us a bit more", es: "Cu\xE9ntanos un poco m\xE1s" },
1487
+ "contactForm.you": { pt: "Como falar com voc\xEA?", en: "How can we reach you?", es: "\xBFC\xF3mo podemos contactarte?" },
1488
+ "contactForm.successBody": {
1489
+ pt: "Obrigado pelo contato. Respondemos assim que poss\xEDvel.",
1490
+ en: "Thanks for reaching out. We'll reply as soon as we can.",
1491
+ es: "Gracias por escribir. Responderemos lo antes posible."
1492
+ },
1493
+ "proposal.expiredHint": { pt: "Fale conosco para receber uma vers\xE3o atualizada.", en: "Get in touch with us for an updated version.", es: "Escr\xEDbenos para recibir una versi\xF3n actualizada." },
1494
+ "checkout.error.NOT_CONFIGURED": {
1495
+ pt: "Os pagamentos ainda n\xE3o est\xE3o configurados neste site. Fale conosco para combinar outra forma de pagamento.",
1496
+ en: "Payments aren't set up on this site yet. Get in touch with us to arrange another way to pay.",
1497
+ es: "Los pagos a\xFAn no est\xE1n configurados en este sitio. Escr\xEDbenos para acordar otra forma de pago."
1498
+ }
1499
+ };
1414
1500
  }
1415
1501
  });
1416
1502
 
@@ -2733,7 +2819,8 @@ var init_catalog = __esm({
2733
2819
  label: "Convidar a enviar depoimento",
2734
2820
  default: false,
2735
2821
  help: "Mostra o bot\xE3o do assistente de depoimento (precisa do plugin testimonials-intake)."
2736
- })
2822
+ }),
2823
+ cta: field.link({ label: "Link para todos", help: 'Ex.: "Ver todos os depoimentos", para a p\xE1gina de depoimentos. Opcional.' })
2737
2824
  }
2738
2825
  });
2739
2826
  faq = defineBlock({
@@ -2764,13 +2851,24 @@ var init_catalog = __esm({
2764
2851
  },
2765
2852
  category: "comum",
2766
2853
  plugin: "blog",
2854
+ // A busca é uma ilha que só filtra os cartões já no HTML (sem ela, a lista inteira aparece).
2855
+ interactive: true,
2856
+ enhances: true,
2857
+ islandOptIn: true,
2858
+ islandWhen: (f) => f.showSearch === true,
2767
2859
  source: { collections: ["posts"], default: { collection: "posts", limit: 3, sort: "recent" } },
2768
2860
  fields: {
2769
2861
  anchor,
2770
2862
  title: heading,
2771
2863
  intro: intro3,
2772
2864
  cta: field.link({ label: "Link para o blog" }),
2773
- showTagFilter: field.boolean({ label: "Filtro por etiqueta", default: false })
2865
+ showTagFilter: field.boolean({ label: "Filtro por etiqueta", default: false }),
2866
+ showSearch: field.boolean({ label: "Busca por texto", default: false, help: "Campo que filtra os posts pelo t\xEDtulo, resumo e etiquetas (p\xE1gina do blog)." }),
2867
+ showFeatured: field.boolean({
2868
+ label: "Destaques no topo",
2869
+ default: false,
2870
+ help: "Os posts marcados como destaque num carrossel acima da lista, nos temas que o desenham (p\xE1gina do blog)."
2871
+ })
2774
2872
  }
2775
2873
  });
2776
2874
  cta = defineBlock({
@@ -2816,7 +2914,59 @@ var init_catalog = __esm({
2816
2914
  ],
2817
2915
  default: "wizard"
2818
2916
  }),
2819
- showChannels: field.boolean({ label: "Mostrar canais de contato", default: true })
2917
+ showChannels: field.boolean({ label: "Mostrar canais de contato", default: true }),
2918
+ presentation: field.select({
2919
+ label: "Onde aparece",
2920
+ options: [
2921
+ { value: "inline", label: "Na p\xE1gina" },
2922
+ { value: "dialog", label: "S\xF3 na janela de contato" }
2923
+ ],
2924
+ default: "inline",
2925
+ help: "S\xF3 na janela: com um tema que tem janela de contato (padr\xE3o, cyberpunk), o bloco sai da p\xE1gina e a janela, que abre em toda p\xE1gina pelos bot\xF5es de contato, mostra o formul\xE1rio, o t\xEDtulo e o sobret\xEDtulo dele. Em tema sem janela, o bloco fica na p\xE1gina."
2926
+ }),
2927
+ eyebrow: field.text({ label: "Sobret\xEDtulo", maxLength: 80, help: "Linha curta acima do t\xEDtulo (ex.: portfolio / contato)." }),
2928
+ flows: field.list({
2929
+ label: "Assuntos do assistente",
2930
+ itemLabel: "Assunto",
2931
+ max: 6,
2932
+ help: "Opcional, para o formato assistente. Cada assunto tem as pr\xF3prias etapas; a primeira tela mostra os assuntos e o resumo para revisar vem no fim. Sem assuntos, o assistente pergunta o assunto, a mensagem e os dados.",
2933
+ of: {
2934
+ id: field.text({ label: "Identificador", localized: false, required: true, maxLength: 40, help: "Curto e sem espa\xE7os (ex.: projeto)." }),
2935
+ emoji: field.text({ label: "Emoji", localized: false, maxLength: 16 }),
2936
+ label: field.text({ label: "R\xF3tulo", required: true, maxLength: 80 }),
2937
+ steps: field.list({
2938
+ label: "Etapas",
2939
+ itemLabel: "Etapa",
2940
+ max: 8,
2941
+ help: "Sem a etapa de dados de contato, ela entra no fim.",
2942
+ of: {
2943
+ kind: field.select({
2944
+ label: "Tipo",
2945
+ options: [
2946
+ { value: "choice", label: "Escolha entre op\xE7\xF5es" },
2947
+ { value: "text", label: "Texto curto" },
2948
+ { value: "textarea", label: "Texto longo (vai como mensagem)" },
2949
+ { value: "contact", label: "Dados de contato" }
2950
+ ],
2951
+ default: "choice"
2952
+ }),
2953
+ key: field.text({
2954
+ label: "Chave da resposta",
2955
+ localized: false,
2956
+ maxLength: 80,
2957
+ help: "Nome da resposta no pedido (ex.: prazo). Em texto curto, v\xE1rias chaves separadas por v\xEDrgula viram v\xE1rios campos."
2958
+ }),
2959
+ title: field.text({ label: "Pergunta", maxLength: 160 }),
2960
+ options: field.text({ label: "Op\xE7\xF5es", multiline: true, maxLength: 1500, help: "Uma por linha (tipo escolha)." }),
2961
+ placeholder: field.text({ label: "Exemplo dentro do campo", multiline: true, maxLength: 400, help: "Um por linha quando a etapa tem v\xE1rios campos." }),
2962
+ optional: field.boolean({ label: "Resposta opcional", default: false }),
2963
+ askPhone: field.boolean({ label: "Pedir telefone", default: false, help: "S\xF3 na etapa de dados de contato." }),
2964
+ askLinkedin: field.boolean({ label: "Pedir LinkedIn", default: false, help: "S\xF3 na etapa de dados de contato." }),
2965
+ askCompany: field.boolean({ label: "Pedir empresa", default: false, help: "S\xF3 na etapa de dados de contato." })
2966
+ }
2967
+ })
2968
+ }
2969
+ })
2820
2970
  }
2821
2971
  });
2822
2972
  galeria = defineBlock({
@@ -3439,7 +3589,7 @@ var init_files = __esm({
3439
3589
  PEERS = package_default.peerDependencies;
3440
3590
  MCP_VERSION = package_default2.version;
3441
3591
  defaultDependencySpecs = () => ({ core: `^${CORE_VERSION}`, theme: `^${CORE_VERSION}`, cli: `^${CLI_PACKAGE_VERSION}`, mcp: `^${MCP_VERSION}` });
3442
- CLI_PACKAGE_VERSION = true ? "2.0.0" : CORE_VERSION;
3592
+ CLI_PACKAGE_VERSION = true ? "2.1.1" : CORE_VERSION;
3443
3593
  MARK = {
3444
3594
  themeStart: "// rubrica:tema:inicio",
3445
3595
  themeEnd: "// rubrica:tema:fim",
@@ -7368,6 +7518,19 @@ function loc(base3, translations) {
7368
7518
  if (en) out[EN] = en;
7369
7519
  return out;
7370
7520
  }
7521
+ function v1FullTitle(title, siteTitle) {
7522
+ if (!siteTitle) return title;
7523
+ const out = {};
7524
+ for (const [l, t] of Object.entries(title)) if (t) out[l] = t.includes(siteTitle) ? t : `${t} | ${siteTitle}`;
7525
+ return out;
7526
+ }
7527
+ function sameInBoth(value) {
7528
+ const v = value[PT] ?? value[EN];
7529
+ return v ? { [PT]: v, [EN]: value[EN] ?? v } : value;
7530
+ }
7531
+ function v1Navigation(items) {
7532
+ return V1_NAV_ORDER.map((href) => items.find((n) => n.href === href)).filter((n) => !!n);
7533
+ }
7371
7534
  function locAny(value) {
7372
7535
  if (typeof value === "string") return loc(value);
7373
7536
  if (value && typeof value === "object") return loc(value.ptBR, value);
@@ -7385,11 +7548,12 @@ function slugify(text2) {
7385
7548
  return text2.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80) || "item";
7386
7549
  }
7387
7550
  function parsePeriod(period) {
7388
- const parts = period.split(/\s+(?:-|–|—|a|até|to)\s+|\s*[–—]\s*|\s+-\s+/i).map((p) => p.trim()).filter(Boolean);
7551
+ const years = /^(\d{4})\s*-\s*(\d{4})$/.exec(period.trim());
7552
+ const parts = years ? [years[1], years[2]] : period.split(/\s+(?:-|–|—|a|até|to)\s+|\s*[–—]\s*|\s+-\s+/i).map((p) => p.trim()).filter(Boolean);
7389
7553
  const one = (p) => {
7390
7554
  const numeric = /^(\d{1,2})[/.-](\d{4})$/.exec(p);
7391
7555
  if (numeric) return `${numeric[2]}-${numeric[1].padStart(2, "0")}`;
7392
- const named = /^([a-zç]{3})[a-zç]*\.?[\s/de]*(\d{4})$/i.exec(p.normalize("NFD").replace(/[̀-ͯ]/g, ""));
7556
+ const named = /^([a-zç]{3})[a-zç]*\.?[\s/de-]*(\d{4})$/i.exec(p.normalize("NFD").replace(/[̀-ͯ]/g, ""));
7393
7557
  if (named && MONTHS[named[1].toLowerCase()]) return `${named[2]}-${MONTHS[named[1].toLowerCase()]}`;
7394
7558
  const year = /^(\d{4})$/.exec(p);
7395
7559
  return year ? year[1] : void 0;
@@ -7412,7 +7576,7 @@ function convertPosts(ctx, docs) {
7412
7576
  content: loc(d.content, d.contentTranslations),
7413
7577
  cover: ctx.image(d.imageId, d.imageUrl),
7414
7578
  seo: compact({
7415
- title: loc(d.seoTitle, d.seoTitleTranslations),
7579
+ title: v1FullTitle(loc(d.seoTitle, d.seoTitleTranslations), ctx.siteTitle),
7416
7580
  description: loc(d.seoDescription, d.seoDescriptionTranslations),
7417
7581
  image: ctx.image(d.ogImageId, d.ogImageUrl)
7418
7582
  }),
@@ -7439,12 +7603,6 @@ function convertProjects(ctx, docs) {
7439
7603
  const body = mapLoc(loc(cs[s.field], { enUS: csEn?.[s.field] }), toHtml);
7440
7604
  if (hasText(body)) sections.push({ title: ctx.t(s.key), body });
7441
7605
  }
7442
- if (cs.metrics?.length) {
7443
- const list2 = (metrics) => `<ul>${metrics.map((m) => `<li><strong>${m.value}</strong> ${m.label}</li>`).join("")}</ul>`;
7444
- const body = { [PT]: list2(cs.metrics) };
7445
- if (csEn?.metrics?.length) body[EN] = list2(csEn.metrics);
7446
- sections.push({ title: ctx.t("portfolio.metrics"), body });
7447
- }
7448
7606
  if (cs.testimonial?.text) {
7449
7607
  const t = cs.testimonial;
7450
7608
  const quote = (text2, role) => `<blockquote><p>${text2}</p><footer>${t.author}${role ? `, ${role}` : ""}</footer></blockquote>`;
@@ -7456,13 +7614,14 @@ function convertProjects(ctx, docs) {
7456
7614
  sections.push({ title: ctx.t("portfolio.testimonial"), body });
7457
7615
  }
7458
7616
  }
7617
+ const metrics = caseMetrics(cs?.metrics, csEn?.metrics);
7459
7618
  const images = (d.imageIds ?? []).map((id) => ctx.image(id)).filter(Boolean);
7460
7619
  const external = (d.externalImageUrls ?? []).map((url) => ({ url }));
7461
7620
  const [cover, ...gallery] = [...images, ...external];
7462
7621
  const links = [];
7463
7622
  if (str2(d.demoLink)) links.push({ label: ctx.t("portfolio.liveDemo"), href: d.demoLink });
7464
7623
  if (str2(d.githubLink)) links.push({ label: ctx.t("portfolio.code"), href: d.githubLink });
7465
- const tags = [.../* @__PURE__ */ new Set([...str2(d.category) ? [d.category] : [], ...d.tags ?? []])];
7624
+ const tags = [...new Set(d.tags ?? [])];
7466
7625
  return compact({
7467
7626
  ...meta2(d),
7468
7627
  slug,
@@ -7470,6 +7629,7 @@ function convertProjects(ctx, docs) {
7470
7629
  summary: loc(d.description, d.descriptionTranslations),
7471
7630
  content: mapLoc(loc(d.longDescription, d.longDescriptionTranslations), toHtml),
7472
7631
  sections: sections.length ? sections : void 0,
7632
+ metrics: metrics.length ? metrics : void 0,
7473
7633
  cover,
7474
7634
  gallery: gallery.length ? gallery : void 0,
7475
7635
  role: cs ? loc(cs.role, { enUS: csEn?.role }) : void 0,
@@ -7484,6 +7644,14 @@ function convertProjects(ctx, docs) {
7484
7644
  });
7485
7645
  });
7486
7646
  }
7647
+ function caseMetrics(pt, en) {
7648
+ return (pt ?? []).flatMap((m, i) => {
7649
+ const value = str2(m.value === void 0 ? void 0 : String(m.value));
7650
+ const label = loc(m.label, { enUS: en?.[i]?.label });
7651
+ if (!value || !hasText(label)) return [];
7652
+ return [compact({ value, label, icon: str2(m.icon) })];
7653
+ });
7654
+ }
7487
7655
  function convertResume(ctx, docs) {
7488
7656
  return docs.map((d) => {
7489
7657
  const c = d.content ?? {};
@@ -7504,14 +7672,14 @@ function convertResume(ctx, docs) {
7504
7672
  case "skill":
7505
7673
  return compact({ ...base3, kind: "skill", title: loc(c.name, { enUS: en.name }), description: loc(c.level, { enUS: en.level }), group: str2(c.group) ? loc(c.group, { enUS: en.group }) : void 0, tags: str2(c.group) ? [c.group] : void 0 });
7506
7674
  case "soft_skill":
7507
- return compact({ ...base3, kind: "skill", title: loc(c.text, tr2), tags: ["soft-skill"] });
7675
+ return compact({ ...base3, kind: "soft-skill", title: loc(c.text, tr2) });
7508
7676
  case "course":
7509
7677
  return compact({ ...base3, kind: "certification", title: loc(c.text, tr2) });
7510
7678
  case "language":
7511
7679
  return compact({ ...base3, kind: "language", title: loc(c.name, tr2.enUS ? { enUS: typeof tr2.enUS === "string" ? tr2.enUS : tr2.enUS.name } : void 0), description: str2(c.level) ? loc(c.level) : void 0 });
7512
7680
  case "volunteer":
7513
- if (str2(c.text)) return compact({ ...base3, kind: "experience", title: loc(c.text, tr2), tags: ["voluntariado"] });
7514
- return compact({ ...base3, kind: "experience", title: loc(c.role, { enUS: en.role }), organization: str2(c.company), description: loc(c.description, { enUS: en.description }), tags: ["voluntariado"], ...period(c.period) });
7681
+ if (str2(c.text)) return compact({ ...base3, kind: "volunteer", title: loc(c.text, tr2) });
7682
+ return compact({ ...base3, kind: "volunteer", title: loc(c.role, { enUS: en.role }), organization: str2(c.company), description: loc(c.description, { enUS: en.description }), ...period(c.period) });
7515
7683
  default:
7516
7684
  ctx.warnings.push(`Curr\xEDculo: item do tipo desconhecido "${d.type}" ficou de fora.`);
7517
7685
  return null;
@@ -7571,8 +7739,8 @@ function convertSettings(ctx, input, plugins) {
7571
7739
  }
7572
7740
  if (ctx.config.get("theme_colors_per_mode") === true) ctx.warnings.push("As cores separadas por modo (claro/escuro) do painel da v1 n\xE3o foram convertidas: ajuste em Apar\xEAncia.");
7573
7741
  const social = [
7574
- ["linkedin", contact?.linkedinUrl],
7575
7742
  ["github", contact?.githubUrl],
7743
+ ["linkedin", contact?.linkedinUrl],
7576
7744
  ["behance", contact?.behanceUrl]
7577
7745
  ].filter(([, url2]) => str2(url2)).map(([network, url2]) => ({ network, url: url2 }));
7578
7746
  const url = (c("site_url") ?? id.siteUrl ?? "").replace(/\/+$/, "");
@@ -7602,7 +7770,9 @@ function convertSettings(ctx, input, plugins) {
7602
7770
  name: str2(contact?.name) ?? id.authorName ?? "",
7603
7771
  jobTitle: contact ? loc(contact.role, contact.roleTranslations) : void 0,
7604
7772
  email: contact?.showEmail ? str2(contact.email) : void 0,
7605
- photo: contact?.avatarStorageId || str2(contact?.avatarUrl) ? compact({ url: str2(contact?.avatarUrl) ?? "", storageId: contact?.avatarStorageId }) : void 0
7773
+ photo: contact?.avatarStorageId ? { url: "", storageId: contact.avatarStorageId } : ctx.image(void 0, str2(contact?.avatarUrl)),
7774
+ // A sidebar da v1 mostrava o telefone (com o ícone do WhatsApp) quando "mostrar" estava ligado.
7775
+ whatsapp: contact?.showPhone ? str2(contact.phone) : void 0
7606
7776
  }) : void 0,
7607
7777
  plugins,
7608
7778
  ogImage: ogStorage || c("og_image_url") ? compact({ url: c("og_image_url") ?? "", storageId: ogStorage }) : void 0,
@@ -7610,6 +7780,16 @@ function convertSettings(ctx, input, plugins) {
7610
7780
  whatsapp: convertWhatsApp(ctx)
7611
7781
  });
7612
7782
  }
7783
+ function highlightNumbersHtml(text2) {
7784
+ const escape = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
7785
+ let out = "";
7786
+ let last = 0;
7787
+ for (const m of text2.matchAll(NUMBER_WITH_UNIT)) {
7788
+ out += escape(text2.slice(last, m.index)) + `<strong>${escape(m[0])}</strong>`;
7789
+ last = m.index + m[0].length;
7790
+ }
7791
+ return out + escape(text2.slice(last));
7792
+ }
7613
7793
  function homeTestimonialsSource(ctx, path5, block) {
7614
7794
  if (path5 !== "/" || block.type !== "depoimentos" || block.source) return {};
7615
7795
  const list2 = (ctx.tables.testimonials ?? []).filter((d) => d.deletedAt === void 0);
@@ -7651,7 +7831,7 @@ function buildPages(ctx, input, plugins, report) {
7651
7831
  dropped.push({ type: block.type, reason: "a v1 n\xE3o tinha esta se\xE7\xE3o nesta p\xE1gina" });
7652
7832
  continue;
7653
7833
  }
7654
- const fields = fill(ctx, plugins);
7834
+ const fields = fill(ctx, plugins, page.blocks);
7655
7835
  if (!fields) {
7656
7836
  dropped.push({ type: block.type, reason: "sem conte\xFAdo na v1" });
7657
7837
  continue;
@@ -7681,7 +7861,9 @@ function buildPages(ctx, input, plugins, report) {
7681
7861
  path: page.path,
7682
7862
  title,
7683
7863
  seo: m.seo && Object.keys(m.seo).length ? m.seo : void 0,
7684
- blocks: kept.map((b, i) => compact({ id: ids[i], type: b.type, variant: b.variant, visible: true, fields: b.fields ?? {}, source: b.source })),
7864
+ // `fields` é obrigatório no schema, mesmo vazio: fica fora do compact (que tira objetos vazios).
7865
+ // A receita do tema pode trazer o bloco escondido (ex.: o contato da home num tema com a janela de contato).
7866
+ blocks: kept.map((b, i) => ({ ...compact({ id: ids[i], type: b.type, variant: b.variant, visible: b.visible !== false, source: b.source }), fields: b.fields ?? {} })),
7685
7867
  published: true,
7686
7868
  system: true,
7687
7869
  createdAt: now,
@@ -7692,7 +7874,70 @@ function buildPages(ctx, input, plugins, report) {
7692
7874
  }
7693
7875
  return pages;
7694
7876
  }
7695
- function buildUiTexts(ctx, report, now) {
7877
+ function locLines(texts) {
7878
+ const out = {};
7879
+ for (const locale of [PT, EN]) {
7880
+ const lines = texts.map((t) => t[locale] ?? t[PT] ?? "").filter(Boolean);
7881
+ if (lines.length) out[locale] = lines.join("\n");
7882
+ }
7883
+ return out;
7884
+ }
7885
+ function wizardOptions(ctx, prefix, defaults2) {
7886
+ const extra = [...ctx.siteTexts.keys(), ...Object.keys(ctx.projectTexts)].filter((k) => k.startsWith(prefix) && !k.slice(prefix.length).includes(".")).map((k) => k.slice(prefix.length));
7887
+ const ids = [.../* @__PURE__ */ new Set([...defaults2, ...extra])];
7888
+ return locLines(ids.map((id) => ctx.t(`${prefix}${id}`)).filter(hasText));
7889
+ }
7890
+ function contactWizardFields(ctx) {
7891
+ const flows = V1_WIZARD_FLOWS.map((flow) => ({
7892
+ id: flow.id,
7893
+ emoji: flow.emoji,
7894
+ label: ctx.t(`contactWizard.flows.${flow.id}.label`),
7895
+ steps: flow.steps.map((step) => {
7896
+ if (step.kind === "contact") {
7897
+ return compact({ kind: "contact", title: ctx.t("contactWizard.contact.title"), askPhone: step.askPhone, askLinkedin: step.askLinkedin, askCompany: step.askCompany });
7898
+ }
7899
+ const base3 = `contactWizard.${flow.id}.step${step.n}`;
7900
+ const placeholder = step.placeholders ? locLines(step.placeholders.map((p) => ctx.t(`${base3}.${p}`)).filter(hasText)) : {};
7901
+ return compact({
7902
+ kind: step.kind,
7903
+ key: step.key,
7904
+ title: ctx.t(`${base3}.title`),
7905
+ options: step.options ? wizardOptions(ctx, `${base3}.options.`, step.options) : void 0,
7906
+ placeholder: hasText(placeholder) ? placeholder : void 0
7907
+ });
7908
+ })
7909
+ }));
7910
+ return compact({
7911
+ anchor: "contato",
7912
+ presentation: "dialog",
7913
+ eyebrow: { [PT]: "portfolio / contato", [EN]: "portfolio / contato" },
7914
+ title: ctx.t("contactWizard.title"),
7915
+ intro: ctx.t("contactWizard.subtitle"),
7916
+ mode: "wizard",
7917
+ showChannels: false,
7918
+ flows
7919
+ });
7920
+ }
7921
+ function wizardUiTexts(ctx) {
7922
+ const step = ctx.t("contactWizard.step");
7923
+ const of = ctx.t("contactWizard.of");
7924
+ const stepOf = {};
7925
+ for (const locale of [PT, EN]) if (step[locale] && of[locale]) stepOf[locale] = `${step[locale]} {current} ${of[locale]} {total}`;
7926
+ const pairs = [
7927
+ ["contactWizard.next", "form.next"],
7928
+ ["contactWizard.back", "form.back"],
7929
+ ["contactWizard.submit", "form.send"],
7930
+ ["contactWizard.submitting", "form.sending"],
7931
+ ["contactWizard.successTitle", "contactForm.success"],
7932
+ ["contactWizard.successBody", "contactForm.successBody"],
7933
+ ["contactWizard.summary.title", "contactForm.summary"],
7934
+ ["contactWizard.summary.type", "contactForm.summaryTopic"],
7935
+ ["contactWizard.summary.contact", "contactForm.summaryContact"],
7936
+ ["common.close", "contactForm.close"]
7937
+ ];
7938
+ return [{ v1: "contactWizard.step + contactWizard.of", v2: "form.step", value: stepOf }, ...pairs.map(([v1, v2]) => ({ v1, v2, value: ctx.t(v1) }))].filter((p) => hasText(p.value));
7939
+ }
7940
+ function buildUiTexts(ctx, report, now, plugins = {}) {
7696
7941
  const out = [];
7697
7942
  const availability = ctx.home.get("availability_status");
7698
7943
  const fromHome = availability?.label ? locAny(availability.label) : {};
@@ -7706,17 +7951,37 @@ function buildUiTexts(ctx, report, now) {
7706
7951
  const v2 = UI_TEXT_MAP[key];
7707
7952
  if (v2) {
7708
7953
  if (out.some((t) => t.key === v2)) continue;
7709
- out.push({ key: v2, value: ctx.t(key), updatedAt: now });
7954
+ out.push({ key: v2, value: adaptText(key, ctx.t(key)), updatedAt: now });
7710
7955
  report.texts.ui.push({ v1: key, v2 });
7711
7956
  } else if (!key.startsWith("admin.")) {
7712
7957
  report.texts.unmapped.push({ key, pt: String(ctx.siteTexts.get(key)?.ptBR ?? ctx.projectTexts[key]?.pt ?? "").slice(0, 120) });
7713
7958
  }
7714
7959
  }
7960
+ for (const key of V1_LABELS) {
7961
+ const v2 = UI_TEXT_MAP[key];
7962
+ if (out.some((t) => t.key === v2)) continue;
7963
+ const value = adaptText(key, ctx.t(key));
7964
+ if (!hasText(value)) continue;
7965
+ if (Object.entries(value).every(([locale, text2]) => text2 === defaultUiText(v2, locale))) continue;
7966
+ out.push({ key: v2, value, updatedAt: now });
7967
+ report.texts.ui.push({ v1: key, v2 });
7968
+ }
7969
+ if (plugins["contact-wizard"] !== false) {
7970
+ for (const { v1, v2, value } of wizardUiTexts(ctx)) {
7971
+ if (out.some((t) => t.key === v2)) continue;
7972
+ out.push({ key: v2, value, updatedAt: now });
7973
+ report.texts.ui.push({ v1, v2 });
7974
+ }
7975
+ }
7715
7976
  return out;
7716
7977
  }
7978
+ function adaptText(key, value) {
7979
+ const adapt = UI_TEXT_ADAPT[key];
7980
+ return adapt ? mapLoc(value, adapt) : value;
7981
+ }
7717
7982
  function convertV1(input) {
7718
7983
  const t = input.tables;
7719
- const ctx = new Ctx(t, input.projectTexts);
7984
+ const ctx = new Ctx(t, input.projectTexts, input.storage);
7720
7985
  const report = { tables: [], pages: [], texts: { sectionKeys: 0, ui: [], unmapped: [] }, plugins: [], pending: [], dropped: [], unknownTables: [], warnings: ctx.warnings };
7721
7986
  const now = input.now ?? Date.now();
7722
7987
  const out = {};
@@ -7741,8 +8006,11 @@ function convertV1(input) {
7741
8006
  );
7742
8007
  put("faq", "aboutFaq", (t.aboutFaq ?? []).map((d) => compact({ ...meta2(d), question: loc(d.question, d.questionTranslations), answer: mapLoc(loc(d.answer, d.answerTranslations), (s) => s), order: d.displayOrder, ...lifecycle(d) })));
7743
8008
  const routine = t.aboutDailyRoutine ?? [];
7744
- if (routine.some((d) => d.spanSize && d.spanSize !== "1x1")) ctx.warnings.push("Dia a dia: o tamanho de cada foto na grade (1x2, 2x1) n\xE3o existe na v2; a galeria do tema decide.");
7745
- put("routine", "aboutDailyRoutine", routine.map((d) => compact({ ...meta2(d), title: loc(d.description, d.descriptionTranslations), image: ctx.image(d.imageId, d.imageUrl), order: d.displayOrder, ...lifecycle(d) })));
8009
+ const span = (d) => {
8010
+ const s = str2(d.spanSize) || str2(d.span_size);
8011
+ return s === "1x2" || s === "2x1" || s === "2x2" ? s : void 0;
8012
+ };
8013
+ put("routine", "aboutDailyRoutine", routine.map((d) => compact({ ...meta2(d), title: loc(d.description, d.descriptionTranslations), image: ctx.image(d.imageId, d.imageUrl), span: span(d), order: d.displayOrder, ...lifecycle(d) })));
7746
8014
  put("resumeItems", "resumeItems", convertResume(ctx, t.resumeItems ?? []));
7747
8015
  put(
7748
8016
  "media",
@@ -7756,10 +8024,10 @@ function convertV1(input) {
7756
8024
  report.plugins = plugins.report;
7757
8025
  const settings = convertSettings(ctx, input, plugins.record);
7758
8026
  const pages = buildPages(ctx, input, plugins.record, report);
7759
- settings.navigation = navigationFromPages(pages);
8027
+ settings.navigation = v1Navigation(navigationFromPages(pages));
7760
8028
  put("siteSettings", "", [compact({ ...settings, updatedAt: now })]);
7761
8029
  put("pages", "", pages);
7762
- put("uiTexts", "", buildUiTexts(ctx, report, now));
8030
+ put("uiTexts", "", buildUiTexts(ctx, report, now, plugins.record));
7763
8031
  report.texts.sectionKeys = [...ctx.siteTexts.keys()].filter((k) => SECTION_KEYS.has(k)).length;
7764
8032
  if (input.projectTexts) report.texts.projectKeys = Object.keys(input.projectTexts).filter((k) => ctx.fileCustomized(k)).length;
7765
8033
  const business = convertBusiness(t, now);
@@ -7777,7 +8045,7 @@ function convertV1(input) {
7777
8045
  for (const u of report.unknownTables) ctx.warnings.push(`Tabela pr\xF3pria do projeto na v1 (${u.table}, ${u.count} documentos): n\xE3o convertida. Leve-a para o convex/ do projeto v2 (schema e fun\xE7\xF5es) e importe \xE0 parte.`);
7778
8046
  return { tables: out, sources, pending, report };
7779
8047
  }
7780
- var V1_TEXTS, PT, EN, LOCALES, V1_PLUGIN_DEFAULTS, TABLE_MAP, DROPPED_TABLES, str2, hasText, compact, meta2, lifecycle, MONTHS, PRESENT, Ctx, CASE_SECTIONS, link2, ABOUT_TEXT, SECTION_FILLERS, PAGE_META, SECTION_KEYS, UI_TEXT_MAP;
8048
+ var V1_TEXTS, PT, EN, LOCALES, V1_PLUGIN_DEFAULTS, TABLE_MAP, DROPPED_TABLES, str2, V1_NAV_ORDER, hasText, compact, meta2, lifecycle, MONTHS, PRESENT, Ctx, CASE_SECTIONS, link2, ABOUT_TEXT, RESULT_UNITS, NUMBER_WITH_UNIT, RESUME_SUMMARY, hasHeader, header, HOME_METRICS, SECTION_FILLERS, PAGE_META, SECTION_KEYS, UI_TEXT_MAP, V1_LABELS, UI_TEXT_ADAPT, V1_WIZARD_FLOWS;
7781
8049
  var init_convert = __esm({
7782
8050
  "src/migrate/convert.ts"() {
7783
8051
  "use strict";
@@ -7840,6 +8108,7 @@ var init_convert = __esm({
7840
8108
  contactInfo: "convertido nas configura\xE7\xF5es do site (pessoa, redes)"
7841
8109
  };
7842
8110
  str2 = (v) => typeof v === "string" && v.trim() ? v : void 0;
8111
+ V1_NAV_ORDER = ["/", "/curriculo", "/portfolio", "/sobre", "/blog"];
7843
8112
  hasText = (l) => Object.keys(l).length > 0;
7844
8113
  compact = (doc) => Object.fromEntries(Object.entries(doc).filter(([, v]) => v !== void 0 && !(typeof v === "object" && v !== null && !Array.isArray(v) && Object.keys(v).length === 0)));
7845
8114
  meta2 = (d) => ({ _id: d._id, _creationTime: d._creationTime });
@@ -7873,9 +8142,10 @@ var init_convert = __esm({
7873
8142
  };
7874
8143
  PRESENT = /atual|presente|present|hoje|now|current|o momento|em andamento/i;
7875
8144
  Ctx = class {
7876
- constructor(tables, projectTexts = {}) {
8145
+ constructor(tables, projectTexts = {}, storage = []) {
7877
8146
  this.tables = tables;
7878
8147
  this.projectTexts = projectTexts;
8148
+ for (const f of storage) if (typeof f.internalId === "string" && typeof f._id === "string") this.storageByUrlId.set(f.internalId, f._id);
7879
8149
  for (const f of tables.imageFolders ?? []) this.folders.set(f._id, f.path);
7880
8150
  for (const m of tables.imageMetadata ?? []) this.media.set(m._id, m);
7881
8151
  for (const t of tables.siteTexts ?? []) this.siteTexts.set(t.key, t);
@@ -7892,13 +8162,25 @@ var init_convert = __esm({
7892
8162
  home = /* @__PURE__ */ new Map();
7893
8163
  config = /* @__PURE__ */ new Map();
7894
8164
  contact;
8165
+ /** `internalId` (o UUID das URLs `/api/storage/<uuid>` da v1) → id do arquivo, que o import mantém. */
8166
+ storageByUrlId = /* @__PURE__ */ new Map();
8167
+ /** O `site_title` da v1, que o componente SEO punha no fim dos títulos. */
8168
+ get siteTitle() {
8169
+ return str2(this.config.get("site_title"));
8170
+ }
7895
8171
  /** Imagem da biblioteca da v1 (id do imageMetadata), ou só a URL. */
8172
+ /** Arquivo do export a partir de uma URL do storage da v1 (que deixa de existir com o banco velho). */
8173
+ storageIdFromUrl(url) {
8174
+ const m = /\/api\/storage\/([0-9a-f-]{36})/i.exec(str2(url) ?? "");
8175
+ return m ? this.storageByUrlId.get(m[1].toLowerCase()) : void 0;
8176
+ }
7896
8177
  image(imageId, url) {
7897
8178
  const m = imageId ? this.media.get(imageId) : void 0;
7898
8179
  if (!m && !str2(url)) return void 0;
8180
+ const fromUrl = m?.storageId ? void 0 : this.storageIdFromUrl(url);
7899
8181
  return compact({
7900
- url: str2(url) ?? "",
7901
- storageId: m?.storageId,
8182
+ url: fromUrl ? "" : str2(url) ?? "",
8183
+ storageId: m?.storageId ?? fromUrl,
7902
8184
  alt: m?.altText ? loc(m.altText) : void 0,
7903
8185
  width: m?.width,
7904
8186
  height: m?.height
@@ -7945,7 +8227,49 @@ var init_convert = __esm({
7945
8227
  { field: "learnings", key: "portfolio.learnings" }
7946
8228
  ];
7947
8229
  link2 = (label, href) => hasText(label) ? { label, href } : void 0;
7948
- ABOUT_TEXT = (ctx) => mapLoc(locAny(ctx.home.get("about_text")), toHtml);
8230
+ ABOUT_TEXT = (ctx) => mapLoc(
8231
+ locAny(ctx.home.get("about_text")),
8232
+ (text2) => /<(p|h[1-6]|ul|ol|div|blockquote)[\s>]/i.test(text2) ? text2 : text2.split(/\n\s*\n/).map((p) => p.trim()).filter(Boolean).map((p) => `<p>${highlightNumbersHtml(p).replace(/\n/g, "<br>")}</p>`).join("")
8233
+ );
8234
+ RESULT_UNITS = [
8235
+ "skills",
8236
+ "automa\xE7\xF5es",
8237
+ "\xE1reas",
8238
+ "chamados",
8239
+ "horas",
8240
+ "minutos",
8241
+ "meses",
8242
+ "anos",
8243
+ "iniciativas",
8244
+ "pessoas",
8245
+ "times",
8246
+ "sistemas",
8247
+ "projetos",
8248
+ "automations",
8249
+ "areas",
8250
+ "tickets",
8251
+ "hours",
8252
+ "minutes",
8253
+ "months",
8254
+ "years",
8255
+ "initiatives",
8256
+ "people",
8257
+ "teams",
8258
+ "systems",
8259
+ "projects"
8260
+ ];
8261
+ NUMBER_WITH_UNIT = new RegExp(`(?<![\\p{L}\\d.])~?\\d+(?:[.,]\\d+)*\\+?\\s(?:${RESULT_UNITS.join("|")})(?![\\p{L}])`, "gu");
8262
+ RESUME_SUMMARY = (ctx) => mapLoc(locAny(ctx.home.get("about_text")), (text2) => {
8263
+ const first = text2.split(/\n\s*\n/).map((p) => p.trim()).find(Boolean);
8264
+ return first ? `<p>${highlightNumbersHtml(first)}</p>` : "";
8265
+ });
8266
+ hasHeader = (recipe) => recipe?.[0]?.type === "hero";
8267
+ header = (ctx, prefix) => compact({ title: ctx.t(`${prefix}.title`), subtitle: hasText(ctx.t(`${prefix}.subtitle`)) ? ctx.t(`${prefix}.subtitle`) : void 0 });
8268
+ HOME_METRICS = (ctx) => {
8269
+ const metrics = ctx.home.get("home_metrics") ?? [];
8270
+ if (!metrics.length) return null;
8271
+ return { items: metrics.slice(0, 8).map((m) => ({ value: String(m.value), label: loc(m.label, m.labelTranslations) })) };
8272
+ };
7949
8273
  SECTION_FILLERS = {
7950
8274
  "/": {
7951
8275
  hero: (ctx, plugins) => {
@@ -7953,7 +8277,8 @@ var init_convert = __esm({
7953
8277
  const availability = ctx.home.get("availability_status");
7954
8278
  const title = ctx.t("home.hero.headline");
7955
8279
  return compact({
7956
- eyebrow: ctx.contact ? loc(ctx.contact.role, ctx.contact.roleTranslations) : void 0,
8280
+ // O selo da v1 é o texto home.greeting ("whoami"), não o cargo (que aparece abaixo).
8281
+ eyebrow: ctx.t("home.greeting"),
7957
8282
  title: hasText(title) ? title : loc(ctx.home.get("hero_title")),
7958
8283
  subtitle: ctx.t("home.hero.description"),
7959
8284
  primaryCta: plugins.portfolio !== false ? link2(ctx.t("home.hero.ctaCases"), "#cases") : void 0,
@@ -7962,25 +8287,22 @@ var init_convert = __esm({
7962
8287
  showAvailability: availability?.available === true
7963
8288
  });
7964
8289
  },
7965
- numeros: (ctx) => {
7966
- const metrics = ctx.home.get("home_metrics") ?? [];
7967
- if (!metrics.length) return null;
7968
- return { items: metrics.slice(0, 8).map((m) => ({ value: String(m.value), label: loc(m.label, m.labelTranslations) })) };
7969
- },
8290
+ numeros: HOME_METRICS,
7970
8291
  cases: (ctx) => compact({ anchor: "cases", title: ctx.t("home.cases.title"), cta: link2(ctx.t("home.cases.viewAll"), "/portfolio") }),
7971
8292
  texto: (ctx) => {
7972
8293
  const body = ABOUT_TEXT(ctx);
7973
8294
  return hasText(body) ? { title: ctx.t("home.about.title"), body } : null;
7974
8295
  },
7975
8296
  servicos: (ctx) => ({ title: ctx.t("home.skills.title") }),
7976
- depoimentos: (ctx, plugins) => compact({ title: ctx.t("home.testimonials.title"), allowSubmission: plugins["testimonials-intake"] !== false }),
8297
+ // "Ver todos os depoimentos" levava à página de depoimentos (que existe com o plugin ligado).
8298
+ depoimentos: (ctx, plugins) => compact({ title: ctx.t("home.testimonials.title"), allowSubmission: plugins["testimonials-intake"] !== false, cta: hasText(ctx.t("testimonials.viewAll")) ? link2(ctx.t("testimonials.viewAll"), "/depoimentos") : void 0 }),
7977
8299
  cta: (ctx, plugins) => compact({
7978
8300
  title: ctx.t("home.cta.title"),
7979
8301
  body: ctx.t("home.cta.subtitle"),
7980
8302
  primary: link2(ctx.t("home.cta.project"), "#contato"),
7981
8303
  secondary: plugins["contact-wizard"] !== false ? link2(ctx.t("home.cta.job"), "#contato") : void 0
7982
8304
  }),
7983
- contato: (ctx, plugins) => ({ anchor: "contato", title: ctx.t("sidebar.contact"), mode: plugins["contact-wizard"] === false ? "channels" : "wizard", showChannels: true }),
8305
+ contato: (ctx, plugins) => plugins["contact-wizard"] === false ? { anchor: "contato", title: ctx.t("sidebar.contact"), mode: "channels", showChannels: true } : contactWizardFields(ctx),
7984
8306
  "posts-recentes": (ctx) => compact({ title: ctx.t("blog.title"), cta: link2(ctx.t("blog.title"), "/blog") })
7985
8307
  },
7986
8308
  "/sobre": {
@@ -7997,22 +8319,49 @@ var init_convert = __esm({
7997
8319
  "lista-itens": (ctx) => {
7998
8320
  const items = (ctx.home.get("work_principles") ?? []).filter((p) => str2(p.title));
7999
8321
  if (!items.length) return null;
8000
- return { title: ctx.t("about.principles.title"), numbered: true, items: items.slice(0, 12).map((p) => compact({ title: loc(p.title, p.titleTranslations), body: loc(p.description, p.descriptionTranslations) })) };
8322
+ return { title: ctx.t("about.principles.title"), numbered: false, items: items.slice(0, 12).map((p) => compact({ title: loc(p.title, p.titleTranslations), body: loc(p.description, p.descriptionTranslations) })) };
8001
8323
  },
8002
8324
  galeria: (ctx) => ({ title: ctx.t("about.dailyRoutine.title") }),
8003
8325
  faq: (ctx) => ({ title: ctx.t("about.faq.title") })
8004
8326
  },
8005
- "/curriculo": { curriculo: (ctx) => ({ title: ctx.t("resume.title"), intro: ctx.t("resume.subtitle"), showDownload: true }) },
8006
- "/portfolio": { cases: (ctx) => ({ title: ctx.t("portfolio.title"), intro: ctx.t("portfolio.subtitle") }) },
8007
- "/blog": { "posts-recentes": (ctx) => ({ title: ctx.t("blog.title"), intro: ctx.t("blog.subtitle"), showTagFilter: true }) },
8008
- "/depoimentos": { depoimentos: (ctx, plugins) => compact({ title: ctx.t("testimonials.title"), intro: ctx.t("testimonials.subtitle"), allowSubmission: plugins["testimonials-intake"] !== false }) }
8327
+ // A página da v1: título e apoio, o resumo (1º parágrafo do "sobre"), os números e o PDF no
8328
+ // topo, depois o currículo. Numa receita sem o cabeçalho (hero), o título fica no currículo.
8329
+ "/curriculo": {
8330
+ hero: (ctx) => header(ctx, "resume"),
8331
+ texto: (ctx) => {
8332
+ const body = RESUME_SUMMARY(ctx);
8333
+ return hasText(body) ? { body } : null;
8334
+ },
8335
+ numeros: HOME_METRICS,
8336
+ curriculo: (ctx, _plugins, recipe) => hasHeader(recipe) ? { showDownload: true } : { title: ctx.t("resume.title"), intro: ctx.t("resume.subtitle"), showDownload: true }
8337
+ },
8338
+ // Páginas de lista: com um cabeçalho (hero) na receita, o título e o apoio da v1 vão para ele.
8339
+ "/portfolio": {
8340
+ hero: (ctx) => header(ctx, "portfolio"),
8341
+ cases: (ctx, _p, recipe) => hasHeader(recipe) ? {} : { title: ctx.t("portfolio.title"), intro: ctx.t("portfolio.subtitle") }
8342
+ },
8343
+ "/blog": {
8344
+ hero: (ctx) => header(ctx, "blog"),
8345
+ // O blog da v1 sempre teve os destaques em carrossel, a busca e o filtro por etiquetas.
8346
+ "posts-recentes": (ctx, _p, recipe) => ({
8347
+ ...hasHeader(recipe) ? {} : { title: ctx.t("blog.title"), intro: ctx.t("blog.subtitle") },
8348
+ showTagFilter: true,
8349
+ showSearch: true,
8350
+ showFeatured: true
8351
+ })
8352
+ },
8353
+ "/depoimentos": {
8354
+ hero: (ctx) => header(ctx, "testimonials"),
8355
+ depoimentos: (ctx, plugins, recipe) => compact({ ...hasHeader(recipe) ? {} : { title: ctx.t("testimonials.title"), intro: ctx.t("testimonials.subtitle") }, allowSubmission: plugins["testimonials-intake"] !== false })
8356
+ }
8009
8357
  };
8010
8358
  PAGE_META = {
8011
- "/": (ctx) => ({ title: ctx.t("navigation.home"), seo: compact({ title: loc(ctx.config.get("seo_home_title")), description: loc(ctx.config.get("seo_home_description")) }) }),
8012
- "/sobre": (ctx) => ({ title: ctx.t("navigation.about"), seo: compact({ title: ctx.t("seo.aboutTitle"), description: ctx.t("seo.aboutDescription") }) }),
8013
- "/curriculo": (ctx) => ({ title: ctx.t("navigation.resume"), seo: compact({ title: ctx.t("seo.resumeTitle"), description: ctx.t("seo.resumeDescription") }) }),
8014
- "/portfolio": (ctx) => ({ title: ctx.t("navigation.portfolio"), seo: compact({ title: ctx.t("seo.portfolioTitle"), description: ctx.t("seo.portfolioDescription") }) }),
8015
- "/blog": (ctx) => ({ title: ctx.t("navigation.blog"), seo: compact({ title: ctx.t("seo.blogTitle"), description: ctx.t("seo.blogDescription") }) }),
8359
+ // O título e a descrição da home ficavam no siteConfig, sem tradução: valiam nos dois idiomas.
8360
+ "/": (ctx) => ({ title: ctx.t("navigation.home"), seo: compact({ title: sameInBoth(loc(ctx.config.get("seo_home_title"))), description: sameInBoth(loc(ctx.config.get("seo_home_description"))) }) }),
8361
+ "/sobre": (ctx) => ({ title: ctx.t("navigation.about"), seo: compact({ title: v1FullTitle(ctx.t("seo.aboutTitle"), ctx.siteTitle), description: ctx.t("seo.aboutDescription") }) }),
8362
+ "/curriculo": (ctx) => ({ title: ctx.t("navigation.resume"), seo: compact({ title: v1FullTitle(ctx.t("seo.resumeTitle"), ctx.siteTitle), description: ctx.t("seo.resumeDescription") }) }),
8363
+ "/portfolio": (ctx) => ({ title: ctx.t("navigation.portfolio"), seo: compact({ title: v1FullTitle(ctx.t("seo.portfolioTitle"), ctx.siteTitle), description: ctx.t("seo.portfolioDescription") }) }),
8364
+ "/blog": (ctx) => ({ title: ctx.t("navigation.blog"), seo: compact({ title: v1FullTitle(ctx.t("seo.blogTitle"), ctx.siteTitle), description: ctx.t("seo.blogDescription") }) }),
8016
8365
  "/depoimentos": (ctx) => ({ title: ctx.t("testimonials.title"), seo: compact({ description: ctx.t("seo.testimonialsDescription") }) })
8017
8366
  };
8018
8367
  SECTION_KEYS = /* @__PURE__ */ new Set([
@@ -8044,6 +8393,8 @@ var init_convert = __esm({
8044
8393
  "portfolio.subtitle",
8045
8394
  "testimonials.title",
8046
8395
  "testimonials.subtitle",
8396
+ "testimonials.viewAll",
8397
+ "home.greeting",
8047
8398
  "navigation.home",
8048
8399
  "navigation.about",
8049
8400
  "navigation.resume",
@@ -8064,7 +8415,6 @@ var init_convert = __esm({
8064
8415
  "portfolio.decisions",
8065
8416
  "portfolio.results",
8066
8417
  "portfolio.learnings",
8067
- "portfolio.metrics",
8068
8418
  "portfolio.testimonial",
8069
8419
  "portfolio.liveDemo",
8070
8420
  "portfolio.code"
@@ -8072,7 +8422,8 @@ var init_convert = __esm({
8072
8422
  UI_TEXT_MAP = {
8073
8423
  "blog.readMore": "common.readMore",
8074
8424
  "common.back": "common.back",
8075
- "testimonials.leaveTestimonial": "testimonials.send",
8425
+ // O botão do envio de depoimento é o da ilha (`testimonialForm.open`).
8426
+ "testimonials.leaveTestimonial": "testimonialForm.open",
8076
8427
  "testimonials.empty": "common.empty",
8077
8428
  "resume.experience": "resume.experience",
8078
8429
  "resume.education": "resume.education",
@@ -8080,8 +8431,33 @@ var init_convert = __esm({
8080
8431
  "resume.courses": "resume.certification",
8081
8432
  "resume.languages": "resume.language",
8082
8433
  "resume.downloadCV": "resume.download",
8434
+ "resume.softSkills": "resume.soft-skill",
8435
+ "resume.volunteer": "resume.volunteer",
8436
+ "resume.showOlder": "resume.showOlder",
8437
+ "resume.hideOlder": "resume.hideOlder",
8438
+ "contactWizard.trigger": "sidebar.talk",
8439
+ "sidebar.downloadCV": "sidebar.downloadCV",
8440
+ "portfolio.screenshots": "case.gallery",
8083
8441
  "home.cases.read": "case.view",
8442
+ "portfolio.viewCase": "case.view",
8443
+ "portfolio.details": "case.details",
8444
+ "portfolio.all": "cases.all",
8445
+ "portfolio.metrics": "case.metrics",
8446
+ "portfolio.nextCase": "case.next",
8447
+ "portfolio.ctaTitle": "case.ctaTitle",
8448
+ "portfolio.ctaSubtitle": "case.ctaBody",
8449
+ "portfolio.ctaProject": "case.ctaButton",
8450
+ "portfolio.expandImage": "gallery.expand",
8451
+ "portfolio.previousImage": "gallery.prev",
8452
+ "portfolio.nextImage": "gallery.next",
8084
8453
  "blog.filterByTags": "blog.filter",
8454
+ "blog.featured": "blog.featured",
8455
+ "blog.readNow": "blog.readNow",
8456
+ "blog.searchPlaceholder": "blog.search",
8457
+ "blog.backToBlog": "blog.back",
8458
+ "blog.authorCta": "blog.authorCta",
8459
+ "blog.authorLine": "blog.authorLine",
8460
+ "blog.relatedCase": "blog.relatedCase",
8085
8461
  "sidebar.language": "nav.language",
8086
8462
  "sidebar.menu": "nav.menu",
8087
8463
  "contactWizard.contact.name": "form.name",
@@ -8092,9 +8468,78 @@ var init_convert = __esm({
8092
8468
  "contactWizard.rateLimited": "form.rateLimited",
8093
8469
  "contactWizard.back": "form.back",
8094
8470
  "notFound.cta": "notFound.home",
8471
+ "notFound.label": "notFound.label",
8472
+ "notFound.errorCode": "notFound.code",
8095
8473
  "portfolio.myRole": "case.role",
8096
8474
  "home.availability.label": "hero.available"
8097
8475
  };
8476
+ V1_LABELS = [
8477
+ "resume.experience",
8478
+ "resume.education",
8479
+ "resume.skills",
8480
+ "resume.softSkills",
8481
+ "resume.courses",
8482
+ "resume.languages",
8483
+ "resume.volunteer",
8484
+ "resume.downloadCV",
8485
+ "resume.showOlder",
8486
+ "resume.hideOlder",
8487
+ "contactWizard.trigger",
8488
+ "sidebar.downloadCV",
8489
+ "testimonials.leaveTestimonial",
8490
+ "portfolio.screenshots",
8491
+ "blog.filterByTags",
8492
+ "portfolio.metrics",
8493
+ "notFound.cta",
8494
+ "blog.featured",
8495
+ "blog.backToBlog",
8496
+ "blog.authorCta"
8497
+ ];
8498
+ UI_TEXT_ADAPT = {
8499
+ "resume.showOlder": (s) => s.includes("{count}") ? s : `${s} ({count})`
8500
+ };
8501
+ V1_WIZARD_FLOWS = [
8502
+ {
8503
+ id: "project",
8504
+ emoji: "\u{1F4BC}",
8505
+ steps: [
8506
+ { kind: "choice", key: "projectType", n: 1, options: ["webapp", "mobile", "landing", "system", "consulting", "other"] },
8507
+ { kind: "choice", key: "timeline", n: 2, options: ["urgent", "short", "medium", "flexible"] },
8508
+ { kind: "choice", key: "budget", n: 3, options: ["small", "medium", "large", "enterprise", "unknown"] },
8509
+ { kind: "textarea", key: "description", n: 4, placeholders: ["placeholder"] },
8510
+ { kind: "contact", askPhone: true, askLinkedin: true }
8511
+ ]
8512
+ },
8513
+ {
8514
+ id: "job",
8515
+ emoji: "\u{1F9D1}\u200D\u{1F4BC}",
8516
+ steps: [
8517
+ { kind: "choice", key: "contractType", n: 1, options: ["clt", "pj", "freelance"] },
8518
+ { kind: "choice", key: "modality", n: 2, options: ["remote", "hybrid", "onsite"] },
8519
+ { kind: "choice", key: "area", n: 3, options: ["frontend", "fullstack", "techlead"] },
8520
+ { kind: "text", key: "jobCompany,jobRole", n: 4, placeholders: ["companyPlaceholder", "rolePlaceholder"] },
8521
+ { kind: "contact", askLinkedin: true }
8522
+ ]
8523
+ },
8524
+ {
8525
+ id: "networking",
8526
+ emoji: "\u{1F91D}",
8527
+ steps: [
8528
+ { kind: "choice", key: "howFound", n: 1, options: ["blog", "linkedin", "referral", "portfolio"] },
8529
+ { kind: "textarea", key: "subject", n: 2, placeholders: ["placeholder"] },
8530
+ { kind: "contact", askLinkedin: true }
8531
+ ]
8532
+ },
8533
+ {
8534
+ id: "feedback",
8535
+ emoji: "\u{1F4AC}",
8536
+ steps: [
8537
+ { kind: "choice", key: "about", n: 1, options: ["post", "project", "general"] },
8538
+ { kind: "textarea", key: "message", n: 2, placeholders: ["placeholder"] },
8539
+ { kind: "contact" }
8540
+ ]
8541
+ }
8542
+ ];
8098
8543
  }
8099
8544
  });
8100
8545
 
@@ -8528,6 +8973,10 @@ function pendingZip(result, source) {
8528
8973
  const tableNumbers = Object.fromEntries(Object.keys(result.pending).filter((t) => source.tableNumbers[t] !== void 0).map((t) => [t, source.tableNumbers[t]]));
8529
8974
  return snapshotZip({ tables: result.pending, tableNumbers, storage: {} });
8530
8975
  }
8976
+ function storageDocs(snapshot) {
8977
+ const bytes = snapshot.storage["_storage/documents.jsonl"];
8978
+ return bytes ? parseJsonl(strFromU8(bytes)) : [];
8979
+ }
8531
8980
  var toJsonl;
8532
8981
  var init_snapshot = __esm({
8533
8982
  "src/migrate/snapshot.ts"() {
@@ -8641,7 +9090,7 @@ function renderReport(input) {
8641
9090
  out.push("");
8642
9091
  }
8643
9092
  } else {
8644
- out.push("## Dados", "", "Sem export da v1 ainda. Rode `npx convex export --path .rubrica/migracao/export-v1.zip` (no Convex de desenvolvimento) e depois `npx create-rubrica migrar dados --export .rubrica/migracao/export-v1.zip`.", "");
9093
+ out.push("## Dados", "", "Sem export da v1 ainda. Rode `npx convex export --prod --include-file-storage --path .rubrica/migracao/export-v1.zip` (do banco com o conte\xFAdo de verdade, em geral a produ\xE7\xE3o; o export s\xF3 l\xEA) e depois `npx create-rubrica migrar dados --export .rubrica/migracao/export-v1.zip`.", "");
8645
9094
  }
8646
9095
  out.push("## Personaliza\xE7\xF5es (comparando com a v1 de refer\xEAncia)", "");
8647
9096
  if (input.customizationsError) out.push(`N\xE3o deu para comparar: ${input.customizationsError}`, "");
@@ -8741,6 +9190,7 @@ var migrate_exports = {};
8741
9190
  __export(migrate_exports, {
8742
9191
  BRANCH: () => BRANCH,
8743
9192
  LAST_V1: () => LAST_V1,
9193
+ MIGRATE_HELP: () => MIGRATE_HELP,
8744
9194
  WORK_DIR: () => WORK_DIR,
8745
9195
  convertExport: () => convertExport,
8746
9196
  readV1: () => readV1,
@@ -8801,7 +9251,7 @@ function v2StateFrom(v1, theme, plugins, now = /* @__PURE__ */ new Date()) {
8801
9251
  }
8802
9252
  function convertExport(exportPath, v1, theme, recipe, outDir, storageUrl, texts) {
8803
9253
  const snapshot = readSnapshot(exportPath);
8804
- const result = convertV1({ tables: snapshot.tables, v1, theme, recipe, ...texts?.texts && { projectTexts: texts.texts } });
9254
+ const result = convertV1({ tables: snapshot.tables, storage: storageDocs(snapshot), v1, theme, recipe, ...texts?.texts && { projectTexts: texts.texts } });
8805
9255
  result.report.warnings.push(...texts?.warnings ?? []);
8806
9256
  mkdirSync3(outDir, { recursive: true });
8807
9257
  const files = {};
@@ -8831,7 +9281,8 @@ async function customizationsFor(projectDir, v1, packageName, deps, templateDir)
8831
9281
  const dir = mkdtempSync(join24(tmpdir2(), "rubrica-v1-pristine-"));
8832
9282
  try {
8833
9283
  await (deps.pristine ?? defaultPristine)(dir, v1, packageName, templateDir);
8834
- return { list: listCustomizations(projectDir, dir, gitFiles(projectDir, deps.runner ?? run)) };
9284
+ const templateRoots = new Set(readdirSync6(dir));
9285
+ return { list: listCustomizations(projectDir, dir, gitFiles(projectDir, deps.runner ?? run)), templateRoots };
8835
9286
  } catch (err) {
8836
9287
  return { error: `${err.message}${templateDir ? "" : " (sem internet? passe --template-v1 <pasta com o reposit\xF3rio do Rubrica>)"}` };
8837
9288
  } finally {
@@ -8863,7 +9314,7 @@ async function runReport(projectDir, values, deps) {
8863
9314
  if (values.export) {
8864
9315
  const snapshot = readSnapshot(resolve3(deps.cwd, values.export));
8865
9316
  const texts = readV1ProjectTexts(projectDir, resolve3(projectDir, WORK_DIR));
8866
- data = convertV1({ tables: snapshot.tables, v1, theme: theme.tema, recipe: CORE_RECIPES.pessoal, ...texts.texts && { projectTexts: texts.texts } }).report;
9317
+ data = convertV1({ tables: snapshot.tables, storage: storageDocs(snapshot), v1, theme: theme.tema, recipe: CORE_RECIPES.pessoal, ...texts.texts && { projectTexts: texts.texts } }).report;
8867
9318
  data.warnings.push(...texts.warnings);
8868
9319
  }
8869
9320
  const report = renderReport({
@@ -8877,7 +9328,7 @@ async function runReport(projectDir, values, deps) {
8877
9328
  nextSteps: [
8878
9329
  v1.version === LAST_V1 ? "A v1 est\xE1 na \xFAltima vers\xE3o: d\xE1 para migrar." : `Atualize a v1 para a ${LAST_V1} antes (npx create-rubrica@1 update).`,
8879
9330
  "Fa\xE7a commit de tudo e rode `npx create-rubrica@latest migrar` (cria a branch rubrica-v2; nada muda na branch atual).",
8880
- ...values.export ? [] : ["Exporte os dados do Convex de desenvolvimento da v1 (`npx convex export --path .rubrica/migracao/export-v1.zip`) para ver no relat\xF3rio o que eles viram."]
9331
+ ...values.export ? [] : ["Exporte os dados da v1 do banco com o conte\xFAdo de verdade, em geral a produ\xE7\xE3o (`npx convex export --prod --include-file-storage --path .rubrica/migracao/export-v1.zip`; o export s\xF3 l\xEA) para ver no relat\xF3rio o que eles viram."]
8881
9332
  ]
8882
9333
  });
8883
9334
  if (values.saida) writeFileSync7(resolve3(deps.cwd, values.saida), report);
@@ -8895,7 +9346,7 @@ async function runCompare(values, deps) {
8895
9346
  return formatComparison(results.filter((r) => r.missing !== "v1"));
8896
9347
  }
8897
9348
  async function runData(projectDir, values, deps) {
8898
- if (!values.export) throw new Cancelled(`Uso: npx create-rubrica migrar dados --export <arquivo.zip>. Para gerar o export: npx convex export --path ${WORK_DIR}/export-v1.zip`);
9349
+ if (!values.export) throw new Cancelled(`Uso: npx create-rubrica migrar dados --export <arquivo.zip>. Para gerar o export (s\xF3 l\xEA; em geral da produ\xE7\xE3o): npx convex export --prod --include-file-storage --path ${WORK_DIR}/export-v1.zip`);
8899
9350
  const raw = JSON.parse(readFileSync16(join24(projectDir, STATE_FILE), "utf-8"));
8900
9351
  const migrated = raw.rubrica === 2 ? raw : null;
8901
9352
  const v1 = migrated ? raw.v1 ?? { layout: migrated.migracao?.layoutV1 ?? "", version: migrated.migracao?.de } : readV1(projectDir);
@@ -8954,7 +9405,16 @@ async function runFull(projectDir, values, flags, deps) {
8954
9405
  }
8955
9406
  const previous = JSON.parse(readFileSync16(join24(projectDir, "package.json"), "utf-8"));
8956
9407
  const oldGitignore = existsSync17(join24(projectDir, ".gitignore")) ? readFileSync16(join24(projectDir, ".gitignore"), "utf-8") : "";
8957
- for (const entry of readdirSync6(projectDir)) if (!KEEP.has(entry)) rmSync3(join24(projectDir, entry), { recursive: true, force: true });
9408
+ const kept = [];
9409
+ for (const entry of readdirSync6(projectDir)) {
9410
+ if (KEEP.has(entry)) continue;
9411
+ if (custom.templateRoots && !custom.templateRoots.has(entry)) {
9412
+ kept.push(entry);
9413
+ continue;
9414
+ }
9415
+ rmSync3(join24(projectDir, entry), { recursive: true, force: true });
9416
+ }
9417
+ if (kept.length) log2.info(`Ficaram na raiz (n\xE3o s\xE3o do template da v1): ${kept.join(", ")}`);
8958
9418
  rmSync3(join24(projectDir, "public", "data"), { recursive: true, force: true });
8959
9419
  const state = v2StateFrom(v1, theme);
8960
9420
  const depSpecs = values.local ? localDependencySpecs(resolve3(deps.cwd, values.local), theme.tema) : defaultDependencySpecs();
@@ -8976,6 +9436,7 @@ ${extra.join("\n")}
8976
9436
  if (!flags.has("sem-instalar")) {
8977
9437
  s.start(`Instalando com o ${pm}...`);
8978
9438
  try {
9439
+ rmSync3(join24(projectDir, "node_modules"), { recursive: true, force: true });
8979
9440
  runner(pm, ["install"], { cwd: projectDir });
8980
9441
  s.stop("Instalado.");
8981
9442
  const core = await loadInstalledCore(projectDir);
@@ -9022,7 +9483,7 @@ ${tail(errorOutput(err))}`);
9022
9483
  ...custom.error && { customizationsError: custom.error },
9023
9484
  outputs: { ...data?.files ?? {}, Relat\u00F3rio: join24(outDir, "relatorio.md") },
9024
9485
  nextSteps: [
9025
- ...data ? [] : [`Exporte os dados da v1 (no Convex de desenvolvimento dela, antes de trocar o .env.local): \`npx convex export --path ${WORK_DIR}/export-v1.zip\`, e rode \`npx create-rubrica migrar dados --export ${WORK_DIR}/export-v1.zip\`.`],
9486
+ ...data ? [] : [`Exporte os dados da v1 do banco com o conte\xFAdo de verdade, em geral a produ\xE7\xE3o (o export s\xF3 l\xEA): \`npx convex export --prod --include-file-storage --path ${WORK_DIR}/export-v1.zip\`, e rode \`npx create-rubrica migrar dados --export ${WORK_DIR}/export-v1.zip\`.`],
9026
9487
  `Build com os dados convertidos: ${build}. Compare com o site no ar: \`npx create-rubrica migrar conferir --v1 ${v1.identity?.siteUrl ?? "<url da v1>"} --v2 dist\`.`,
9027
9488
  ...importSteps(join24(WORK_DIR), projectPackageManager(projectDir)),
9028
9489
  "Para cada personaliza\xE7\xE3o listada, siga a sugest\xE3o (bloco pr\xF3prio, ejetar, tokens). Depois: pnpm check, pnpm test, commit na branch rubrica-v2."
@@ -9036,6 +9497,10 @@ O Convex n\xE3o foi tocado: siga os pr\xF3ximos passos do relat\xF3rio.`);
9036
9497
  }
9037
9498
  async function runMigrate(argv, deps) {
9038
9499
  const out = deps.out ?? ((t) => console.log(t));
9500
+ if (argv.includes("--help") || argv.includes("-h")) {
9501
+ out(MIGRATE_HELP);
9502
+ return;
9503
+ }
9039
9504
  const args = parseArgs(argv, {
9040
9505
  values: ["export", "template-v1", "saida", "v1", "v2", "local", "convex-url"],
9041
9506
  flags: ["relatorio", "yes", "sem-instalar", "sem-build"],
@@ -9070,7 +9535,7 @@ async function runMigrate(argv, deps) {
9070
9535
  }
9071
9536
  await runFull(projectDir, args.values, args.flags, deps);
9072
9537
  }
9073
- var LAST_V1, BRANCH, WORK_DIR, KEEP;
9538
+ var LAST_V1, BRANCH, WORK_DIR, KEEP, MIGRATE_HELP;
9074
9539
  var init_migrate = __esm({
9075
9540
  "src/commands/migrate.ts"() {
9076
9541
  "use strict";
@@ -9101,6 +9566,21 @@ var init_migrate = __esm({
9101
9566
  BRANCH = "rubrica-v2";
9102
9567
  WORK_DIR = ".rubrica/migracao";
9103
9568
  KEEP = /* @__PURE__ */ new Set([".git", "public", "docs", "README.md", "LICENSE", ".agents", ".claude", ".github", ".rubrica", "node_modules", ".env.local", ".env", ".vscode", ".idea"]);
9569
+ MIGRATE_HELP = `Uso: npx create-rubrica@latest migrar [op\xE7\xF5es]
9570
+
9571
+ Leva um projeto da v1 (1.13.1) para a v2, numa branch nova (rubrica-v2). O Convex n\xE3o \xE9 tocado.
9572
+
9573
+ --relatorio s\xF3 mostra o que vai acontecer (tema, personaliza\xE7\xF5es, dados), sem gravar
9574
+ --export <zip> export da v1 (npx convex export --prod --include-file-storage --path .rubrica/migracao/export-v1.zip)
9575
+ --yes, -y n\xE3o pede confirma\xE7\xE3o
9576
+ --sem-instalar n\xE3o instala as depend\xEAncias
9577
+ --sem-build n\xE3o faz o build de confer\xEAncia
9578
+ --saida <pasta> onde gravar os arquivos da migra\xE7\xE3o (padr\xE3o: .rubrica/migracao)
9579
+
9580
+ migrar dados --export <zip> s\xF3 converte os dados (sem trocar o c\xF3digo)
9581
+ migrar conferir --v1 <url> --v2 dist compara t\xEDtulo, h1 e texto das p\xE1ginas
9582
+
9583
+ Guia: https://userubrica.vercel.app/docs/guia/migrar`;
9104
9584
  }
9105
9585
  });
9106
9586
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rubrica",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "CLI do Rubrica v2: cria, configura, publica, atualiza e migra sites feitos com @rubrica/core",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,7 +46,7 @@
46
46
  "tsup": "^8.3.0",
47
47
  "typescript": "^5.9.0",
48
48
  "vitest": "^3.2.4",
49
- "@rubrica/core": "^2.0.0"
49
+ "@rubrica/core": "^2.1.1"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "tsup",