refactor(md-deck): pos string and yaml copy output

Replace per-axis x1/y1/x2/y2 layer fields with a single
pos string (x1,y1-x2,y2) matching the compact layers format.

When a deck is configured via a yaml/tag codeblock (data-config),
the copy button now emits a yaml/tag block serialized from current
store state so template layers round-trip.
This commit is contained in:
2026-09-02 18:30:32 +08:00
parent 16dfc8a88c
commit f1ddc8fb8e
7 changed files with 100 additions and 33 deletions
+3 -9
View File
@@ -436,24 +436,18 @@ data-config:
grid: 5x5
layers:
- prop: title
x1: 1
y1: 1
x2: 5
y2: 1
pos: 1,1-5,1
font: 12
- template: |
**{{name}}** — {{type}}
{{description}}
x1: 1
y1: 3
x2: 5
y2: 8
pos: 1,3-5,8
font: 3
align: l
```
````
每个图层通过 `prop`(读取 CSV 字段)或 `template`(渲染带 `{{变量}}` 替换的 markdown 模板)定义,支持 `x1/y1/x2/y2``font`、`orientation`、`align`。`back_layers` 用于背面图层。
每个图层通过 `prop`(读取 CSV 字段)或 `template`(渲染带 `{{变量}}` 替换的 markdown 模板)定义,`pos` 为网格位置 `x1,y1-x2,y2`1-based,与紧凑 layers 字符串同格式),支持 `font`、`orientation`、`align`。`back_layers` 用于背面图层。
### 🧶 叙事线组件 (md-yarn-spinner)