@dongmingzhixiu/vuexir-compiler 0.7.3 → 0.7.5
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/codegen/compose.js
CHANGED
|
@@ -1436,7 +1436,8 @@ function emitNodeInner(node, ctx, depth, loop, useParamModifier = false, parentS
|
|
|
1436
1436
|
return out;
|
|
1437
1437
|
}
|
|
1438
1438
|
case 'button': {
|
|
1439
|
-
const
|
|
1439
|
+
const flex = p.flex !== undefined ? flexModifier(p, ctx) : '';
|
|
1440
|
+
const chain = modChain([...stretchModifiers(parentStretch, node), ...sizeModifiers(p, ctx), flex, ...absM(p), ...clipModifiers(p), ...visualModifiers(p), ...borderModifiers(p), ...paddingModifiers(p), ...alphaArr, ...transformModifiers(p)], pad + ' ');
|
|
1440
1441
|
// R108:动态按钮文案(props.bind)优先;Kotlin 里用字符串模板插值
|
|
1441
1442
|
const label = p.bind !== undefined ? String(p.bind) : (p.label ?? '');
|
|
1442
1443
|
const click = kotlinClickAction(p, ctx, loop);
|
package/dist/codegen/swiftui.js
CHANGED
|
@@ -703,6 +703,9 @@ function emitNodeInner(node, ctx) {
|
|
|
703
703
|
const size = sizeModifiers(props, axis, ctx);
|
|
704
704
|
let padMods = paddingModifiers(props);
|
|
705
705
|
let boxMods = boxModifiers(props);
|
|
706
|
+
if (node.type === 'image' && props.objectFit === 'cover' && !props.clip) {
|
|
707
|
+
boxMods.unshift('.clipped()');
|
|
708
|
+
}
|
|
706
709
|
// R44:胶囊标签(大圆角+同色背景描边+对称 padding)→ 单次 .tagCapsule(...)
|
|
707
710
|
const capsule = currentFrameShort && isCapsule(props, padMods) ? capsuleExpr(props) : undefined;
|
|
708
711
|
if (capsule !== undefined) {
|
package/dist/transform/css.js
CHANGED
|
@@ -70,6 +70,9 @@ export function resolveCssRules(rules, element, ancestors, inline, warnings) {
|
|
|
70
70
|
const props = {};
|
|
71
71
|
for (const rule of matched)
|
|
72
72
|
mergeIrProps(props, rule.props);
|
|
73
|
+
// object-fit 只影响图片内容,容器复用同一个类时不产生 IR 属性。
|
|
74
|
+
if (element.tag !== 'img')
|
|
75
|
+
delete props.objectFit;
|
|
73
76
|
return props;
|
|
74
77
|
}
|
|
75
78
|
const px = (v) => {
|
|
@@ -118,6 +121,8 @@ function mapDeclInner(prop, value, warnings) {
|
|
|
118
121
|
if (prop.startsWith('--'))
|
|
119
122
|
return []; // 变量声明由 token 解析器处理,不是未支持的视觉属性。
|
|
120
123
|
switch (prop) {
|
|
124
|
+
case 'object-fit':
|
|
125
|
+
return v === 'contain' || v === 'cover' ? [['objectFit', v]] : null;
|
|
121
126
|
case 'aspect-ratio': {
|
|
122
127
|
const parts = v.split('/').map((part) => Number(part.trim()));
|
|
123
128
|
const ratio = parts.length === 1 ? parts[0] : parts.length === 2 ? parts[0] / parts[1] : NaN;
|
package/dist/transform/vue2ir.js
CHANGED
|
@@ -2369,9 +2369,9 @@ function walkElement(node, classProps, comboRules, scopedRules, pseudoRules, war
|
|
|
2369
2369
|
mapping = { type: 'group' };
|
|
2370
2370
|
if (mapping.type === 'text' && content.length === 0 && ['i', 'span', 'b'].includes(node.tag))
|
|
2371
2371
|
mapping = { type: 'spacer' };
|
|
2372
|
-
// R108:button
|
|
2372
|
+
// R108:button 文案使用 label/bind,保留作为父容器子项的 flex。
|
|
2373
2373
|
if (mapping.type === 'button') {
|
|
2374
|
-
const badProps = ['flexDirection', 'justifyContent', 'alignItems', 'gap', '
|
|
2374
|
+
const badProps = ['flexDirection', 'justifyContent', 'alignItems', 'gap', 'textAlign', 'lineHeight', 'lineHeightMultiplier', 'overflow', 'clip'];
|
|
2375
2375
|
for (const k of badProps)
|
|
2376
2376
|
delete props[k];
|
|
2377
2377
|
}
|