Expand description
Reusable native workspace for editing FerroUI XAML.
DesignerSession is the UI-thread transaction boundary used by source editing,
visual tools and automation. DesignerWorkspace is an optional embeddable view
of that session. Neither starts a window, server or background transport.
Re-exports§
pub use ferroui_designer_tools as tools;
Modules§
- sharing
- UI-thread coordination for the reusable room service. Workers own all transport, credentials and disk I/O; the session remains the only authority that mutates authored/preview state.
Structs§
- Asset
Toolbox - Canvas
Guide - Canvas
Guide Edit Snapshot - Accepted source and view identity for a staged guide editor. A source change retires the draft even when it returns to the same text; camera changes alone are harmless.
- Canvas
Guide Settings - Canvas
Guide View Snapshot - Retained tab presentation. This can only restore into the matching document allocation.
- Canvas
Guides Editor - Canvas
Layer Choice - One authored control in the native front-to-back hit stack. The path distinguishes unnamed controls and repeated names in separate XAML namescopes.
- Canvas
Selection Snapshot - Accepted canvas context. Native identities and geometry supplement document/view epochs: runtime-only layout or template replacement also retires a retained menu.
- Canvas
Viewport - Maps authored artboard coordinates to a clipped native canvas without remeasuring
application content:
viewport = artboard * zoom + offset. - Component
Edit Preview - Component
Library - Component
Library Item - A definition in the current document or an application-registered asset. IDs are host identities, independent of display names and resource aliases.
- Copied
Property - A displayable immutable clipboard entry. Its private value retains the exact source literal or namespace-closed object graph, rather than the current rendered value.
- Definition
Preview Options - Definition
Preview Settings - Definition
Property Field - A host-created typed editor, shared with the regular property inspector.
- Definition
Reference - Definition
Scope - Design
Surface - Transparent native adorner for selecting, moving, resizing and rotating live controls. Motion changes only the adorner; release commits one semantic transaction. Escape and capture loss cancel the gesture, so neither source nor history receive partial drags.
- Design
Time Editor - Design
Time Editor Model - Design
Time Property - Design
Time Snapshot - A popup owns an immutable acceptance token. Leaving and returning to the same selection or definition cannot make an obsolete draft current again.
- Designer
Asset - A source snippet available to a designer host. Custom controls can register their own category, description and vector icon without modifying the shell.
- Designer
Definition Asset - Exact XAML supplied by a library or a project. The designer does not reconstruct a compiled template from live visuals. The source is copied through an AST edit.
- Designer
Session - Shared UI-thread state. All authored changes pass through the same document history; runtime load errors preserve both source and the last successfully rendered tree.
- Designer
Workspace - A native, embeddable workspace. The host retains the returned
Rcfor the lifetime of the view. Event callbacks capture it weakly, and dropping it stops the preview timer. - Document
- An owned source buffer with a last-valid syntax snapshot and bounded history. Runtime acceptance is deliberately separate: the host may keep an older live tree when compilation fails, while authored and syntactically valid XAML stays available for correction.
- Drag
Visual Ghost - A native drag snapshot. Capture after the move threshold and drop it when the gesture finishes or cancels; no accepted control property is changed.
- Easing
Preview - A small native graph of the incoming keyframe easing. Hosts can embed it beside their own editor; sampling follows the animation engine, including overshoot.
- Focus
Label Association - A real Label.Target association and the authored inputs reachable in its namescope.
- Focus
Label Target - Focus
Order Catalog - Focus
Order Editor - A staged editor for group-local order, tab eligibility, modes and Label.Target. Every command is submitted together on Apply; Cancel discards the complete draft.
- Focus
Order Item - One runtime tab stop or group entry. An absent source identity is intentional: generated controls can influence navigation without being editable XAML nodes.
- Focus
Order Scope - Each non-Continue container establishes a separate native TabIndex group. Continue descendants share the nearest group’s index space.
- Focus
Order Snapshot - A retained dialog cannot edit another document, another definition scope, or a preview whose navigation semantics have changed without a source edit.
- Grid
Track Editor - An axis picker, length/unit editor and insertion/removal commands in one native row. Configure it from accepted state; a change callback must validate and apply the intent.
- Layer
Edit Snapshot - Immutable source-row/host intent. A lock/unlock round trip invalidates a retained callback just as a source, document or definition-scope transition does.
- Layer
State - Source-row presentation. Direct flags can be changed on this row; inherited flags require changing their ancestor. Isolation preserves visible ancestor context.
- Layer
View Snapshot - A tab retains this alongside its Document clone. It restores only into the exact same syntax allocation and URI, never a new document that happens to reuse NodeIds.
- Layout
Edit Preview - Immutable, validated authoring result paired with the geometry presented to the user. A rejected result still contains an explicit target and explanation for red feedback. The edit list is private: commit applies the exact accepted preview after checking its source, selection, permissions and provider identity again.
- Layout
Helper Render State - Optional view state; neither hovering nor rendering changes authored layout.
- Layout
Helper Snapshot - Portable panel-local helper geometry and its measured affine mapping to the artboard. Renderers transform vertices explicitly so their pens, labels and hit targets can stay constant in screen space under zoom, rotation, reflection and shear.
- Preview
Environment - Preview
Environment Editor - The host retains this object while its control is visible. Callbacks are weak and do not make control/host cycles; applying validates the complete draft before notifying the host.
- Preview
Host Options - Preview
Prototype - Preview
Prototype Element Choice - The workspace supplies only eligible authored elements from its accepted sources.
- Preview
Prototype Flow - Preview
Prototype Flow Editor - Preview
Prototype Flow Manifest - Preview
Prototype Hotspot - Clipped bounds are expressed in the accepted stage host’s logical coordinates.
- Preview
Prototype Link - Preview
Prototype Link Editor - Preview
Prototype Link Manifest - Preview
Prototype Manifest - Portable graph descriptors. Every stage reference is an index into the owning preview-stage manifest, never a runtime ID or a source node’s transient identity.
- Preview
Prototype Overlay - Preview
Prototype Overlay Options - Presentation settings for one overlay entry. Outside dismissal is opt-in; explicit CloseOverlay and Back remain available regardless of that setting.
- Preview
Prototype Playback Info - Preview
Prototype Player Layer - A retained native screen in the base screen’s logical coordinate space. The first layer is the base screen; subsequent layers are modal overlays.
- Preview
Prototype Player View - Preview
Prototype Session - A bounded navigation cursor over one accepted graph. It owns no source session, controls, timers or application state. Hosts validate native/source authority before activating an interaction and can retain native views across Back.
- Preview
Prototype View - Preview
Request - A factory receives the actual authored document and base URI. It may instantiate a real
registered code-behind class and call
populateto apply XAML before wiring its handlers. - Preview
Size Preset - Preview
Source Anchor - A namespace-qualified source path. No runtime or session-local numeric node ID is persisted. Named/keyed paths survive sibling insertion and reordering, while ambiguous unnamed siblings are rejected instead of guessing which view was meant.
- Preview
Source Segment - Preview
Stage Board - One UI-thread collection of native comparison stages across the host’s open document buffers. It never owns document history or performs authored mutations.
- Preview
Stage Configuration - Preview
Stage Editor - A reusable form with an independently scrolling body and fixed Apply/Cancel footer. Source documents are immutable snapshots used to offer actual definitions and states.
- Preview
Stage Export Options - Raster density relative to the stage’s existing logical layout. This changes the bitmap density, never the application’s available layout space.
- Preview
Stage Image - A captured PNG and the dimensions of the exact native frame that produced it. The image is owned bytes, so a save picker may await without retaining controls.
- Preview
Stage Info - Preview
Stage Manifest - Preview
Stage Matrix - An empty environment axis keeps the base stage’s value. Each nonempty axis participates in the Cartesian product. State axes override only their named owner/group; the base stage’s other selected state endpoints remain intact.
- Preview
Stage Matrix Editor - Empty check-box groups retain the original stage’s values. Applying requests a complete matrix only after the host verifies the source and board still match.
- Preview
Stage Matrix Size - Preview
Stage Selection - Preview
Stage Selection Token - An accepted native/source identity. Its private weak reference and retained AST prevent callers from manufacturing a source selection using a stale visual ID.
- Preview
Stage Size - Resolved native logical dimensions, independent from a card’s visual scaling.
- Preview
Stage Source - A host-supplied authored buffer.
pendingmeans text has been staged but its accepted runtime update has not yet been requested; the board never applies it. - Preview
Stage State - Preview
Stage State Axis - Preview
Stage View - The view never owns document or runtime state. A host supplies stable native stage controls and immutable descriptions, then handles explicit guarded commands.
- Property
Binding Draft - Edits only arguments that were explicitly changed. Unknown arguments, nested
extensions, aliases, quoting and spacing in every untouched argument are retained.
binding_extensionmust be the host’s namespace-resolved framework extension; an application extension with the same local name is deliberately not accepted. - Property
Binding Editor - Native structured controls and an exact-expression fallback.
value()accepts either the fields or the expression. When both were edited, the user must reload the fields explicitly, preventing a stale form from overwriting a newer expression. - Property
Clipboard - Workspace-local clipboard. Literal and self-contained object values can be pasted into another document. Resources additionally require the exact captured source AST and identical unambiguous lookup at every destination; they never silently rebind.
- Property
Color Editor - A native swatch and XAML color field with a staged spectrum/palette flyout.
- Property
Components Editor - A linked value or compact 2 × 2 editor for Margin, Padding, BorderThickness or CornerRadius. All fields commit together on Enter; Escape restores the accepted value. A linked edit deliberately sets every component and is also valid for mixed selections.
- Property
Editor Context - Property
Editor Metadata - Property
Inspector View - Local, reusable inspector preferences. No source or undo entries are created.
- Property
Number Options - Numeric interaction policy shared by labels, keyboard nudging and component editors.
- Property
Number Scrubber - A property-name label that also scrubs a numeric value. Dragging shows a local draft; releasing commits once. Escape, pointer capture loss and reconfiguration cancel.
- Property
Object Draft - Property
Paste Change - Property
Paste Preview - An accepted set of compatible destination writes. Unsupported destinations are reported explicitly; malformed values or protected layers reject planning as a whole.
- Property
Resource Choice - Property
Transfer Editor - A native picker with fixed Apply/Cancel controls and an independently scrolling body. Compatible authored values are selected initially; every skipped value is explained.
- Property
Transfer Issue - Property
Vector Editor - Labeled Point/Size/Vector/Rect/Matrix and relative-value editor. Enter commits all components once. Mixed fields remain empty until every component has been supplied.
- Resource
Definition Editor - Resource
Definition Model - Runtime
Node - One live-tree row; inspector identities remain shared with MCP and DevTools.
- Timeline
Lane
Enums§
- Asset
Icon - Asset
View Mode - The asset library keeps the same filtering and insertion semantics in both presentations.
- Canvas
Guide Axis - Canvas
Wheel Mode - Wheel behavior for the design canvas. Fractional native wheel deltas are preserved.
- Component
Library Filter - Copied
Property Kind - Definition
Creation Kind - Definition
Editor Command - Design
Gesture - Semantic pointer results. A host translates these into layout-adapter transactions.
- Design
Time Edit - Every command changes only a design-namespace value. Application attributes, bindings and property elements retain their exact source spelling.
- Edit
- Commands are evaluated against a private candidate, then committed once. Consecutive attribute edits are validated together, allowing a property and its namespace declaration in either order. Other commands observe preceding commands. Element-child indices exclude text, whitespace and comments. Move indices refer to the destination list after removing the moving node.
- Focus
Order Edit - Layer
Command - Layout
Match - Match logical layout dimensions to the first selected control. Render transforms and ancestor scaling remain intact, so matching dimensions need not match screen-space size.
- Layout
Reset - Remove authored values so the native style, inheritance and default layers take effect.
Allincludes margin, alignment, explicit dimensions and min/max constraints. It does not change padding, content alignment, transforms, panel placement or child definitions. - Navigation
Pane - Outline
Command - Structural edits in source order. Commands operate on the outermost selected elements, preserve their identities, and reject partial moves across incompatible content hosts.
- Outline
Mode - Preview
Flow Direction - Preview
Prototype Action - Preview
Prototype Action Manifest - Preview
Prototype Overlay Placement - Placement in the base screen’s logical coordinate space. The native presenter constrains the resulting visible rectangle to the prototype viewport.
- Preview
Prototype Player Action - Preview
Prototype View Action - Preview
Stage Action - Commands retain the card’s accepted epoch. Hosts reject callbacks from a replaced graph or dismissed menu rather than applying them to a different preview scenario.
- Preview
Stage Comparison - Preview
Stage Layout - Native measurement policy for a stage. Environment dimensions are the finite layout proposal and maximum size; fitting axes use the content’s desired size.
- Preview
Stage Mode - Preview
Stage Status - Preview
Stage Target - Preview
Status - The authored document and preview have independent acceptance states.
- Preview
Theme - Property
Binding Option - Property
Binding Source - Property
Components Kind - Four-component property ordering. The two-value XAML shorthand differs between thickness (horizontal/vertical) and corner radius (top/bottom).
- Property
Editor Kind - Property
Inspector Filter - A source filter applies in addition to the property search text.
- Property
Inspector Sort - How property rows are arranged. This changes only the inspector view.
- Property
Value Edit - Property
Value Source - Workspace
View Mode
Constants§
- MAX_
PREVIEW_ PROTOTYPE_ FLOWS - MAX_
PREVIEW_ PROTOTYPE_ HISTORY - MAX_
PREVIEW_ PROTOTYPE_ LINKS - MAX_
PREVIEW_ PROTOTYPE_ OVERLAYS - MAX_
PREVIEW_ PROTOTYPE_ OVERLAY_ OFFSET - MAX_
PREVIEW_ STAGES - MAX_
PREVIEW_ STAGE_ EXPORT_ BYTES - MAX_
PREVIEW_ STAGE_ EXPORT_ PIXELS - PREVIEW_
SIZE_ PRESETS - Generic logical sizes deliberately avoid claiming a particular device’s scale factor.
- STARTER_
XAML - The self-contained example opened by Designer Studio and usable by hosts.
Traits§
- Property
Editor Factory - Return a native control when this factory handles the property; otherwise let the next
factory try. Hosts register factories in priority order on
crate::DesignerWorkspace.
Functions§
- binding_
expression - Build a binding without interpolating path/key strings into markup syntax. Existing converter, fallback, validation and extension arguments survive structured changes.
- capture_
preview_ stage_ png - Capture a native stage at its existing arranged size, excluding all ancestors such as the board’s Viewbox, card title and commands. Pass the board’s stage control, not its card. No application input, layout, source or clock is changed.
- create_
property_ editor - Shared inspector/definition-editor pipeline. First matching registered factory wins; built-ins and a source-safe fallback follow. Hosts supply a revision-bound commit.
- default_
designer_ assets - Practical defaults rather than runtime-only infrastructure types. Hosts may
append project-specific controls using
AssetToolbox::register. - designer_
chrome_ style - Load the reusable, scoped designer chrome styles and semantic color resources.
- hit_
test_ layout_ handle - Find the nearest editable grip in screen space. Disabled or singular scenes remain visible but cannot intercept a pointer gesture.
- hover_
layout_ handle - Find the nearest visible grip for hover feedback, including disabled grips so their reason can be explained. Use hit_test_layout_handle to begin an edit.
- navigation_
mode_ name - plan_
design_ time_ edits - Source-only planning is independently reusable by host editors and automation. A private candidate evaluates the complete batch before the caller commits once.
- plan_
element_ names - Plan an atomic name change using the language service’s namescope-aware reference grammar.
Existing
Name/XAML directive aliases, quoting, unrelated strings and comments are retained.Noneremoves names only when doing so cannot leave a known reference unresolved. - property_
value_ data_ format - Cross-process native drag format for a single XAML property value, such as a color, resource expression or binding. Targets still validate against their active document.
- render_
layout_ helpers - Draw a model scene using the standard designer adorner palette.
- render_
layout_ helpers_ with_ state - Draw a scene with native hover/drag feedback and optional viewport clipping.
- render_
manipulation_ metrics - Paint bounded alignment guides, neighboring gaps and measured selection size. Inputs are artboard-space bounds. This provides visual feedback only; snapping and accepted layout changes remain owned by the gesture/session engines.
- resolve_
property_ editor_ metadata - Resolve actual runtime enum members, nullable forms and parsers when a property is available. The type-name fallback also supports source-only/template setter editors.
Type Aliases§
- NodeId
- Stable document-local identity. IDs are never reused, including after undo.
- Preview
Factory - Preview
Stage Id - Preview
Stage Snapshot - Property
Literal Validator - Property
Value Commit - Resource
Preview Factory