# `Alternera.Plugin.Provisional.Editing`
[🔗](https://github.com/10e-ab/alternera-sdk/blob/v0.9.0/alternera_plugin_sdk/lib/alternera/plugin/provisional/editing.ex#L1)

Provisional: added for Script, and a change to it needs a changelog line but
no new major (`docs/USER_PLUGINS_DESIGN.md`). The namespace has nothing to do
with the context's `:provisional?` key.

What a plugin tells the pipeline editor about its steps, beyond its own step
editor. Every callback is optional. A plugin that exports none starts with
empty settings, has no starter, and its steps get the editor's plain treatment.

# `side`

```elixir
@type side() :: :request | :response
```

The side of the exchange a step works on.

# `starter`

```elixir
@type starter() :: %{settings: map(), source: String.t()}
```

A step's starter: `:settings`, string keys, are merged into the step's
settings, and `:source` is the text they hold, which the step editor gets back
as its `starter` prop, to tell a generated source from an edited one.

# `chooses_streaming?`
*optional* 

```elixir
@callback chooses_streaming?() :: boolean()
```

Whether a step chooses between streaming and holding its body. The pipeline
editor then always cues which it does, even on a side that nothing streams.

# `configuration_toggle?`
*optional* 

```elixir
@callback configuration_toggle?() :: boolean()
```

Whether the plugin's step editor draws a Configuration toggle
(`Alternera.Plugin.Editor.section_toggle/1`), so that a section's ⋮ menu
offers to fold it.

# `initial_settings`
*optional* 

```elixir
@callback initial_settings(side()) :: map()
```

The settings a step of this plugin starts with when added on `side`.

# `starter`
*optional* 

```elixir
@callback starter(body :: binary() | nil, side(), mode :: atom()) ::
  {:ok, starter()} | :error
```

The starter of a step on `side` whose input is `body`, or `:error` when there
is nothing to build one from. `mode` is what the plugin's own editor passed to
`Alternera.Plugin.Editor.request_step_input/3`, `:full_body` for a step
just added.

A plugin that exports this has its step's input offered to its editor (the
`step_input?` prop), and a step just added gets its starter in place of the
initial settings when there is a body.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
