diff --git a/crates/draw/src/ui/brush_presets/panel.rs b/crates/draw/src/ui/brush_presets/panel.rs index 793a5c2ca..83132959f 100644 --- a/crates/draw/src/ui/brush_presets/panel.rs +++ b/crates/draw/src/ui/brush_presets/panel.rs @@ -2,11 +2,11 @@ use std::hash::Hash; -use craft_behavior::{EditEvents, IconId}; +use craft_behavior::{EditEvents, IconId, Selection}; use craft_ui::contract::{Bind, EditResponse, Outcome, Props as _, ShowContainer as _}; use craft_ui::layout_components::Stack; use craft_ui::patterns::presets::{ - PresetBrowser, PresetEvent, PresetFooterEvent, PresetFooterOptions, PresetReorder, PresetRow, PresetRowMenu, PresetState, + PresetBrowser, PresetEvent, PresetFooterEvent, PresetFooterOptions, PresetReorder, PresetRow, PresetState, }; use craft_ui::runtime::drag::DropZone; use craft_ui::runtime::env::{Env, Label}; @@ -88,12 +88,12 @@ impl<'a, K: Clone + Eq + Hash + Send + Sync + 'static> BrushesPanel<'a, K> { } let mut browser = PresetBrowser::new(label.clone(), state.reborrowed(), rows) .toolbar(true) - .row_menu(PresetRowMenu::Standard) // P3(appearance-w5): ap.AP5 + .reorder(PresetReorder::items_and_groups()) .thumb_range(BRUSH_THUMBS) .footer(footer); if let Some(key) = selected.take() { - browser = browser.selected(key); + browser = browser.selection(Bind::given(Selection::single(key))); } if let Some(zone) = drop_zone.take() { browser = browser.drop_zone(zone); diff --git a/crates/draw/src/ui/brush_presets/picker.rs b/crates/draw/src/ui/brush_presets/picker.rs index 711264ae7..431dcbc57 100644 --- a/crates/draw/src/ui/brush_presets/picker.rs +++ b/crates/draw/src/ui/brush_presets/picker.rs @@ -14,9 +14,9 @@ use craft_ui::form::SliderField; use craft_ui::layout_components::{Row, Stack}; use craft_ui::menu::{Menu, MenuItem}; use craft_ui::patterns::presets::{ - CellShape, PickerField, PresetBrowser, PresetEvent, PresetFooterOptions, PresetPicker, PresetRow, PresetState, PresetView, PreviewPaint, + CellShape, PickerField, PresetBrowser, PresetEvent, PresetFooterOptions, PresetPicker, PresetRow, PresetState, PresetView, }; -use craft_ui::primitives::IconSpec; +use craft_ui::primitives::{FacePaint, IconSpec}; use craft_ui::runtime::env::{Env, Label, UnitKind}; use craft_ui::runtime::overlay::CloseReason; use egui::{Pos2, Response, Ui}; @@ -283,7 +283,7 @@ pub struct BrushPresetPicker<'a, K: Value + Eq + Hash> { /// Paints the brush's current tip on the chip, as the app's engine draws it (its falloff, angle and roundness, a /// sampled tip's shape); without it the chip shows the picked preset's tip. #[prop] - tip: Option, + tip: Option, } /// The app's own rows of the picker's gear menu. diff --git a/crates/draw/src/ui/brush_presets/rows.rs b/crates/draw/src/ui/brush_presets/rows.rs index f5cade1c6..cae7a2223 100644 --- a/crates/draw/src/ui/brush_presets/rows.rs +++ b/crates/draw/src/ui/brush_presets/rows.rs @@ -1,11 +1,11 @@ //! The rows of the Brush Preset picker: a preset row shows the tip or the stroke by the parts the picker shows. use craft_ui::list::ThumbAspect; -use craft_ui::patterns::presets::{PresetRow, PreviewPaint}; -use craft_ui::primitives::ContentPainterCx; +use craft_ui::patterns::presets::PresetRow; +use craft_ui::primitives::FacePaint; use craft_ui::runtime::env::Env; use egui::Rect; -use std::sync::Arc; +use std::hash::{Hash, Hasher}; use super::settings::BrushCardParts; use super::words::BrushPresetWords; @@ -25,21 +25,25 @@ pub fn tip_thumb_scale(diameter: f64) -> f32 { #[non_exhaustive] pub struct BrushRowPaint { /// The tip, white on dark themes as the engine renders it. - pub tip: PreviewPaint, + pub tip: FacePaint, /// The stroke preview. - pub stroke: PreviewPaint, + pub stroke: FacePaint, } impl BrushRowPaint { - /// The painters of one preset. - pub fn new( - tip: impl Fn(&ContentPainterCx, Rect) + Send + Sync + 'static, - stroke: impl Fn(&ContentPainterCx, Rect) + Send + Sync + 'static, - ) -> Self { - Self { tip: Arc::new(tip), stroke: Arc::new(stroke) } + /// The faces of one preset, each keyed by the host by the brush's identity. + pub fn new(tip: FacePaint, stroke: FacePaint) -> Self { + Self { tip, stroke } } } +/// The key of a tip drawn at `scale`: the tip's key and the scale, since one tip face draws at several scales. +fn scaled_key(tip: u64, scale: f32) -> u64 { + let mut hasher = std::collections::hash_map::DefaultHasher::new(); + (tip, scale.to_bits()).hash(&mut hasher); + hasher.finish() +} + /// A preset row for the picker: `name` at `depth`, its size as the caption and in the accessible name /// ("{name}, {size}"), and its picture by `parts`: the stroke band while the stroke shows, else the tip drawn at /// [`tip_thumb_scale`] of `diameter`. @@ -58,10 +62,10 @@ pub fn brush_row( let row = PresetRow::item(key, name.clone(), depth).caption(size.clone()).accessible_name(words.preset_size.fill(&[("name", &name), ("size", &size)])); if parts.normalised().stroke { - let stroke = Arc::clone(&paint.stroke); - row.preview(ThumbAspect::new(STROKE_ASPECT.0, STROKE_ASPECT.1), move |cx, rect| stroke(cx, rect)) + row.preview_face(ThumbAspect::new(STROKE_ASPECT.0, STROKE_ASPECT.1), paint.stroke.clone()) } else { - let (tip, scale) = (Arc::clone(&paint.tip), tip_thumb_scale(diameter)); - row.preview(ThumbAspect::SQUARE, move |cx, rect| tip(cx, Rect::from_center_size(rect.center(), rect.size() * scale))) + let (tip, scale) = (paint.tip.clone(), tip_thumb_scale(diameter)); + let face = FacePaint::new(scaled_key(tip.key(), scale), move |cx, rect| tip.paint(cx, Rect::from_center_size(rect.center(), rect.size() * scale))); + row.preview_face(ThumbAspect::SQUARE, face) } } diff --git a/crates/draw/src/ui/brush_presets/stories.rs b/crates/draw/src/ui/brush_presets/stories.rs index 619d16d5b..1b517f112 100644 --- a/crates/draw/src/ui/brush_presets/stories.rs +++ b/crates/draw/src/ui/brush_presets/stories.rs @@ -3,6 +3,7 @@ use craft_behavior::Mixed; use craft_ui::contract::Bind; use craft_ui::patterns::presets::PresetRow; +use craft_ui::primitives::FacePaint; use craft_ui::runtime::env::Env; use craft_ui::testing::pictures::{SampleTip, paint_tip, paint_wave}; use craft_ui::testing::{Drive, StoryData, StoryOutput, story}; @@ -22,10 +23,10 @@ const MAX_SIZE: f64 = 5000.0; /// The tip and stroke of a preset with `tip`, in the ink of the surface; a soft tip's stroke is wider and half /// opaque. fn paint(tip: SampleTip) -> BrushRowPaint { - let (width, alpha) = if tip == SampleTip::Soft { (0.19, 0.5) } else { (0.12, 1.0) }; + let ((width, alpha), (tip_key, stroke_key)) = if tip == SampleTip::Soft { ((0.19, 0.5), (1, 2)) } else { ((0.12, 1.0), (3, 4)) }; BrushRowPaint::new( - move |cx, rect| paint_tip(cx, rect, tip, cx.ink()), - move |cx, rect| paint_wave(cx, rect, width, cx.ink().gamma_multiply(alpha)), + FacePaint::new(tip_key, move |cx, rect| paint_tip(cx, rect, tip, cx.ink())), + FacePaint::new(stroke_key, move |cx, rect| paint_wave(cx, rect, width, cx.ink().gamma_multiply(alpha))), ) } diff --git a/crates/draw/src/ui/gradient/palette/mod.rs b/crates/draw/src/ui/gradient/palette/mod.rs index cb1866ba6..5401eb3a9 100644 --- a/crates/draw/src/ui/gradient/palette/mod.rs +++ b/crates/draw/src/ui/gradient/palette/mod.rs @@ -2,6 +2,7 @@ //! family's [`PresetBrowser`]: the browser owns the grid, the list, the roving focus, the keys and the accessible tree; //! the palette supplies the rows and paints each preset's thumbnail as a gradient ramp. +use craft_behavior::Selection; use craft_ui::contract::{Bind, NoValue, Outcome, Pattern}; use craft_ui::patterns::presets::{CellShape, PresetBrowser, PresetEvent, PresetRow, PresetState, PresetTiles}; use craft_ui::runtime::env::{Env, Label}; @@ -215,7 +216,7 @@ impl<'a> GradientPalette<'a> { .room_height(most) .thumb(thumb); if let Some(selected) = self.selected { - browser = browser.selected(selected); + browser = browser.selection(Bind::given(Selection::single(selected))); } let out = browser.show(ui); let mut picked = None; diff --git a/crates/draw/src/ui/pattern/editor.rs b/crates/draw/src/ui/pattern/editor.rs index 2180c5594..fab1a895e 100644 --- a/crates/draw/src/ui/pattern/editor.rs +++ b/crates/draw/src/ui/pattern/editor.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use super::{PatternColors, PatternFillOptions, PatternSwatch, PatternWords}; -use craft_behavior::{EditEvent, EditEvents, Mixed, NumberCodec}; +use craft_behavior::{EditEvent, EditEvents, Mixed, NumberCodec, Selection}; use craft_color_ui::ui::{ColorPopover, PickedColor}; use craft_ui::buttons::Button; use craft_ui::choice::Checkbox; @@ -110,10 +110,10 @@ impl<'a> PatternFillEditor<'a> { let browser = Field::new(words.pattern.clone()).id_salt("grid").show(ui, |ui, _| { let thumbs = thumbnails.clone(); let mut browser = PresetBrowser::new(words.pattern.clone(), Bind::bound(&mut state), &rows) - .selected(current.pattern.clone()) + .selection(Bind::given(Selection::single(current.pattern.clone()))) .cell_shape(CellShape::Square) .view_lock(PresetView::Grid) - .row_menu(PresetRowMenu::Off); // P3(appearance-w5): ap.AP5 + .row_menu(PresetRowMenu::Off); if let Some(thumbs) = thumbs { browser = browser.thumb(move |cx: &ContentPainterCx<'_>, rect: Rect, info: ThumbInfo<'_, String>| { if let Some(swatch) = swatches.iter().find(|swatch| swatch.id == *info.key) { diff --git a/crates/draw/tests/it/brush_presets.rs b/crates/draw/tests/it/brush_presets.rs index af6b8b41a..d772a8c31 100644 --- a/crates/draw/tests/it/brush_presets.rs +++ b/crates/draw/tests/it/brush_presets.rs @@ -6,6 +6,7 @@ use craft_draw::ui::brush_presets::{BrushPick, BrushPickerState, BrushPickerValu use craft_draw::ui::brush_settings::TipAngle; use craft_ui::contract::{Bind, Role, SaveKey}; use craft_ui::patterns::presets::PresetEvent; +use craft_ui::primitives::FacePaint; use craft_ui::runtime::env::Env; use craft_ui::testing::{Fixture, trial}; use egui::{Key, Modifiers, Pos2, Rect, Vec2}; @@ -14,6 +15,11 @@ use std::rc::Rc; const HARD: u32 = 2; +/// Rows whose tip and stroke paint nothing, each face with a key of its own. +fn silent() -> BrushRowPaint { + BrushRowPaint::new(FacePaint::new(1, |_, _| {}), FacePaint::new(2, |_, _| {})) +} + struct Host { current: Option, state: BrushPickerState, @@ -26,7 +32,7 @@ fn rename_brush_opens_the_name_field_on_the_current_preset() { let shown = Rc::clone(&host); let mut fixture = Fixture::new(move |ui| { let env = Env::of(ui); - let paint = BrushRowPaint::new(|_, _| {}, |_, _| {}); + let paint = silent(); let mut host = shown.borrow_mut(); let Host { current, state, picks } = &mut *host; let rows = @@ -89,7 +95,7 @@ fn opened_rig(at_point: bool, remember: bool) -> (Fixture, Rc>) let shown = Rc::clone(&host); let mut fixture = Fixture::new(move |ui| { let env = Env::of(ui); - let paint = BrushRowPaint::new(|_, _| {}, |_, _| {}); + let paint = silent(); let mut host = shown.borrow_mut(); let Opened { current, state, values, open, tip_edits, at, offset } = &mut *host; ui.add_space(*offset); diff --git a/crates/imaging/src/ui/layer_style/styles.rs b/crates/imaging/src/ui/layer_style/styles.rs index 60b805610..a1c4205b2 100644 --- a/crates/imaging/src/ui/layer_style/styles.rs +++ b/crates/imaging/src/ui/layer_style/styles.rs @@ -46,7 +46,7 @@ pub(super) fn styles_page(ui: &mut Ui, presets: Option<&StylePresets<'_>>, words if let Some(StylePresets { rows, thumb }) = presets { let browser = PresetBrowser::new(words.styles.clone(), Bind::>::kept(), rows) .thumb(move |cx, rect, info| thumb(cx, rect, info)) - .row_menu(PresetRowMenu::Off) // P3(appearance-w5): ap.AP5 + .row_menu(PresetRowMenu::Off) .max_rows(STYLE_ROWS); for event in browser.show(ui).events { if let PresetEvent::Select { key, .. } | PresetEvent::Activate { key, .. } = event { diff --git a/crates/ui-contract/src/primitives/face.rs b/crates/ui-contract/src/primitives/face.rs index 950e94134..8d92a6b81 100644 --- a/crates/ui-contract/src/primitives/face.rs +++ b/crates/ui-contract/src/primitives/face.rs @@ -16,7 +16,7 @@ pub struct FacePaint { impl FacePaint { /// A face identified by `key` that paints with `paint`. pub fn new(key: u64, paint: impl Fn(&ContentPainterCx<'_>, Rect) + Send + Sync + 'static) -> Self { - FacePaint { key, paint: Arc::new(paint) } + Self { key, paint: Arc::new(paint) } } /// The key that identifies the face. diff --git a/crates/ui-patterns/src/patterns/presets/browser.rs b/crates/ui-patterns/src/patterns/presets/browser.rs index affc9212b..f481e0721 100644 --- a/crates/ui-patterns/src/patterns/presets/browser.rs +++ b/crates/ui-patterns/src/patterns/presets/browser.rs @@ -20,7 +20,8 @@ use super::words::PresetWords; use crate::bars::{Bar, BarKind}; use crate::choice::Segmented; use crate::contract::{ - Bind, BodyCx, CollectionEvent, DropAt, DropMark, DropPlace, DropTarget, DropZone, Entry, ListDrag, OpenChange, Pattern, Props, Rename, + Bind, BodyCx, CollectionEvent, DropAt, DropKind, DropMark, DropPayload, DropPlace, DropTarget, DropZone, Entry, ListDrag, OpenChange, Pattern, + Props, Rename, TooltipSpec, ReorderMove, ReorderRule, RowHeight, SelectMode, Show as _, ShowCollection as _, ShowContainer as _, request_rename, }; use crate::display::Divider; @@ -33,13 +34,14 @@ use crate::runtime::drag; use crate::runtime::env::{Env, Label}; use crate::runtime::memory::Remember as _; use crate::text::TextField; -use crate::tile_grid::{CaptionPlace, GridEvent, TailRow, Tile, TileGrid, TileGroup, TileZoom}; -use craft_behavior::{DisplayOrder, DropOperation, EditEvent, GesturePhase, IconId, ItemSource, Mixed, Selection, SelectionChange}; +use crate::tile_grid::{CaptionPlace, GridEvent, GroupHeads, TailRow, Tile, TileGrid, TileGroup, TileZoom}; +use craft_behavior::{DisplayOrder, DropOperation, EditEvent, GesturePhase, IconId, ItemSource, Mixed, Selection, SelectionChange, SelectionModel}; use craft_i18n::matcher::Matcher; use craft_theme::variant::Tone; use egui::{Id, Pos2, Rect, Ui}; use std::cell::RefCell; use std::hash::{Hash, Hasher}; +use std::rc::Rc; use std::sync::Arc; /// The commands of a preset's context menu. They are app commands: the browser reports a run row as the event of the @@ -81,6 +83,26 @@ impl BrowserKey { BrowserKey::Action(_) => None, } } + + /// The app's key of a preset or group row, `None` for an action row. + fn into_preset(self) -> Option { + match self { + BrowserKey::Preset(key) => Some(key), + BrowserKey::Action(_) => None, + } + } +} + +/// The app's change of a selection change the browser's collection reports: only the rows `selectable` accepts stay in +/// it, so action rows and groups are never part of the host's selection. Cell changes do not occur under the modes the +/// browser allows. +fn app_change(change: SelectionChange>, selectable: impl Fn(&K) -> bool) -> Option> { + match change { + SelectionChange::Set(keys) => Some(SelectionChange::Set(keys.into_iter().filter_map(BrowserKey::into_preset).filter(|key| selectable(key)).collect())), + SelectionChange::Toggle(key) => key.into_preset().filter(|key| selectable(key)).map(SelectionChange::Toggle), + SelectionChange::Clear => Some(SelectionChange::Clear), + _ => None, + } } /// The app's drag of a drag the browser's collection carries: its presets and groups. `None` for a drag grabbed at an @@ -113,10 +135,7 @@ impl DropTarget>> for ZoneDrop<'_, /// The app's move of a move the browser's collection reports. Only presets and groups drag, and only they take a drop /// (`can_drag`, `accepts`), so every key of a move is one of the app's. fn app_move(mv: ReorderMove>) -> Option> { - let app = |key: BrowserKey| match key { - BrowserKey::Preset(key) => Some(key), - BrowserKey::Action(_) => None, - }; + let app = BrowserKey::into_preset; Some(ReorderMove { key: app(mv.key)?, keys: mv.keys.into_iter().filter_map(app).collect(), @@ -146,25 +165,63 @@ impl<'a, K> ThumbPainter<'a, K> { type RowItemsFn<'a, K> = Box Vec> + 'a>; /// The host's rows of the row menu for a target ([`PresetBrowser::row_items`]). -pub struct RowItems<'a, K>(#[allow(dead_code)] RowItemsFn<'a, K>); // P3(appearance-w5): ap.AP5 +pub struct RowItems<'a, K>(RowItemsFn<'a, K>); impl<'a, K> RowItems<'a, K> { /// The rows that `items` gives for a target. pub fn new(items: impl Fn(&K) -> Vec> + 'a) -> Self { RowItems(Box::new(items)) } + + /// The rows for `key`: how the browser builds its row menu. + pub(super) fn items(&self, key: &K) -> Vec> { + (self.0)(key) + } } +/// Paints the tip of a tile or row on hover ([`PresetBrowser::tip`]). +pub(super) type TipFn<'a, K> = Box; + +/// The rows and the order the shown collection lists them in: what a drop needs to say where a payload landed in the +/// host's rows. +struct RowMap<'a, K> { + rows: &'a [PresetRow], + /// The positions in `rows` of the collection's items, in display order. + displayed: Vec, +} + +impl RowMap<'_, K> { + /// The host's place of a place in the browser's collection; `None` where no drop lands: on a group or an action + /// row, or past the presets. + fn host(&self, at: &DropAt>) -> Option> { + match at { + DropAt::Onto(BrowserKey::Preset(key)) => self.rows.iter().any(|row| row.key == *key && !row.is_group()).then(|| DropAt::Onto(key.clone())), + DropAt::Gap { key, insert, .. } if *insert <= self.displayed.len() => { + let over = match key { + Some(BrowserKey::Action(_)) => return None, + Some(BrowserKey::Preset(key)) => Some(key.clone()), + None => None, + }; + Some(DropAt::gap(over, full_position(self.rows, &self.displayed, &[], *insert))) + } + _ => None, + } + } +} + +type DropMaker<'a, K> = Box>) -> DropKind<'a, BrowserKey> + 'a>; + /// A drop target on the presets: a host payload of type `P` dropped onto a preset or between presets. -pub struct PresetDrop<'a, K> { - _marker: std::marker::PhantomData<(&'a (), K)>, -} +pub struct PresetDrop<'a, K>(DropMaker<'a, K>); -impl<'a, K> PresetDrop<'a, K> { +impl<'a, K: Clone + Eq + 'a> PresetDrop<'a, K> { /// Takes payloads of type `P` at `place` where `accepts` agrees; the drop comes back as `PresetEvent::Dropped`. pub fn new(place: DropPlace, accepts: impl Fn(&P, &DropAt) -> bool + 'a) -> Self { - let _ = (place, accepts); - todo!("ap.AP2") + let accepts = Rc::new(accepts); + PresetDrop(Box::new(move |map| { + let accepts = Rc::clone(&accepts); + DropKind::new::

(place, move |payload, at| map.host(at).is_some_and(|at| accepts(payload, &at))) + })) } } @@ -196,13 +253,15 @@ impl<'a> BrowserTools<'a> { /// (Shift to the ends) reorder by the `reorder` rules. The host performs the delete, rename and move it is told of. /// - **Search.** The toolbar's field keeps the presets whose name matches, with their groups, all open; Up, Down and /// Enter go from the field to the presets. -/// - **Row menu.** Rename, Move to, Delete and the host's `extra_items` act on the row the menu was asked for, which the -/// browser keeps until the menu closes, else on `selected`. +/// - **Selection.** The host's `selection`, in the collection's modes (`select`): `Single` by default, `Multi` for +/// Shift ranges and Cmd/Ctrl toggles. `PresetEvent::Select` reports a plain pick only. +/// - **Row menu.** Rename, Move to, Delete and the host's `row_items` (`row_menu`) act on the row the menu was asked +/// for, which the browser keeps until the menu closes, else on the selection's lead. /// - **Actions.** Rows after the presets, below a divider (`actions`): Down from the last preset reaches them, and a /// click or Enter reports `PresetEvent::Action`. They are never selected, dragged or renamed. /// /// ```ignore -/// let out = PresetBrowser::new("Swatches", Bind::bound(&mut state), &rows).selected(chosen.clone()).toolbar(true).show(ui); +/// let out = PresetBrowser::new("Swatches", Bind::bound(&mut state), &rows).selection(Bind::given(Selection::single(chosen.clone()))).toolbar(true).show(ui); /// for event in out.events { /* the host applies Select, Activate, Reorder, ... */ } /// ``` #[must_use = "show the browser with `show`"] @@ -216,9 +275,7 @@ pub struct PresetBrowser<'a, K: Clone + Eq + Hash + Send + Sync + 'static> { browser_id: Option, state: Bind<'a, PresetState>, rows: &'a [PresetRow], - /// The selected preset, which the host keeps. - #[prop] - selected: Option, + /// The host's selection. With `Bind::given`, every change comes out as `PresetEvent::Selection`; with /// `Bind::bound`, the browser writes the binding. #[prop] @@ -251,8 +308,8 @@ pub struct PresetBrowser<'a, K: Clone + Eq + Hash + Send + Sync + 'static> { /// The host's controls at the reading end of the toolbar. #[prop(func = "FnMut(&mut Ui)")] tools: Option>, - /// Whether a secondary click or the context-menu key opens the row menu: Rename, Move to, Delete and the host's - /// `extra_items`. + /// What a secondary click or the context-menu key opens: the standard row menu, the host's `row_items` alone, or + /// nothing. #[prop] row_menu: PresetRowMenu, /// The host's rows of the row menu for a target, after the standard ones (or alone with `PresetRowMenu::Host`). @@ -260,8 +317,10 @@ pub struct PresetBrowser<'a, K: Clone + Eq + Hash + Send + Sync + 'static> { row_items: Option>, /// Presets drag out as `ListDrag`, without reorder or a drop zone. #[prop] - #[allow(dead_code)] // P3(appearance-w5): ap.AP-drags drags: bool, + /// How group heads show: titled rows, or full-width rules between the groups, which are always open. + #[prop] + group_heads: GroupHeads, /// Fixes the view, whatever the state says; the toolbar then has no view buttons. #[prop] view_lock: Option, @@ -285,8 +344,9 @@ pub struct PresetBrowser<'a, K: Clone + Eq + Hash + Send + Sync + 'static> { /// `reorder` presets still drag, to the zone and to the host's own drop targets only. #[prop] drop_zone: Option, - extra_items: Vec>, actions: Vec