@open-feishu-card/adapter 0.3.13 → 0.3.14

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.
package/dist/index.cjs CHANGED
@@ -1732,7 +1732,14 @@ function unwrap(node, ctx) {
1732
1732
  const tp = isRecord3(text.property) ? text.property : {};
1733
1733
  const content = typeof tp.content === "string" ? tp.content : "";
1734
1734
  const textAlign = typeof tp.textAlign === "string" ? tp.textAlign : "left";
1735
- out.text = { tag: "plain_text", content, text_align: textAlign };
1735
+ const outText = { tag: "plain_text", content, text_align: textAlign };
1736
+ const ts = isRecord3(tp.textStyle) ? tp.textStyle : void 0;
1737
+ if (ts && typeof ts.size === "string") outText.text_size = ts.size;
1738
+ const { color } = resolveInlineStyle(ts, ctx);
1739
+ if (color) outText.text_color = color;
1740
+ out.text = outText;
1741
+ if (isRecord3(property.margin) && hasSide(property.margin)) out.margin = formatBox(property.margin);
1742
+ else if (typeof property.margin === "string") out.margin = property.margin;
1736
1743
  if (isRecord3(property.icon)) {
1737
1744
  out.icon = unwrap(property.icon, ctx);
1738
1745
  }
package/dist/index.js CHANGED
@@ -1730,7 +1730,14 @@ function unwrap(node, ctx) {
1730
1730
  const tp = isRecord3(text.property) ? text.property : {};
1731
1731
  const content = typeof tp.content === "string" ? tp.content : "";
1732
1732
  const textAlign = typeof tp.textAlign === "string" ? tp.textAlign : "left";
1733
- out.text = { tag: "plain_text", content, text_align: textAlign };
1733
+ const outText = { tag: "plain_text", content, text_align: textAlign };
1734
+ const ts = isRecord3(tp.textStyle) ? tp.textStyle : void 0;
1735
+ if (ts && typeof ts.size === "string") outText.text_size = ts.size;
1736
+ const { color } = resolveInlineStyle(ts, ctx);
1737
+ if (color) outText.text_color = color;
1738
+ out.text = outText;
1739
+ if (isRecord3(property.margin) && hasSide(property.margin)) out.margin = formatBox(property.margin);
1740
+ else if (typeof property.margin === "string") out.margin = property.margin;
1734
1741
  if (isRecord3(property.icon)) {
1735
1742
  out.icon = unwrap(property.icon, ctx);
1736
1743
  }
@@ -1 +1 @@
1
- {"version":3,"file":"raw-to-dsl.d.ts","sourceRoot":"","sources":["../src/raw-to-dsl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAwBH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIzD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAcvD;AAorDD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CA8C9C;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGnF"}
1
+ {"version":3,"file":"raw-to-dsl.d.ts","sourceRoot":"","sources":["../src/raw-to-dsl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAwBH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIzD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAcvD;AA8rDD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CA8C9C;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGnF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-feishu-card/adapter",
3
- "version": "0.3.13",
3
+ "version": "0.3.14",
4
4
  "description": "公开 DSL 与飞书内部 RAW JSON 的双向适配器;raw→DSL 对齐 feishu-raw-card-to-dsl",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",