selectionRules#

Interfaces#

Owner#

Defined in: arranger/src/selectionRules.ts:69

What a drawn element stands for when it draws part of something else: a named timestamp (its wedge, its labels, its cross-section line) or a named MatchStamp (an alignment anchor’s line and its name label).

Properties#

address#

readonly address: ElementAddress

Defined in: arranger/src/selectionRules.ts:70

kind#

readonly kind: "timestamp" | "matchstamp"

Defined in: arranger/src/selectionRules.ts:71

match#

readonly match: boolean

Defined in: arranger/src/selectionRules.ts:73

Whether it belongs to a MatchStamp: a MatchStamp itself, or a match timestamp.

selects#

readonly selects: ElementAddress

Defined in: arranger/src/selectionRules.ts:79

What a press on it selects: the owner, but for a match timestamp’s line the MatchStamp holding it (holdingMatchStamp), whose selection the line shows too.


Pressed#

Defined in: arranger/src/selectionRules.ts:43

What a pointer or key target on the canvas is, read once from its event.

Properties#

node#

readonly node: BlockNode | undefined

Defined in: arranger/src/selectionRules.ts:45

The block node it lies in; undefined off every block.

pane#

readonly pane: boolean

Defined in: arranger/src/selectionRules.ts:54

Whether it is the empty pane.

point#

readonly point: Point | null

Defined in: arranger/src/selectionRules.ts:52

The drawing point under the pointer; null without one (a key) or off a drawing.

source#

readonly source: CanvasSource | null

Defined in: arranger/src/selectionRules.ts:50

What it draws, a descriptor or an affordance; null for anything else (the node, the drawing’s <svg>).


Resizable#

Defined in: arranger/src/selectionRules.ts:295

The box the resize toolbar acts on, in the block holding it.

Properties#

block#

readonly block: string

Defined in: arranger/src/selectionRules.ts:296

box#

readonly box: DrawnBox

Defined in: arranger/src/selectionRules.ts:297


Tap#

Defined in: arranger/src/selectionRules.ts:337

A touch released within the click distance of its press: where, when, and what it would do.

Properties#

action#

readonly action: DoubleClick

Defined in: arranger/src/selectionRules.ts:341

time#

readonly time: number

Defined in: arranger/src/selectionRules.ts:340

x#

readonly x: number

Defined in: arranger/src/selectionRules.ts:338

y#

readonly y: number

Defined in: arranger/src/selectionRules.ts:339

Type Aliases#

DoubleClick#

DoubleClick = Address | typeof DONE | typeof RECENTRE

Defined in: arranger/src/selectionRules.ts:249

What a double-click or a double tap does: open an editor, close the innermost, or centre the view.

Variables#

DONE#

const DONE: typeof DONE

Defined in: arranger/src/selectionRules.ts:243

What a double-click outside the edited element does: close the innermost editor, as Done does.


DOUBLE_TAP_DISTANCE#

const DOUBLE_TAP_DISTANCE: 10 = 10

Defined in: arranger/src/selectionRules.ts:347

…and this many screen pixels, where a double-click would do the same.


DOUBLE_TAP_MS#

const DOUBLE_TAP_MS: 300 = 300

Defined in: arranger/src/selectionRules.ts:345

Two taps act as a double-click when the second follows the first within this many milliseconds…


ON_PANE#

const ON_PANE: Pressed

Defined in: arranger/src/selectionRules.ts:271

What a click on the empty pane is, read without its event: no block, no descriptor, no point.


RECENTRE#

const RECENTRE: typeof RECENTRE

Defined in: arranger/src/selectionRules.ts:246

What a double-click on the edited element does: centre the view on it again, as opening does.

Functions#

clickedAt()#

clickedAt(selection, pressed, editing, __namedParameters): Selection

Defined in: arranger/src/selectionRules.ts:282

The selection after a click on pressed: what the press selects (pressedIn), alone, or, when additive (Shift, or the marquee toggle), toggled in the selection (click). A click on the empty canvas, and in an editor a click outside the edited element (isOutside: on its group, on anything else faded, on another block), clears the selection in every mode, the marquee mode included; with Shift it leaves it. Anything else (a control of the canvas) leaves it.

Parameters#

selection#

Selection

pressed#

Pressed

editing#

Editing | null

__namedParameters#
additive#

boolean

shift#

boolean

Returns#

Selection


doubleClickAt()#

doubleClickAt(view, pressed, editing): DoubleClick | null

Defined in: arranger/src/selectionRules.ts:259

What a double-click or a double tap on pressed does: outside the edited element it closes the innermost editor (DONE); else it opens the editor openableAt names; else, on a block inside the edited element (the edited element itself, or anything in it that opens no editor), it centres the view on the edited element again (RECENTRE); else nothing (null, on the arranger).

Parameters#

view#

View

pressed#

Pressed

editing#

Editing | null

Returns#

DoubleClick | null


doubleTap()#

doubleTap(previous, tap): boolean

Defined in: arranger/src/selectionRules.ts:360

Whether tap completes a double tap begun by previous: within DOUBLE_TAP_MS and DOUBLE_TAP_DISTANCE of it, where a double-click would do the same (open the same editor, or close the innermost).

Parameters#

previous#

Tap | null

tap#

Tap

Returns#

boolean


editorsAt()#

editorsAt(view, pressed, editing): readonly EditorChoice[]

Defined in: arranger/src/selectionRules.ts:185

The editors a long press on pressed offers (editorsUnder): none off every block or without a drawing point.

Parameters#

view#

View

pressed#

Pressed

editing#

Editing | null

Returns#

readonly EditorChoice[]


hitAt()#

hitAt(pressed, editing): Hit | null

Defined in: arranger/src/selectionRules.ts:58

What a press on pressed hits (hitOf); null off every block.

Parameters#

pressed#

Pressed

editing#

Editing | null

Returns#

Hit | null


holdingMatchStamp()#

holdingMatchStamp(manifest, timestamp): string | undefined

Defined in: arranger/src/selectionRules.ts:91

The named MatchStamp a press on the line of match timestamp timestamp of manifest selects, undefined where none holds it: of the MatchStamps one of whose alignment anchors joins it, the first in the manifest’s order whose anchor joining it shows the MatchStamp’s name (display lists name), else the first. Read once per manifest.

Parameters#

manifest#

Manifest

timestamp#

string

Returns#

string | undefined


isOutside()#

isOutside(pressed, editing): boolean

Defined in: arranger/src/selectionRules.ts:236

Whether pressed lies outside the edited element: the empty pane (which a faded block, taking no pointer, lets a press through to), or a part of a block where a press selects nothing (pressedIn, the inside test that also fades), so never an offered band. Nothing lies outside on the arranger; the canvas’s own controls (toolbars, handles) lie in no block and are not the pane.

Parameters#

pressed#

Pressed

editing#

Editing | null

Returns#

boolean


openable()#

openable(view, selection, drawingOf, editing): Address | null

Defined in: arranger/src/selectionRules.ts:204

The editor Enter and the inspector’s Edit button open: that of the single selected address, as a double-click on it would, its hit read from its block’s drawing (drawingOf, hitForAddress), never from the DOM, so a block outside the view opens as one in it; a selected band (in its timeline’s editor) opens as a press on it would. null when the selection is not one openable address.

Parameters#

view#

View

selection#

Selection

drawingOf#

(block) => Drawing | undefined

editing#

Editing | null

Returns#

Address | null


openableAt()#

openableAt(view, pressed, editing): Address | null

Defined in: arranger/src/selectionRules.ts:173

The editor target a double-click or a double tap on pressed opens (editorTargetOf): null off every block, outside the edited element and on the edited element itself. A pointer gives its drawing point, so that the band under it (bandUnder) opens its timeline’s editor, a root’s flow control band the root’s flow-control editor, and text or a region the last drawn card or frame under it, the innermost where none overlap.

Parameters#

view#

View

pressed#

Pressed

editing#

Editing | null

Returns#

Address | null


ownerOf()#

ownerOf(manifest, element): Owner | null

Defined in: arranger/src/selectionRules.ts:118

What element of manifest draws part of (core’s resolveElement, a part read up to its owner): a named timestamp’s own address {id} for its wedge, its labels and its line; the address of the MatchStamp holding an alignment anchor for the anchor’s line and its name label; null for any other element. A press on a match timestamp’s line selects its MatchStamp (holdingMatchStamp), a press on anything else its owner.

Parameters#

manifest#

Manifest

element#

ElementAddress

Returns#

Owner | null


pressedIn()#

pressedIn(pressed, editing): Address | null

Defined in: arranger/src/selectionRules.ts:149

What a press on pressed selects (pressSelection): the card, the frame, the band or the element it hit, a named timestamp for any of its parts but a match timestamp’s line, and a named MatchStamp for that line and for any alignment anchor’s line or label (ownerOf), the gap of an elision for itself, its ellipses and its labels (gapOf: {id: E} stored, {id: T, part: ["elision"]} default), a timestamp for its affordance, whose source carries the timestamp’s own address, or the block where it hit the block itself; null off every block and outside the edited element, where a press changes nothing. A band is hit only with a drawing point: a key selects none.

Parameters#

pressed#

Pressed

editing#

Editing | null

Returns#

Address | null


resizableOf()#

resizableOf(selection, nodes, editing, level): Resizable | undefined

Defined in: arranger/src/selectionRules.ts:308

What the resize toolbar acts on: the single selected box level resizes (resizes), the block itself, a group’s frame or a card (for the cards of a member of several groups the one in the frame worked in, workedBox, and none where no frame is); on the arranger any of them, in an editor one inside the edited element, the edited element’s own box included where the level resizes it.

Parameters#

selection#

Selection

nodes#

ReadonlyMap<string, BlockNode>

editing#

Editing | null

level#

Level

Returns#

Resizable | undefined