infographic-item-creator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInfographic Item Generator
信息图表Item生成器
Overview
概述
Generate complete Item component code for the infographic framework, following the project's item rules, layout constraints, and registration requirements.
为信息图表框架生成完整的Item组件代码,遵循项目的Item规则、布局约束和注册要求。
Workflow
工作流程
- Read for the full framework rules, allowed components, and output requirements.
references/item-prompt.md - Clarify minimal requirements if missing: desired visuals, required fields (icon/label/value/desc/illus), sizing, and alignment needs.
- Use to extract custom props and compute layout with
getItemProps.getElementBounds - Produce a full TypeScript file: imports, Props extends BaseItemProps, component implementation, and with accurate
registerItem.composites - Self-check against the constraints in the reference (no unlisted components, indexes passed to all wrapped components, correct conditional rendering).
- 阅读文档,了解完整的框架规则、允许使用的组件以及输出要求。
references/item-prompt.md - 若存在缺失信息,明确最低要求:期望的视觉效果、必填字段(图标/标签/数值/描述/插图)、尺寸以及对齐需求。
- 使用提取自定义属性,并通过
getItemProps计算布局。getElementBounds - 生成完整的TypeScript文件:包含导入语句、继承自BaseItemProps的Props定义、组件实现,以及带有准确的
composites注册逻辑。registerItem - 根据参考文档中的约束条件进行自我检查:不得使用未列出的组件,所有包装组件都需传入索引,条件渲染逻辑正确。
Notes
注意事项
- Prefer scanning for similar items to match local patterns when appropriate.
src/designs/items - Keep output concise; avoid React-only features (keys, hooks).
- 如有需要,优先查看目录下的同类Item,以匹配本地代码风格。
src/designs/items - 保持输出简洁;避免使用仅React支持的特性(如keys、hooks)。