+
+ {#if rule.actions.length === 0}
+
+ {/if}
+
+ {#each rule.actions as action, idx (idx)}
+
+
+
+
+
+ {ACTION_KINDS.find(k => k.kind === action.type)?.label ?? action.type}
+
+ setActionLabel(rule.id, idx, e.currentTarget.value, rule)}
+ placeholder="Descripción opcional..."
+ class="flex-1 rounded border border-transparent bg-transparent px-1.5 py-0.5
+ text-xs text-gray-400 placeholder-gray-700
+ hover:border-gray-700 focus:border-gray-600 focus:bg-gray-800
+ focus:outline-none transition-colors"
+ />
+
+
+
+
+ {#if action.type === 'attribute'}
+ {@const a = action as RuleActionAttribute}
+
+
+ Si cumple
+
+
+
+ Si no cumple
+
+
+
+
+ Target (vacío = self)
+ editor.updateAction(ruleSet, rule.id, idx,
+ { ...a, target: e.currentTarget.value
+ .split(',').map((s:string) => s.trim()).filter(Boolean) as any })}
+ placeholder="vacío = el propio att"
+ class="field-input" />
+
+
+ {:else if action.type === 'validation'}
+ {@const a = action as RuleActionValidation}
+
+
+ Nivel
+
+
+
+ Mensaje
+ editor.updateAction(ruleSet, rule.id, idx,
+ { ...a, message: e.currentTarget.value })}
+ placeholder="Campo obligatorio"
+ class="field-input" />
+
+
+
+ {:else if action.type === 'domain'}
+ {@const a = action as RuleActionDomain}
+
+
+ Estado
+
+
+
+ Target
+ editor.updateAction(ruleSet, rule.id, idx,
+ { ...a, target: e.currentTarget.value
+ .split(',').map((s:string) => s.trim()).filter(Boolean) as any })}
+ class="field-input" />
+
+
+
+ {:else if action.type === 'value'}
+ {@const a = action as RuleActionValue}
+
+ Valor (JSON)
+ {
+ try {
+ const parsed = JSON.parse(e.currentTarget.value);
+ editor.updateAction(ruleSet, rule.id, idx,
+ { ...a, value: { ...a.value, value: parsed } as any });
+ } catch { /* JSON inválido, esperar */ }
+ }}
+ placeholder='"texto" o 42 o true'
+ class="field-input" />
+
+ {/if}
+
+