diff --git a/.cursor/rules/antd-strict-governance.mdc b/.cursor/rules/antd-strict-governance.mdc index a8b16f7..5d4215a 100644 --- a/.cursor/rules/antd-strict-governance.mdc +++ b/.cursor/rules/antd-strict-governance.mdc @@ -41,11 +41,19 @@ Legacy CRM UI (`components/ui/*`, `.crm-*`, `.btn` / `.field` in `styles/`) rema 6. **24-column grid only** Page layout on migrated screens uses Ant Grid: `a-row` / `a-col` with the **24-column** system (`:span`, `:xs`, `:sm`, `:md`, `:lg`, `:xl`). Do not invent parallel flex/grid CSS layouts for page chrome. -7. **RTL + locale** - App root is wrapped with ``. Do not override direction to LTR on whole pages; use local `direction="ltr"` only for inherently LTR fragments (e.g. phone numbers, codes). +7. **RTL + locale + StyleProvider** + App root in `App.vue` **must** wrap ConfigProvider with `` so legacy `main.css` cannot override Ant controls via higher specificity: + ```vue + + + + + + ``` + Do not override direction to LTR on whole pages; use local `direction="ltr"` only for inherently LTR fragments (e.g. phone numbers, codes). 8. **Auto-import** - `` components are resolved via `unplugin-vue-components` + `AntDesignVueResolver({ importStyle: false })`. Do not add blanket `app.use(antd)` unless there is a documented exception. Do not per-component CSS imports (`importStyle` stays `false`; CSS-in-JS + theme). + `` components are resolved via `unplugin-vue-components` + `AntDesignVueResolver({ importStyle: false })`. Do not add blanket `app.use(antd)` unless there is a documented exception. Do not per-component CSS imports (`importStyle` stays `false`; CSS-in-JS + theme). Prefer **explicit** `import { Button as AButton, … } from 'ant-design-vue'` in migrated files when the Vite resolver is missing or unreliable. 9. **Theme is central** Visual tokens (primary, radius, `controlHeight`, padding/margin scale, shadows, Form/Card overrides) live only in `antdTheme.ts`. Do not fork theme objects inside views. diff --git a/.cursor/settings.json b/.cursor/settings.json new file mode 100644 index 0000000..0b72ad4 --- /dev/null +++ b/.cursor/settings.json @@ -0,0 +1,7 @@ +{ + "plugins": { + "hex": { + "enabled": true + } + } +} diff --git a/.cursor/skills/antd-system-architect/SKILL.md b/.cursor/skills/antd-system-architect/SKILL.md index ea38348..5421498 100644 --- a/.cursor/skills/antd-system-architect/SKILL.md +++ b/.cursor/skills/antd-system-architect/SKILL.md @@ -38,9 +38,13 @@ Also read and obey [`.cursor/rules/antd-strict-governance.mdc`](../../rules/antd | Dependency | `ant-design-vue` ^4, `@ant-design/icons-vue`, `unplugin-vue-components` in `@mento/web` | | Vite plugin | `apps/web/vite.config.ts` — `Components` + `AntDesignVueResolver` | | Theme | `apps/web/src/theme/antdTheme.ts` (`controlHeight: 36`) | -| RTL + locale + theme | `apps/web/src/App.vue` — `` | +| RTL + locale + theme + StyleProvider | `apps/web/src/App.vue` — `` wrapping `` (mandatory so legacy `main.css` cannot override Ant) | | Legacy kit (do not touch) | `apps/web/src/components/ui/*`, `styles/main.css` utilities | +### Mandatory child-control conversion (same pass) + +هنگام بازنویسی یک صفحه (View)، ایجنت موظف است علاوه بر خود فایل View، تمام کامپوننت‌های فرزندی را که در آن View ایمپورت شده‌اند و حاوی اینپوت/سلکت/دکمه هستند نیز بازبینی کرده و درون آن‌ها را به کامپوننت‌های رسمی `ant-design-vue` تبدیل کند. هیچ تگ ``, `