> For the complete documentation index, see [llms.txt](/llms.txt).
> The full corpus is at [llms-full.txt](/llms-full.txt).

# getSelectedValue

> `const` **getSelectedValue**: `EditorSelector`\<`PortableTextBlock`[]\>

Defined in: selector.get-selected-value.ts:39

Returns the portion of the document's value covered by the selection,
resolved at any depth.

Containers fully inside the selection are preserved verbatim. Containers
on the selection boundary are recursed into so only the selected portion
of their content is kept. Text blocks on the boundary are span-sliced.

The result preserves the full ancestor envelope around the selection. For
the clipboard-shaped view that unwraps the envelope toward the selection's
lowest common ancestor, see [getFragment](/api/selectors/variables/getfragment/).