mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 15:46:29 +08:00
5de63c29f5
Fixes [BS-3528](https://linear.app/affine-design/issue/BS-3528) Fixes [BS-3331](https://linear.app/affine-design/issue/BS-3331/frame-移动逻辑很奇怪) ### Changed - Remove `onSelected` method from gfx view, use `handleSelection` provided by `GfxViewInteraction` instead. - Add `selectable` to allow model to filter out itself from selection. - Frame can be selected by body only if it's locked or its background is not transparent. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced selection behavior for frames, edgeless text, notes, and mind map elements with refined control based on lock state and background transparency. - Introduced group-aware selection logic promoting selection of appropriate group ancestors. - Added support for element selection events in interactivity extensions. - **Bug Fixes** - Resolved frame selection issues by enabling selection via title clicks and restricting body selection to locked frames or those with non-transparent backgrounds. - **Documentation** - Added clarifying comments for group retrieval methods. - **Tests** - Updated and added end-to-end tests for frame and lock selection reflecting new selection conditions. - **Refactor** - Unified and simplified selection handling by moving logic from component methods to interaction handlers and removing deprecated selection methods. - Streamlined selection candidate processing with extension-driven target suggestion. - Removed legacy group element retrieval and selection helper methods to simplify interaction logic. - **Style** - Renamed types and improved type signatures for selection context and interaction configurations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
118 lines
3.1 KiB
TypeScript
118 lines
3.1 KiB
TypeScript
export { generateKeyBetweenV2 } from '../utils/fractional-indexing.js';
|
|
export {
|
|
compare as compareLayer,
|
|
renderableInEdgeless,
|
|
SortOrder,
|
|
} from '../utils/layer.js';
|
|
export {
|
|
canSafeAddToContainer,
|
|
descendantElementsImpl,
|
|
getTopElements,
|
|
hasDescendantElementImpl,
|
|
} from '../utils/tree.js';
|
|
export { GfxController } from './controller.js';
|
|
export type { CursorType, StandardCursor } from './cursor.js';
|
|
export { GfxExtension, GfxExtensionIdentifier } from './extension.js';
|
|
export { GridManager } from './grid.js';
|
|
export { GfxControllerIdentifier } from './identifiers.js';
|
|
export type {
|
|
BoxSelectionContext,
|
|
DragEndContext,
|
|
DragExtensionInitializeContext,
|
|
DragInitializationOption,
|
|
DragMoveContext,
|
|
DragStartContext,
|
|
ExtensionDragEndContext,
|
|
ExtensionDragMoveContext,
|
|
ExtensionDragStartContext,
|
|
GfxInteractivityContext,
|
|
GfxViewInteractionConfig,
|
|
ResizeConstraint,
|
|
ResizeEndContext,
|
|
ResizeHandle,
|
|
ResizeMoveContext,
|
|
ResizeStartContext,
|
|
RotateConstraint,
|
|
RotateEndContext,
|
|
RotateMoveContext,
|
|
RotateStartContext,
|
|
SelectContext,
|
|
} from './interactivity/index.js';
|
|
export {
|
|
GfxViewEventManager,
|
|
GfxViewInteractionExtension,
|
|
InteractivityExtension,
|
|
InteractivityIdentifier,
|
|
InteractivityManager,
|
|
} from './interactivity/index.js';
|
|
export { LayerManager, type ReorderingDirection } from './layer.js';
|
|
export type {
|
|
GfxCompatibleInterface,
|
|
GfxElementGeometry,
|
|
GfxGroupCompatibleInterface,
|
|
PointTestOptions,
|
|
} from './model/base.js';
|
|
export {
|
|
gfxGroupCompatibleSymbol,
|
|
isGfxGroupCompatibleModel,
|
|
} from './model/base.js';
|
|
export {
|
|
GfxBlockElementModel,
|
|
type GfxCommonBlockProps,
|
|
GfxCompatibleBlockModel as GfxCompatible,
|
|
type GfxCompatibleProps,
|
|
} from './model/gfx-block-model.js';
|
|
export { type GfxModel, isPrimitiveModel } from './model/model.js';
|
|
export {
|
|
convert,
|
|
convertProps,
|
|
derive,
|
|
field,
|
|
getDerivedProps,
|
|
getFieldPropsSet,
|
|
initializeObservers,
|
|
initializeWatchers,
|
|
local,
|
|
observe,
|
|
updateDerivedProps,
|
|
watch,
|
|
} from './model/surface/decorators/index.js';
|
|
export {
|
|
type BaseElementProps,
|
|
GfxGroupLikeElementModel,
|
|
GfxPrimitiveElementModel,
|
|
type SerializedElement,
|
|
} from './model/surface/element-model.js';
|
|
export {
|
|
GfxLocalElementModel,
|
|
prop,
|
|
} from './model/surface/local-element-model.js';
|
|
export {
|
|
SURFACE_TEXT_UNIQ_IDENTIFIER,
|
|
SURFACE_YMAP_UNIQ_IDENTIFIER,
|
|
SurfaceBlockModel,
|
|
type SurfaceBlockProps,
|
|
type SurfaceMiddleware,
|
|
} from './model/surface/surface-model.js';
|
|
export { GfxSelectionManager } from './selection.js';
|
|
export {
|
|
SurfaceMiddlewareBuilder,
|
|
SurfaceMiddlewareExtension,
|
|
} from './surface-middleware.js';
|
|
export {
|
|
BaseTool,
|
|
type ToolOptions,
|
|
type ToolOptionWithType,
|
|
type ToolType,
|
|
} from './tool/tool.js';
|
|
export { MouseButton, ToolController } from './tool/tool-controller.js';
|
|
export {
|
|
type EventsHandlerMap,
|
|
GfxElementModelView,
|
|
type SupportedEvent,
|
|
} from './view/view.js';
|
|
export { ViewManager } from './view/view-manager.js';
|
|
export * from './viewport.js';
|
|
export { GfxViewportElement } from './viewport-element.js';
|
|
export { generateKeyBetween, generateNKeysBetween } from 'fractional-indexing';
|