@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,226 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <presentation xmlns="http://www.larkoffice.com/sml/2.0" height="540" width="960">
3
- <title>制造端智能升级</title>
4
- <theme>
5
- <textStyles>
6
- <headline fontColor="rgb(255,255,255)" fontFamily="思源黑体" fontSize="36"/>
7
- <sub-headline fontColor="rgb(229,231,235)" fontFamily="思源黑体" fontSize="20"/>
8
- <body fontColor="rgb(229,231,235)" fontFamily="思源黑体" fontSize="16"/>
9
- </textStyles>
10
- </theme>
11
- <slide>
12
- <style>
13
- <fill>
14
- <fillColor color="linear-gradient(180deg, rgb(47, 79, 79) 0%, rgb(26, 26, 26) 100%)"/>
15
- </fill>
16
- </style>
17
- <data>
18
- <shape height="36" rotation="0" topLeftX="48" topLeftY="40" type="text" width="300">
19
- <content>
20
- <p>
21
- <strong>
22
- <span color="rgb(255, 215, 0)" fontFamily="黑体" fontSize="28">时代背景</span>
23
- </strong>
24
- </p>
25
- </content>
26
- </shape>
27
- <shape height="200" rotation="0" topLeftX="48" topLeftY="85" type="rect" width="864">
28
- <fill>
29
- <fillColor color="rgba(0,0,0,0.2)"/>
30
- </fill>
31
- </shape>
32
- <img alpha="0.4" alt="十月革命场景" height="180" rotation="0" src="https://example.com/images/scene-1.png" topLeftX="48" topLeftY="95" width="288">
33
- <crop type="rect"/>
34
- </img>
35
- <img alpha="0.4" alt="列宁演讲油画" height="180" rotation="0" src="https://example.com/images/scene-2.png" topLeftX="336" topLeftY="95" width="288">
36
- <crop type="rect"/>
37
- </img>
38
- <img alpha="0.4" alt="十月革命战斗场面" height="180" rotation="0" src="https://example.com/images/scene-3.png" topLeftX="624" topLeftY="95" width="288">
39
- <crop type="rect"/>
40
- </img>
41
- <shape height="2" rotation="0" topLeftX="90" topLeftY="180" type="rect" width="780">
42
- <fill>
43
- <fillColor color="rgba(255, 215, 0, 0.3)"/>
44
- </fill>
45
- </shape>
46
- <shape height="10" rotation="0" topLeftX="120" topLeftY="176" type="ellipse" width="10">
47
- <fill>
48
- <fillColor color="rgb(196, 30, 58)"/>
49
- </fill>
50
- <border color="rgb(255, 215, 0)" width="1"/>
51
- </shape>
52
- <shape height="24" rotation="0" topLeftX="60" topLeftY="140" type="text" width="200">
53
- <content>
54
- <p textAlign="center">
55
- <strong>
56
- <span color="rgb(255, 215, 0)" fontFamily="黑体" fontSize="20">1917</span>
57
- </strong>
58
- </p>
59
- </content>
60
- </shape>
61
- <shape height="22" rotation="0" topLeftX="60" topLeftY="200" type="text" width="200">
62
- <content>
63
- <p textAlign="center">
64
- <span color="rgb(230, 230, 230)" fontFamily="宋体" fontSize="16">十月革命</span>
65
- </p>
66
- </content>
67
- </shape>
68
- <shape height="40" rotation="0" topLeftX="60" topLeftY="225" type="text" width="200">
69
- <content verticalAlign="top">
70
- <p textAlign="center">
71
- <span color="rgb(156, 163, 175)" fontSize="12">沙皇专制终结,苏维埃政权建立</span>
72
- </p>
73
- </content>
74
- </shape>
75
- <shape height="10" rotation="0" topLeftX="475" topLeftY="176" type="ellipse" width="10">
76
- <fill>
77
- <fillColor color="rgb(196, 30, 58)"/>
78
- </fill>
79
- <border color="rgb(255, 215, 0)" width="1"/>
80
- </shape>
81
- <shape height="24" rotation="0" topLeftX="380" topLeftY="140" type="text" width="200">
82
- <content>
83
- <p textAlign="center">
84
- <strong>
85
- <span color="rgb(255, 215, 0)" fontFamily="黑体" fontSize="20">1920s</span>
86
- </strong>
87
- </p>
88
- </content>
89
- </shape>
90
- <shape height="22" rotation="0" topLeftX="380" topLeftY="200" type="text" width="200">
91
- <content>
92
- <p textAlign="center">
93
- <span color="rgb(230, 230, 230)" fontFamily="宋体" fontSize="16">国内战争</span>
94
- </p>
95
- </content>
96
- </shape>
97
- <shape height="40" rotation="0" topLeftX="380" topLeftY="225" type="text" width="200">
98
- <content verticalAlign="top">
99
- <p textAlign="center">
100
- <span color="rgb(156, 163, 175)" fontSize="12">革命与反革命的残酷斗争</span>
101
- </p>
102
- </content>
103
- </shape>
104
- <shape height="10" rotation="0" topLeftX="830" topLeftY="176" type="ellipse" width="10">
105
- <fill>
106
- <fillColor color="rgb(196, 30, 58)"/>
107
- </fill>
108
- <border color="rgb(255, 215, 0)" width="1"/>
109
- </shape>
110
- <shape height="24" rotation="0" topLeftX="740" topLeftY="140" type="text" width="200">
111
- <content>
112
- <p textAlign="center">
113
- <strong>
114
- <span color="rgb(255, 215, 0)" fontFamily="黑体" fontSize="20">1930s</span>
115
- </strong>
116
- </p>
117
- </content>
118
- </shape>
119
- <shape height="22" rotation="0" topLeftX="740" topLeftY="200" type="text" width="200">
120
- <content>
121
- <p textAlign="center">
122
- <span color="rgb(230, 230, 230)" fontFamily="宋体" fontSize="16">社会主义建设</span>
123
- </p>
124
- </content>
125
- </shape>
126
- <shape height="40" rotation="0" topLeftX="740" topLeftY="225" type="text" width="200">
127
- <content verticalAlign="top">
128
- <p textAlign="center">
129
- <span color="rgb(156, 163, 175)" fontSize="12">新经济政策与工业化探索</span>
130
- </p>
131
- </content>
132
- </shape>
133
- <shape height="1" rotation="0" topLeftX="48" topLeftY="300" type="rect" width="864">
134
- <fill>
135
- <fillColor color="rgba(255, 215, 0, 0.2)"/>
136
- </fill>
137
- </shape>
138
- <shape height="24" rotation="0" topLeftX="48" topLeftY="320" type="text" width="280">
139
- <content>
140
- <p>
141
- <span color="rgb(230, 230, 230)" fontFamily="宋体" fontSize="18">作者:奥斯特洛夫斯基</span>
142
- </p>
143
- </content>
144
- </shape>
145
- <icon height="16" iconType="iconpark/Peoples/user.svg" topLeftX="52" topLeftY="360" width="16">
146
- <fill>
147
- <fillColor color="rgb(196, 30, 58)"/>
148
- </fill>
149
- </icon>
150
- <shape height="20" topLeftX="76" topLeftY="358" type="text" width="260">
151
- <content verticalAlign="middle">
152
- <p>
153
- <span color="rgb(209, 213, 219)" fontSize="13">工人家庭出身,投身革命浪潮</span>
154
- </p>
155
- </content>
156
- </shape>
157
- <icon height="16" iconType="iconpark/Sports/torch.svg" topLeftX="52" topLeftY="390" width="16">
158
- <fill>
159
- <fillColor color="rgb(196, 30, 58)"/>
160
- </fill>
161
- </icon>
162
- <shape height="20" topLeftX="76" topLeftY="388" type="text" width="260">
163
- <content verticalAlign="middle">
164
- <p>
165
- <span color="rgb(209, 213, 219)" fontSize="13">战场负伤致残,生命陷入黑暗</span>
166
- </p>
167
- </content>
168
- </shape>
169
- <icon height="16" iconType="iconpark/Health/first-aid-kit.svg" topLeftX="52" topLeftY="420" width="16">
170
- <fill>
171
- <fillColor color="rgb(196, 30, 58)"/>
172
- </fill>
173
- </icon>
174
- <shape height="20" topLeftX="76" topLeftY="418" type="text" width="260">
175
- <content verticalAlign="middle">
176
- <p>
177
- <span color="rgb(209, 213, 219)" fontSize="13">全身瘫痪、双目失明</span>
178
- </p>
179
- </content>
180
- </shape>
181
- <icon height="16" iconType="iconpark/Edit/edit.svg" topLeftX="52" topLeftY="450" width="16">
182
- <fill>
183
- <fillColor color="rgb(196, 30, 58)"/>
184
- </fill>
185
- </icon>
186
- <shape height="20" topLeftX="76" topLeftY="448" type="text" width="260">
187
- <content verticalAlign="middle">
188
- <p>
189
- <span color="rgb(209, 213, 219)" fontSize="13">以文学为武器,口述完成创作</span>
190
- </p>
191
- </content>
192
- </shape>
193
- <img alt="奥斯特洛夫斯基青年时期" height="213" rotation="0" src="https://example.com/images/ostrovsky.png" topLeftX="360" topLeftY="320" width="160">
194
- <border color="rgba(255, 215, 0, 0.5)" width="2"/>
195
- <crop type="rect"/>
196
- </img>
197
- <shape height="24" rotation="0" topLeftX="552" topLeftY="320" type="text" width="360">
198
- <content>
199
- <p>
200
- <span color="rgb(230, 230, 230)" fontFamily="宋体" fontSize="18">创作动机</span>
201
- </p>
202
- </content>
203
- </shape>
204
- <shape height="16" rotation="0" topLeftX="552" topLeftY="350" type="rect" width="2">
205
- <fill>
206
- <fillColor color="rgb(196, 30, 58)"/>
207
- </fill>
208
- </shape>
209
- <shape height="120" rotation="0" topLeftX="562" topLeftY="350" type="text" width="350">
210
- <content lineSpacing="multiple:1.6" verticalAlign="top">
211
- <p>
212
- <span color="rgb(209, 213, 219)" fontSize="13">在双目失明、全身瘫痪的逆境中,奥斯特洛夫斯基以自身经历为蓝本,用顽强的意志口述完成了这部不朽巨著。他将文学创作视为生命的延续和战斗的武器,旨在通过保尔·柯察金的形象,向青年一代传递坚不可摧的革命信念和超越个人痛苦的崇高人生价值观。</span>
213
- </p>
214
- </content>
215
- </shape>
216
- </data>
217
- <note>
218
- <content>
219
- <p>各位好,这一页将我们带回《钢铁是怎样炼成的》这部巨著诞生的波澜壮阔的时代。</p>
220
- <p>上半部分展示了从1917年十月革命到1930年代苏联社会主义建设的宏大历史画卷。这是一个充满剧烈社会变革和残酷斗争的年代,也是英雄主义和理想主义精神熊熊燃烧的年代。正是这样的背景,孕育了小说的灵魂。</p>
221
- <p>下半部分,我们聚焦于作者奥斯特洛夫斯基的个人经历。他的一生,本身就是一部比小说更震撼人心的传奇。从投身革命的青年,到因伤致残的战士,再到与命运抗争的文学巨匠。他的创作动机源于自身不屈的战斗精神,他希望用保尔的故事激励后人,在任何困境中都不要放弃理想,要将有限的生命投入到无限的为人类解放而斗争的事业中去。</p>
222
- <p>通过了解这段历史和作者的生平,我们能更深刻地理解《钢铁是怎样炼成的》这部作品的伟大之处。</p>
223
- </content>
224
- </note>
225
- </slide>
226
- </presentation>
@@ -1,433 +0,0 @@
1
- # XML 格式指南
2
-
3
- 本文档基于 [slides_xml_schema_definition.xml](slides_xml_schema_definition.xml) 整理,说明飞书 Slides XML Schema(SML 2.0)的核心结构和常用写法。
4
-
5
- ## 基本结构
6
-
7
- ```xml
8
- <?xml version="1.0" encoding="UTF-8"?>
9
- <presentation xmlns="http://www.larkoffice.com/sml/2.0" width="960" height="540">
10
- <title>演示文稿标题</title>
11
- <slide>
12
- <style>
13
- <fill>
14
- <fillColor color="rgb(245, 245, 245)"/>
15
- </fill>
16
- </style>
17
- <data>
18
- <shape type="text" topLeftX="80" topLeftY="80" width="800" height="120">
19
- <content textType="title">
20
- <p>主标题</p>
21
- </content>
22
- </shape>
23
- </data>
24
- <note>
25
- <content textType="body">
26
- <p>这是演讲者备注。</p>
27
- </content>
28
- </note>
29
- </slide>
30
- </presentation>
31
- ```
32
-
33
- ## 根元素
34
-
35
- ### `<presentation>`
36
-
37
- 协议标准写法应带命名空间 `http://www.larkoffice.com/sml/2.0`;当前服务端实现可能兼容不带 `xmlns` 的输入,但不作为协议保证。
38
-
39
- **属性:**
40
-
41
- | 属性 | 类型 | 必需 | 说明 |
42
- |------|------|------|------|
43
- | `width` | positiveInteger | 是 | 演示文稿宽度,如 `960` |
44
- | `height` | positiveInteger | 是 | 演示文稿高度,如 `540` |
45
- | `id` | string | 否 | 演示文稿标识 |
46
-
47
- **子元素:**
48
-
49
- | 元素 | 必需 | 说明 |
50
- |------|------|------|
51
- | `<title>` | 否 | 演示文稿标题 |
52
- | `<theme>` | 否 | 全局主题 |
53
- | `<slide>` | 是 | 幻灯片页面,至少 1 页,最多 100 页 |
54
-
55
- ## 主题
56
-
57
- ### `<theme>`
58
-
59
- `<theme>` 当前包含两部分:
60
-
61
- - `<background>`:演示文稿级背景填充
62
- - `<textStyles>`:主题文本样式集合
63
-
64
- `<textStyles>` 下可选子元素:
65
-
66
- - `<title>`
67
- - `<headline>`
68
- - `<sub-headline>`
69
- - `<body>`
70
- - `<caption>`
71
-
72
- 这些元素定义的是主题默认样式,不是页面结构。常用属性:
73
-
74
- | 属性 | 说明 |
75
- |------|------|
76
- | `fontFamily` | 字体 |
77
- | `fontSize` | 字号 |
78
- | `fontColor` | 字体颜色 |
79
-
80
- ## 幻灯片元素
81
-
82
- ### `<slide>`
83
-
84
- 单张幻灯片的结构比较严格。
85
-
86
- **属性:**
87
-
88
- | 属性 | 类型 | 必需 | 说明 |
89
- |------|------|------|------|
90
- | `id` | string | 否 | 幻灯片标识 |
91
-
92
- **直接子元素只有:**
93
-
94
- | 元素 | 必需 | 说明 |
95
- |------|------|------|
96
- | `<style>` | 否 | 页面样式 |
97
- | `<data>` | 否 | 页面元素容器 |
98
- | `<note>` | 否 | 演讲者备注 |
99
-
100
- 这意味着 `<title>`、`<headline>`、`<body>`、`<caption>` 不能直接放在 `<slide>` 下。
101
-
102
- ## 文本内容模型
103
-
104
- ### `<content>`
105
-
106
- 实际页面文本通常通过 `<content>` 表达,常见位置有:
107
-
108
- - `shape` 内部
109
- - `table/td` 内部
110
- - `note` 内部
111
-
112
- **常用属性:**
113
-
114
- | 属性 | 说明 |
115
- |------|------|
116
- | `textType` | `title` / `headline` / `sub-headline` / `body` / `caption` |
117
- | `verticalAlign` | 垂直对齐 |
118
- | `textAlign` | 水平对齐 |
119
- | `lineSpacing` | 行间距 |
120
- | `fontSize` | 字号 |
121
- | `fontFamily` | 字体 |
122
- | `color` | 字体颜色 |
123
- | `bold` / `italic` / `underline` / `strikethrough` | 内容级样式 |
124
- | `wrap` | 是否自动换行 |
125
-
126
- **可包含的子元素:**
127
-
128
- - `<p>`
129
- - `<ul>`
130
- - `<ol>`
131
-
132
- ### `<p>`
133
-
134
- `<p>` 是段落元素,可混排纯文本和内联标签:
135
-
136
- - `<br/>`
137
- - `<strong>`
138
- - `<em>`
139
- - `<u>`
140
- - `<span>`
141
- - `<del>`
142
- - `<a>`
143
- - `<shadow>`
144
- - `<outline>`
145
-
146
- 示例:
147
-
148
- ```xml
149
- <content textType="body" textAlign="left">
150
- <p>普通文本 <strong>加粗</strong> <em>斜体</em> <a href="https://example.com">链接</a></p>
151
- <ul>
152
- <li><p>列表项 1</p></li>
153
- <li><p>列表项 2</p></li>
154
- </ul>
155
- </content>
156
- ```
157
-
158
- ## 常用页面元素
159
-
160
- 所有页面元素都放在 `<data>` 中。
161
-
162
- ### `<shape>`
163
-
164
- `shape` 可表示普通形状,也可表示文本框。文本框推荐使用 `type="text"`。
165
-
166
- ```xml
167
- <shape type="text" topLeftX="80" topLeftY="80" width="800" height="120">
168
- <content textType="title">
169
- <p>主标题</p>
170
- </content>
171
- </shape>
172
- ```
173
-
174
- ```xml
175
- <shape type="rect" topLeftX="700" topLeftY="120" width="180" height="120">
176
- <fill>
177
- <fillColor color="rgba(100, 149, 237, 0.25)"/>
178
- </fill>
179
- <border color="rgb(100, 149, 237)" width="2"/>
180
- </shape>
181
- ```
182
-
183
- **属性:**
184
-
185
- | 属性 | 必需 | 说明 |
186
- |------|------|------|
187
- | `type` | 是 | 形状类型,`text` 表示文本框 |
188
- | `topLeftX` | 是 | 左上角 X 坐标 |
189
- | `topLeftY` | 是 | 左上角 Y 坐标 |
190
- | `width` | 是 | 宽度 |
191
- | `height` | 是 | 高度 |
192
- | `rotation` | 否 | 旋转角度 |
193
- | `flipX` / `flipY` | 否 | 翻转 |
194
- | `alpha` | 否 | 透明度 |
195
-
196
- **可选子元素:**
197
-
198
- - `<fill>`
199
- - `<border>`
200
- - `<reflection>`
201
- - `<shadow>`
202
- - `<content>`
203
-
204
- ### `<line>`
205
-
206
- ```xml
207
- <line startX="100" startY="200" endX="420" endY="200">
208
- <border color="rgb(43, 47, 54)" width="2"/>
209
- </line>
210
- ```
211
-
212
- `line` 使用的是 `startX` / `startY` / `endX` / `endY`,不是 `x1` / `y1` / `x2` / `y2`。
213
-
214
- ### `<img>`
215
-
216
- ```xml
217
- <img src="file_token_or_url" topLeftX="100" topLeftY="220" width="320" height="180"/>
218
- ```
219
-
220
- `img` 使用 `topLeftX` / `topLeftY`,不是 `x` / `y`。
221
-
222
- `src` 只接受两种值:
223
-
224
- | `src` 形式 | 说明 |
225
- |---|---|
226
- | `file_token`(如 `boxcnXXXXXXXXXXXXXXXXXXXXXX`) | 通过 `slides +media-upload` 上传后返回的 token |
227
- | `@<本地路径>`(如 `@./assets/chart.png`) | **仅在 `slides +create --slides` 中可用**:CLI 会自动上传该文件并替换为 file_token |
228
-
229
- > **禁止使用 http(s) 外链 URL**:飞书 slides 渲染端不会代理外链图片,`src="https://..."` 在 PPT 里通常显示破图。要用网图必须先 `curl`/下载到 CWD 内,再走上传流程拿 `file_token`。
230
-
231
- 本地图片的两种姿势:
232
-
233
- - **新建带图 PPT**:`+create --slides` 里直接写 `src="@./pic.png"`,CLI 在创空白 PPT 后、加 slides 前自动上传并替换 token
234
- - **给已有 PPT 加带图新页**:先 `slides +media-upload --file ./pic.png --presentation $PID` 拿 token,再用 token 写进 `xml_presentation.slide create` 的 XML
235
-
236
- ### `<icon>`
237
-
238
- ```xml
239
- <icon iconType="iconpark/Base/setting.svg" topLeftX="440" topLeftY="220" width="32" height="32"/>
240
- ```
241
-
242
- ### `<table>`
243
-
244
- 表格结构为:
245
-
246
- - `<table>`
247
- - `<colgroup>` / `<tr>`
248
- - `<tr>` 内为 `<td>`
249
- - `<td>` 内可放 `<content>`
250
-
251
- `<table>` 可选设置 `width` 和 `height`,分别表示表格的目标总宽度和总高度:
252
-
253
- ```xml
254
- <table topLeftX="80" topLeftY="120" width="800" height="300">
255
- <colgroup>
256
- <col width="240"/>
257
- <col/>
258
- </colgroup>
259
- <tr height="80">
260
- <td><content textType="body"><p>表头 1</p></content></td>
261
- <td><content textType="body"><p>表头 2</p></content></td>
262
- </tr>
263
- </table>
264
- ```
265
-
266
- ### `<chart>`
267
-
268
- 图表元素必须至少包含:
269
-
270
- - `<chartPlotArea>`
271
- - `<chartData>`
272
-
273
- 同时还可以包含:
274
-
275
- - `<chartTitle>`
276
- - `<chartSubTitle>`
277
- - `<chartStyle>`
278
- - `<chartLegend>`
279
- - `<chartTooltip>`
280
-
281
- 完整图表类型覆盖示例见 [slides_chart_demo.xml](slides_chart_demo.xml),其中包含柱状、条形、折线、面积、饼 / 环、雷达等原生 `<chart>` 示例,以及散点、气泡、漏斗、帕累托、瀑布等 `<whiteboard>` SVG 图表示例。
282
-
283
- 组合图示例(来自 [slides_chart_demo.xml](slides_chart_demo.xml)):
284
-
285
- ```xml
286
- <chart width="556" height="350" topLeftX="42" topLeftY="132">
287
- <chartPlotArea>
288
- <chartPlot type="combo">
289
- <chartExtra/>
290
- <chartSeriesList>
291
- <chartSeries index="1" comboType="column"/>
292
- <chartSeries index="2" comboType="line" yAxisPosition="right">
293
- <chartTooltip format="0%"/>
294
- </chartSeries>
295
- </chartSeriesList>
296
- </chartPlot>
297
- <chartAxes>
298
- <chartAxis type="x">
299
- <chartLabel fontSize="10"/>
300
- </chartAxis>
301
- <chartAxis type="y" position="left">
302
- <chartGridLine color="rgb(226, 232, 240)"/>
303
- <chartLabel fontSize="10"/>
304
- </chartAxis>
305
- <chartAxis type="y" position="right">
306
- <chartLabel fontSize="10" format="0%"/>
307
- </chartAxis>
308
- </chartAxes>
309
- </chartPlotArea>
310
- <chartLegend position="bottom" fontSize="11"/>
311
- <chartData>
312
- <dim1>
313
- <chartField name="季度">24Q1,24Q2,24Q3,24Q4,25Q1,25Q2,25Q3,25Q4</chartField>
314
- </dim1>
315
- <dim2>
316
- <chartField name="营收">180,195,210,245,220,238,258,296</chartField>
317
- <chartField name="增速">0.08,0.12,0.15,0.18,0.22,0.22,0.23,0.21</chartField>
318
- </dim2>
319
- </chartData>
320
- <chartTitle fontSize="12" color="rgba(15, 30, 58, 1)" bold="true">营收(亿美元, 左轴) · 同比增速(%, 右轴)</chartTitle>
321
- <chartStyle>
322
- <chartBackground color="rgba(0, 0, 0, 0)"/>
323
- <chartBorder color="rgb(222, 224, 227)" width="0"/>
324
- <chartColorTheme>
325
- <color value="rgb(28, 71, 120)"/>
326
- <color value="rgb(240, 129, 54)"/>
327
- </chartColorTheme>
328
- </chartStyle>
329
- </chart>
330
- ```
331
-
332
- ## 样式元素
333
-
334
- ### `<fill>`
335
-
336
- ```xml
337
- <fill>
338
- <fillColor color="rgb(100, 149, 237)"/>
339
- </fill>
340
- ```
341
-
342
- ### `<border>`
343
-
344
- ```xml
345
- <border color="rgb(0, 0, 0)" width="2" dashArray="solid"/>
346
- ```
347
-
348
- ### 颜色格式
349
-
350
- ```xml
351
- <fillColor color="rgb(255, 0, 0)"/>
352
- <fillColor color="rgba(255, 0, 0, 0.5)"/>
353
- <fillColor color="linear-gradient(90deg, rgb(255,0,0) 0%, rgb(0,0,255) 100%)"/>
354
- <fillColor color="radial-gradient(circle at 50% 50%, rgb(255,0,0) 0%, rgb(0,0,255) 100%)"/>
355
- ```
356
-
357
- ## 演讲者备注
358
-
359
- ### `<note>`
360
-
361
- ```xml
362
- <note>
363
- <content textType="body">
364
- <p>这是演讲者备注内容。</p>
365
- </content>
366
- </note>
367
- ```
368
-
369
- ## 完整示例
370
-
371
- ```xml
372
- <?xml version="1.0" encoding="UTF-8"?>
373
- <presentation xmlns="http://www.larkoffice.com/sml/2.0" width="960" height="540">
374
- <title>季度报告</title>
375
- <theme>
376
- <textStyles>
377
- <title fontFamily="思源黑体" fontSize="54" fontColor="rgba(0, 0, 0, 1)"/>
378
- <body fontFamily="思源黑体" fontSize="18" fontColor="rgba(43, 47, 54, 1)"/>
379
- </textStyles>
380
- </theme>
381
- <slide>
382
- <style>
383
- <fill>
384
- <fillColor color="rgb(245, 245, 245)"/>
385
- </fill>
386
- </style>
387
- <data>
388
- <shape type="text" topLeftX="80" topLeftY="72" width="760" height="100">
389
- <content textType="title">
390
- <p>2024 年第一季度报告</p>
391
- </content>
392
- </shape>
393
- <shape type="text" topLeftX="80" topLeftY="200" width="520" height="180">
394
- <content textType="body">
395
- <p>核心指标</p>
396
- <ul>
397
- <li><p>用户增长:+25%</p></li>
398
- <li><p>收入增长:+30%</p></li>
399
- <li><p>市场份额:15%</p></li>
400
- </ul>
401
- </content>
402
- </shape>
403
- <shape type="rect" topLeftX="660" topLeftY="180" width="180" height="140">
404
- <fill>
405
- <fillColor color="rgba(100, 149, 237, 0.25)"/>
406
- </fill>
407
- <border color="rgb(100, 149, 237)" width="2"/>
408
- </shape>
409
- </data>
410
- <note>
411
- <content textType="body">
412
- <p>讲到增长率时补充样本范围。</p>
413
- </content>
414
- </note>
415
- </slide>
416
- </presentation>
417
- ```
418
-
419
- ## 最佳实践
420
-
421
- 1. 始终带上命名空间 `xmlns="http://www.larkoffice.com/sml/2.0"`
422
- 2. 用 `shape type="text"` + `content` 表达页面文本
423
- 3. 用 `topLeftX` / `topLeftY`、`startX` / `startY` 等 schema 中定义的属性名
424
- 4. 优先使用 `rgb` / `rgba` 颜色格式
425
- 5. 特殊字符按 XML 规则转义
426
- 6. 标准 16:9 页面建议使用 `width="960"` 和 `height="540"`
427
-
428
- ## 参考文档
429
-
430
- - [xml-schema-quick-ref.md](xml-schema-quick-ref.md)
431
- - [slides_xml_schema_definition.xml](slides_xml_schema_definition.xml)
432
- - [examples.md](examples.md)
433
- - [slides_demo.xml](slides_demo.xml)