|
|
|
|
@ -544,6 +544,10 @@ function build_element_attribute_update_assignment(element, node_id, attribute,
|
|
|
|
|
let update;
|
|
|
|
|
|
|
|
|
|
if (name === 'class') {
|
|
|
|
|
if (attribute.metadata.is_dynamic_class) {
|
|
|
|
|
value = b.call('$.clsx', value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (attribute.metadata.expression.has_state && has_call) {
|
|
|
|
|
// ensure we're not creating a separate template effect for this so that
|
|
|
|
|
// potential class directives are added to the same effect and therefore always apply
|
|
|
|
|
@ -552,11 +556,13 @@ function build_element_attribute_update_assignment(element, node_id, attribute,
|
|
|
|
|
value = b.call('$.get', id);
|
|
|
|
|
has_call = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
update = b.stmt(
|
|
|
|
|
b.call(
|
|
|
|
|
is_svg ? '$.set_svg_class' : is_mathml ? '$.set_mathml_class' : '$.set_class',
|
|
|
|
|
node_id,
|
|
|
|
|
value
|
|
|
|
|
value,
|
|
|
|
|
attribute.metadata.is_dynamic_class ? b.literal(context.state.analysis.css.hash) : undefined
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
} else if (name === 'value') {
|
|
|
|
|
|