@amaster.ai/pi-lark 0.1.2-beta.44 → 0.1.2-beta.46

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.
Files changed (130) hide show
  1. package/package.json +2 -2
  2. package/skills/lark-apps/SKILL.md +23 -12
  3. package/skills/lark-apps/creative-design/agents/assets/vision-probe.png +0 -0
  4. package/skills/lark-apps/creative-design/agents/fork-verifier-agent.md +71 -0
  5. package/skills/lark-apps/creative-design/agents/vision-probe-agent.md +41 -0
  6. package/skills/lark-apps/creative-design/assets/index.html +27 -0
  7. package/skills/lark-apps/creative-design/creative-design.md +239 -0
  8. package/skills/lark-apps/creative-design/references/aily.md +39 -0
  9. package/skills/lark-apps/creative-design/references/animated-video.md +34 -0
  10. package/skills/lark-apps/creative-design/references/charts.md +165 -0
  11. package/skills/lark-apps/creative-design/references/claude.md +36 -0
  12. package/skills/lark-apps/creative-design/references/codex.md +32 -0
  13. package/skills/lark-apps/creative-design/references/data-report.md +108 -0
  14. package/skills/lark-apps/creative-design/references/frontend-design.md +71 -0
  15. package/skills/lark-apps/creative-design/references/hi-fi-design.md +32 -0
  16. package/skills/lark-apps/creative-design/references/interactive-prototype.md +24 -0
  17. package/skills/lark-apps/creative-design/references/make-a-deck.md +133 -0
  18. package/skills/lark-apps/creative-design/references/visual-exposure.md +82 -0
  19. package/skills/lark-apps/creative-design/references/wireframe.md +14 -0
  20. package/skills/lark-apps/creative-design/starter-components/android-frame.jsx +188 -0
  21. package/skills/lark-apps/creative-design/starter-components/animations.jsx +773 -0
  22. package/skills/lark-apps/creative-design/starter-components/browser-window.jsx +122 -0
  23. package/skills/lark-apps/creative-design/starter-components/deck-stage.js +2483 -0
  24. package/skills/lark-apps/creative-design/starter-components/design-canvas.jsx +1432 -0
  25. package/skills/lark-apps/creative-design/starter-components/ios-frame.jsx +270 -0
  26. package/skills/lark-apps/creative-design/starter-components/macos-window.jsx +197 -0
  27. package/skills/lark-apps/creative-design/starter-components/tweaks-panel.jsx +752 -0
  28. package/skills/lark-apps/references/lark-apps-automation.md +80 -2
  29. package/skills/lark-apps/references/lark-apps-cloud-dev.md +0 -1
  30. package/skills/lark-apps/references/lark-apps-create.md +1 -2
  31. package/skills/lark-apps/references/lark-apps-db.md +1 -1
  32. package/skills/lark-apps/references/lark-apps-env-pull.md +1 -1
  33. package/skills/lark-apps/references/lark-apps-file.md +2 -2
  34. package/skills/lark-apps/references/lark-apps-git-credential.md +1 -1
  35. package/skills/lark-apps/references/lark-apps-html-publish.md +4 -8
  36. package/skills/lark-apps/references/lark-apps-init.md +1 -1
  37. package/skills/lark-apps/references/lark-apps-list.md +1 -1
  38. package/skills/lark-apps/references/lark-apps-local-dev.md +54 -11
  39. package/skills/lark-apps/references/lark-apps-openapi-key.md +1 -1
  40. package/skills/lark-apps/references/lark-apps-release-create.md +2 -2
  41. package/skills/lark-apps/references/lark-apps-release-get.md +3 -3
  42. package/skills/lark-base/SKILL.md +4 -6
  43. package/skills/lark-base/references/lark-base-cell-value.md +3 -3
  44. package/skills/lark-base/references/lark-base-field-create.md +4 -0
  45. package/skills/lark-base/references/lark-base-field-json.md +4 -4
  46. package/skills/lark-base/references/lark-base-field-update.md +17 -1
  47. package/skills/lark-base/references/lark-base-form-submit.md +16 -7
  48. package/skills/lark-base/references/lark-base-record-batch-create.md +12 -10
  49. package/skills/lark-base/references/lark-base-record-batch-update.md +11 -9
  50. package/skills/lark-base/references/lark-base-record-upsert.md +1 -1
  51. package/skills/lark-calendar/references/lark-calendar-create.md +1 -0
  52. package/skills/lark-calendar/references/lark-calendar-update.md +3 -0
  53. package/skills/lark-doc/references/lark-doc-fetch.md +10 -2
  54. package/skills/lark-doc/references/lark-doc-whiteboard.md +9 -8
  55. package/skills/lark-doc/references/lark-doc-xml-extended-blocks.md +41 -0
  56. package/skills/lark-doc/references/lark-doc-xml.md +4 -3
  57. package/skills/lark-drive/SKILL.md +4 -1
  58. package/skills/lark-drive/references/lark-drive-comment-location.md +2 -2
  59. package/skills/lark-drive/references/lark-drive-search.md +1 -0
  60. package/skills/lark-drive/references/lark-drive-upload.md +1 -0
  61. package/skills/lark-drive/references/lark-drive-workflow-topic-move-collector-execute.md +273 -0
  62. package/skills/lark-drive/references/lark-drive-workflow-topic-move-collector-recall.md +202 -0
  63. package/skills/lark-drive/references/lark-drive-workflow-topic-move-collector-resolve-verify.md +231 -0
  64. package/skills/lark-drive/references/lark-drive-workflow-topic-move-collector-review-plan.md +248 -0
  65. package/skills/lark-drive/references/lark-drive-workflow-topic-move-collector-setup.md +174 -0
  66. package/skills/lark-drive/references/lark-drive-workflow-topic-move-collector.md +202 -0
  67. package/skills/lark-drive/references/lark-drive-workflow.md +5 -4
  68. package/skills/lark-event/SKILL.md +1 -0
  69. package/skills/lark-event/references/lark-event-application.md +38 -0
  70. package/skills/lark-im/SKILL.md +1 -1
  71. package/skills/lark-im/references/card/card-2.0-schema.md +1 -1
  72. package/skills/lark-im/references/card/lark-im-card-style.md +4 -4
  73. package/skills/lark-im/references/card/resource/icons.md +14 -0
  74. package/skills/lark-im/references/lark-im-flag-list.md +8 -7
  75. package/skills/lark-okr/SKILL.md +71 -26
  76. package/skills/lark-okr/references/lark-okr-batch-create.md +19 -18
  77. package/skills/lark-okr/references/lark-okr-create.md +173 -0
  78. package/skills/lark-okr/references/lark-okr-cycle-list.md +17 -7
  79. package/skills/lark-okr/references/lark-okr-entities.md +1 -0
  80. package/skills/lark-okr/references/lark-okr-indicator-update.md +3 -1
  81. package/skills/lark-okr/references/lark-okr-indicators.md +61 -12
  82. package/skills/lark-okr/references/lark-okr-progress-list.md +21 -9
  83. package/skills/lark-slides/SKILL.md +104 -47
  84. package/skills/lark-slides/references/asset-planning.md +6 -4
  85. package/skills/lark-slides/references/iconpark.md +2 -2
  86. package/skills/lark-slides/references/lark-slides-create.md +2 -3
  87. package/skills/lark-slides/references/lark-slides-history.md +132 -0
  88. package/skills/lark-slides/references/lark-slides-media-upload.md +1 -2
  89. package/skills/lark-slides/references/lark-slides-pptx-template-workflows.md +7 -11
  90. package/skills/lark-slides/references/lark-slides-replace-slide.md +0 -3
  91. package/skills/lark-slides/references/lark-slides-screenshot.md +4 -4
  92. package/skills/lark-slides/references/lark-slides-xml-presentation-slide-create.md +219 -0
  93. package/skills/lark-slides/references/lark-slides-xml-presentation-slide-delete.md +6 -5
  94. package/skills/lark-slides/references/lark-slides-xml-presentation-slide-get.md +2 -2
  95. package/skills/lark-slides/references/lark-slides-xml-presentation-slide-replace.md +2 -3
  96. package/skills/lark-slides/references/lark-slides-xml-presentations-get.md +65 -30
  97. package/skills/lark-slides/references/planning-layer.md +11 -10
  98. package/skills/lark-slides/references/slides_chart_demo.xml +1416 -1
  99. package/skills/lark-slides/references/slides_xml_schema_definition.xml +1 -45
  100. package/skills/lark-slides/references/troubleshooting.md +25 -7
  101. package/skills/lark-slides/references/validation-checklist.md +53 -16
  102. package/skills/lark-slides/references/visual-planning.md +25 -22
  103. package/skills/lark-slides/references/xml-schema-quick-ref.md +243 -46
  104. package/skills/lark-slides/scripts/xml_text_overlap_lint.py +1054 -78
  105. package/skills/lark-slides/scripts/xml_text_overlap_lint_test.py +957 -150
  106. package/skills/lark-task/SKILL.md +7 -0
  107. package/skills/lark-task/references/lark-task-complete.md +6 -2
  108. package/skills/lark-task/references/lark-task-update.md +6 -2
  109. package/skills/lark-whiteboard/SKILL.md +13 -12
  110. package/skills/lark-whiteboard/elements/layout.md +1 -1
  111. package/skills/lark-whiteboard/elements/schema.md +2 -2
  112. package/skills/lark-whiteboard/references/{lark-whiteboard-query.md → lark-whiteboard-export.md} +15 -15
  113. package/skills/lark-whiteboard/references/lark-whiteboard-update.md +3 -3
  114. package/skills/lark-whiteboard/references/lark-whiteboard-workflow.md +7 -17
  115. package/skills/lark-whiteboard/routes/dsl.md +3 -3
  116. package/skills/lark-whiteboard/routes/mermaid.md +2 -2
  117. package/skills/lark-whiteboard/routes/svg-edit.md +4 -4
  118. package/skills/lark-whiteboard/routes/svg.md +11 -6
  119. package/skills/lark-whiteboard/scenes/bar-chart.md +1 -1
  120. package/skills/lark-whiteboard/scenes/fishbone.md +1 -1
  121. package/skills/lark-whiteboard/scenes/flywheel.md +1 -1
  122. package/skills/lark-whiteboard/scenes/line-chart.md +1 -1
  123. package/skills/lark-whiteboard/scenes/treemap.md +1 -1
  124. package/skills/lark-wiki/SKILL.md +1 -0
  125. package/skills/lark-slides/references/examples.md +0 -91
  126. package/skills/lark-slides/references/lark-slides-whiteboard.md +0 -331
  127. package/skills/lark-slides/references/lark-slides-xml-get.md +0 -100
  128. package/skills/lark-slides/references/slide-templates.md +0 -201
  129. package/skills/lark-slides/references/slides_demo.xml +0 -226
  130. package/skills/lark-slides/references/xml-format-guide.md +0 -433
@@ -1,6 +1,6 @@
1
1
  # XML Schema 快速参考
2
2
 
3
- 本文档是 [slides_xml_schema_definition.xml](slides_xml_schema_definition.xml) 的精简版摘要;如果两者不一致,以 XSD 原文为准。
3
+ 本文档是 [slides_xml_schema_definition.xml](slides_xml_schema_definition.xml) 的精简版摘要,并合并了常用 XML 格式写法;如果两者不一致,以 XSD 原文为准。
4
4
 
5
5
  ## 最重要的规则
6
6
 
@@ -17,7 +17,7 @@
17
17
  <slide>
18
18
  <data>
19
19
  <shape type="text" topLeftX="80" topLeftY="80" width="800" height="120">
20
- <content textType="title">
20
+ <content autoFit="normal-auto-fit" wrap="true" textType="title">
21
21
  <p>标题</p>
22
22
  </content>
23
23
  </shape>
@@ -30,24 +30,30 @@
30
30
 
31
31
  | 属性 | 必需 | 说明 |
32
32
  |------|------|------|
33
- | `width` | 是 | 演示文稿宽度,正整数 |
34
- | `height` | 是 | 演示文稿高度,正整数 |
33
+ | `width` | 是 | 演示文稿宽度,正整数,标准 16:9 页面建议使用 `960` |
34
+ | `height` | 是 | 演示文稿高度,正整数,标准 16:9 页面建议使用 `540` |
35
35
  | `id` | 否 | 演示文稿标识 |
36
36
 
37
37
  **子元素:** `<title>?`, `<theme>?`, `<slide>+`
38
38
 
39
- ## slide 元素
39
+ `<slide>` 至少 1 页,最多 100 页。
40
40
 
41
- | 属性 | 必需 | 说明 |
42
- |------|------|------|
43
- | `id` | 否 | 幻灯片标识 |
41
+ ## theme 与文本类型
44
42
 
45
- **子元素:**
46
- - `<style>?` - 页面样式,目前可放 `<fill>`
47
- - `<data>?` - 页面元素容器,可放 `shape`、`line`、`polyline`、`img`、`table`、`icon`、`chart`、`whiteboard`、`undefined`
48
- - `<note>?` - 演讲者备注,内部可放 `<content>`
43
+ `<theme>` 当前包含两部分:
49
44
 
50
- ## theme 与文本类型
45
+ - `<background>`:演示文稿级背景填充
46
+ - `<textStyles>`:主题文本样式集合
47
+
48
+ `<textStyles>` 下可选子元素包括 `<title>`、`<headline>`、`<sub-headline>`、`<body>`、`<caption>`。这些元素定义的是主题默认样式,不是页面结构。
49
+
50
+ 常用属性:
51
+
52
+ | 属性 | 说明 |
53
+ |------|------|
54
+ | `fontFamily` | 字体 |
55
+ | `fontSize` | 字号 |
56
+ | `fontColor` | 字体颜色 |
51
57
 
52
58
  XSD 中的 `title`、`headline`、`sub-headline`、`body`、`caption` 主要出现在:
53
59
 
@@ -64,6 +70,22 @@ XSD 中的 `title`、`headline`、`sub-headline`、`body`、`caption` 主要出
64
70
  | `body` | 16 |
65
71
  | `caption` | 12 |
66
72
 
73
+ 默认字号是省略 `fontSize` 时的兜底字号,不是推荐值。字号必须显式设置 `<content>` 的 `fontSize` 属性,不要依赖 `textType` 的默认字号兜底,这些兜底值明显偏大。
74
+
75
+ ## slide 元素
76
+
77
+ | 属性 | 必需 | 说明 |
78
+ |------|------|------|
79
+ | `id` | 否 | 幻灯片标识 |
80
+
81
+ **子元素:**
82
+
83
+ - `<style>?` - 页面样式,目前可放 `<fill>`
84
+ - `<data>?` - 页面元素容器,可放 `shape`、`line`、`polyline`、`img`、`table`、`icon`、`chart`、`undefined`
85
+ - `<note>?` - 演讲者备注,内部可放 `<content>`
86
+
87
+ 这意味着 `<title>`、`<headline>`、`<body>`、`<caption>` 不能直接放在 `<slide>` 下。
88
+
67
89
  ## content 内容模型
68
90
 
69
91
  `<content>` 可出现在 `shape`、`table/td`、`note` 中,常用属性包括:
@@ -71,23 +93,47 @@ XSD 中的 `title`、`headline`、`sub-headline`、`body`、`caption` 主要出
71
93
  | 属性 | 说明 |
72
94
  |------|------|
73
95
  | `textType` | `title` / `headline` / `sub-headline` / `body` / `caption` |
96
+ | `verticalAlign` | 垂直对齐 |
74
97
  | `textAlign` | 文本对齐方式 |
75
98
  | `lineSpacing` | 行间距,schema 默认 `multiple:1.5` |
76
99
  | `fontSize` | 字号 |
77
100
  | `fontFamily` | 字体 |
78
101
  | `color` | 字体颜色 |
79
- | `bold` / `italic` / `underline` / `strikethrough` | 文本样式 |
102
+ | `bold` / `italic` / `underline` / `strikethrough` | 内容级样式 |
103
+ | `wrap` | 是否自动换行 |
104
+ | `autoFit` | 是否自动缩排 |
105
+
106
+ 注意事项:
107
+
108
+ - 字号必须显式设置 `<content>` 的 `fontSize` 属性,不要依赖 `textType` 的默认字号兜底,这些兜底值明显偏大。
109
+ - 大数字、字号大或字数多的 `<content>` 必须设置 `wrap="true" autoFit="normal-auto-fit"` 属性自动换行和缩排,避免文字溢出。
110
+ - 文字颜色必须用 `<content>` 的 `color` 属性而不是 `fontColor` 属性。
111
+ - 文字行间距必须设置 `<content>` 的 `lineSpacing="multiple:xx"` 或 `lineSpacing="fixed:xx"` 而不是 `lineSpacing="xx"`。
80
112
 
81
- `<content>` 的子元素只能是:
113
+ `<content>` 直接子元素只有:
82
114
 
83
115
  - `<p>`
84
116
  - `<ul>`
85
117
  - `<ol>`
86
118
 
87
- ### content 示例
119
+ ### p 段落与内联标签
120
+
121
+ `<p>` 是段落元素,可混排纯文本和内联标签:
122
+
123
+ - `<br/>`
124
+ - `<strong>`
125
+ - `<em>`
126
+ - `<u>`
127
+ - `<span>`
128
+ - `<del>`
129
+ - `<a>`
130
+ - `<shadow>`
131
+ - `<outline>`
132
+
133
+ 示例:
88
134
 
89
135
  ```xml
90
- <content textType="body" textAlign="left">
136
+ <content autoFit="normal-auto-fit" textType="body" textAlign="left">
91
137
  <p>正文内容 <strong>加粗</strong> <em>斜体</em> <a href="https://example.com">链接</a></p>
92
138
  <ul>
93
139
  <li><p>列表项 1</p></li>
@@ -98,8 +144,20 @@ XSD 中的 `title`、`headline`、`sub-headline`、`body`、`caption` 主要出
98
144
 
99
145
  ## data 常用元素
100
146
 
147
+ 所有页面元素都放在 `<data>` 中。
148
+
101
149
  ### shape
102
150
 
151
+ `shape` 可表示普通形状,也可表示文本框。文本框推荐使用 `type="text"`。
152
+
153
+ ```xml
154
+ <shape type="text" topLeftX="80" topLeftY="80" width="800" height="120">
155
+ <content textType="title">
156
+ <p>主标题</p>
157
+ </content>
158
+ </shape>
159
+ ```
160
+
103
161
  ```xml
104
162
  <shape type="rect" topLeftX="120" topLeftY="120" width="240" height="120">
105
163
  <fill>
@@ -108,6 +166,8 @@ XSD 中的 `title`、`headline`、`sub-headline`、`body`、`caption` 主要出
108
166
  <border color="rgb(0, 0, 0)" width="2"/>
109
167
  </shape>
110
168
  ```
169
+ `<shape type="rect">` 只是形状不是容器,`<icon>`、`<img>`、`<shape type="text">` 和其他 `<shape>` 必须与它平级靠坐标叠放。
170
+
111
171
 
112
172
  | 属性 | 必需 | 说明 |
113
173
  |------|------|------|
@@ -117,6 +177,23 @@ XSD 中的 `title`、`headline`、`sub-headline`、`body`、`caption` 主要出
117
177
  | `width` | 是 | 宽度 |
118
178
  | `height` | 是 | 高度 |
119
179
  | `rotation` | 否 | 旋转角度 |
180
+ | `flipX` / `flipY` | 否 | 翻转 |
181
+ | `alpha` | 否 | 透明度 |
182
+
183
+ 可选子元素:
184
+
185
+ - `<fill>`
186
+ - `<border>`
187
+ - `<reflection>`
188
+ - `<shadow>`
189
+ - `<content>`
190
+
191
+ `type` 常用取值:`text`(文本框)、`rect`、`round-rect`(圆角矩形)、`ellipse`(椭圆/圆)、`triangle`、`diamond`、`parallelogram`、`trapezoid`、`custom`(配合 `path` 属性写 SVG 路径串)。箭头、星形、标注气泡、`chevron`、`flow-chart-*` 等更多形状见 XSD `ShapeType` 枚举。
192
+
193
+ 其它可选属性:
194
+
195
+ - `presetHandlers`:控制点,用于圆角等。例如 `<shape type="rect" presetHandlers="60">` = 圆角半径 60px 的圆角矩形;多个控制点用逗号分隔。
196
+ - `path`:仅 `type="custom"` 时使用,SVG 路径串。
120
197
 
121
198
  ### line
122
199
 
@@ -126,55 +203,118 @@ XSD 中的 `title`、`headline`、`sub-headline`、`body`、`caption` 主要出
126
203
  </line>
127
204
  ```
128
205
 
206
+ `line` 使用的是 `startX` / `startY` / `endX` / `endY`,不是 `x1` / `y1` / `x2` / `y2`。
207
+
208
+ ### polyline
209
+
210
+ 折线 / 曲线连接线,用外接矩形定位(`topLeftX` / `topLeftY` / `width` / `height`),不是端点坐标;`<border>` 必填(无 border 不可见)。`type` 默认 `bent-connector2`(可选 `bent-connector2-5` 折线 / `curved-connector2-5` 曲线)。
211
+
212
+ ```xml
213
+ <polyline topLeftX="120" topLeftY="120" width="200" height="100">
214
+ <border color="rgb(43, 47, 54)" width="2"/>
215
+ </polyline>
216
+ ```
217
+
129
218
  ### img
130
219
 
131
220
  ```xml
132
221
  <img src="file_token_or_url" topLeftX="80" topLeftY="120" width="320" height="180"/>
133
222
  ```
134
223
 
224
+ `img` 使用 `topLeftX` / `topLeftY`,不是 `x` / `y`。
225
+
135
226
  `src` 只支持:`slides +media-upload` 返回的 `file_token`,或 `@<本地路径>` 占位符(仅 `+create --slides` 自动上传并替换)。**禁止使用 http(s) 外链 URL**——飞书 slides 渲染端不会代理外链图,外链 src 在 PPT 里通常不显示。本地图片详见 [lark-slides-create.md](lark-slides-create.md#本地图片path-占位符) / [lark-slides-media-upload.md](lark-slides-media-upload.md)。
136
227
 
228
+ 本地图片的两种姿势:
229
+
230
+ - 新建带图 PPT:`+create --slides` 里直接写 `src="@./pic.png"`,CLI 在创空白 PPT 后、加 slides 前自动上传并替换 token
231
+ - 给已有 PPT 加带图新页:先 `slides +media-upload --file ./pic.png --presentation $PID` 拿 token,再用 token 写进 `xml_presentation.slide create` 的 XML
232
+
137
233
  > **注意**:`width`/`height` 是**裁剪后**的显示尺寸。比例和原图不一致时会自动裁剪(无法靠属性关闭),想避免裁剪就让 `width:height` 对齐原图比例。
138
234
 
139
235
  ### icon
140
236
 
141
237
  ```xml
142
- <icon iconType="iconpark/Base/setting.svg" topLeftX="80" topLeftY="120" width="32" height="32">
238
+ <icon iconType="iconpark/Charts/chart-line.svg" topLeftX="80" topLeftY="120" width="32" height="32">
143
239
  <fill>
144
240
  <fillColor color="rgba(37, 99, 235, 1)"/>
145
241
  </fill>
146
242
  </icon>
147
243
  ```
148
244
 
149
- `iconType` 必须来自已验证的 IconPark 路径;视觉 lint 规范要求 `fillColor` 显式设置为非透明颜色,避免图标不可见。需要语义图标时,先运行 `scripts/iconpark_tool.py search --query "<语义>"`,不要凭记忆拼路径。更多规则见 [iconpark.md](iconpark.md)。
245
+ 图标必须填充颜色并和背景有足够对比。
246
+
247
+ 禁止盲猜 iconType,必须先检索 IconPark,再写 `<icon iconType="...">`。检索方式和更多规则见 [iconpark.md](iconpark.md)。
248
+
249
+
250
+ ### table
251
+
252
+ 表格结构为:
253
+
254
+ - `<table>` 直接子元素只有 `<colgroup>` 和 `<tr>`,`width` 和 `height` 分别表示表格的目标总宽度和总高度。
255
+ - `<colgroup>` 直接子元素只有 `<col width="...">`,width 定义列宽,默认 110。
256
+ - `<tr height="...">` 直接子元素只有 `<td>`,height 定义行高,默认 37。
257
+ - `<td>` 直接子元素只有 `<fill>`(背景)、`<content>`(文字)和边框配置(一般不用),不能嵌套 `<shape>`、`<img>`、`<icon>`。
258
+ - 合并单元格:`<td>` 上用 `colspan`(跨列,默认 1)和 `rowspan`(跨行,默认 1);被合并覆盖的单元格不再写对应 `<td>`。
259
+
260
+ 表头默认的白底白字视觉效果极差,必须设置背景和文字颜色,需在首行每个 `<td>` 上加 `<fill>`(配合 `bold` 与对比文字色)与正文行区分。
261
+
262
+ 表格里的文字默认是居中对齐,可以设置 `textAlign` 调整对齐方式。
263
+
264
+ 表格宽高设置:
265
+
266
+ - 已设置的列宽和行高优先保留,未设置的列宽、行高会使用表格的目标总宽度、总高度分配剩余空间
267
+ - **必须设置 `<table>` 的 `width` 和 `height` 固定表格大小,同时设置需要保留列宽或行高的 `<col>` 的 `width` 和 `<tr>` 的 `height`,其余自动分配。**
268
+
269
+ 不同字号的行高参考:
270
+
271
+ | `fontSize` | 内容行数 | 紧凑 `height` | 适中 `height` | 宽松 `height` |
272
+ |------|------|------|------|------|
273
+ | 10 | 单行 | 16 | 20 | 24 |
274
+ | 12 | 单行 | 20 | 24 | 28 |
275
+ | 10 | 双行 | 32 | 36 | 42 |
276
+ | 12 | 双行 | 36 | 42 | 48 |
150
277
 
151
- ### whiteboard
278
+ 示例:
152
279
 
153
280
  ```xml
154
- <!-- SVG 模式:<chart> 不支持的图表或自定义视觉、装饰元素 -->
155
- <whiteboard topLeftX="580" topLeftY="120" width="340" height="280">
156
- <svg xmlns="http://www.w3.org/2000/svg">
157
- <rect x="60" y="80" width="40" height="140" rx="3" fill="rgba(59,130,246,0.85)"/>
158
- <text x="80" y="238" text-anchor="middle" font-size="11" fill="rgba(100,116,139,1)">ABC</text>
159
- </svg>
160
- </whiteboard>
161
-
162
- <!-- Mermaid 模式:流程图、时序图等结构化图表 -->
163
- <whiteboard topLeftX="72" topLeftY="100" width="816" height="340">
164
- <mermaid>
165
- <![CDATA[
166
- flowchart LR
167
- A[开始] --> B{判断}
168
- B -- 是 --> C[执行]
169
- B -- 否 --> D[结束]
170
- ]]>
171
- </mermaid>
172
- </whiteboard>
281
+ <table topLeftX="80" topLeftY="140" width="520" height="52">
282
+ <colgroup>
283
+ <col width="160"/>
284
+ <col width="120"/>
285
+ <col />
286
+ </colgroup>
287
+ <tr height="28">
288
+ <td>
289
+ <fill><fillColor color="rgba(30,60,114,1)"/></fill>
290
+ <content textType="body" fontSize="12" bold="true" color="rgba(255,255,255,1)" textAlign="center"><p>项目</p></content>
291
+ </td>
292
+ <td>
293
+ <fill><fillColor color="rgba(30,60,114,1)"/></fill>
294
+ <content textType="body" fontSize="12" bold="true" color="rgba(255,255,255,1)" textAlign="right"><p>营收</p></content>
295
+ </td>
296
+ <td>
297
+ <fill><fillColor color="rgba(30,60,114,1)"/></fill>
298
+ <content textType="body" fontSize="12" bold="true" color="rgba(255,255,255,1)" textAlign="left"><p>备注说明</p></content>
299
+ </td>
300
+ </tr>
301
+ <tr>
302
+ <td><content textType="body" fontSize="10" textAlign="center"><p>线上业务</p></content></td>
303
+ <td><content textType="body" fontSize="10" textAlign="right"><p>195</p></content></td>
304
+ <td><content textType="body" fontSize="10" textAlign="left"><p>同比增长 8%,主要来自新客</p></content></td>
305
+ </tr>
306
+ </table>
173
307
  ```
174
308
 
175
- SVG 模式:`<svg>` 需声明 `xmlns="http://www.w3.org/2000/svg"`,内容大小由子元素包围盒决定;`width`/`height`/`viewBox` 不影响渲染,仅当元素使用百分比属性值时需声明 `viewBox`。\
176
- Mermaid 模式:内容用 `<![CDATA[...]]>` 包裹,避免 `[`、`>`、`-->` 等字符破坏 XML 解析。\
177
- 详细用法见 [lark-slides-whiteboard.md](lark-slides-whiteboard.md)。
309
+ ### chart
310
+
311
+ 图表语法十分复杂,必须阅读 [slides_chart_demo.xml](slides_chart_demo.xml),直接照抄其中的柱状、条形、折线、面积、饼(环)、雷达、组合图。
312
+
313
+ `<chart>` 直接子元素必须有 `<chartPlotArea>`(绘图区)和 `<chartData>`(数据);`<chartTitle>`、`<chartSubTitle>`、`<chartStyle>`、`<chartLegend>`、`<chartTooltip>` 可选,如果想不展示标题、副标题、图例或悬浮提示,省略相应元素标签即可。
314
+
315
+ 隐藏 `<chart>` 的图例只能通过不写或删除 `<chartLegend>` 实现,`<chartLegend>` 不支持 `position="none"`。
316
+
317
+ 详细用法见 [slides_xml_schema_definition.xml](slides_xml_schema_definition.xml)。
178
318
 
179
319
  ## 颜色与样式
180
320
 
@@ -229,18 +369,75 @@ Mermaid 模式:内容用 `<![CDATA[...]]>` 包裹,避免 `[`、`>`、`-->`
229
369
 
230
370
  ```xml
231
371
  <note>
232
- <content textType="body">
372
+ <content autoFit="normal-auto-fit" textType="body">
233
373
  <p>这是演讲者备注。</p>
234
374
  </content>
235
375
  </note>
236
376
  ```
237
377
 
378
+ ## 完整示例
379
+
380
+ ```xml
381
+ <?xml version="1.0" encoding="UTF-8"?>
382
+ <presentation xmlns="http://www.larkoffice.com/sml/2.0" width="960" height="540">
383
+ <title>季度报告</title>
384
+ <theme>
385
+ <textStyles>
386
+ <title fontFamily="思源黑体" fontSize="54" fontColor="rgba(0, 0, 0, 1)"/>
387
+ <body fontFamily="思源黑体" fontSize="18" fontColor="rgba(43, 47, 54, 1)"/>
388
+ </textStyles>
389
+ </theme>
390
+ <slide>
391
+ <style>
392
+ <fill>
393
+ <fillColor color="rgb(245, 245, 245)"/>
394
+ </fill>
395
+ </style>
396
+ <data>
397
+ <shape type="text" topLeftX="80" topLeftY="72" width="760" height="100">
398
+ <content textType="title">
399
+ <p>2024 年第一季度报告</p>
400
+ </content>
401
+ </shape>
402
+ <shape type="text" topLeftX="80" topLeftY="200" width="520" height="180">
403
+ <content textType="body">
404
+ <p>核心指标</p>
405
+ <ul>
406
+ <li><p>用户增长:+25%</p></li>
407
+ <li><p>收入增长:+30%</p></li>
408
+ <li><p>市场份额:15%</p></li>
409
+ </ul>
410
+ </content>
411
+ </shape>
412
+ <shape type="rect" topLeftX="660" topLeftY="180" width="180" height="140">
413
+ <fill>
414
+ <fillColor color="rgba(100, 149, 237, 0.25)"/>
415
+ </fill>
416
+ <border color="rgb(100, 149, 237)" width="2"/>
417
+ </shape>
418
+ </data>
419
+ <note>
420
+ <content textType="body">
421
+ <p>讲到增长率时补充样本范围。</p>
422
+ </content>
423
+ </note>
424
+ </slide>
425
+ </presentation>
426
+ ```
427
+
428
+ ## 最佳实践
429
+
430
+ 1. 始终带上命名空间 `xmlns="http://www.larkoffice.com/sml/2.0"`
431
+ 2. 用 `shape type="text"` + `content` 表达页面文本
432
+ 3. 用 `topLeftX` / `topLeftY`、`startX` / `startY` 等 schema 中定义的属性名
433
+ 4. 优先使用 `rgb` / `rgba` 颜色格式;渐变必须使用 `rgba()` 且带百分比停靠点
434
+ 5. 特殊字符按 XML 规则转义
435
+ 6. 标准 16:9 页面建议使用 `width="960"` 和 `height="540"`
436
+
238
437
  ## 详细参考
239
438
 
240
439
  - [slides_xml_schema_definition.xml](slides_xml_schema_definition.xml)
241
- - [xml-format-guide.md](xml-format-guide.md)
242
- - [examples.md](examples.md)
243
- - [slides_demo.xml](slides_demo.xml)
440
+ - [slides_chart_demo.xml](slides_chart_demo.xml)
244
441
 
245
442
  ## Schema 版本信息
246
443