@cratis/event-models 0.380.4 → 0.381.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Board/EventModelBoard.d.ts +1 -0
- package/dist/Board/HostedEventModelBoard.d.ts +1 -0
- package/dist/StickyNotes/StickyNotes.d.ts +2 -0
- package/dist/StickyNotes/index.d.ts +1 -0
- package/dist/StickyNotes/noteAnchoring.d.ts +26 -0
- package/dist/StickyNotes/readColumnAnchors.d.ts +7 -0
- package/dist/index.js +4641 -4562
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@ export interface EventModelBoardProps {
|
|
|
22
22
|
handle?: Ref<EventModelBoardHandle>;
|
|
23
23
|
sliceLinks?: readonly SliceLink[];
|
|
24
24
|
screens?: BoardScreens;
|
|
25
|
+
anchorNotes?: boolean;
|
|
25
26
|
}
|
|
26
27
|
export declare const leftToolbarInset = 72;
|
|
27
28
|
export declare const EventModelBoard: ({ showLogo, showViewOptions, toolbar, toolbarPlacement, handle, editor, readOnly, document, ...props }: EventModelBoardProps) => import("react").JSX.Element;
|
|
@@ -24,5 +24,6 @@ export interface HostedEventModelBoardProps<T extends BoardCollection> {
|
|
|
24
24
|
initialFocus?: BoardFocus;
|
|
25
25
|
handle?: Ref<EventModelBoardHandle>;
|
|
26
26
|
sliceLinks?: readonly SliceLink[];
|
|
27
|
+
anchorNotes?: boolean;
|
|
27
28
|
}
|
|
28
29
|
export declare const HostedEventModelBoard: <T extends BoardCollection>({ id, readOnly, showMinimap, showLogo, showViewOptions, toolbar, editor, ...props }: HostedEventModelBoardProps<T>) => import("react").JSX.Element;
|
|
@@ -4,5 +4,7 @@ import type { StickyNoteHandle } from './StickyNoteHandle';
|
|
|
4
4
|
export interface StickyNotesProps {
|
|
5
5
|
notes: readonly StickyNote[];
|
|
6
6
|
boardRoot?: RefObject<HTMLElement | null>;
|
|
7
|
+
anchorToColumns?: boolean;
|
|
8
|
+
getZoom?: () => number;
|
|
7
9
|
}
|
|
8
10
|
export declare const StickyNotes: import("react").ForwardRefExoticComponent<StickyNotesProps & import("react").RefAttributes<StickyNoteHandle>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { StickyNote } from '../Model';
|
|
2
|
+
/** A named thing on the board and the column of the board it stands in, in world units. */
|
|
3
|
+
export interface NoteAnchor {
|
|
4
|
+
name: string;
|
|
5
|
+
x: number;
|
|
6
|
+
width: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The anchor a note is about: the first one (from the left) whose name the note's text says as a whole word, with the case the card has. A note that names nothing on the board is about the board
|
|
10
|
+
* as a whole, and has no anchor.
|
|
11
|
+
*/
|
|
12
|
+
export declare const anchorOf: (text: string, anchors: readonly NoteAnchor[]) => NoteAnchor | undefined;
|
|
13
|
+
export interface NoteAnchoring {
|
|
14
|
+
anchors: readonly NoteAnchor[];
|
|
15
|
+
/** The note must lie wholly above this world height (the top of the board's content) to be moved: a note a person put on the content is where they want it. */
|
|
16
|
+
above: number;
|
|
17
|
+
/** The notes a person moved in this session: they stay where they were put. */
|
|
18
|
+
keep?: ReadonlySet<string>;
|
|
19
|
+
}
|
|
20
|
+
/** Whether two readings of the page say the same: the board is read again on every change, and only a different reading is a reason to draw the notes again. */
|
|
21
|
+
export declare const sameAnchoring: (first: NoteAnchoring | undefined, second: NoteAnchoring | undefined) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The notes as they are drawn: a note parked above the board that names something on it is moved to stand over the column of what it names, so it is read beside what it explains. Notes that
|
|
24
|
+
* collide after the move are set side by side, left to right. Nothing is written: a note's stored position is not changed, and the same notes with no anchors are drawn where they are.
|
|
25
|
+
*/
|
|
26
|
+
export declare const anchoredNotes: (notes: readonly StickyNote[], { anchors, above, keep }: NoteAnchoring) => StickyNote[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StickyNote } from '../Model';
|
|
2
|
+
import type { NoteAnchoring } from './noteAnchoring';
|
|
3
|
+
/**
|
|
4
|
+
* What the page says about where the board's columns are, in world units: each slice column with the names in it (the slice's own header and its cards), and the top of the content. The notes'
|
|
5
|
+
* wrapper takes no part in layout, so the origin of the world is found from a note that is drawn (the browser says where it is, the note says where it thinks it is). Nothing when no note is drawn.
|
|
6
|
+
*/
|
|
7
|
+
export declare const readColumnAnchors: (root: HTMLElement, notes: HTMLElement | null, shown: readonly StickyNote[], zoom: number) => NoteAnchoring | undefined;
|