rook-cli 1.3.13 → 1.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rook-cli",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "CLI para instalar componentes Shopify",
5
5
  "repository": {
6
6
  "type": "git",
@@ -531,20 +531,20 @@ Shapes: `text` \| `circle` \| `rect`
531
531
 
532
532
  ---
533
533
 
534
- #### `rk-modal` (Media Lightbox)
534
+ #### `rk-modal` (Generic Lightbox Container)
535
535
  **Arquivo:** `snippets/rk-modal.liquid`
536
536
  **Controller:** `assets/rk-modal.js` → `<rk-modal-element>`
537
- **Descrição:** Lightbox de mídia especializado para imagens, vídeos hospedados, YouTube, Vimeo e HTML customizado. Suporta lazy-loading de iframes, autoplay, overlay escuro (85% opacidade), ESC key e scroll lock.
537
+ **Descrição:** Container lightbox genérico e fullscreen. Aceita qualquer conteúdo por padrão (type: `custom`) e oferece presets de conveniência para tipos de mídia comuns (image, video, youtube, vimeo, html). Suporta lazy-loading de iframes, autoplay, overlay escuro (85% opacidade), ESC key e scroll lock.
538
538
 
539
539
  | Prop | Tipo | Default | Descrição |
540
540
  |---|---|---|---|
541
541
  | `id` | string | — | ID único do modal (obrigatório) |
542
- | `type` | string | `image` | `image` \| `video` \| `youtube` \| `vimeo` \| `html` |
542
+ | `type` | string | `custom` | `custom` \| `image` \| `video` \| `youtube` \| `vimeo` \| `html` |
543
+ | `content` | string | — | HTML arbitrário (funciona com qualquer type, obrigatório para `custom` e `html`) |
543
544
  | `image` | object | — | Objeto imagem Shopify (para type: `image`) |
544
545
  | `video_url` | string | — | URL do arquivo .mp4 (para type: `video`) |
545
546
  | `youtube_id` | string | — | ID do vídeo YouTube (para type: `youtube`) |
546
547
  | `vimeo_id` | string | — | ID do vídeo Vimeo (para type: `vimeo`) |
547
- | `content` | string | — | HTML customizado (para type: `html`) |
548
548
  | `alt` | string | — | Texto alternativo / aria-label |
549
549
  | `aspect_ratio` | string | `16/9` | Aspect ratio para vídeos |
550
550
  | `autoplay` | boolean | `true` | Autoplay ao abrir |
@@ -554,6 +554,14 @@ Shapes: `text` \| `circle` \| `rect`
554
554
 
555
555
  **Exemplo:**
556
556
  ```liquid
557
+ {%- comment -%} Conteúdo customizado (default) {%- endcomment -%}
558
+ {%- capture modal_body -%}
559
+ <h2>Meu conteúdo</h2>
560
+ <p>Qualquer HTML aqui</p>
561
+ {%- render 'rk-button', text: 'Fechar', attr: 'data-action="close"' -%}
562
+ {%- endcapture -%}
563
+ {% render 'rk-modal', id: 'my-modal', content: modal_body %}
564
+
557
565
  {%- comment -%} Lightbox de imagem {%- endcomment -%}
558
566
  {% render 'rk-modal', id: 'product-zoom', type: 'image', image: product.featured_image, alt: product.title %}
559
567
 
@@ -563,10 +571,14 @@ Shapes: `text` \| `circle` \| `rect`
563
571
  {%- comment -%} Vídeo hospedado {%- endcomment -%}
564
572
  {% render 'rk-modal', id: 'story', type: 'video', video_url: video_source, autoplay: true %}
565
573
 
566
- {%- comment -%} HTML customizado {%- endcomment -%}
567
- {% render 'rk-modal', id: 'custom', type: 'html', content: '<p>Conteúdo aqui</p>' %}
574
+ {%- comment -%} HTML customizado (com bg branco e padding) {%- endcomment -%}
575
+ {% render 'rk-modal', id: 'info', type: 'html', content: '<p>Conteúdo aqui</p>' %}
568
576
  ```
569
577
 
578
+ **Diferença entre `custom` e `html`:**
579
+ - `custom` (default): Container transparente sem styling — o conteúdo controla 100% da aparência.
580
+ - `html`: Container com fundo branco, border-radius e padding — ideal para conteúdo de texto.
581
+
570
582
  **Comportamento Técnico:**
571
583
  - Iframes (YouTube/Vimeo) usam `data-src` para lazy-loading (carregam apenas ao abrir)
572
584
  - YouTube: `https://www.youtube.com/embed/{ID}?rel=0&enablejsapi=1`
@@ -1152,7 +1164,7 @@ Shapes: `text` \| `circle` \| `rect`
1152
1164
  | `updateButtons()` | Habilita/desabilita botões nos limites |
1153
1165
  | `dispatchChange()` | Emite `rk:quantity:change` com o novo valor |
1154
1166
 
1155
- ### 6.2 `rk-modal.js` → `<rk-modal-element>` (Media Lightbox)
1167
+ ### 6.2 `rk-modal.js` → `<rk-modal-element>` (Generic Lightbox Container)
1156
1168
 
1157
1169
  | Método | Descrição |
1158
1170
  |---|---|
@@ -941,6 +941,12 @@
941
941
  user-select: none;
942
942
  }
943
943
 
944
+ .rk-modal__media--custom {
945
+ max-width: min(90vw, 800px);
946
+ max-height: 90vh;
947
+ overflow-y: auto;
948
+ }
949
+
944
950
  .rk-modal__media--html {
945
951
  background: #fff;
946
952
  border-radius: var(--rk-radius);
@@ -1,9 +1,11 @@
1
1
  /* ==========================================================================
2
- Rook UI Core — Modal Media Lightbox Controller
2
+ Rook UI Core — Modal Lightbox Controller
3
3
  Web Component: <rk-modal-element>
4
4
 
5
- Handles image zoom, hosted video (with custom Instagram-style controls),
6
- YouTube/Vimeo embeds, and raw HTML in a fullscreen lightbox overlay.
5
+ Generic fullscreen lightbox container. Accepts any content by default
6
+ (type: 'custom') and provides convenience presets for media types
7
+ (image, video, youtube, vimeo, html). Includes custom Instagram-style
8
+ video controls for hosted video playback.
7
9
  ========================================================================== */
8
10
 
9
11
  if (!customElements.get('rk-modal-element')) {
@@ -1,20 +1,29 @@
1
1
  {% doc %}
2
2
  Snippet: RkModal
3
- Renders a media lightbox for images, videos, and embedded content.
3
+ Generic fullscreen lightbox container. Accepts any content by default (type: 'custom')
4
+ and provides convenience presets for common media types (image, video, youtube, vimeo, html).
4
5
  Uses Web Component <rk-modal-element> for behaviour.
5
6
  Videos use custom Instagram-style controls (autoplay + muted by default).
6
7
 
7
8
  @param {string} id - Unique modal id (required)
8
- @param {string} [type] - 'image' | 'video' | 'youtube' | 'vimeo' | 'html' (default: 'image')
9
+ @param {string} [type] - 'custom' | 'image' | 'video' | 'youtube' | 'vimeo' | 'html' (default: 'custom')
10
+ @param {string} [content] - Arbitrary HTML content (works with any type, required for 'custom' and 'html')
9
11
  @param {object} [image] - Shopify image object (when type is 'image')
10
12
  @param {string} [video_url] - Video URL for hosted .mp4 (when type is 'video')
11
13
  @param {string} [youtube_id] - YouTube video ID (when type is 'youtube')
12
14
  @param {string} [vimeo_id] - Vimeo video ID (when type is 'vimeo')
13
- @param {string} [content] - Raw HTML content (when type is 'html')
14
15
  @param {string} [alt] - Alt text for images / aria-label for media
15
16
  @param {string} [aspect_ratio] - Aspect ratio for video (e.g. '16/9', default: '16/9')
16
17
  @param {string} [custom_class] - Extra CSS classes
17
18
 
19
+ @example — Custom content (default)
20
+ {% capture modal_body %}
21
+ <h2>Meu conteúdo</h2>
22
+ <p>Qualquer HTML aqui</p>
23
+ {% render 'rk-button', text: 'Fechar', attr: 'data-action="close"' %}
24
+ {% endcapture %}
25
+ {% render 'rk-modal', id: 'my-modal', content: modal_body %}
26
+
18
27
  @example — Image lightbox
19
28
  {% render 'rk-modal', id: 'product-zoom', type: 'image', image: product.featured_image, alt: product.title %}
20
29
 
@@ -26,7 +35,7 @@
26
35
  {% enddoc %}
27
36
 
28
37
  {%- liquid
29
- assign modal_type = type | default: 'image'
38
+ assign modal_type = type | default: 'custom'
30
39
  assign modal_aspect = aspect_ratio | default: '16/9'
31
40
  assign modal_alt = alt | default: ''
32
41
  -%}
@@ -44,7 +53,7 @@
44
53
  {% render 'rk-icon', icon: 'close', size: 'md', color: '#fff' %}
45
54
  </button>
46
55
 
47
- {%- comment -%} Media content {%- endcomment -%}
56
+ {%- comment -%} Content {%- endcomment -%}
48
57
  <div
49
58
  class="rk-modal__content"
50
59
  role="dialog"
@@ -53,6 +62,11 @@
53
62
  >
54
63
  {%- case modal_type -%}
55
64
 
65
+ {%- when 'custom' -%}
66
+ <div class="rk-modal__media rk-modal__media--custom">
67
+ {{ content }}
68
+ </div>
69
+
56
70
  {%- when 'image' -%}
57
71
  {%- if image != blank -%}
58
72
  {%- assign img_alt = modal_alt | default: image.alt | escape -%}
@@ -59,7 +59,7 @@ export class Logger {
59
59
  console.log(bold(white(' ██║ ██║╚██████╔╝╚██████╔╝██║ ██╗')));
60
60
  console.log(bold(white(' ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝')));
61
61
  console.log('');
62
- console.log(dim(' v1.3.13 — Rook UI'));
62
+ console.log(dim(' v1.3.14 — Rook UI'));
63
63
  console.log('');
64
64
  }
65
65