@open-feishu-card/renderer 0.2.32 → 0.3.0

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
@@ -6046,6 +6046,18 @@ function registerBuiltins() {
6046
6046
  if (borderColor) style.border = `1px solid ${borderColor}`;
6047
6047
  const radius = resolveCornerRadius(p);
6048
6048
  if (radius != null) style.borderRadius = radius;
6049
+ const horizontalDir = p.direction === "horizontal";
6050
+ if (horizontalDir) style.flexDirection = "row";
6051
+ const hAlign = p.horizontal_align ?? p.horizontalAlign;
6052
+ const vAlign = p.vertical_align ?? p.verticalAlign;
6053
+ const H_ALIGN = { left: "flex-start", center: "center", right: "flex-end" };
6054
+ const V_ALIGN = { top: "flex-start", center: "center", bottom: "flex-end" };
6055
+ const justify = horizontalDir ? H_ALIGN[hAlign] : V_ALIGN[vAlign];
6056
+ const align = horizontalDir ? V_ALIGN[vAlign] : H_ALIGN[hAlign];
6057
+ if (justify) style.justifyContent = justify;
6058
+ if (align) style.alignItems = align;
6059
+ const hGap = p.horizontalSpacingValue?.value ?? p.horizontal_spacing ?? p.horizontalSpacing;
6060
+ if (hGap != null) style.columnGap = horizontalSpacingToPx(hGap) + "px";
6049
6061
  const vGap = p.verticalSpacingValue?.value ?? p.vertical_spacing;
6050
6062
  if (vGap != null) style.rowGap = verticalSpacingToPx(vGap) + "px";
6051
6063
  const icWv = p.widthValue;
package/dist/index.js CHANGED
@@ -6045,6 +6045,18 @@ function registerBuiltins() {
6045
6045
  if (borderColor) style.border = `1px solid ${borderColor}`;
6046
6046
  const radius = resolveCornerRadius(p);
6047
6047
  if (radius != null) style.borderRadius = radius;
6048
+ const horizontalDir = p.direction === "horizontal";
6049
+ if (horizontalDir) style.flexDirection = "row";
6050
+ const hAlign = p.horizontal_align ?? p.horizontalAlign;
6051
+ const vAlign = p.vertical_align ?? p.verticalAlign;
6052
+ const H_ALIGN = { left: "flex-start", center: "center", right: "flex-end" };
6053
+ const V_ALIGN = { top: "flex-start", center: "center", bottom: "flex-end" };
6054
+ const justify = horizontalDir ? H_ALIGN[hAlign] : V_ALIGN[vAlign];
6055
+ const align = horizontalDir ? V_ALIGN[vAlign] : H_ALIGN[hAlign];
6056
+ if (justify) style.justifyContent = justify;
6057
+ if (align) style.alignItems = align;
6058
+ const hGap = p.horizontalSpacingValue?.value ?? p.horizontal_spacing ?? p.horizontalSpacing;
6059
+ if (hGap != null) style.columnGap = horizontalSpacingToPx(hGap) + "px";
6048
6060
  const vGap = p.verticalSpacingValue?.value ?? p.vertical_spacing;
6049
6061
  if (vGap != null) style.rowGap = verticalSpacingToPx(vGap) + "px";
6050
6062
  const icWv = p.widthValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-feishu-card/renderer",
3
- "version": "0.2.32",
3
+ "version": "0.3.0",
4
4
  "description": "零框架依赖的飞书卡片渲染引擎:Web / DOM / SSR,输入 RAW 或公开 DSL,输出真实 DOM 或 HTML 字符串",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",