<script>
  export let block;
  export let onChange;

  const update = (patch) => onChange({ ...block.data, ...patch });
  let showAdv = false;
</script>

<label>ID товаров (через запятую)
  <input type="text" value={block.data.productIds ?? ""} on:input={(e) => update({ productIds: e.target.value })} />
</label>

<div class="advanced-wrapper">
  <button class="btn-advanced-toggle" class:is-open={showAdv} type="button" on:click={() => (showAdv = !showAdv)}>
    Доп. настройки
  </button>
  {#if showAdv}
    <div class="advanced-panel">
      <label>
        Отступ снизу (px)
        <input
          type="number"
          value={block.data.bottomSpacing ?? 40}
          on:input={(e) => update({ bottomSpacing: parseInt(e.target.value, 10) || 0 })}
        />
      </label>
    </div>
  {/if}
</div>

<label class="inline">
  <input
    type="checkbox"
    checked={block.data.removeBottomSpacing}
    on:change={(e) => update({ removeBottomSpacing: e.target.checked })}
  />
  Убрать отступ после блока
</label>
