bklit-studio
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBklit Studio Skill (chart development)
Bklit Studio Skill(图表开发)
Monorepo contributors only. Use this skill automatically whenever you build, edit, or prototype a chart — before shipping via bklit-ship.
Studio at is the single development surface: full editor shell, component tree, properties, motion, codegen, and registry previews. Do not scaffold .
/studioapps/web/app/playground/仅面向Monorepo贡献者使用。 每当你构建、编辑或制作图表原型时,请自动使用此技能——在通过bklit-ship发布之前。
位于****的Studio是唯一的开发界面:包含完整编辑器外壳、组件树、属性面板、动效设置、代码生成和注册表预览。请勿搭建目录。
/studioapps/web/app/playground/When to use (auto-trigger)
使用场景(自动触发)
- Build, prototype, or edit a chart (new or existing)
- Tune props, layers, data, styling, or animation
- Mentions Studio, , registry preview, or chart controls
/studio - Work continues from a prior playground task → use Studio instead
- 构建、制作原型或编辑图表(新图表或已有图表)
- 调整props、图层、数据、样式或动画
- 涉及Studio、、注册表预览或图表控件的工作
/studio - 从之前的playground任务继续开发→改用Studio
Quick start
快速开始
bash
pnpm dev # repo rootOpen http://localhost:3000/studio (optional query: ).
?chart=line-chart| Task | URL |
|---|---|
| Edit existing chart | |
| Profit/loss line mode | |
bash
pnpm dev # 仓库根目录| 任务 | URL |
|---|---|
| 编辑已有图表 | |
| 盈亏折线模式 | |
Editor layout
编辑器布局
| Region | Purpose |
|---|---|
| Left | Chart type (in full Studio), layer list, data controls, animation |
| Center | Canvas, rulers, resizable frame, replay/scramble |
| Right | Properties for the selected layer |
Pane rules: animation → left ( on chart config); per-layer props → right; visibility → eye icon on layer (uses in URL state).
motionPanelhiddenComponents| 区域 | 用途 |
|---|---|
| 左侧 | 图表类型(完整Studio中)、图层列表、数据控件、动效设置 |
| 中间 | 画布、标尺、可调整大小的框架、重放/随机打乱 |
| 右侧 | 选中图层的属性面板 |
面板规则:动效设置→左侧(图表配置中的);图层专属props→右侧;可见性→图层上的眼睛图标(使用URL状态中的)。
motionPanelhiddenComponentsWhere to implement (existing charts)
已有图表的实现位置
Edit the chart in and — not .
packages/studiopackages/uiapps/web/components/playground/| Concern | Path |
|---|---|
| Chart preview + codegen | |
| Layer tree (components panel) | |
| Control groups (properties) | |
| URL / default state | |
| Chart UI | |
| Slugs | |
| Studio-only previews | |
在**和**中编辑图表——不要在中操作。
packages/studiopackages/uiapps/web/components/playground/| 关注点 | 路径 |
|---|---|
| 图表预览 + 代码生成 | |
| 图层树(组件面板) | |
| 控件组(属性面板) | |
| URL / 默认状态 | |
| 图表UI | |
| Slugs | |
| Studio专属预览组件 | |
Patterns in registry.tsx
render
registry.tsxregistry.tsx
中render方法的模式
registry.tsxReuse committed helpers (do not reimplement):
- +
StudioChartShell— legend grid +studioCartesianLegendItemsshowLegend - +
StudioVisibleLayer— ties render to layer visibility (componentId,line.grid, …)line.series.0 - — motion / reveal
getStudioCssRevealPropsForPreview - — conditional children
isStudioComponentVisible(state, componentId) - ,
seriesStrokePropsFromState,fadeEdgesPropValuechartTooltipPropsFromState
Reference implementation: in .
lineConfig.renderregistry.tsx复用已提交的工具方法(请勿重新实现):
- +
StudioChartShell— 图例网格 +studioCartesianLegendItems属性showLegend - +
StudioVisibleLayer— 将渲染与图层可见性绑定(如componentId、line.grid等)line.series.0 - — 动效/显示过渡
getStudioCssRevealPropsForPreview - — 条件渲染子组件
isStudioComponentVisible(state, componentId) - ,
seriesStrokePropsFromState,fadeEdgesPropValuechartTooltipPropsFromState
参考实现:中的方法。
registry.tsxlineConfig.renderNew chart (not in registry yet)
新图表(尚未加入注册表)
- Implement component(s) in (minimal API first).
packages/ui/src/charts/ - Add slug to .
packages/studio/src/chart-slugs.ts - Add to
StudioChartConfiginstudioRegistry:registry.tsx- — preview inside
render(state, ctx)viaEditorChartFrameStudioShell - in
resolveComponentsstudio-components.ts - /
controlGroupsresolveControlGroups - for the code sheet
generateCode
- Open and iterate.
/studio?chart=<new-slug> - When stable, follow bklit-ship for docs, gallery, shadcn registry.
- 在中实现组件(优先实现最小化API)。
packages/ui/src/charts/ - 在中添加slug。
packages/studio/src/chart-slugs.ts - 在的
registry.tsx中添加studioRegistry:StudioChartConfig- — 通过
render(state, ctx)在StudioShell内渲染预览EditorChartFrame - 在中实现
studio-components.ts方法resolveComponents - /
controlGroups配置resolveControlGroups - 为代码面板实现方法
generateCode
- 打开并迭代开发。
/studio?chart=<new-slug> - 稳定后,遵循bklit-ship流程完成文档、画廊和shadcn注册表的提交。
Adding a prop or layer
添加props或图层
- Add key to /
StudioUrlStateindefaultStudioStateif missing.studio-parsers.ts - Add control(s) on the right layer in or per-component
registry-control-groups.tsincontrolGroups.studio-components.ts - Wire prop in
registry.tsx(and inrenderchart code).packages/ui - If the prop affects animation → ensure on chart config.
motionPanel: true - Verify in Studio: layer list, visibility toggle, properties, replay.
- 如果中的
studio-parsers.ts/StudioUrlState缺少对应键,添加该键。defaultStudioState - 在的对应图层上添加控件,或在
registry-control-groups.ts的组件专属studio-components.ts中添加。controlGroups - 在的
registry.tsx方法中关联该props(同时在render的图表代码中关联)。packages/ui - 如果该props影响动画→确保图表配置中。
motionPanel: true - 在Studio中验证:图层列表、可见性切换、属性面板、重放功能。
Shipping
发布
When the API is stable, read — prototype code should already live in + ; no playground route to migrate.
.agents/skills/bklit-ship/SKILL.mdpackages/uipackages/studio当API稳定后,阅读——原型代码应已存放在 + 中;无需迁移playground路由。
.agents/skills/bklit-ship/SKILL.mdpackages/uipackages/studioDeprecated: /playground
/playground已废弃:/playground
/playgroundThe local route and skill are deprecated. redirects to . Do not copy or for new work.
/playgroundbklit-playground/playground/studioplayground-editor-shellapps/web/components/playground/本地**路由和**技能已被废弃。会重定向到。请勿为新工作复制或目录。
/playgroundbklit-playground/playground/studioplayground-editor-shellapps/web/components/playground/File reference
文件参考
| Item | Path |
|---|---|
| Studio app route | |
| Studio package | |
| Studio skill | |
| Ship checklist | |
| Performance audit | |
| 项目 | 路径 |
|---|---|
| Studio应用路由 | |
| Studio包 | |
| Studio技能文档 | |
| 发布检查清单 | |
| 性能审计文档 | |