mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
refactor(editor): adjust ui of surface-ref inner toolbar (#11129)
Close [BS-2803](https://linear.app/affine-design/issue/BS-2803/inserted-frame-ui%E8%B0%83%E6%95%B4) Close [BS-2815](https://linear.app/affine-design/issue/BS-2815/inserted-group-ui调整) ### What Changes - Add an inner toolbar for hovered `surface-ref-block` - Simplify viewport related codes of `surface-ref-block` - Expose popover floating options from `affine-menu-button` https://github.com/user-attachments/assets/916b0a22-6271-4a6f-b338-6630e0426967
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
autoUpdate,
|
||||
computePosition,
|
||||
offset,
|
||||
type Placement,
|
||||
type Rect,
|
||||
shift,
|
||||
size,
|
||||
@@ -39,6 +40,7 @@ export type ButtonPopperOptions = {
|
||||
stateUpdated?: (state: { display: Display }) => void;
|
||||
mainAxis?: number;
|
||||
crossAxis?: number;
|
||||
allowedPlacements?: Placement[];
|
||||
rootBoundary?: Rect | (() => Rect | undefined);
|
||||
ignoreShift?: boolean;
|
||||
offsetHeight?: number;
|
||||
@@ -64,6 +66,7 @@ export function createButtonPopper(options: ButtonPopperOptions) {
|
||||
stateUpdated = () => {},
|
||||
mainAxis,
|
||||
crossAxis,
|
||||
allowedPlacements = ['top', 'bottom'],
|
||||
rootBoundary,
|
||||
ignoreShift,
|
||||
offsetHeight,
|
||||
@@ -84,7 +87,7 @@ export function createButtonPopper(options: ButtonPopperOptions) {
|
||||
crossAxis: crossAxis ?? 0,
|
||||
}),
|
||||
autoPlacement({
|
||||
allowedPlacements: ['top', 'bottom'],
|
||||
allowedPlacements,
|
||||
...overflowOptions,
|
||||
}),
|
||||
shift(overflowOptions),
|
||||
|
||||
Reference in New Issue
Block a user