wagtail-enap-designsystem 1.2.1.145__py3-none-any.whl → 1.2.1.146__py3-none-any.whl

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.

Potentially problematic release.


This version of wagtail-enap-designsystem might be problematic. Click here for more details.

Files changed (32) hide show
  1. enap_designsystem/blocks/__init__.py +2 -0
  2. enap_designsystem/blocks/html_blocks.py +88 -0
  3. enap_designsystem/models.py +81 -13
  4. enap_designsystem/static/enap_designsystem/blocks/apresentacao_block.css +174 -0
  5. enap_designsystem/static/enap_designsystem/blocks/cards_section.css +112 -0
  6. enap_designsystem/static/enap_designsystem/blocks/cards_titles.css +229 -0
  7. enap_designsystem/static/enap_designsystem/blocks/carousel_images.css +323 -0
  8. enap_designsystem/static/enap_designsystem/blocks/carousel_responsive.css +522 -0
  9. enap_designsystem/static/enap_designsystem/blocks/carousel_responsivo_snippet.css +294 -0
  10. enap_designsystem/static/enap_designsystem/blocks/clientes_block.css +146 -0
  11. enap_designsystem/templates/enap_designsystem/base.html +8 -1
  12. enap_designsystem/templates/enap_designsystem/blocks/apresentacao_block.html +17 -13
  13. enap_designsystem/templates/enap_designsystem/blocks/apresentacao_simple_block.html +3 -3
  14. enap_designsystem/templates/enap_designsystem/blocks/banner.html +14 -1
  15. enap_designsystem/templates/enap_designsystem/blocks/banner_logo.html +15 -1
  16. enap_designsystem/templates/enap_designsystem/blocks/card_block.html +2 -2
  17. enap_designsystem/templates/enap_designsystem/blocks/cards_section.html +2 -109
  18. enap_designsystem/templates/enap_designsystem/blocks/cards_titles.html +10 -2
  19. enap_designsystem/templates/enap_designsystem/blocks/carousel.html +1 -187
  20. enap_designsystem/templates/enap_designsystem/blocks/carousel_images.html +17 -314
  21. enap_designsystem/templates/enap_designsystem/blocks/carousel_responsive.html +0 -328
  22. enap_designsystem/templates/enap_designsystem/blocks/carousel_responsivo_snippet.html +3 -197
  23. enap_designsystem/templates/enap_designsystem/blocks/clientes_block.html +9 -152
  24. enap_designsystem/templates/enap_designsystem/blocks/footer_block.html +122 -0
  25. enap_designsystem/templates/enap_designsystem/blocks/section_block.html +1 -1
  26. enap_designsystem/templates/enap_designsystem/blocks/video_hero_banner.html +1 -2
  27. enap_designsystem/templates/enap_designsystem/pages/showcase_components.html +501 -180
  28. {wagtail_enap_designsystem-1.2.1.145.dist-info → wagtail_enap_designsystem-1.2.1.146.dist-info}/METADATA +1 -1
  29. {wagtail_enap_designsystem-1.2.1.145.dist-info → wagtail_enap_designsystem-1.2.1.146.dist-info}/RECORD +32 -24
  30. {wagtail_enap_designsystem-1.2.1.145.dist-info → wagtail_enap_designsystem-1.2.1.146.dist-info}/WHEEL +0 -0
  31. {wagtail_enap_designsystem-1.2.1.145.dist-info → wagtail_enap_designsystem-1.2.1.146.dist-info}/licenses/LICENSE +0 -0
  32. {wagtail_enap_designsystem-1.2.1.145.dist-info → wagtail_enap_designsystem-1.2.1.146.dist-info}/top_level.txt +0 -0
@@ -29,6 +29,7 @@ from .html_blocks import (
29
29
  ApresentacaoBlock,
30
30
  ApresentacaoSimpleBlock,
31
31
  RecaptchaBlock,
32
+ FooterGenericoBlock,
32
33
  SecaoApresentacaoCardsBlock,
33
34
  LogosSimpleBlock,
34
35
  NumerosBlock
@@ -484,6 +485,7 @@ LAYOUT_STREAMBLOCKS = [
484
485
 
485
486
  # ===== SEÇÃO COMPLEXA (MANTIDA PARA COMPATIBILIDADE) =====
486
487
  ('recaptcha', RecaptchaBlock()),
488
+ ('footer_generico', FooterGenericoBlock()),
487
489
  ("enap_section", EnapSectionBlock([
488
490
  ("button", ButtonBlock()),
489
491
  ("image", ImageBlock()),
@@ -7513,6 +7513,12 @@ class ApresentacaoBlock(blocks.StructBlock):
7513
7513
  help_text="Cor do botão no hover"
7514
7514
  )
7515
7515
 
7516
+ cor_botao_active = blocks.CharBlock(
7517
+ required=False,
7518
+ default='#B396FC',
7519
+ help_text="Cor do botão ao apertar"
7520
+ )
7521
+
7516
7522
  class Meta:
7517
7523
  template = 'enap_designsystem/blocks/apresentacao_block.html'
7518
7524
  icon = 'doc-full'
@@ -7703,6 +7709,18 @@ class SecaoApresentacaoCardsBlock(blocks.StructBlock):
7703
7709
  default='#FFFFFF',
7704
7710
  help_text="Cor do botão"
7705
7711
  )
7712
+
7713
+ cor_botao_hover = blocks.CharBlock(
7714
+ required=False,
7715
+ default='#FFFFFF',
7716
+ help_text="Cor do botão no hover"
7717
+ )
7718
+
7719
+ cor_botao_active = blocks.CharBlock(
7720
+ required=False,
7721
+ default='#FFFFFF',
7722
+ help_text="Cor do botão ao apertar"
7723
+ )
7706
7724
 
7707
7725
  cor_botao_texto = blocks.CharBlock(
7708
7726
  required=False,
@@ -7805,9 +7823,79 @@ class RecaptchaBlock(StructBlock):
7805
7823
  label = 'reCAPTCHA'
7806
7824
  help_text = 'Componente de verificação reCAPTCHA'
7807
7825
 
7826
+ class LinkBlock(blocks.StructBlock):
7827
+ """
7828
+ Bloco de titulo e links
7829
+ """
7830
+
7831
+ title = blocks.RawHTMLBlock(
7832
+ label="Título",
7833
+ required=False,
7834
+ help_text="Texto do link",
7835
+ default="Título"
7836
+ )
7837
+
7838
+ link_url = blocks.URLBlock(
7839
+ label="URL do Link",
7840
+ required=False,
7841
+ help_text="Link para página",
7842
+ default="https://enap.gov.br/"
7843
+ )
7808
7844
 
7845
+ class Meta:
7846
+ icon = 'user'
7847
+ label = 'Links'
7809
7848
 
7849
+ class FooterGenericoBlock(StructBlock):
7850
+ """Block para footer generico"""
7851
+ cor_fundo = CharBlock(required=False, label="Cor do fundo", default="#525258")
7852
+ cor_texto = CharBlock(required=False, label="Cor dos textos", default="#ffffff")
7853
+ logo = ImageChooserBlock(label="Logo", required=False)
7854
+ texto_logo = blocks.RawHTMLBlock(label="Texto do Evento", help_text="Texto que fica abaixo da logo.", required=False)
7855
+
7856
+ titulo_1 = blocks.CharBlock(
7857
+ required=False,
7858
+ max_length=200,
7859
+ help_text="Título da primeira seção"
7860
+ )
7861
+
7862
+ links_1 = blocks.StreamBlock([
7863
+ ('texto_secao1', LinkBlock()),
7864
+ ],
7865
+ required=False,
7866
+ help_text="Links da primeira seção"
7867
+ )
7868
+
7869
+ titulo_2 = blocks.CharBlock(
7870
+ required=False,
7871
+ max_length=200,
7872
+ help_text="Título da segunda seção"
7873
+ )
7874
+
7875
+ links_2 = blocks.StreamBlock([
7876
+ ('texto_secao2', LinkBlock()),
7877
+ ],
7878
+ required=False,
7879
+ help_text="Links da segunda seção"
7880
+ )
7881
+
7882
+ titulo_3 = blocks.CharBlock(
7883
+ required=False,
7884
+ max_length=200,
7885
+ help_text="Título da terceira seção"
7886
+ )
7887
+
7888
+ links_3 = blocks.StreamBlock([
7889
+ ('texto_secao3', LinkBlock()),
7890
+ ],
7891
+ required=False,
7892
+ help_text="Links da terceira seção"
7893
+ )
7810
7894
 
7895
+ class Meta:
7896
+ template = 'enap_designsystem/blocks/footer_block.html'
7897
+ icon = 'list-ul'
7898
+ label = 'Footer'
7811
7899
 
7812
7900
 
7813
7901
 
@@ -5246,13 +5246,38 @@ class ShowcaseComponentesDireto(Page):
5246
5246
  try:
5247
5247
  debug_log.append(f" 🎨 Tipo: {comp_block.__class__.__name__}")
5248
5248
 
5249
- # Gerar dados COMPLETOS para o componente
5250
5249
  component_data = self.generate_realistic_component_data(comp_name, comp_block, debug_log)
5251
5250
 
5252
- # Tentar renderizar
5251
+ try:
5252
+ if hasattr(comp_block, 'child_blocks'):
5253
+ for field_name, field_block in comp_block.child_blocks.items():
5254
+ if field_name in component_data:
5255
+ field_type = field_block.__class__.__name__
5256
+ value = component_data[field_name]
5257
+
5258
+ if 'Stream' in field_type and not isinstance(value, list):
5259
+ component_data[field_name] = []
5260
+ debug_log.append(f" 🔧 Corrigido {field_name}: StreamBlock precisa de lista")
5261
+
5262
+ elif 'List' in field_type and not isinstance(value, list):
5263
+ component_data[field_name] = []
5264
+ debug_log.append(f" 🔧 Corrigido {field_name}: ListBlock precisa de lista")
5265
+
5266
+ elif 'Choice' in field_type and not isinstance(value, str):
5267
+ component_data[field_name] = 'opcao1'
5268
+ debug_log.append(f" 🔧 Corrigido {field_name}: ChoiceBlock precisa de string")
5269
+
5270
+ elif 'RichText' in field_type and not isinstance(value, str):
5271
+ component_data[field_name] = '<p>Texto exemplo</p>'
5272
+ debug_log.append(f" 🔧 Corrigido {field_name}: RichText precisa de string")
5273
+
5274
+ except Exception as validation_error:
5275
+ debug_log.append(f" ⚠️ Erro na validação: {str(validation_error)}")
5276
+ component_data = {}
5277
+
5253
5278
  rendered_html = None
5254
5279
  render_error = None
5255
-
5280
+
5256
5281
  try:
5257
5282
  debug_log.append(f" 🎯 Tentando renderizar componente completo...")
5258
5283
  rendered_html = comp_block.render(component_data)
@@ -5262,7 +5287,6 @@ class ShowcaseComponentesDireto(Page):
5262
5287
  debug_log.append(f" ❌ Erro na renderização: {str(e)}")
5263
5288
  render_error = str(e)
5264
5289
 
5265
- # Tentar com dados mínimos
5266
5290
  try:
5267
5291
  debug_log.append(f" 🔄 Tentando com dados mínimos...")
5268
5292
  minimal_data = self.generate_minimal_component_data(comp_block)
@@ -5338,10 +5362,10 @@ class ShowcaseComponentesDireto(Page):
5338
5362
  return {} # Será processado recursivamente
5339
5363
 
5340
5364
  elif field_type == 'ListBlock':
5341
- return [] # Lista vazia por padrão
5365
+ return self.generate_listblock_default_data(field_block, field_name)
5342
5366
 
5343
5367
  elif field_type == 'StreamBlock':
5344
- return [] # Stream vazio por padrão
5368
+ return self.generate_streamblock_default_data(field_block, field_name)
5345
5369
 
5346
5370
  # === CAMPOS DE ESCOLHA ===
5347
5371
  elif field_type == 'ChoiceBlock':
@@ -5535,6 +5559,56 @@ class ShowcaseComponentesDireto(Page):
5535
5559
  return '2024-06-15T14:30:00'
5536
5560
 
5537
5561
  return '2024-06-15'
5562
+
5563
+ def generate_streamblock_default_data(self, stream_block, field_name):
5564
+ """Gera dados padrão para StreamBlocks"""
5565
+ if not hasattr(stream_block, 'child_blocks'):
5566
+ return []
5567
+
5568
+ stream_data = []
5569
+ available_blocks = list(stream_block.child_blocks.items())[:2]
5570
+
5571
+ for block_name, block_instance in available_blocks:
5572
+ if hasattr(block_instance, 'child_blocks'):
5573
+ block_data = {}
5574
+ for child_field, child_block in block_instance.child_blocks.items():
5575
+ block_data[child_field] = self.generate_realistic_field_value(
5576
+ child_field, child_block, f"{field_name}_{block_name}"
5577
+ )
5578
+ else:
5579
+ block_data = self.generate_realistic_field_value(
5580
+ block_name, block_instance, field_name
5581
+ )
5582
+
5583
+ stream_data.append({
5584
+ 'type': block_name,
5585
+ 'value': block_data
5586
+ })
5587
+
5588
+ return stream_data
5589
+
5590
+ def generate_listblock_default_data(self, field_block, field_name):
5591
+ """Gera dados padrão para ListBlocks"""
5592
+ if hasattr(field_block, 'child_block'):
5593
+ child_block = field_block.child_block
5594
+ items = []
5595
+
5596
+ for i in range(2):
5597
+ if hasattr(child_block, 'child_blocks'):
5598
+ item_data = {}
5599
+ for sub_field, sub_block in child_block.child_blocks.items():
5600
+ item_data[sub_field] = self.generate_realistic_field_value(
5601
+ sub_field, sub_block, f"{field_name}_item_{i}"
5602
+ )
5603
+ else:
5604
+ item_data = self.generate_realistic_field_value(
5605
+ f"{field_name}_item_{i}", child_block, f"{field_name}_list"
5606
+ )
5607
+ items.append(item_data)
5608
+
5609
+ return items
5610
+
5611
+ return []
5538
5612
 
5539
5613
  def get_richtext_default_value(self, field_name):
5540
5614
  """Gera valor padrão para campos de texto rico"""
@@ -5646,9 +5720,6 @@ class ShowcaseComponentesDireto(Page):
5646
5720
  titles = [
5647
5721
  'Escola Nacional de Administração Pública',
5648
5722
  'Capacitação para o Serviço Público',
5649
- 'Inovação na Gestão Pública',
5650
- 'Transformação Digital do Governo',
5651
- 'Excelência em Administração Pública'
5652
5723
  ]
5653
5724
  import random
5654
5725
  return random.choice(titles)
@@ -5658,10 +5729,7 @@ class ShowcaseComponentesDireto(Page):
5658
5729
 
5659
5730
  elif 'description' in field_lower or 'descricao' in field_lower:
5660
5731
  descriptions = [
5661
- 'A ENAP é a escola de governo do Poder Executivo federal, responsável pela formação e capacitação de servidores públicos.',
5662
- 'Desenvolvemos competências e habilidades dos servidores para uma gestão pública moderna, eficiente e orientada ao cidadão.',
5663
- 'Nossa missão é contribuir para a modernização do Estado através da capacitação de seus servidores.',
5664
- 'Promovemos a inovação e a transformação digital na administração pública federal.'
5732
+ 'A ENAP é a escola de governo do Poder Executivo federal, responsável pela formação e capacitação de servidores públicos.'
5665
5733
  ]
5666
5734
  import random
5667
5735
  return random.choice(descriptions)
@@ -0,0 +1,174 @@
1
+ /* Estilos gerais */
2
+ .secao-display {
3
+ padding: 90px 0;
4
+ }
5
+
6
+ .secao-cabecalho {
7
+ font-size: 48px !important;
8
+ font-weight: 500;
9
+ margin-bottom: 2rem;
10
+ }
11
+
12
+ .secao-conteudo-cartoes {
13
+ max-width: 1142px;
14
+ margin: 0 auto;
15
+ padding: 45px;
16
+ }
17
+
18
+ .secao-texto {
19
+ font-size: 1.125rem;
20
+ line-height: 1.75;
21
+ }
22
+
23
+ /* Forçar cores do richtext */
24
+ .secao-display .secao-texto * {
25
+ color: inherit !important;
26
+ }
27
+
28
+ /* Grid de Cards */
29
+ .secao-cartoes {
30
+ display: grid;
31
+ gap: 2rem;
32
+ margin-top: 3rem;
33
+ }
34
+
35
+ /* Grid responsivo baseado na escolha */
36
+ .cards-grid-1 {
37
+ grid-template-columns: 1fr;
38
+ max-width: 600px;
39
+ margin-left: auto;
40
+ margin-right: auto;
41
+ }
42
+
43
+ .cards-grid-2 {
44
+ grid-template-columns: 1fr;
45
+ max-width: 800px;
46
+ margin-left: auto;
47
+ margin-right: auto;
48
+ }
49
+
50
+ @media (min-width: 768px) {
51
+ .cards-grid-2 {
52
+ grid-template-columns: repeat(2, 1fr);
53
+ }
54
+ }
55
+
56
+ .cards-grid-3 {
57
+ grid-template-columns: 1fr;
58
+ }
59
+
60
+ @media (min-width: 768px) {
61
+ .cards-grid-3 {
62
+ grid-template-columns: repeat(2, 1fr);
63
+ }
64
+ }
65
+
66
+ @media (min-width: 1024px) {
67
+ .cards-grid-3 {
68
+ grid-template-columns: repeat(3, 1fr);
69
+ }
70
+ }
71
+
72
+ .cards-grid-4 {
73
+ grid-template-columns: 1fr;
74
+ }
75
+
76
+ @media (min-width: 768px) {
77
+ .cards-grid-4 {
78
+ grid-template-columns: repeat(2, 1fr);
79
+ }
80
+ }
81
+
82
+ @media (min-width: 1024px) {
83
+ .cards-grid-4 {
84
+ grid-template-columns: repeat(4, 1fr);
85
+ }
86
+ }
87
+
88
+ .cards-grid-5 {
89
+ grid-template-columns: 1fr;
90
+ }
91
+
92
+ @media (min-width: 640px) {
93
+ .cards-grid-5 {
94
+ grid-template-columns: repeat(2, 1fr);
95
+ }
96
+ }
97
+
98
+ @media (min-width: 768px) {
99
+ .cards-grid-5 {
100
+ grid-template-columns: repeat(3, 1fr);
101
+ }
102
+ }
103
+
104
+ @media (min-width: 1024px) {
105
+ .cards-grid-5 {
106
+ grid-template-columns: repeat(4, 1fr);
107
+ }
108
+ }
109
+
110
+ @media (min-width: 1280px) {
111
+ .cards-grid-5 {
112
+ grid-template-columns: repeat(5, 1fr);
113
+ }
114
+ }
115
+
116
+ /* Estilos do Card */
117
+ .secao-cartao {
118
+ text-align: center;
119
+ padding: 0px;
120
+ }
121
+
122
+ .cartao-simbolo {
123
+ margin-bottom: 1.5rem;
124
+ width: 60px;
125
+ height: 60px;
126
+ border-radius: 50%;
127
+ }
128
+
129
+ .cartao-simbolo i {
130
+ font-size: 2rem;
131
+ color: #FFFFFF;
132
+ width: 60px;
133
+ height: 60px;
134
+ border-radius: 50%;
135
+ display: flex;
136
+ align-items: center;
137
+ justify-content: center;
138
+ margin: 0 auto;
139
+ }
140
+
141
+ .cartao-cabecalho {
142
+ font-size: 1.25rem;
143
+ font-weight: 600;
144
+ color: #FFFFFF;
145
+ margin-bottom: 1rem;
146
+ line-height: 1.4;
147
+ text-align: left;
148
+ }
149
+
150
+ .cartao-texto {
151
+ font-size: 0.95rem;
152
+ color: rgba(255, 255, 255, 0.9);
153
+ line-height: 1.6;
154
+ margin: 0;
155
+ text-align: left;
156
+ }
157
+
158
+ /* Responsividade mobile */
159
+ @media (max-width: 767px) {
160
+ .secao-conteudo-cartoes {
161
+ padding: 2rem;
162
+ }
163
+
164
+ .secao-cartoes {
165
+ gap: 2.5rem;
166
+ margin-top: 2rem;
167
+ }
168
+
169
+ .cartao-simbolo i {
170
+ font-size: 2.5rem;
171
+ width: 70px;
172
+ height: 70px;
173
+ }
174
+ }
@@ -0,0 +1,112 @@
1
+ .enap-cards-section {
2
+ padding: 60px 20px;
3
+ background-color: #ffffff;
4
+ }
5
+
6
+ .enap-cards-container {
7
+ max-width: 1142px;
8
+ margin: 0 auto;
9
+ }
10
+
11
+ .enap-section-header {
12
+ margin-bottom: 50px;
13
+ }
14
+
15
+ .enap-section-title {
16
+ font-size: 32px;
17
+ font-weight: 700;
18
+ color: #024248;
19
+ margin: 0 0 15px 0;
20
+ line-height: 1.2;
21
+ }
22
+
23
+ .enap-section-subtitle {
24
+ font-size: 18px;
25
+ color: #024248;
26
+ margin: 0;
27
+ max-width: 600px;
28
+ }
29
+
30
+ .enap-cards-grid {
31
+ display: grid;
32
+ gap: 30px;
33
+ grid-template-columns: 1fr;
34
+ }
35
+
36
+ /* Responsive Grid */
37
+ @media (min-width: 768px) {
38
+ .enap-cards-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }
39
+ .enap-cards-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
40
+ .enap-cards-grid.grid-4 { grid-template-columns: repeat(4, 1fr); }
41
+ }
42
+
43
+ .enap-card {
44
+ overflow: hidden;
45
+ transition: all 0.3s ease;
46
+ }
47
+
48
+ .enap-card:hover {
49
+ transform: translateY(-4px);
50
+ }
51
+
52
+ .enap-card-image {
53
+ width: 100%;
54
+ height: 350px;
55
+ object-fit: cover;
56
+ display: block;
57
+ object-position: top;
58
+ border-radius: 12px;
59
+ }
60
+
61
+ .enap-card-content {
62
+ padding: 24px 0;
63
+ }
64
+
65
+ .enap-card-title {
66
+ font-size: 20px;
67
+ font-weight: 600;
68
+ color: #2d3748;
69
+ margin: 0 0 8px 0;
70
+ line-height: 1.3;
71
+ }
72
+
73
+ .enap-card-subtitle {
74
+ font-size: 14px;
75
+ color:#000;
76
+ font-weight: 500;
77
+ margin: 0 0 12px 0;
78
+ }
79
+
80
+ .enap-card-description {
81
+ color: #4a5568;
82
+ margin: 0 0 16px 0;
83
+ line-height: 1.5;
84
+ font-size: 14px;
85
+ }
86
+
87
+ .enap-card-link {
88
+ display: inline-flex;
89
+ align-items: center;
90
+ color: #007D7A;
91
+ font-weight: 500;
92
+ text-decoration: none;
93
+ font-size: 14px;
94
+ transition: color 0.2s ease;
95
+ display: flex;
96
+ gap: 6px;
97
+ }
98
+
99
+ .enap-card-link:hover {
100
+ color: #047857;
101
+ }
102
+
103
+ .enap-card-link-arrow {
104
+ width: 16px;
105
+ height: 16px;
106
+ margin-left: 6px;
107
+ transition: transform 0.2s ease;
108
+ }
109
+
110
+ .enap-card-link:hover .enap-card-link-arrow {
111
+ transform: translateX(3px);
112
+ }