> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/es/aplicaciones/components/inputs/editor.md).

# Editor

El componente editor está basado en [Editor.js](https://editorjs.io/). Es un editor de bloques que acepta texto, enlaces, listas, código e imágenes.

Al trabajar con el editor, puede recibir datos sobre el documento actual mediante el parámetro `OnChange`. De forma predeterminada, los datos se devuelven en el [formato JSON](https://editorjs.io/saving-data) de Editor.js.

## Crear un editor

Para crear un editor básico, utilice el cmdlet `New-UDEditor`.

```
New-UDEditor
```

El editor estará disponible y podrá añadir nuevos bloques haciendo clic en el botón más.

![](/files/OmUce0AzvWtpGihsnZmV)

## Trabajar con datos

Si define un bloque de script para el controlador de eventos `-OnChange`. La variable `$EventData` contendrá el estado actual del editor. De forma predeterminada, esto devuelve el [formato de bloques JSON](https://editorjs.io/saving-data) de Editor.JS.

```
New-UDEditor -OnChange {
    Show-UDToast $EventData
}
```

También puede utilizar el complemento de renderizado HTML especificando el parámetro `-Format`.

```
New-UDEditor -OnChange {
    Show-UDToast $EventData
} -Format 'html'
```

Para especificar los datos predeterminados del editor, utilice el parámetro `-Data`. Debe especificar el formato de bloques JSON.

```
New-UDEditor -Data $Data
```

## Compatibilidad con imágenes

Para admitir imágenes, deberá proporcionar una [carpeta publicada](/powershell-universal/es/plataforma/published-folders.md) en la que subir las imágenes. Una vez definida una carpeta publicada, las imágenes se pueden subir directamente en el editor. Se colocarán dentro del directorio y luego se servirán a través de la ruta de solicitud.

```powershell
New-UDEditor -PublishedFolder 'MyImages'
```

## API

### New-UDEditor

<table><thead><tr><th>Nombre</th><th>Tipo</th><th>Descripción</th><th data-type="checkbox">Obligatorio</th></tr></thead><tbody><tr><td>Id</td><td>string</td><td>El ID de este componente.</td><td>false</td></tr><tr><td>Data</td><td>Hashtable</td><td>Los datos de Editor.JS para este componente</td><td>false</td></tr><tr><td>OnChange</td><td>ScriptBlock</td><td>El controlador de eventos de bloque de script que se llamará cuando cambien los datos del editor.</td><td>false</td></tr><tr><td>Format</td><td>string</td><td>Si se debe devolver json o html en el bloque de script OnChange.</td><td>false</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/es/aplicaciones/components/inputs/editor.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
