@quicktvui/ai 1.1.12 → 1.1.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/README.md CHANGED
@@ -107,6 +107,7 @@ quicktvui-ai prompt --lang zh
107
107
  ### 2. 严格的 CSS 子集
108
108
  - 必须使用 `px` 单位,严禁使用 `%`, `auto`, `rem`, `vh` 等。
109
109
  - 严禁 CSS 属性简写(如 `margin` 必须拆分为 `margin-top` 等)。
110
+ - 所有标签和组件都必须显式设置 `width` 和 `height`,不能依赖文本内容、父容器或自动撑开。
110
111
  - 必须显式声明 `display: flex` 且默认方向为 `column`。
111
112
 
112
113
  ### 3. TV 特有的焦点系统
package/USAGE.md CHANGED
@@ -61,6 +61,7 @@ quicktvui-ai doctor
61
61
  当 AI 为你生成代码后,请务必核对以下关键点:
62
62
 
63
63
  - [ ] **标签检查**:是否误用了 `p`, `img`, `h1`?(必须是 `qt-text`, `qt-image`)
64
+ - [ ] **尺寸检查**:所有标签和组件是否都显式设置了 `width` 和 `height`?(尤其 `div`、`span`、`qt-text`、`qt-image`、`qt-view`)
64
65
  - [ ] **生命周期**:入口函数是否叫 `onESCreate(params)`?
65
66
  - [ ] **返回键**:处理函数是否叫 `onBackPressed()` 且已 `return`?
66
67
  - [ ] **焦点系统**:页面是否至少有一个元素设置了 `:autofocus="true"`?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quicktvui/ai",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "QuickTVUI AI 开发规范与脚手架注入工具",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: create-component.md
3
- version: 1.1.12
3
+ version: 1.1.14
4
4
  ---
5
5
 
6
6
  # 创建 QuickTVUI 组件
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: create-page.md
3
- version: 1.1.12
3
+ version: 1.1.14
4
4
  ---
5
5
 
6
6
  # 创建 TV 页面
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: create-project.md
3
- version: 1.1.12
3
+ version: 1.1.14
4
4
  ---
5
5
 
6
6
  # 创建 QuickTVUI 项目
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lookup-api.md
3
- version: 1.1.12
3
+ version: 1.1.14
4
4
  ---
5
5
 
6
6
  # 查询 QuickTVUI 组件 API
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lookup-css.md
3
- version: 1.1.12
3
+ version: 1.1.14
4
4
  ---
5
5
 
6
6
  # 查询 QuickTVUI CSS 属性
package/rules/.clinerules CHANGED
@@ -35,6 +35,7 @@ version: 0.6.1
35
35
  **STRICT RULES:**
36
36
  - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `node_modules/@quicktvui/ai/rules/.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
37
37
  - **NOT A BROWSER & NO HTML**: **This framework does NOT support HTML. Standard HTML tags (like `p`, `img`, `a`, `ul`, `li`, `h1`) are STRICTLY PROHIBITED. It does NOT support `window`, `document` (DOM), or DOM APIs. You must exclusively use framework tags (like `qt-text`, `qt-image`) and Vue `ref`s.**
38
+ - **EXPLICIT SIZE IS MANDATORY FOR ALL TAGS AND COMPONENTS**: Every tag and component, including `div`, `span`, `qt-text`, `qt-image`, `qt-view`, and all `qt-*` components, MUST declare explicit `width` and `height` in px. Do NOT rely on content, parent layout, or auto sizing.
38
39
  - **NO HALLUCINATED TAGS**: e.g. `qt-web` is wrong, it is `qt-web-view`.
39
40
  - **NO HALLUCINATED APIs**: e.g. `onBack` is wrong, it must be `onBackPressed`.
40
41
  - **REFERENCE FIRST**: Search for component usages in the linked repositories if unsure.
@@ -146,6 +147,7 @@ QuickTVUI is a Vue 3 UI framework for Android TV / large-screen devices. Runs on
146
147
  ### Component Names (Must be exact — no HTML tag substitutes)
147
148
  - Image component is `qt-image` — NOT `qt-img`, NOT `<img>`
148
149
  - Text MUST use `<qt-text>` or `<span>` — NOT `<p>`, `<h1>`~`<h6>`, `<label>`
150
+ - All tags and components, including `<div>`, `<span>`, `<qt-text>`, `<qt-image>`, `<qt-view>`, and all `qt-*` tags, MUST declare explicit `width` and `height` (px).
149
151
  - Containers: `<div>`, `<qt-view>`, `<qt-row>`, `<qt-column>` — NOT `<section>`, `<main>`, `<article>`
150
152
  - Buttons: `<qt-button>` or focusable `<div>` — NOT `<button>`
151
153
 
@@ -192,6 +194,7 @@ CORRECT — `<template>` tag attributes use camelCase:
192
194
  Other CSS rules:
193
195
 
194
196
  - **CRITICAL: NO `auto` sizing**. All elements MUST have explicit `px` values.
197
+ - **CRITICAL: Every tag and component MUST set explicit `width` and `height` in px.** This includes `div`, `span`, `qt-text`, `qt-image`, `qt-view`, and all other `qt-*` components.
195
198
  - **CRITICAL: NO `alert()`**. Use `useESToast().showToast()` instead.
196
199
  - **CRITICAL: NO `e.preventDefault()`** or `e.stopPropagation()`. These do not exist in the native event system.
197
200
  - **CRITICAL: NO `window` or `document` (DOM) objects**. The runtime is not a browser.
@@ -35,6 +35,7 @@ version: 0.6.1
35
35
  **STRICT RULES:**
36
36
  - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `node_modules/@quicktvui/ai/rules/.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
37
37
  - **NOT A BROWSER & NO HTML**: **This framework does NOT support HTML. Standard HTML tags (like `p`, `img`, `a`, `ul`, `li`, `h1`) are STRICTLY PROHIBITED. It does NOT support `window`, `document` (DOM), or DOM APIs. You must exclusively use framework tags (like `qt-text`, `qt-image`) and Vue `ref`s.**
38
+ - **EXPLICIT SIZE IS MANDATORY FOR ALL TAGS AND COMPONENTS**: Every tag and component, including `div`, `span`, `qt-text`, `qt-image`, `qt-view`, and all `qt-*` components, MUST declare explicit `width` and `height` in px. Do NOT rely on content, parent layout, or auto sizing.
38
39
  - **NO HALLUCINATED TAGS**: e.g. `qt-web` is wrong, it is `qt-web-view`.
39
40
  - **NO HALLUCINATED APIs**: e.g. `onBack` is wrong, it must be `onBackPressed`.
40
41
  - **REFERENCE FIRST**: Search for component usages in the linked repositories if unsure.
@@ -147,6 +148,7 @@ QuickTVUI is a Vue 3 UI framework for Android TV / large-screen devices. Runs on
147
148
  ### Component Names (Must be exact — no HTML tag substitutes)
148
149
  - Image component is `qt-image` — NOT `qt-img`, NOT `<img>`
149
150
  - Text MUST use `<qt-text>` or `<span>` — NOT `<p>`, `<h1>`~`<h6>`, `<label>`
151
+ - All tags and components, including `<div>`, `<span>`, `<qt-text>`, `<qt-image>`, `<qt-view>`, and all `qt-*` tags, MUST declare explicit `width` and `height` (px).
150
152
  - Containers: `<div>`, `<qt-view>`, `<qt-row>`, `<qt-column>` — NOT `<section>`, `<main>`, `<article>`
151
153
  - Buttons: `<qt-button>` or focusable `<div>` — NOT `<button>`
152
154
 
@@ -193,6 +195,7 @@ CORRECT — `<template>` tag attributes use camelCase:
193
195
  Other CSS rules:
194
196
 
195
197
  - **CRITICAL: NO `auto` sizing**. All elements MUST have explicit `px` values.
198
+ - **CRITICAL: Every tag and component MUST set explicit `width` and `height` in px.** This includes `div`, `span`, `qt-text`, `qt-image`, `qt-view`, and all other `qt-*` components.
196
199
  - **CRITICAL: NO `alert()`**. Use `useESToast().showToast()` instead.
197
200
  - **CRITICAL: NO `e.preventDefault()`** or `e.stopPropagation()`. These do not exist in the native event system.
198
201
  - **CRITICAL: NO `window` or `document` (DOM) objects**. The runtime is not a browser.
@@ -56,6 +56,7 @@ quicktvui-ai doctor
56
56
  当 AI 为你生成代码后,请务必核对以下关键点:
57
57
 
58
58
  - **标签检查**:是否误用了 `p`, `img`, `h1`?(必须是 `qt-text`, `qt-image`)
59
+ - **尺寸检查**:所有标签和组件是否都显式设置了 `width` 和 `height`?(尤其 `div`、`span`、`qt-text`、`qt-image`、`qt-view`)
59
60
  - **生命周期**:入口函数是否叫 `onESCreate(params)`?
60
61
  - **返回键**:处理函数是否叫 `onBackPressed()` 且已 `return`?
61
62
  - **焦点系统**:页面是否至少有一个元素设置了 `:autofocus="true"`?
@@ -5,9 +5,9 @@ lang: zh-CN
5
5
 
6
6
  # 布局样式相关问题
7
7
 
8
- ## 一、所有的组件都需要指定宽高尺寸
8
+ ## 一、所有的标签和组件都需要指定宽高尺寸
9
9
 
10
- `div`、`qt-text`、`qt-image`、`qt-view`等组件都需要指定宽高尺寸
10
+ `div`、`span`、`qt-text`、`qt-image`、`qt-view` 等标签和组件都需要指定宽高尺寸
11
11
 
12
12
  ## 二、仅支持部分 css 样式
13
13
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: copilot-instructions.md
3
- version: 1.1.12
3
+ version: 1.1.14
4
4
  ---
5
5
 
6
6
  # copilot-instructions.md - QuickTVUI AI Development Guide
@@ -35,6 +35,7 @@ version: 1.1.12
35
35
  **STRICT RULES:**
36
36
  - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `node_modules/@quicktvui/ai/rules/.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
37
37
  - **NOT A BROWSER & NO HTML**: **This framework does NOT support HTML. Standard HTML tags (like `p`, `img`, `a`, `ul`, `li`, `h1`) are STRICTLY PROHIBITED. It does NOT support `window`, `document` (DOM), or DOM APIs. You must exclusively use framework tags (like `qt-text`, `qt-image`) and Vue `ref`s.**
38
+ - **EXPLICIT SIZE IS MANDATORY FOR ALL TAGS AND COMPONENTS**: Every tag and component, including `div`, `span`, `qt-text`, `qt-image`, `qt-view`, and all `qt-*` components, MUST declare explicit `width` and `height` in px. Do NOT rely on content, parent layout, or auto sizing.
38
39
  - **NO HALLUCINATED TAGS**: e.g. `qt-web` is wrong, it is `qt-web-view`.
39
40
  - **NO HALLUCINATED APIs**: e.g. `onBack` is wrong, it must be `onBackPressed`.
40
41
  - **REFERENCE FIRST**: Search for component usages in the linked repositories if unsure.
@@ -115,6 +116,7 @@ QuickTVUI is a Vue 3 UI framework for Android TV / large-screen devices. Runs on
115
116
 
116
117
  - Image component is `qt-image` — NOT `qt-img`, NOT `<img>`
117
118
  - Text MUST use `<qt-text>` or `<span>` — NOT `<p>`, `<h1>`~`<h6>`, `<label>`
119
+ - All tags and components, including `<div>`, `<span>`, `<qt-text>`, `<qt-image>`, `<qt-view>`, and all `qt-*` tags, MUST declare explicit `width` and `height` (px).
118
120
  - Containers: `<div>`, `<qt-view>`, `<qt-row>`, `<qt-column>` — NOT `<section>`, `<main>`, `<article>`
119
121
  - Buttons: `<qt-button>` or focusable `<div>` — NOT `<button>`
120
122
 
@@ -165,6 +167,7 @@ CORRECT — `<template>` tag attributes use camelCase:
165
167
  Other CSS rules:
166
168
 
167
169
  - **CRITICAL: NO `auto` sizing**. All elements MUST have explicit `px` values.
170
+ - **CRITICAL: Every tag and component MUST set explicit `width` and `height` in px.** This includes `div`, `span`, `qt-text`, `qt-image`, `qt-view`, and all other `qt-*` components.
168
171
  - **CRITICAL: NO `alert()`**. Use `useESToast().showToast()` instead.
169
172
  - **CRITICAL: NO `e.preventDefault()`** or `e.stopPropagation()`. These do not exist in the native event system.
170
173
  - **CRITICAL: NO `window` or `document` (DOM) objects**. The runtime is not a browser.
@@ -511,4 +514,4 @@ AI MUST understand the mapping between Vue components and Java Native controller
511
514
  | **(Deprecated)** | `Text` | `com.tencent.mtt.hippy.views.text.HippyTextViewController` | **DEPRECATED** |
512
515
  | **(Deprecated)** | `ListView` | `com.tencent.mtt.hippy.views.list.HippyListViewController` | **DEPRECATED** |
513
516
 
514
- **Rule**: Always prefer source code in `.source/hippy/extend_views/`. Use `.source/hippy/hippy_views/` only as a secondary fallback.
517
+ **Rule**: Always prefer source code in `.source/hippy/extend_views/`. Use `.source/hippy/hippy_views/` only as a secondary fallback.
@@ -35,6 +35,7 @@ version: 0.6.1
35
35
  **STRICT RULES:**
36
36
  - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `node_modules/@quicktvui/ai/rules/.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
37
37
  - **NOT A BROWSER & NO HTML**: **This framework does NOT support HTML. Standard HTML tags (like `p`, `img`, `a`, `ul`, `li`, `h1`) are STRICTLY PROHIBITED. It does NOT support `window`, `document` (DOM), or DOM APIs. You must exclusively use framework tags (like `qt-text`, `qt-image`) and Vue `ref`s.**
38
+ - **EXPLICIT SIZE IS MANDATORY FOR ALL TAGS AND COMPONENTS**: Every tag and component, including `div`, `span`, `qt-text`, `qt-image`, `qt-view`, and all `qt-*` components, MUST declare explicit `width` and `height` in px. Do NOT rely on content, parent layout, or auto sizing.
38
39
  - **NO HALLUCINATED TAGS**: e.g. `qt-web` is wrong, it is `qt-web-view`.
39
40
  - **NO HALLUCINATED APIs**: e.g. `onBack` is wrong, it must be `onBackPressed`.
40
41
  - **REFERENCE FIRST**: Search for component usages in the linked repositories if unsure.
@@ -146,6 +147,7 @@ QuickTVUI is a Vue 3 UI framework for Android TV / large-screen devices. Runs on
146
147
  ### Component Names (Must be exact — no HTML tag substitutes)
147
148
  - Image component is `qt-image` — NOT `qt-img`, NOT `<img>`
148
149
  - Text MUST use `<qt-text>` or `<span>` — NOT `<p>`, `<h1>`~`<h6>`, `<label>`
150
+ - All tags and components, including `<div>`, `<span>`, `<qt-text>`, `<qt-image>`, `<qt-view>`, and all `qt-*` tags, MUST declare explicit `width` and `height` (px).
149
151
  - Containers: `<div>`, `<qt-view>`, `<qt-row>`, `<qt-column>` — NOT `<section>`, `<main>`, `<article>`
150
152
  - Buttons: `<qt-button>` or focusable `<div>` — NOT `<button>`
151
153
 
@@ -192,6 +194,7 @@ CORRECT — `<template>` tag attributes use camelCase:
192
194
  Other CSS rules:
193
195
 
194
196
  - **CRITICAL: NO `auto` sizing**. All elements MUST have explicit `px` values.
197
+ - **CRITICAL: Every tag and component MUST set explicit `width` and `height` in px.** This includes `div`, `span`, `qt-text`, `qt-image`, `qt-view`, and all other `qt-*` components.
195
198
  - **CRITICAL: NO `alert()`**. Use `useESToast().showToast()` instead.
196
199
  - **CRITICAL: NO `e.preventDefault()`** or `e.stopPropagation()`. These do not exist in the native event system.
197
200
  - **CRITICAL: NO `window` or `document` (DOM) objects**. The runtime is not a browser.
package/rules/AGENTS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: AGENTS.md
3
- version: 1.1.12
3
+ version: 1.1.14
4
4
  ---
5
5
 
6
6
  # AGENTS.md - QuickTVUI AI Development Guide
@@ -35,6 +35,7 @@ version: 1.1.12
35
35
  **STRICT RULES:**
36
36
  - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `node_modules/@quicktvui/ai/rules/.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
37
37
  - **NOT A BROWSER & NO HTML**: **This framework does NOT support HTML. Standard HTML tags (like `p`, `img`, `a`, `ul`, `li`, `h1`) are STRICTLY PROHIBITED. It does NOT support `window`, `document` (DOM), or DOM APIs. You must exclusively use framework tags (like `qt-text`, `qt-image`) and Vue `ref`s.**
38
+ - **EXPLICIT SIZE IS MANDATORY FOR ALL TAGS AND COMPONENTS**: Every tag and component, including `div`, `span`, `qt-text`, `qt-image`, `qt-view`, and all `qt-*` components, MUST declare explicit `width` and `height` in px. Do NOT rely on content, parent layout, or auto sizing.
38
39
  - **NO HALLUCINATED TAGS**: e.g. `qt-web` is wrong, it is `qt-web-view`.
39
40
  - **NO HALLUCINATED APIs**: e.g. `onBack` is wrong, it must be `onBackPressed`.
40
41
  - **REFERENCE FIRST**: Search for component usages in the linked repositories if unsure.
@@ -172,6 +173,7 @@ QuickTVUI is a Vue 3 UI framework for Android TV / large-screen devices. Runs on
172
173
 
173
174
  - Image component is `qt-image` — NOT `qt-img`, NOT `<img>`
174
175
  - Text MUST use `<qt-text>` or `<span>` — NOT `<p>`, `<h1>`~`<h6>`, `<label>`
176
+ - All tags and components, including `<div>`, `<span>`, `<qt-text>`, `<qt-image>`, `<qt-view>`, and all `qt-*` tags, MUST declare explicit `width` and `height` (px).
175
177
  - Containers: `<div>`, `<qt-view>`, `<qt-row>`, `<qt-column>` — NOT `<section>`, `<main>`, `<article>`
176
178
  - Buttons: `<qt-button>` or focusable `<div>` — NOT `<button>`
177
179
 
@@ -228,6 +230,7 @@ CORRECT — `<template>` tag attributes use camelCase:
228
230
 
229
231
  Other CSS rules:
230
232
 
233
+ - **CRITICAL: Every tag and component MUST set explicit `width` and `height` in px.** This includes `div`, `span`, `qt-text`, `qt-image`, `qt-view`, and all other `qt-*` components.
231
234
  - **CRITICAL: MANDATORY `display: flex;`**. QuickTVUI exclusively supports Flexbox layout. Every styled element MUST explicitly include `display: flex;`. The default orientation is `flex-direction: column;`.
232
235
  - Only use properties listed in "Supported Style Properties" section below
233
236
  - Do NOT use `<style scoped>` (unreliable in native rendering)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: AI_HANDOFF.md
3
- version: 1.1.12
3
+ version: 1.1.14
4
4
  ---
5
5
 
6
6
  # QuickTVUI AI 集成 - 工作交接文档
@@ -20,6 +20,7 @@ version: 1.1.12
20
20
  **要求:**
21
21
  - **检索与能力验证优先**:在实现任何功能(如“视频播放”)前,必须先在 `node_modules/@quicktvui/ai/rules/.docs/` 目录中检索相关文档,验证组件是否支持该功能。切勿想当然!**例如:`qt-web-view` 绝对不支持视频播放,视频播放必须使用框架提供的专用视频组件和管理器(如 `es-video-player` 和 `es-player-manager`)。**
22
22
  - **非浏览器与无 HTML 环境**:**本框架绝对不支持标准 HTML 标签(如 `p`, `img`, `a`, `ul`, `li`, `h1` 等),严禁在模板中使用!绝对不支持 `window`、`document` (DOM) 对象或任何 DOM 操作 API。必须使用框架专属标签(如 `qt-text`, `qt-image`)和 Vue `ref`。**
23
+ - **标签与组件尺寸强约束**:所有标签和组件都必须显式设置 `width` 和 `height`(px),包括 `div`、`span`、`qt-text`、`qt-image`、`qt-view` 以及所有 `qt-*` 组件。不能依赖内容、父容器或自动撑开。
23
24
  - **严禁自造标签**:如 `qt-web` 是错的,官方示例中是 `qt-web-view`。
24
25
  - **严禁自造 API**:如 `onBack` 是错的,必须是 `onBackPressed`。
25
26
  - **参考优先**:遇到不确定的组件用法,必须先在上述仓库中搜索同名组件的实际用法。
@@ -41,6 +42,7 @@ AI 在编写业务逻辑时,极易带入传统 Web 开发习惯导致严重报
41
42
  4. **CSS 严格子集**:
42
43
  * 不支持任何 CSS 简写(例如 `margin: 10px` 必崩,必须写 `margin-top: 10px; margin-left: 10px;`)。
43
44
  * 不支持 `auto`,不支持 `%`。所有组件**必须显式定义宽高**(`width` / `height` 赋明确的 px 值)。
45
+ * 所有标签和组件都要遵守这个硬约束:生成代码时必须显式声明 `width` 和 `height`,不能依赖文案长度、父容器或 `autoWidth` / `autoHeight` 自动撑开。
44
46
 
45
47
  ## 快速创建项目 (Scaffolding)
46
48
 
package/rules/CLAUDE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: CLAUDE.md
3
- version: 1.1.12
3
+ version: 1.1.14
4
4
  ---
5
5
 
6
6
  # QuickTVUI - AI 开发指南
@@ -35,6 +35,7 @@ version: 1.1.12
35
35
  **要求:**
36
36
  - **检索与能力验证优先**:在实现任何功能(如“视频播放”)前,必须先在 `node_modules/@quicktvui/ai/rules/.docs/` 目录中检索相关文档,验证组件是否支持该功能。切勿想当然!**例如:`qt-web-view` 绝对不支持视频播放,视频播放必须使用框架提供的专用视频组件和管理器(如 `es-video-player` 和 `es-player-manager`)。**
37
37
  - **非浏览器与无 HTML 环境**:**本框架绝对不支持标准 HTML 标签(如 `p`, `img`, `a`, `ul`, `li`, `h1` 等),严禁在模板中使用!绝对不支持 `window`、`document` (DOM) 对象或任何 DOM 操作 API。必须使用框架专属标签(如 `qt-text`, `qt-image`)和 Vue `ref`。**
38
+ - **标签与组件尺寸强约束**:所有标签和组件都必须显式设置 `width` 和 `height`(px),包括 `div`、`span`、`qt-text`、`qt-image`、`qt-view` 以及所有 `qt-*` 组件。不能依赖内容、父容器或自动撑开。
38
39
  - **严禁自造标签**:如 `qt-web` 是错的,官方示例中是 `qt-web-view`。
39
40
  - **严禁自造 API**:如 `onBack` 是错的,必须是 `onBackPressed`。
40
41
  - **参考优先**:遇到不确定的组件用法,必须先在上述仓库或 `node_modules/@quicktvui/ai/rules/.docs/` 中搜索同名组件的实际用法。
@@ -187,6 +188,7 @@ https://quicktvui.com
187
188
 
188
189
  - 图片组件是 `qt-image`,不是 `qt-img`、`<img>`
189
190
  - 文字必须用 `<qt-text>` 或 `<span>`,不能用 `<p>`、`<h1>`~`<h6>`、`<label>` 等 HTML 标签
191
+ - 所有标签和组件都必须显式声明 `width` 和 `height`(px),包括 `<div>`、`<span>`、`<qt-text>`、`<qt-image>`、`<qt-view>` 以及所有 `qt-*` 标签
190
192
  - 容器用 `<div>`、`<qt-view>`、`<qt-row>`、`<qt-column>`,不能用 `<section>`、`<main>`、`<article>` 等语义标签
191
193
  - 按钮用 `<qt-button>` 或可获焦的 `<div>`,不能用 `<button>`
192
194
 
@@ -240,6 +242,7 @@ https://quicktvui.com
240
242
  其他 CSS 规则:
241
243
 
242
244
  - **CRITICAL: NO `auto` sizing**. All elements MUST have explicit `px` values.
245
+ - **CRITICAL: 所有标签和组件都必须显式设置 `width` 和 `height`(px)**。包括 `div`、`span`、`qt-text`、`qt-image`、`qt-view` 以及所有其他 `qt-*` 组件,不能依赖内容自适应或父容器撑开。
243
246
  - **CRITICAL: NO `alert()`**. Use `useESToast().showToast()` instead.
244
247
  - **CRITICAL: NO `e.preventDefault()`** or `e.stopPropagation()`. These do not exist in the native event system.
245
248
  - **CRITICAL: NO `window` or `document` (DOM) objects**. The runtime is not a browser.
@@ -581,6 +584,8 @@ Events: `focus(isFocused: boolean)`, `click()`
581
584
 
582
585
  ### qt-text
583
586
 
587
+ **强制规则**:生成代码时,所有标签和组件都必须显式声明 `width` 和 `height`,`qt-text` 只是最常见的易错项,不要依赖 `autoWidth` / `autoHeight`、文案内容或父容器自动撑开。
588
+
584
589
  ```vue
585
590
  <qt-text
586
591
  text="标题"
package/rules/GEMINI.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: GEMINI.md
3
- version: 1.1.12
3
+ version: 1.1.14
4
4
  ---
5
5
 
6
6
  # GEMINI.md - QuickTVUI AI 开发指南
@@ -138,6 +138,7 @@ AI 在编写业务逻辑时,必须牢记以下框架特性,防止套用 Web
138
138
  * **强制 Flex**:每个有样式的元素必须显式写 `display: flex;`。默认方向为 `flex-direction: column;`。
139
139
  * **禁止简写**:不支持 `margin: 10px`,必须写 `margin-top: 10px;` 等。
140
140
  * **禁止相对单位**:只允许 `px`,不支持 `%`, `auto`, `vh/vw`, `rem`。
141
+ * **所有标签和组件强制宽高**:所有标签和组件都必须显式声明 `width` 和 `height`(px),包括 `div`、`span`、`qt-text`、`qt-image`、`qt-view` 以及所有 `qt-*` 组件,不能依赖文字内容、父容器或自动撑开。
141
142
 
142
143
  ---
143
144
 
@@ -168,4 +169,5 @@ AI 必须了解 Vue 组件与 Java Native 层的对应关系,避免查阅已
168
169
  * **Back 键**:必须命名为 `onBackPressed`。
169
170
  * **生命周期**:必须命名为 `onESCreate`, `onESResume`, `onESDestroy` 等。
170
171
  * **焦点**:页面必须有元素设置 `:autofocus="true"`,且容器需设置 `:clipChildren="false"`。
172
+ * **尺寸**:所有标签和组件都必须显式设置 `width` 和 `height`,`qt-text` 只是高频易错例子。
171
173
  * **路由**:使用 `useESRouter()`。