# API map of the "Form dialogs" family: old path to new path and setter renames. # Filled in by the family track; the codemods and the app scan read it. family = "Form dialogs" new_module = "craft_ui::patterns::form_dialogs" # One entry per public type: `old` is the path an app calls today, `new` the path after migration. # `status` is "pending", "same" (path unchanged), "moved", "replaced" (use `note`) or "removed". [[type]] name = "ParamDialog" old = "craft_ui::dialog::params::ParamDialog" new = "craft_ui::patterns::form_dialogs::ParamDialog" status = "moved" note = "A pattern: `ParamDialog::new(key, title, params)` with `show(ui) -> ParamDialogOutput { response, closed, result, rows, values, preview_on }`. A `DialogHost` owns it as `HostedParamDialog`, whose `build` closure makes the dialog over the host's values each pass." [[type]] name = "HostedParamDialog" old = "" new = "craft_ui::patterns::form_dialogs::HostedParamDialog" status = "replaced" note = "The `StackDialog` form of `ParamDialog`: `HostedParamDialog::new(key, fields, |fields| ParamDialog::new(..).values(Bind::bound(fields)))`, or `HostedParamDialog::command(..)` for a command form, with `fields`, `fields_mut`, `pick_color`, `pick_path`, `pick_eyedropper`, `answer_color`, `answer_path`, `answer_eyedropper` and `cancel_requests` (over an embedded `HostRequests`)." [[type]] name = "CommandForm" old = "craft_ui::dialog::command_form::CommandForm" new = "" status = "replaced" note = "Replaced by the constructor `ParamDialog::command(key, title, params)`: a `ParamDialog` with no `preview` and no `remember` key, with every option of `ParamDialog` (`values`, `opened`, `ok_enabled`, `ok_reason`, `ok_label`, `cancel_label`, `closable`, `outer_gesture`, `footer_note`, `below`). Hosted, `HostedParamDialog::command(key, fields, build)`." [[type]] name = "ParamLayout" old = "craft_ui::dialog::params::ParamLayout" new = "craft_ui::patterns::form_dialogs::ParamLayout" status = "moved" note = "Variants are `Beside` (was `SideColumn`) and `Below` (was `BottomFooter` and `Stacked`); OK and Cancel are always the dialog's footer (`cancel_label`, `alt_resets`, `outer_gesture`, `collection_body` and `shaped(|dialog| ..)` shape it), and the Preview check box and zoom row sit over the pane." [[type]] name = "ParamResult" old = "craft_ui::dialog::params::ParamResult" new = "craft_ui::patterns::form_dialogs::ParamResult" status = "moved" note = "`key` and `fields` are public fields (`#[non_exhaustive]`); `remember(&self, ui)` stores the values under the dialog's `SaveKey`." [[type]] name = "PreviewPane" old = "" new = "craft_ui::patterns::form_dialogs::PreviewPane" status = "replaced" note = "The preview panes of `ParamDialog` and Save for Web: `PreviewPane::new(label, texture: SizedTexture, view: &PreviewView)` shows the picture; `PreviewPane::state(label, PreviewState, view)` is the second constructor; `.click_centres(bool)` is a builder (fit and the zoom range belong to the `PreviewView`). `show(ui) -> PreviewOutput { response, view: Option, shown: PreviewView }` reports the next view after a pan, a zoom or a double click (which returns to fit) and the view drawn; a caller keeps `view.unwrap_or(shown)`. The pane declares AccessKit's scroll actions on the axes it pans on (`Access::pans`) and takes the wheel's scroll only on those axes (`Sense::WHEEL_X`, `WHEEL_Y`), always the zoom (`Sense::WHEEL_ZOOM`)." [[type]] name = "PreviewView" old = "" new = "craft_ui::patterns::form_dialogs::PreviewView" status = "replaced" note = "The one value a caller keeps per preview pane and passes to `PreviewPane` and `PreviewZoom`, both of which report the next one: `PreviewView { transform: CanvasTransform, fit: bool, range: RangeInclusive }`, built by `PreviewView::new(transform)` or `PreviewView::fitting()` and `.zoom_range(range)`." [[type]] name = "PreviewState" old = "" new = "craft_ui::patterns::form_dialogs::PreviewState" status = "replaced" note = "What a `PreviewPane` shows: `Pending(Option)` (the checker well with a progress line), `Ready(SizedTexture)` and `Failed(Label)` (a message line). The host encodes the preview; the dialog only shows these three." [[type]] name = "HostRequests" old = "" new = "craft_ui::patterns::form_dialogs::HostRequests" status = "replaced" note = "The colour, path and eyedropper requests of hosted rows, kept until the host takes them: `absorb(&mut ParamRowsOutput)`, `request_color(ColorRequest)`, `request_path(PathRequest)`, `request_eyedropper(EyedropperRequest)`, `take_color`, `take_path`, `take_eyedropper`, `cancel`. `HostedParamDialog` embeds it." [[type]] name = "ResetFooter" old = "" new = "craft_ui::patterns::form_dialogs::ResetFooter" status = "replaced" note = "The footer whose Cancel turns into Reset while Alt is held, shared by `ParamDialog` and other dialogs: `ResetFooter::new(ui, cancel_label, alt_resets)`, `buttons(accept, changed) -> [FooterButton; 2]` for `Dialog::buttons` (Reset is role `Other` and stays open), and `pick(DialogOutput::picked) -> Option`. The restore of the values is `ParamDialog`'s own; a `LinkedSize` dialog resets through `LinkedSize::reset`." [[type]] name = "ResetPick" old = "" new = "craft_ui::patterns::form_dialogs::ResetPick" status = "replaced" note = "What `ResetFooter::pick` answers with: `Accept`, `Reset` or `Cancel`." [[type]] name = "PreviewZoom" old = "" new = "craft_ui::patterns::form_dialogs::PreviewZoom" status = "replaced" note = "The zoom-out and zoom-in buttons with the zoom percentage over the same `PreviewView` as `PreviewPane`: `PreviewZoom::new(&view)`; the buttons stay inside the view's zoom range and `show(ui)` reports `PreviewZoomOutput { response, view: Option }`." # Parameter model and rows (form-dialogs-a). [[type]] name = "Param" old = "craft_ui::dialog::params::Param" new = "craft_ui::patterns::form_dialogs::Param" status = "moved" note = "`label`, `hint` and `tooltip` are `Label`s (a word or a string) in place of English strings the dialog translated; `unit` is a `UnitKind`; the struct is `#[non_exhaustive]`, so build it with `Param::new`." [[type]] name = "ParamKind" old = "craft_ui::dialog::params::ParamKind" new = "craft_ui::patterns::form_dialogs::ParamKind" status = "moved" note = "Struct-like variants are `#[non_exhaustive]`: build a kind with `ParamKind::range`, `int`, `number`, `bool`, `choice`, `angle`, `color`, `grid`, `point`, `channel`, `text` or `optional_number`. `Choice` options are `(String, Label)`." [[type]] name = "NumberUnit" old = "craft_ui::dialog::params::NumberUnit" new = "craft_ui::patterns::form_dialogs::NumberUnit" status = "moved" note = "`label` is a `Label`; build with `NumberUnit::new(id, kind, label, factor)`: `kind` is the `UnitKind` the number is read and shown in (`PixelsPerInch`, `PixelsPerCentimetre`), unique within a row." [[type]] name = "PathKind" old = "craft_ui::dialog::params::PathKind" new = "craft_ui::runtime::requests::PathKind" status = "moved" [[type]] name = "PathFilter" old = "" new = "craft_ui::runtime::requests::PathFilter" status = "replaced" note = "Moved with `PathRequest` to the host-services layer (`runtime::requests`); `IMAGE_EXTENSIONS` (the picture extensions a file dialog offers) sits beside `PathKind`." [[type]] name = "HostAnswer" old = "" new = "craft_ui::runtime::requests::HostAnswer" status = "replaced" note = "What the host answered to a colour, path or eyedropper request; defined with the requests in `runtime::requests`, and `HostRequests` (still in `patterns::form_dialogs`) keeps them." [[type]] name = "PathRequest" old = "craft_ui::dialog::params::PathRequest" new = "craft_ui::runtime::requests::PathRequest" status = "moved" note = "`#[non_exhaustive]`: build with `PathRequest::new(key, kind)`." [[type]] name = "EyedropperRequest" old = "craft_ui::dialog::params::EyedropperRequest" new = "craft_ui::runtime::requests::EyedropperRequest" status = "moved" note = "`#[non_exhaustive]`: build with `EyedropperRequest::new(key)`; it names the key the host answers and has no `armed` field (the sampler registration owns that)." [[type]] name = "CustomRow" old = "craft_ui::dialog::params::CustomRow" new = "craft_ui::patterns::form_dialogs::CustomRow" status = "moved" note = "The draw closure takes `&mut CustomContext` in place of `&CustomContext`." [[type]] name = "CustomContext" old = "craft_ui::dialog::params::CustomContext" new = "craft_ui::patterns::form_dialogs::CustomContext" status = "moved" note = "`pick_color(&mut self, key)` records the request, which comes back as `ParamRowsOutput::pick_color`; it no longer goes through egui temp data." [[type]] name = "ParamRowsResponse" old = "craft_ui::dialog::params::ParamRowsResponse" new = "" status = "removed" note = "Replaced by `ParamRowsOutput { response, changed, values, pick_color, path, eyedropper }`; `color` is `pick_color`." [[type]] name = "ParamRowsOutput" old = "" new = "craft_ui::patterns::form_dialogs::ParamRowsOutput" status = "replaced" note = "The output of `ParamRows::show`, in place of `ParamRowsResponse`; `values` holds the values after the pass for a binding that does not write through." [[type]] name = "ParamRows" old = "craft_ui::dialog::params::ParamRows" new = "craft_ui::patterns::form_dialogs::ParamRows" status = "moved" note = "A pattern on `FieldGroup`: `ParamRows::new(label, ¶ms, Bind)` in place of `new(id_salt, ¶ms)` with `show(ui, &mut fields)`; `show(ui)` returns `ParamRowsOutput`. A `Param::section` opens a `Section` whose body is the rows up to the next section. `.read_only(true)` shows the values and refuses edits." [[type]] name = "DialogFields" old = "craft_ui::dialog::fields::DialogFields" new = "craft_ui::patterns::form_dialogs::DialogFields" status = "moved" [[type]] name = "FieldValue" old = "craft_ui::dialog::fields::FieldValue" new = "craft_ui::patterns::form_dialogs::FieldValue" status = "moved" [[type]] name = "ColorRequest" old = "craft_ui::dialog::color_request::ColorRequest" new = "craft_ui::runtime::requests::ColorRequest" status = "moved" note = "`title` is an `Option