rook-cli 1.3.1 → 1.3.4

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 (90) hide show
  1. package/package.json +3 -2
  2. package/rook-framework/PRD-INSTALL-COMMAND.md +379 -0
  3. package/rook-framework/PRD.md +1214 -0
  4. package/rook-framework/README.md +143 -0
  5. package/rook-framework/assets/rk-accordion.js +99 -0
  6. package/rook-framework/assets/rk-alert-dialog.js +132 -0
  7. package/rook-framework/assets/rk-bottom-app-bar.js +88 -0
  8. package/rook-framework/assets/rk-carousel.js +145 -0
  9. package/rook-framework/assets/rk-collapsible.js +151 -0
  10. package/rook-framework/assets/rk-dialog.js +161 -0
  11. package/rook-framework/assets/rk-drawer.js +214 -0
  12. package/rook-framework/assets/rk-framework-core.css +2554 -0
  13. package/rook-framework/assets/rk-framework-tokens.css +101 -0
  14. package/rook-framework/assets/rk-modal.js +91 -0
  15. package/rook-framework/assets/rk-popover.js +264 -0
  16. package/rook-framework/assets/rk-progress.js +81 -0
  17. package/rook-framework/assets/rk-quantity.js +91 -0
  18. package/rook-framework/assets/rk-scroll-area.js +286 -0
  19. package/rook-framework/assets/rk-sheet.js +157 -0
  20. package/rook-framework/assets/rk-tabs.js +179 -0
  21. package/rook-framework/assets/rk-toggle.js +153 -0
  22. package/rook-framework/blocks/rk-accordion.liquid +97 -0
  23. package/rook-framework/blocks/rk-badge.liquid +103 -0
  24. package/rook-framework/blocks/rk-button.liquid +166 -0
  25. package/rook-framework/blocks/rk-divider.liquid +100 -0
  26. package/rook-framework/blocks/rk-form-field.liquid +120 -0
  27. package/rook-framework/blocks/rk-icon.liquid +134 -0
  28. package/rook-framework/blocks/rk-image.liquid +198 -0
  29. package/rook-framework/blocks/rk-installments.liquid +99 -0
  30. package/rook-framework/blocks/rk-pix-discount.liquid +99 -0
  31. package/rook-framework/blocks/rk-price.liquid +128 -0
  32. package/rook-framework/blocks/rk-quantity.liquid +108 -0
  33. package/rook-framework/blocks/rk-quick-add.liquid +137 -0
  34. package/rook-framework/blocks/rk-skeleton.liquid +104 -0
  35. package/rook-framework/blocks/rk-typography.liquid +183 -0
  36. package/rook-framework/config/rk-settings_schema.json +259 -0
  37. package/rook-framework/snippets/rk-accordion.liquid +31 -0
  38. package/rook-framework/snippets/rk-alert-dialog.liquid +83 -0
  39. package/rook-framework/snippets/rk-aspect-ratio.liquid +23 -0
  40. package/rook-framework/snippets/rk-badge.liquid +17 -0
  41. package/rook-framework/snippets/rk-bottom-app-bar.liquid +51 -0
  42. package/rook-framework/snippets/rk-button.liquid +49 -0
  43. package/rook-framework/snippets/rk-card.liquid +64 -0
  44. package/rook-framework/snippets/rk-carousel.liquid +74 -0
  45. package/rook-framework/snippets/rk-checkbox.liquid +34 -0
  46. package/rook-framework/snippets/rk-collapsible.liquid +52 -0
  47. package/rook-framework/snippets/rk-dialog.liquid +85 -0
  48. package/rook-framework/snippets/rk-divider.liquid +25 -0
  49. package/rook-framework/snippets/rk-drawer.liquid +81 -0
  50. package/rook-framework/snippets/rk-external-assets copy.liquid +33 -0
  51. package/rook-framework/snippets/rk-external-assets.liquid +68 -0
  52. package/rook-framework/snippets/rk-form-field.liquid +83 -0
  53. package/rook-framework/snippets/rk-gap-style.liquid +32 -0
  54. package/rook-framework/snippets/rk-icon.liquid +28 -0
  55. package/rook-framework/snippets/rk-image.liquid +60 -0
  56. package/rook-framework/snippets/rk-input.liquid +35 -0
  57. package/rook-framework/snippets/rk-installments.liquid +54 -0
  58. package/rook-framework/snippets/rk-item.liquid +69 -0
  59. package/rook-framework/snippets/rk-layout-style.liquid +37 -0
  60. package/rook-framework/snippets/rk-modal.liquid +31 -0
  61. package/rook-framework/snippets/rk-pix-discount.liquid +34 -0
  62. package/rook-framework/snippets/rk-popover.liquid +77 -0
  63. package/rook-framework/snippets/rk-price.liquid +48 -0
  64. package/rook-framework/snippets/rk-progress.liquid +38 -0
  65. package/rook-framework/snippets/rk-quantity.liquid +56 -0
  66. package/rook-framework/snippets/rk-quick-add.liquid +67 -0
  67. package/rook-framework/snippets/rk-scripts.liquid +17 -0
  68. package/rook-framework/snippets/rk-scroll-area.liquid +60 -0
  69. package/rook-framework/snippets/rk-sheet.liquid +86 -0
  70. package/rook-framework/snippets/rk-size-style.liquid +48 -0
  71. package/rook-framework/snippets/rk-skeleton.liquid +25 -0
  72. package/rook-framework/snippets/rk-spacing-padding.liquid +18 -0
  73. package/rook-framework/snippets/rk-spacing-style.liquid +54 -0
  74. package/rook-framework/snippets/rk-spinner.liquid +43 -0
  75. package/rook-framework/snippets/rk-swatch.liquid +33 -0
  76. package/rook-framework/snippets/rk-table.liquid +44 -0
  77. package/rook-framework/snippets/rk-tabs.liquid +52 -0
  78. package/rook-framework/snippets/rk-textarea.liquid +42 -0
  79. package/rook-framework/snippets/rk-toggle-group.liquid +27 -0
  80. package/rook-framework/snippets/rk-toggle.liquid +58 -0
  81. package/rook-framework/snippets/rk-typography.liquid +27 -0
  82. package/rook-framework/snippets/rk-variables.liquid +74 -0
  83. package/src/app.js +24 -0
  84. package/src/commands/InstallCommand.js +133 -0
  85. package/src/mcp/server.js +111 -1
  86. package/src/services/FrameworkInstaller.js +379 -0
  87. package/src/templates/block.liquid.txt +25 -17
  88. package/src/templates/section.liquid.txt +29 -14
  89. package/src/ui/PromptUI.js +15 -1
  90. package/src/utils/logger.js +1 -1
@@ -1,7 +1,7 @@
1
- {% doc %}
1
+ {% comment %}
2
2
  Block: {{PascalName}} Block
3
3
  Usage: Use inside sections that support blocks.
4
- {% enddoc %}
4
+ {% endcomment %}
5
5
 
6
6
  {% liquid
7
7
  assign block_id = block.id
@@ -12,6 +12,21 @@
12
12
  class="{{kebabName}}-block"
13
13
  data-block-id="{{ block_id }}"
14
14
  {{ block.shopify_attributes }}
15
+ style="
16
+ --bg-color: {{ block.settings.bg_color }};
17
+ --text-color: {{ block.settings.text_color }};
18
+ --title-color: {{ block.settings.title_color }};
19
+ --border-color: {{ block.settings.border_color }};
20
+ --border-radius: {{ block.settings.border_radius }}px;
21
+ --border-width: {{ block.settings.border_width }}px;
22
+ --btn-bg: {{ block.settings.btn_bg_color }};
23
+ --btn-text: {{ block.settings.btn_text_color }};
24
+ --btn-radius: {{ block.settings.btn_border_radius }}px;
25
+ --fs-title-desktop: {{ block.settings.title_size_desktop }}px;
26
+ --fs-text-desktop: {{ block.settings.text_size_desktop }}px;
27
+ --fs-title-mobile: {{ block.settings.title_size_mobile }}px;
28
+ --fs-text-mobile: {{ block.settings.text_size_mobile }}px;
29
+ "
15
30
  >
16
31
  <div class="{{kebabName}}-block__inner">
17
32
  {% if block.settings.title != blank %}
@@ -20,6 +35,14 @@
20
35
  </div>
21
36
  </{{kebabName}}-block>
22
37
 
38
+ {% stylesheet %}
39
+ /* Block Styling */
40
+ .{{kebabName}}-block {
41
+ display: block;
42
+ position: relative;
43
+ }
44
+ {% endstylesheet %}
45
+
23
46
  {% schema %}
24
47
  {
25
48
  "name": "{{PascalName}} Block",
@@ -35,18 +58,3 @@
35
58
  }
36
59
  {% endschema %}
37
60
 
38
- {% javascript %}
39
- class {{PascalName}}Block extends HTMLElement {
40
- connectedCallback() {
41
- this.addEventListener('click', this.handleClick.bind(this));
42
- }
43
-
44
- handleClick() {
45
- console.log('Block clicked:', this.dataset.blockId);
46
- }
47
- }
48
-
49
- if (!customElements.get('{{kebabName}}-block')) {
50
- customElements.define('{{kebabName}}-block', {{PascalName}}Block);
51
- }
52
- {% endjavascript %}
@@ -1,11 +1,11 @@
1
- {% doc %}
1
+ {% comment %}
2
2
  Section: {{PascalName}}
3
3
  Description: Componente principal controlado via Web Component.
4
4
  Architecture:
5
5
  - HTML: Semântico com IDs dinâmicos
6
6
  - JS: Web Component desacoplado
7
7
  - CSS: Scoped ou via Assets
8
- {% enddoc %}
8
+ {% endcomment %}
9
9
 
10
10
  {% liquid
11
11
  assign section_id = section.id
@@ -16,6 +16,21 @@
16
16
  id="{{ container_id }}"
17
17
  class="{{kebabName}} section-container"
18
18
  data-section-id="{{ section_id }}"
19
+ style="
20
+ --bg-color: {{ section.settings.bg_color }};
21
+ --text-color: {{ section.settings.text_color }};
22
+ --title-color: {{ section.settings.title_color }};
23
+ --border-color: {{ section.settings.border_color }};
24
+ --border-radius: {{ section.settings.border_radius }}px;
25
+ --border-width: {{ section.settings.border_width }}px;
26
+ --btn-bg: {{ section.settings.btn_bg_color }};
27
+ --btn-text: {{ section.settings.btn_text_color }};
28
+ --btn-radius: {{ section.settings.btn_border_radius }}px;
29
+ --fs-title-desktop: {{ section.settings.title_size_desktop }}px;
30
+ --fs-text-desktop: {{ section.settings.text_size_desktop }}px;
31
+ --fs-title-mobile: {{ section.settings.title_size_mobile }}px;
32
+ --fs-text-mobile: {{ section.settings.text_size_mobile }}px;
33
+ "
19
34
  >
20
35
  <div class="{{kebabName}}__wrapper page-width">
21
36
  {%- if section.settings.heading != blank -%}
@@ -28,6 +43,18 @@
28
43
  </div>
29
44
  </{{kebabName}}-section>
30
45
 
46
+ {% stylesheet %}
47
+ /* BEM Styling */
48
+ .{{kebabName}} {
49
+ display: block;
50
+ position: relative;
51
+ padding: 2rem 0;
52
+ }
53
+ .{{kebabName}}__heading {
54
+ margin-bottom: 1.5rem;
55
+ }
56
+ {% endstylesheet %}
57
+
31
58
  {% schema %}
32
59
  {
33
60
  "name": "{{PascalName}}",
@@ -54,18 +81,6 @@
54
81
  }
55
82
  {% endschema %}
56
83
 
57
- {% stylesheet %}
58
- /* BEM Styling */
59
- .{{kebabName}} {
60
- display: block;
61
- position: relative;
62
- padding: 2rem 0;
63
- }
64
- .{{kebabName}}__heading {
65
- margin-bottom: 1.5rem;
66
- }
67
- {% endstylesheet %}
68
-
69
84
  {% javascript %}
70
85
  class {{PascalName}}Section extends HTMLElement {
71
86
  constructor() {
@@ -8,7 +8,7 @@
8
8
  * Princípio: Aberto/Fechado (OCP) — fácil adicionar novos menus
9
9
  */
10
10
 
11
- import { select, checkbox, input } from '@inquirer/prompts';
11
+ import { select, checkbox, input, confirm } from '@inquirer/prompts';
12
12
 
13
13
  export class PromptUI {
14
14
 
@@ -120,6 +120,20 @@ export class PromptUI {
120
120
  * @param {Array<{nome: string, caminho: string}>} componentes - Componentes disponíveis
121
121
  * @returns {Promise<Array<{nome: string, caminho: string}>>} Componentes selecionados
122
122
  */
123
+ /**
124
+ * Exibe uma pergunta de confirmação (sim/não).
125
+ *
126
+ * @param {string} mensagem - Pergunta a ser exibida
127
+ * @param {boolean} [padrao=true] - Valor padrão (true = Sim)
128
+ * @returns {Promise<boolean>}
129
+ */
130
+ async confirmar(mensagem, padrao = true) {
131
+ return confirm({
132
+ message: mensagem,
133
+ default: padrao,
134
+ });
135
+ }
136
+
123
137
  async selecionarComponentes(componentes) {
124
138
  if (componentes.length === 0) {
125
139
  throw new Error('Nenhum componente disponível no repositório.');
@@ -49,7 +49,7 @@ export class Logger {
49
49
  banner() {
50
50
  console.log('');
51
51
  console.log(pc.bold(pc.white(' ╔══════════════════════════════╗')));
52
- console.log(pc.bold(pc.white(' ║ ♟️ ROOK CLI v1.3.1 ║')));
52
+ console.log(pc.bold(pc.white(' ║ ♟️ ROOK CLI v1.3.4 ║')));
53
53
  console.log(pc.bold(pc.white(' ║ Shopify Component Tool ║')));
54
54
  console.log(pc.bold(pc.white(' ╚══════════════════════════════╝')));
55
55
  console.log('');