|
|
|
@ -477,66 +477,43 @@ function serialize_element_attribute_update_assignment(element, node_id, attribu
|
|
|
|
const assign = (grouped, singular) => {
|
|
|
|
const assign = (grouped, singular) => {
|
|
|
|
if (name === 'class') {
|
|
|
|
if (name === 'class') {
|
|
|
|
if (singular) {
|
|
|
|
if (singular) {
|
|
|
|
return {
|
|
|
|
return b.stmt(b.call(is_svg ? '$.svg_class_name' : '$.class_name', node_id, singular));
|
|
|
|
singular: b.stmt(
|
|
|
|
|
|
|
|
b.call(
|
|
|
|
|
|
|
|
is_svg ? '$.svg_class_name_effect' : '$.class_name_effect',
|
|
|
|
|
|
|
|
node_id,
|
|
|
|
|
|
|
|
b.thunk(singular)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
grouped: b.stmt(b.call(is_svg ? '$.svg_class_name' : '$.class_name', node_id, singular))
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
return b.stmt(b.call(is_svg ? '$.svg_class_name' : '$.class_name', node_id, value));
|
|
|
|
grouped: b.stmt(b.call(is_svg ? '$.svg_class_name' : '$.class_name', node_id, value))
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} else if (!DOMProperties.includes(name)) {
|
|
|
|
} else if (!DOMProperties.includes(name)) {
|
|
|
|
if (singular) {
|
|
|
|
if (singular) {
|
|
|
|
return {
|
|
|
|
return b.stmt(
|
|
|
|
singular: b.stmt(
|
|
|
|
|
|
|
|
b.call(
|
|
|
|
|
|
|
|
name.startsWith('xlink') ? '$.xlink_attr_effect' : '$.attr_effect',
|
|
|
|
|
|
|
|
node_id,
|
|
|
|
|
|
|
|
b.literal(name),
|
|
|
|
|
|
|
|
b.thunk(singular)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
grouped: b.stmt(
|
|
|
|
|
|
|
|
b.call(
|
|
|
|
|
|
|
|
name.startsWith('xlink') ? '$.xlink_attr' : '$.attr',
|
|
|
|
|
|
|
|
node_id,
|
|
|
|
|
|
|
|
b.literal(name),
|
|
|
|
|
|
|
|
grouped
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
grouped: b.stmt(
|
|
|
|
|
|
|
|
b.call(
|
|
|
|
b.call(
|
|
|
|
name.startsWith('xlink') ? '$.xlink_attr' : '$.attr',
|
|
|
|
name.startsWith('xlink') ? '$.xlink_attr' : '$.attr',
|
|
|
|
node_id,
|
|
|
|
node_id,
|
|
|
|
b.literal(name),
|
|
|
|
b.literal(name),
|
|
|
|
grouped
|
|
|
|
grouped
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return b.stmt(
|
|
|
|
|
|
|
|
b.call(
|
|
|
|
|
|
|
|
name.startsWith('xlink') ? '$.xlink_attr' : '$.attr',
|
|
|
|
|
|
|
|
node_id,
|
|
|
|
|
|
|
|
b.literal(name),
|
|
|
|
|
|
|
|
grouped
|
|
|
|
)
|
|
|
|
)
|
|
|
|
};
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return { grouped: b.stmt(b.assignment('=', b.member(node_id, b.id(name)), grouped)) };
|
|
|
|
return b.stmt(b.assignment('=', b.member(node_id, b.id(name)), grouped));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (attribute.metadata.dynamic) {
|
|
|
|
if (attribute.metadata.dynamic) {
|
|
|
|
const { grouped, singular } = assign(grouped_value, value);
|
|
|
|
const grouped = assign(grouped_value, value);
|
|
|
|
if (contains_call_expression && singular) {
|
|
|
|
if (contains_call_expression) {
|
|
|
|
state.init.push(singular);
|
|
|
|
state.init.push(serialize_update(grouped));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
state.update.push(grouped);
|
|
|
|
state.update.push(grouped);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
state.init.push(assign(grouped_value).grouped);
|
|
|
|
state.init.push(assign(grouped_value));
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|