Apply a partial style to every selected range, as one undoable step.
The style delta, or a SEQUENCE of them applied in order.
Optionaldescription: string
A messageKey('op.…') naming the step in the undo history.
OptionalautoFit: AutoFitOptions
How the selection is fit afterwards, when the default style fit is not it.
A sequence is how a caller expresses REPLACE rather than merge. A style delta merges into
what is already there, and for a border stroke that means an absent color leaves the old
one standing — there is no value for "no color" to write. Erasing the edge first and drawing
it second says the whole thing, and the batch keeps it one step in the undo history.
The color a border draws in when it has none of its own — the pickers' Automatic swatch.
The same value, from the same place, as the toolbar's border picker gets from the
formatBorder command context (see SheetCommands). Without it a picker has no way to offer
"no color of my own", and the panel has to hand it some literal color instead — which then
reads back as a custom swatch that the user never chose.
The ANCHOR cell — the one the panels read their control values from, and the one the preview shows. A multi-cell selection has one style per cell; Excel reads the anchor too.
Mints a detached border for the border diagram, the way the border picker's context does.
Mints a detached cell for the previews (theme + named styles resolve against the workbook).
Whether the GRID renders dark (not the app chrome) — previews and swatches follow the grid.
True when the selection cannot be formatted (a protected sheet).
What is DRAWN on one edge of the selected block, sampled from the cell that carries it.
A range's style object is cell-shaped: getBottom() on it answers for the style's own cell,
not for the bottom of the block. So every edge is sampled from the cell it is drawn on — the
outer edges from the block's CORNER cells (top and left from the top-left, bottom and right
from the bottom-right), and each inner rule from the first cell across it: the horizontal from
the top of the cell one row down, the vertical from the left of the cell one column over.
The inner rules deliberately do NOT come from IBorders.getHorizontal/getVertical. Those
report the RULE, which only exists while one authored block spans the whole selection: a
border written at any other scope splits the blocks and the rule reads null forever after,
and an imported workbook never has one at all (xlsx stores borders per cell). Read that way a
covered-in-lines selection reports "no inner border", so the toggle can only ever draw.
Sampling is direct: a border painted by a conditional format is not something this panel can
clear, so counting it would make the toggle write none over an edge that stays on screen.
Whether the selection spans more than one row / column — i.e. whether it HAS an inside.
Whether the selection spans more than one row / column — i.e. whether it HAS an inside.
Theme color resolution for the color pickers.
The sheet the selection lives on.
cell's resolved style.
The workbook's style collection — theme swatches and recent colors for the pickers.
Everything the format panels need from the workbook, resolved from the live selection.
Remarks
The panels themselves stay presentational — they read style and call applyStyle. That keeps each one usable outside the task pane (a dialog, a shape inspector) by handing it a different implementation of this shape.