/** * Computes the sort_order for a new placement at the position of `zoneEl` * (a drop-zone element rendered inside an Area). * * The iframe is the only place that sees the full rendered ordering — layout * components like ShoppingCart, widget instances, container children, all * interleaved by `sortOrder`. Every renderable is tagged with * `data-evershop-pb-sort-order` by `Area.tsx` (for layout / core components) * and `WidgetChrome.tsx` (for widget instances). * * We walk siblings outward from the drop zone, skipping anything that isn't * tagged (other drop zones, debug spans, etc.), to find the previous and * next sort_order. Midpoint between them is what the new placement should * use. * * Edge cases: * - Drop at the very top of an area (no prev): `next - 1` (lands above * everything currently rendered, including layout components). * - Drop at the very bottom of an area (no next): `prev + 1`. * - Drop into a completely empty area (no neighbors at all): `100` — * matches the existing "fresh area" convention so layout components in * the 1–20 range still render above. */ export declare function computeDropSortOrder(zoneEl: Element): number; /** * Computes the sort_order that moves `widgetEl` (a tagged renderable — in * practice the WidgetChrome wrapper) one visible step up or down within its * Area: past its nearest *rendering* tagged sibling, layout components * included — not just past the nearest widget, which is what the legacy * admin-side swap could see. * * Landing rules mirror the drop math: * - Between two neighbors: their midpoint. * - Past the outermost neighbor (top / bottom of the area): `± 1`. * - Already first (moving up) / last (moving down): `null` — no-op, * callers should not emit an op. * - Neighbors tied on the same sort value: landing strictly between two * equal values is impossible, so land just past both (`± 1`). * * Unlike the drop walk above, wrappers that rendered nothing * (`childNodes.length === 0` — a layout component that returned null, e.g. * Breadcrumb on the homepage) are skipped: stepping "past" an invisible * element would be a click that visibly does nothing. */ export declare function computeMoveSortOrder(widgetEl: Element, direction: 'up' | 'down'): number | null;