% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paintr-copy.R
\name{ptr_ui_text}
\alias{ptr_ui_text}
\title{Inspect, validate, and pre-merge ggpaintr UI copy}
\usage{
ptr_ui_text(ui_text = NULL)
}
\arguments{
\item{ui_text}{\code{NULL} (return defaults), a named list of overrides, or an
already-merged \code{ptr_ui_text} object (returned unchanged).}
}
\value{
A \code{ptr_ui_text} object containing the merged copy rules.
}
\description{
Returns the effective copy tree ggpaintr uses to label every generated
control. Call it with no arguments to see the current defaults, or pass
\verb{ui_text =} a list of overrides to get back a validated, merged
\code{ptr_ui_text} object. That object can be reused across \code{ptr_app()} /
\code{ptr_server()} calls — those entry points short-circuit when handed an
already-merged \code{ptr_ui_text}, so the overrides are validated once.
}
\details{
Use it to (1) discover the override schema (\code{names(ptr_ui_text())} and
the section below), and (2) fail fast on a malformed override list before
launching an app — \code{ptr_ui_text()} raises on unknown sections, keywords,
or leaf fields.
}
\section{UI text schema}{

Override lists mirror the structure of \code{ptr_ui_text()}. Recognised paths
(every leaf is a named list of the fields below):
\itemize{
\item \verb{shell$title$<leaf>}
\item \verb{shell$draw_button$<leaf>}
\item \verb{shell$draw_all_button$<leaf>}
\item \verb{shell$layer_picker$<leaf>}
\item \verb{shell$data_subtab$<leaf>}
\item \verb{shell$controls_subtab$<leaf>}
\item \verb{upload$file$<leaf>}
\item \verb{upload$name$<leaf>}
\item \verb{layer_checkbox$<leaf>}
\item \verb{defaults$<keyword>$<leaf>} — per placeholder keyword (\code{ppVar}, \code{ppText},
\code{ppNum}, \code{ppExpr}, \code{ppUpload}, ...)
\item \verb{params$<param>$<keyword>$<leaf>} — per aesthetic/argument name
(\code{x}, \code{y}, \code{color}, ...); aliases (\code{colour}, \code{size}) are normalized
\item \verb{layers$<layer_name>$<keyword>$<param>$<leaf>} — per layer override
(use \verb{__unnamed__} as \verb{<param>} for positional arguments)
}

Leaf fields are \code{label}, \code{help}, \code{placeholder}, and \code{empty_text}. Leaf
strings may use the \code{{param}} and \code{{layer}} tokens, which are interpolated
at resolve time.
}

\examples{
# Default rules
rules <- ptr_ui_text()
rules$shell$title$label

# Override the draw button label
rules <- ptr_ui_text(
  ui_text = list(shell = list(draw_button = list(label = "Render")))
)
rules$shell$draw_button$label
}
