microboard-temp 0.13.42 → 0.13.44
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/cjs/browser.js +284 -200
- package/dist/cjs/index.js +284 -200
- package/dist/cjs/node.js +284 -200
- package/dist/esm/browser.js +287 -203
- package/dist/esm/index.js +287 -203
- package/dist/esm/node.js +287 -203
- package/dist/types/Events/Log/EventsLog.d.ts +2 -2
- package/dist/types/Events/Log/deserializeAndApplyToList.d.ts +2 -2
- package/dist/types/Events/MessageRouter/boardMessageInterface.d.ts +57 -3
- package/dist/types/Events/MessageRouter/handleAiChatMassage.d.ts +1 -5
- package/dist/types/Events/MessageRouter/handleBoardEventMessage.d.ts +1 -8
- package/dist/types/Events/MessageRouter/handleConfirmation.d.ts +1 -6
- package/dist/types/Events/MessageRouter/handleCreateSnapshotRequestMessage.d.ts +2 -5
- package/dist/types/Events/MessageRouter/handleModeMessage.d.ts +1 -5
- package/dist/types/Events/MessageRouter/handlePresenceEventMessage.d.ts +1 -1
- package/dist/types/Events/MessageRouter/index.d.ts +0 -5
- package/dist/types/Items/AINode/AINode.d.ts +1 -1
- package/dist/types/Items/Audio/Audio.d.ts +1 -1
- package/dist/types/Items/BaseItem/BaseItem.d.ts +2 -2
- package/dist/types/Items/Comment/Comment.d.ts +1 -1
- package/dist/types/Items/Connector/Connector.d.ts +1 -1
- package/dist/types/Items/Drawing/Drawing.d.ts +1 -1
- package/dist/types/Items/Examples/CardGame/Card/Card.d.ts +1 -1
- package/dist/types/Items/Examples/CardGame/Deck/Deck.d.ts +1 -1
- package/dist/types/Items/Examples/CardGame/Dice/Dice.d.ts +1 -1
- package/dist/types/Items/Examples/CardGame/Screen/Screen.d.ts +1 -1
- package/dist/types/Items/Examples/Counter/Counter.d.ts +1 -1
- package/dist/types/Items/Examples/Star/Star.d.ts +1 -1
- package/dist/types/Items/Frame/Frame.d.ts +1 -1
- package/dist/types/Items/Group/Group.d.ts +2 -2
- package/dist/types/Items/Image/Image.d.ts +1 -1
- package/dist/types/Items/Placeholder/Placeholder.d.ts +1 -1
- package/dist/types/Items/RegisterItem.d.ts +2 -2
- package/dist/types/Items/RichText/CanvasText/index.d.ts +2 -0
- package/dist/types/Items/RichText/EditorContainer.d.ts +3 -2
- package/dist/types/Items/RichText/RichText.d.ts +1 -1
- package/dist/types/Items/RichText/RichTextData.d.ts +1 -1
- package/dist/types/Items/RichText/editorHelpers/selectionOps/setSelectionFontColor.d.ts +2 -1
- package/dist/types/Items/Shape/Shape.d.ts +1 -1
- package/dist/types/Items/Sticker/Sticker.d.ts +1 -1
- package/dist/types/Items/Video/Video.d.ts +1 -1
- package/dist/types/Presence/Events.d.ts +1 -20
- package/dist/types/Presence/Presence.d.ts +2 -1
- package/dist/types/Selection/Selection.d.ts +1 -1
- package/dist/types/Selection/SelectionItems.d.ts +1 -0
- package/dist/types/Settings.d.ts +7 -7
- package/dist/types/SpatialIndex/LayeredIndex/index.d.ts +12 -8
- package/dist/types/SpatialIndex/RTreeIndex/index.d.ts +12 -7
- package/dist/types/SpatialIndex/SimpleSpatialIndex.d.ts +24 -8
- package/dist/types/SpatialIndex/SpacialIndex.d.ts +81 -9
- package/dist/types/Tools/CustomTool.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Board, BoardSnapshot } from '../../Board';
|
|
2
|
-
import { BoardEvent, BoardEventPack, SyncBoardEvent, SyncEvent } from '../Events';
|
|
2
|
+
import { BoardEvent, BoardEventPack, SyncBoardEvent, SyncBoardEventPack, SyncEvent } from '../Events';
|
|
3
3
|
import { Operation } from '../EventsOperations';
|
|
4
4
|
import { EventsList } from './createEventsList';
|
|
5
5
|
import { Command } from '../Command';
|
|
@@ -20,7 +20,7 @@ export declare class EventsLog {
|
|
|
20
20
|
private board;
|
|
21
21
|
currentSequenceNumber: number;
|
|
22
22
|
pendingEvent: {
|
|
23
|
-
event:
|
|
23
|
+
event: SyncBoardEventPack;
|
|
24
24
|
sequenceNumber: number;
|
|
25
25
|
lastSentTime: number;
|
|
26
26
|
} | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Board } from "../../Board";
|
|
2
|
-
import {
|
|
2
|
+
import { SyncEvent } from "../Events";
|
|
3
3
|
import { EventsList } from "./createEventsList";
|
|
4
|
-
export declare function deserializeAndApplyToList(events:
|
|
4
|
+
export declare function deserializeAndApplyToList(events: SyncEvent[], list: EventsList, board: Board): void;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SyncBoardEventPack } from "../Events";
|
|
1
|
+
import { BoardSnapshot } from "../../Board";
|
|
2
|
+
import { SyncBoardEventPack, SyncEvent } from "../Events";
|
|
3
|
+
import { PresenceEventType, PresenceUser } from "../../Presence/Events";
|
|
4
|
+
import { AiChatEventType } from "./handleAiChatMassage";
|
|
3
5
|
export interface AuthMsg {
|
|
4
6
|
type: "Auth";
|
|
5
7
|
jwt: string;
|
|
@@ -57,5 +59,57 @@ export interface BoardSubscriptionCompletedMsg {
|
|
|
57
59
|
eventsSinceLastSnapshot: SyncBoardEventPack[];
|
|
58
60
|
initialSequenceNumber: number;
|
|
59
61
|
}
|
|
60
|
-
export
|
|
62
|
+
export interface BoardSnapshotMsg {
|
|
63
|
+
type: "BoardSnapshot";
|
|
64
|
+
boardId: string;
|
|
65
|
+
snapshot: string;
|
|
66
|
+
lastEventOrder: number;
|
|
67
|
+
}
|
|
68
|
+
export interface AiChatMsg<T = AiChatEventType> {
|
|
69
|
+
type: 'AiChat';
|
|
70
|
+
boardId: string;
|
|
71
|
+
event: T;
|
|
72
|
+
}
|
|
73
|
+
export interface BoardEventMsg {
|
|
74
|
+
type: "BoardEvent";
|
|
75
|
+
boardId: string;
|
|
76
|
+
event: SyncEvent;
|
|
77
|
+
sequenceNumber: number;
|
|
78
|
+
userId: string;
|
|
79
|
+
}
|
|
80
|
+
export interface ConfirmationMsg {
|
|
81
|
+
type: 'Confirmation';
|
|
82
|
+
boardId: string;
|
|
83
|
+
sequenceNumber: number;
|
|
84
|
+
order: number;
|
|
85
|
+
}
|
|
86
|
+
export interface ModeMsg {
|
|
87
|
+
type: 'Mode';
|
|
88
|
+
boardId: string;
|
|
89
|
+
mode: 'view' | 'edit';
|
|
90
|
+
}
|
|
91
|
+
export interface SnapshotRequestMsg {
|
|
92
|
+
type: 'CreateSnapshotRequest';
|
|
93
|
+
boardId: string;
|
|
94
|
+
}
|
|
95
|
+
export interface UserJoinMsg {
|
|
96
|
+
type: "UserJoin";
|
|
97
|
+
timestamp: number;
|
|
98
|
+
userId: number;
|
|
99
|
+
boardId: string;
|
|
100
|
+
snapshots: Record<string, PresenceUser>;
|
|
101
|
+
}
|
|
102
|
+
export interface PresenceEventMsg<T = PresenceEventType> {
|
|
103
|
+
type: "PresenceEvent";
|
|
104
|
+
boardId: string;
|
|
105
|
+
event: T;
|
|
106
|
+
userId: string;
|
|
107
|
+
softId: string | null;
|
|
108
|
+
hardId: string | null;
|
|
109
|
+
messageId: string;
|
|
110
|
+
nickname: string;
|
|
111
|
+
color: string | null;
|
|
112
|
+
avatar: string | null;
|
|
113
|
+
}
|
|
114
|
+
export type EventsMsg = ModeMsg | BoardEventMsg | SnapshotRequestMsg | ConfirmationMsg | BoardSubscriptionCompletedMsg | UserJoinMsg | PresenceEventMsg | AiChatMsg | BoardSnapshotMsg;
|
|
61
115
|
export type SocketMsg = EventsMsg | AuthMsg | AuthConfirmationMsg | LogoutMsg | GetModeMsg | InvalidateRightsMsg | UserJoinMsg | SubscribeMsg | UnsubscribeMsg | VersionCheckMsg | ErrorMsg | ModeMsg | PingMsg | AiChatMsg | BoardAccessDeniedMsg;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { Board } from '../../Board';
|
|
2
|
-
|
|
3
|
-
type: 'AiChat';
|
|
4
|
-
boardId: string;
|
|
5
|
-
event: T;
|
|
6
|
-
}
|
|
2
|
+
import { AiChatMsg } from './boardMessageInterface';
|
|
7
3
|
export type AiChatEventType = UserRequest | ChatChunk | StopGeneration | GenerateImageRequest | GenerateImageResponse | GenerateAudioRequest;
|
|
8
4
|
export type OpenAIModels = 'gpt-3.5-turbo' | 'gpt-4' | 'gpt-4o' | 'GPT-4o' | 'gpt-4o-mini' | 'GPT-4o mini' | 'gpt-4-32k' | 'gpt-3.5-turbo-0613' | 'gpt-4-0613' | 'gpt-3.5-turbo-16k' | 'gpt-4-16k' | 'o1-mini' | 'o1' | ImageModels | CustomModels | TextToSpeechModels;
|
|
9
5
|
type ImageModels = 'dall-e-2' | 'dall-e-3' | 'midjourney' | 'flux-schnell' | 'flux-pro' | 'recraft';
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import { Board } from "../../Board";
|
|
2
|
-
import {
|
|
3
|
-
export interface BoardEventMsg {
|
|
4
|
-
type: "BoardEvent";
|
|
5
|
-
boardId: string;
|
|
6
|
-
event: SyncEvent;
|
|
7
|
-
sequenceNumber: number;
|
|
8
|
-
userId: string;
|
|
9
|
-
}
|
|
2
|
+
import { BoardEventMsg } from './boardMessageInterface';
|
|
10
3
|
export declare function handleBoardEventMessage(message: BoardEventMsg, board: Board): void;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { Board } from '../../Board';
|
|
2
|
-
|
|
3
|
-
type: 'Confirmation';
|
|
4
|
-
boardId: string;
|
|
5
|
-
sequenceNumber: number;
|
|
6
|
-
order: number;
|
|
7
|
-
}
|
|
2
|
+
import { ConfirmationMsg } from './boardMessageInterface';
|
|
8
3
|
export declare function handleConfirmation(msg: ConfirmationMsg, board: Board): void;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { Board } from '../../Board';
|
|
2
|
-
|
|
3
|
-
type: 'CreateSnapshotRequest';
|
|
4
|
-
boardId: string;
|
|
5
|
-
}
|
|
2
|
+
import { SnapshotRequestMsg } from './boardMessageInterface';
|
|
6
3
|
export type SnapshotToPublish = {
|
|
7
4
|
boardId: string;
|
|
8
5
|
snapshot: string;
|
|
9
6
|
lastOrder: number;
|
|
10
7
|
};
|
|
11
|
-
export declare function handleCreateSnapshotRequestMessage(msg:
|
|
8
|
+
export declare function handleCreateSnapshotRequestMessage(msg: SnapshotRequestMsg, board: Board): void;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { Board } from "../../Board";
|
|
2
|
+
import { ModeMsg } from './boardMessageInterface';
|
|
2
3
|
export type ViewMode = "view" | "edit" | "loading";
|
|
3
|
-
export interface ModeMsg {
|
|
4
|
-
type: "Mode";
|
|
5
|
-
boardId: string;
|
|
6
|
-
mode: ViewMode;
|
|
7
|
-
}
|
|
8
4
|
export declare function handleModeMessage(message: ModeMsg, board: Board): void;
|
|
9
5
|
type PanelType = "titlePanel" | "userPanel";
|
|
10
6
|
/** Tries to find panel in search param, returns default value if not found */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Board } from '../../Board';
|
|
2
|
-
import { PresenceEventMsg, UserJoinMsg } from '
|
|
2
|
+
import { PresenceEventMsg, UserJoinMsg } from './boardMessageInterface';
|
|
3
3
|
export declare function handlePresenceEventMessage(message: PresenceEventMsg, board: Board): void;
|
|
4
4
|
export declare function handleUserJoinMessage(message: UserJoinMsg, board: Board): void;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
export { messageRouter } from "./messageRouter";
|
|
2
|
-
export type { AiChatMsg } from "./handleAiChatMassage";
|
|
3
|
-
export type { BoardEventMsg } from "./handleBoardEventMessage";
|
|
4
|
-
export type { ConfirmationMsg } from "./handleConfirmation";
|
|
5
|
-
export type { SnapshotRequestMsg } from "./handleCreateSnapshotRequestMessage";
|
|
6
|
-
export type { ModeMsg } from "./handleModeMessage";
|
|
7
2
|
export * from "./boardMessageInterface";
|
|
@@ -17,7 +17,7 @@ import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
|
17
17
|
export declare const CONTEXT_NODE_HIGHLIGHT_COLOR = "rgba(183, 138, 240, 1)";
|
|
18
18
|
export declare const threadDirections: readonly [0, 1, 2, 3];
|
|
19
19
|
export type ThreadDirection = typeof threadDirections[number];
|
|
20
|
-
export declare class AINode extends BaseItem {
|
|
20
|
+
export declare class AINode extends BaseItem<AINode> {
|
|
21
21
|
readonly itemType = "AINode";
|
|
22
22
|
parent: string;
|
|
23
23
|
readonly transformation: Transformation;
|
|
@@ -16,7 +16,7 @@ export interface AudioItemData {
|
|
|
16
16
|
extension?: string;
|
|
17
17
|
[key: string]: unknown;
|
|
18
18
|
}
|
|
19
|
-
export declare class AudioItem extends BaseItem {
|
|
19
|
+
export declare class AudioItem extends BaseItem<AudioItem> {
|
|
20
20
|
private events?;
|
|
21
21
|
private extension?;
|
|
22
22
|
readonly itemType = "Audio";
|
|
@@ -27,7 +27,7 @@ export type SerializedItemData<T extends BaseItemData = BaseItemData> = T & {
|
|
|
27
27
|
id: string;
|
|
28
28
|
transformation: TransformationData;
|
|
29
29
|
};
|
|
30
|
-
export declare class BaseItem extends Mbr implements Geometry {
|
|
30
|
+
export declare class BaseItem<T extends BaseItem<any> = any> extends Mbr implements Geometry {
|
|
31
31
|
private defaultItemData?;
|
|
32
32
|
static createCommand?: (board: Board, operation: Operation) => Command;
|
|
33
33
|
readonly transformation: Transformation;
|
|
@@ -38,7 +38,7 @@ export declare class BaseItem extends Mbr implements Geometry {
|
|
|
38
38
|
readonly index: SimpleSpatialIndex | null;
|
|
39
39
|
board: Board;
|
|
40
40
|
id: string;
|
|
41
|
-
subject: Subject<
|
|
41
|
+
subject: Subject<T>;
|
|
42
42
|
onRemoveCallbacks: (() => void)[];
|
|
43
43
|
shouldUseCustomRender: boolean;
|
|
44
44
|
shouldRenderOutsideViewRect: boolean;
|
|
@@ -27,7 +27,7 @@ export declare const TEXT_BORDER_PADDING = 0;
|
|
|
27
27
|
export declare const CONNECTOR_ANCHOR_COLOR: ConnectorAnchorColors;
|
|
28
28
|
export declare const CONNECTOR_ANCHOR_TYPE = "rect";
|
|
29
29
|
export declare const CONNECTOR_LINE_CAP = "round";
|
|
30
|
-
export declare class Connector extends BaseItem {
|
|
30
|
+
export declare class Connector extends BaseItem<Connector> {
|
|
31
31
|
private startPoint;
|
|
32
32
|
private endPoint;
|
|
33
33
|
private lineStyle;
|
|
@@ -27,7 +27,7 @@ export interface DrawingData {
|
|
|
27
27
|
linkTo?: string;
|
|
28
28
|
[key: string]: unknown;
|
|
29
29
|
}
|
|
30
|
-
export declare class Drawing extends BaseItem {
|
|
30
|
+
export declare class Drawing extends BaseItem<Drawing> {
|
|
31
31
|
points: Point[];
|
|
32
32
|
private events?;
|
|
33
33
|
readonly itemType = "Drawing";
|
|
@@ -16,7 +16,7 @@ export interface CardData extends BaseItemData {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
export declare const defaultCardData: CardData;
|
|
19
|
-
export declare class Card extends BaseItem {
|
|
19
|
+
export declare class Card extends BaseItem<Card> {
|
|
20
20
|
readonly subject: Subject<Card>;
|
|
21
21
|
private faceUrl;
|
|
22
22
|
private backsideUrl;
|
|
@@ -7,7 +7,7 @@ import { DeckOperation } from "../../../Examples/CardGame/Deck/DeckOperation";
|
|
|
7
7
|
import { Path } from "../../../Path";
|
|
8
8
|
import { DocumentFactory } from "../../../../api/DocumentFactory";
|
|
9
9
|
export declare const defaultDeckData: BaseItemData;
|
|
10
|
-
export declare class Deck extends BaseItem {
|
|
10
|
+
export declare class Deck extends BaseItem<Deck> {
|
|
11
11
|
readonly subject: Subject<Deck>;
|
|
12
12
|
shouldUseCustomRender: boolean;
|
|
13
13
|
private cachedCanvas;
|
|
@@ -12,7 +12,7 @@ export interface DiceData extends BaseItemData {
|
|
|
12
12
|
values?: (number | string)[];
|
|
13
13
|
}
|
|
14
14
|
export declare const defaultDiceData: DiceData;
|
|
15
|
-
export declare class Dice extends BaseItem {
|
|
15
|
+
export declare class Dice extends BaseItem<Dice> {
|
|
16
16
|
readonly itemType = "Dice";
|
|
17
17
|
private type;
|
|
18
18
|
private path;
|
|
@@ -10,7 +10,7 @@ export interface ScreenData extends BaseItemData {
|
|
|
10
10
|
backgroundUrl?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare const defaultScreenData: ScreenData;
|
|
13
|
-
export declare class Screen extends BaseItem {
|
|
13
|
+
export declare class Screen extends BaseItem<Screen> {
|
|
14
14
|
readonly subject: Subject<Screen>;
|
|
15
15
|
private path;
|
|
16
16
|
private borderWidth;
|
|
@@ -11,7 +11,7 @@ export declare const COUNTER_DIMENSIONS: {
|
|
|
11
11
|
width: number;
|
|
12
12
|
height: number;
|
|
13
13
|
};
|
|
14
|
-
export declare class Counter extends BaseItem {
|
|
14
|
+
export declare class Counter extends BaseItem<Counter> {
|
|
15
15
|
private count;
|
|
16
16
|
readonly subject: Subject<Counter>;
|
|
17
17
|
shouldUseCustomRender: boolean;
|
|
@@ -19,7 +19,7 @@ export interface StarData {
|
|
|
19
19
|
linkTo?: string;
|
|
20
20
|
}
|
|
21
21
|
export declare const defaultStarData: BaseItemData;
|
|
22
|
-
export declare class Star extends BaseItem {
|
|
22
|
+
export declare class Star extends BaseItem<Star> {
|
|
23
23
|
readonly itemType = "Star";
|
|
24
24
|
private path;
|
|
25
25
|
readonly subject: Subject<Star>;
|
|
@@ -22,7 +22,7 @@ import { DocumentFactory } from "../../api/DocumentFactory";
|
|
|
22
22
|
import { ResizeType } from "../../Selection/Transformer/TransformerHelpers/getResizeType";
|
|
23
23
|
import { BaseItem } from "../BaseItem";
|
|
24
24
|
import { ColorValue } from "../../..";
|
|
25
|
-
export declare class Frame extends BaseItem {
|
|
25
|
+
export declare class Frame extends BaseItem<Frame> {
|
|
26
26
|
private getItemById;
|
|
27
27
|
private name;
|
|
28
28
|
private shapeType;
|
|
@@ -17,9 +17,9 @@ export interface GroupData {
|
|
|
17
17
|
childIds: string[];
|
|
18
18
|
transformation: TransformationData;
|
|
19
19
|
isLockedGroup?: boolean;
|
|
20
|
-
[key: string]:
|
|
20
|
+
[key: string]: unknown;
|
|
21
21
|
}
|
|
22
|
-
export declare class Group extends BaseItem {
|
|
22
|
+
export declare class Group extends BaseItem<Group> {
|
|
23
23
|
private events?;
|
|
24
24
|
readonly linkTo: LinkTo;
|
|
25
25
|
readonly itemType = "Group";
|
|
@@ -29,7 +29,7 @@ export interface ImageConstructorData {
|
|
|
29
29
|
storageLink: string;
|
|
30
30
|
imageDimension: Dimension;
|
|
31
31
|
}
|
|
32
|
-
export declare class ImageItem extends BaseItem {
|
|
32
|
+
export declare class ImageItem extends BaseItem<ImageItem> {
|
|
33
33
|
private events?;
|
|
34
34
|
readonly itemType = "Image";
|
|
35
35
|
parent: string;
|
|
@@ -25,7 +25,7 @@ export interface PlaceholderData {
|
|
|
25
25
|
miroData?: unknown;
|
|
26
26
|
[key: string]: unknown;
|
|
27
27
|
}
|
|
28
|
-
export declare class Placeholder extends BaseItem {
|
|
28
|
+
export declare class Placeholder extends BaseItem<Placeholder> {
|
|
29
29
|
private events?;
|
|
30
30
|
private miroData?;
|
|
31
31
|
backgroundColor: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Board } from "../Board";
|
|
2
2
|
import { CustomTool } from "../Tools/CustomTool";
|
|
3
|
-
import {
|
|
4
|
-
type ItemConstructor = new (board: Board, id: string, defaultData: BaseItemData) =>
|
|
3
|
+
import { BaseItemData } from "./BaseItem/BaseItem";
|
|
4
|
+
type ItemConstructor = new (board: Board, id: string, defaultData: BaseItemData) => any;
|
|
5
5
|
type RegisterItemArgs = {
|
|
6
6
|
item: ItemConstructor;
|
|
7
7
|
defaultData: BaseItemData;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { DefaultTextStyles } from "../../Settings";
|
|
2
2
|
import { Subject } from "../../Subject";
|
|
3
|
-
import { BaseSelection, Descendant,
|
|
3
|
+
import { BaseSelection, Descendant, Operation as SlateOp, Operation } from "slate";
|
|
4
4
|
import { HorisontalAlignment, VerticalAlignment } from "../Alignment";
|
|
5
5
|
import { BlockNode, ListType, ParagraphNode } from "./Editor/BlockNode";
|
|
6
6
|
import { TextNode, TextStyle } from "./Editor/TextNode";
|
|
7
7
|
import { ColorValue } from '../../..';
|
|
8
8
|
import { RichTextOperation } from "./RichTextOperations";
|
|
9
9
|
import { MarkdownProcessor } from "../RichText/editorHelpers/markdown/markdownProcessor";
|
|
10
|
+
import { CustomEditor } from "Items/RichText/Editor/Editor.d";
|
|
10
11
|
export declare class EditorContainer {
|
|
11
12
|
private id;
|
|
12
13
|
private emit;
|
|
@@ -23,7 +24,7 @@ export declare class EditorContainer {
|
|
|
23
24
|
private calcAutoSize;
|
|
24
25
|
private applyAutoSizeScale;
|
|
25
26
|
private updateElement;
|
|
26
|
-
readonly editor:
|
|
27
|
+
readonly editor: CustomEditor;
|
|
27
28
|
maxWidth: number | undefined;
|
|
28
29
|
textScale: number;
|
|
29
30
|
verticalAlignment: VerticalAlignment;
|
|
@@ -28,7 +28,7 @@ export declare function toggleEdit(value: boolean): void;
|
|
|
28
28
|
* A geometric item to render a rich text on a DrawingContext.
|
|
29
29
|
*
|
|
30
30
|
*/
|
|
31
|
-
export declare class RichText extends BaseItem {
|
|
31
|
+
export declare class RichText extends BaseItem<RichText> {
|
|
32
32
|
container: Mbr;
|
|
33
33
|
readonly transformation: Transformation;
|
|
34
34
|
placeholderText: string;
|
|
@@ -14,7 +14,7 @@ export interface RichTextData {
|
|
|
14
14
|
placeholderText: string;
|
|
15
15
|
realSize: 'auto' | number;
|
|
16
16
|
linkTo?: string;
|
|
17
|
-
[key: string]:
|
|
17
|
+
[key: string]: unknown;
|
|
18
18
|
}
|
|
19
19
|
export declare class DefaultRichTextData implements RichTextData {
|
|
20
20
|
children: Descendant[];
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
|
|
2
|
+
import type { ColorValue } from '../../../../..';
|
|
3
|
+
export declare function setSelectionFontColor(editor: Editor, format: string | ColorValue, selectionContext?: string): void;
|
|
@@ -350,7 +350,7 @@ export declare const Shapes: {
|
|
|
350
350
|
useMbrUnderPointer: boolean;
|
|
351
351
|
};
|
|
352
352
|
};
|
|
353
|
-
export declare class Shape extends BaseItem {
|
|
353
|
+
export declare class Shape extends BaseItem<Shape> {
|
|
354
354
|
shapeType: ShapeType;
|
|
355
355
|
backgroundColor: ColorValue;
|
|
356
356
|
backgroundOpacity: number;
|
|
@@ -27,7 +27,7 @@ export declare const StickerShape: {
|
|
|
27
27
|
anchorPoints: Point[];
|
|
28
28
|
DEFAULTS: number[];
|
|
29
29
|
};
|
|
30
|
-
export declare class Sticker extends BaseItem {
|
|
30
|
+
export declare class Sticker extends BaseItem<Sticker> {
|
|
31
31
|
backgroundColor: ColorValue;
|
|
32
32
|
parent: string;
|
|
33
33
|
readonly itemType = "Sticker";
|
|
@@ -29,7 +29,7 @@ export interface VideoConstructorData {
|
|
|
29
29
|
previewUrl?: string;
|
|
30
30
|
}
|
|
31
31
|
export declare const createPlaceholderImage: (width: number, height: number) => HTMLImageElement;
|
|
32
|
-
export declare class VideoItem extends BaseItem {
|
|
32
|
+
export declare class VideoItem extends BaseItem<VideoItem> {
|
|
33
33
|
private events?;
|
|
34
34
|
private extension;
|
|
35
35
|
readonly itemType = "Video";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export type { PresenceUser } from "./Presence";
|
|
2
2
|
export interface PointerMoveEvent {
|
|
3
3
|
method: "PointerMove";
|
|
4
4
|
position: {
|
|
@@ -63,22 +63,3 @@ export interface FollowEvent {
|
|
|
63
63
|
export interface PresenceUserSnapshot {
|
|
64
64
|
}
|
|
65
65
|
export type PresenceEventType = PointerMoveEvent | SelectionEvent | SetUserColorEvent | DrawSelectEvent | CancelDrawSelectEvent | CameraEvent | PresencePingEvent | BringToMeEvent | StopFollowingEvent | FollowEvent;
|
|
66
|
-
export interface UserJoinMsg {
|
|
67
|
-
type: "UserJoin";
|
|
68
|
-
timestamp: number;
|
|
69
|
-
userId: number;
|
|
70
|
-
boardId: string;
|
|
71
|
-
snapshots: Record<string, PresenceUser>;
|
|
72
|
-
}
|
|
73
|
-
export interface PresenceEventMsg<T = PresenceEventType> {
|
|
74
|
-
type: "PresenceEvent";
|
|
75
|
-
boardId: string;
|
|
76
|
-
event: T;
|
|
77
|
-
userId: string;
|
|
78
|
-
softId: string | null;
|
|
79
|
-
hardId: string | null;
|
|
80
|
-
messageId: string;
|
|
81
|
-
nickname: string;
|
|
82
|
-
color: string | null;
|
|
83
|
-
avatar: string | null;
|
|
84
|
-
}
|
|
@@ -3,7 +3,8 @@ import { Events } from '../Events';
|
|
|
3
3
|
import { Item } from '../Items';
|
|
4
4
|
import { DrawingContext } from '../Items/DrawingContext';
|
|
5
5
|
import { Subject } from '../Subject';
|
|
6
|
-
import { PresenceEventType,
|
|
6
|
+
import { PresenceEventType, PointerMoveEvent, SelectionEvent, SetUserColorEvent, DrawSelectEvent, CancelDrawSelectEvent, CameraEvent, PresencePingEvent, BringToMeEvent, StopFollowingEvent, FollowEvent } from './Events';
|
|
7
|
+
import { PresenceEventMsg, UserJoinMsg } from '../Events/MessageRouter/boardMessageInterface';
|
|
7
8
|
export declare const PRESENCE_CURSOR_THROTTLE: number;
|
|
8
9
|
export declare const CURSORS_ANIMATION_DURATION: number;
|
|
9
10
|
export declare const PRESENCE_CLEANUP_USER_TIMER = 180000;
|
|
@@ -62,7 +62,7 @@ export declare class BoardSelection {
|
|
|
62
62
|
private emitApplied;
|
|
63
63
|
private emitCommand;
|
|
64
64
|
updateQueue: Set<() => void>;
|
|
65
|
-
decorateObserverToScheduleUpdate<T extends (...args:
|
|
65
|
+
decorateObserverToScheduleUpdate<T extends (...args: never[]) => void>(observer: T): T;
|
|
66
66
|
updateScheduledObservers: () => void;
|
|
67
67
|
private itemObserver;
|
|
68
68
|
decoratedItemObserver: (item: Item) => void;
|
package/dist/types/Settings.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { Theme, ColorValue } from "./Color/ColorValue";
|
|
|
10
10
|
export type { Theme, ColorValue };
|
|
11
11
|
import type { PresenceEventType } from "./Presence/Events";
|
|
12
12
|
import type { SocketMsg } from "./Events/MessageRouter/boardMessageInterface";
|
|
13
|
-
import type { Editor } from "slate";
|
|
13
|
+
import type { Editor, BasePoint } from "slate";
|
|
14
14
|
export interface Connection {
|
|
15
15
|
connectionId: number;
|
|
16
16
|
getCurrentUser: () => string;
|
|
@@ -28,8 +28,8 @@ export interface Connection {
|
|
|
28
28
|
send: (msg: SocketMsg) => void;
|
|
29
29
|
}
|
|
30
30
|
export interface I18NextInterface {
|
|
31
|
-
t: (key: string, options?: Record<string,
|
|
32
|
-
changeLanguage: (lng: string, callback?: (err:
|
|
31
|
+
t: (key: string, options?: Record<string, unknown>) => string;
|
|
32
|
+
changeLanguage: (lng: string, callback?: (err: Error | null, t: TFunction) => void) => Promise<TFunction>;
|
|
33
33
|
}
|
|
34
34
|
export interface NotifyFunction {
|
|
35
35
|
(options: {
|
|
@@ -116,7 +116,7 @@ type GetDOMParser = () => {
|
|
|
116
116
|
parseFromString: (str: string, type: DOMParserSupportedType) => Document;
|
|
117
117
|
};
|
|
118
118
|
type ReactEditorFocus = (editor: Editor) => void;
|
|
119
|
-
type ReactEditorToSlatePoint = (editor: Editor, domNode: Node, offset: number, options
|
|
119
|
+
type ReactEditorToSlatePoint = (editor: Editor, domNode: Node, offset: number, options?: Record<string, unknown>) => BasePoint | null;
|
|
120
120
|
/**
|
|
121
121
|
* Set properties before using the board.
|
|
122
122
|
* @property {Path2DFactory} - The factory for creating Path2D objects.
|
|
@@ -130,9 +130,9 @@ export declare const conf: {
|
|
|
130
130
|
measureCtx: CanvasRenderingContext2D;
|
|
131
131
|
i18n: import("i18next").i18n;
|
|
132
132
|
hooks: {
|
|
133
|
-
beforeMediaUpload: (...args:
|
|
134
|
-
beforeMediaRemove: (...args:
|
|
135
|
-
onUploadMediaError: (...args:
|
|
133
|
+
beforeMediaUpload: (...args: unknown[]) => Promise<boolean>;
|
|
134
|
+
beforeMediaRemove: (...args: unknown[]) => Promise<boolean>;
|
|
135
|
+
onUploadMediaError: (...args: unknown[]) => Promise<boolean>;
|
|
136
136
|
};
|
|
137
137
|
getAccessToken: GetAccessTokenFunction;
|
|
138
138
|
openModal: OpenModalFunction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mbr } from '../../Items/Mbr/Mbr';
|
|
2
2
|
import type { Point } from '../../Items/Point/Point';
|
|
3
|
-
import type { Item } from '../../Items/Item';
|
|
3
|
+
import type { Item, ItemDataWithId } from '../../Items/Item';
|
|
4
4
|
import { Layers } from './Layers';
|
|
5
5
|
import { RTreeIndex } from '../RTreeIndex';
|
|
6
6
|
export declare class Container {
|
|
@@ -20,13 +20,12 @@ export declare class LayeredIndex<T extends Item> {
|
|
|
20
20
|
layers: Layers<RTreeIndex>;
|
|
21
21
|
constructor(getZIndex: (item: T) => number);
|
|
22
22
|
private isT;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
getRectsEnclosedOrCrossedBy(rect: Mbr): T[];
|
|
23
|
+
listEnclosedBy(rect: Mbr): Item[];
|
|
24
|
+
listEnclosedOrCrossedBy(rect: Mbr): Item[];
|
|
25
|
+
listUnderPoint(point: Point, tolerance?: number): Item[];
|
|
26
|
+
listRectsEnclosedOrCrossedBy(rect: Mbr): T[];
|
|
28
27
|
isAnyEnclosedOrCrossedBy(rect: Mbr): boolean;
|
|
29
|
-
|
|
28
|
+
listNearestTo(point: Point, maxItems: number, filter: (item: Item) => boolean, maxDistance: number): Item[];
|
|
30
29
|
private getContainersFromItems;
|
|
31
30
|
insertContainer(container: Container): void;
|
|
32
31
|
shiftContainerAbove(container: Container, layer: number): void;
|
|
@@ -35,7 +34,12 @@ export declare class LayeredIndex<T extends Item> {
|
|
|
35
34
|
change(item: T): void;
|
|
36
35
|
remove(item: Item): void;
|
|
37
36
|
get(id: string): T | undefined;
|
|
38
|
-
|
|
37
|
+
listAll(): T[];
|
|
38
|
+
getById(id: string): Item | undefined;
|
|
39
|
+
findById(id: string): Item | undefined;
|
|
40
|
+
getByZIndex(index: number): Item;
|
|
41
|
+
getLastZIndex(): number;
|
|
42
|
+
copy(): ItemDataWithId[];
|
|
39
43
|
batchInsert(items: T[]): void;
|
|
40
44
|
batchChange(items: T[]): void;
|
|
41
45
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import RBush, { BBox } from 'rbush';
|
|
2
2
|
import { Point, Mbr } from '../../Items';
|
|
3
|
-
import { Item } from '../../Items';
|
|
3
|
+
import type { Item, ItemDataWithId } from '../../Items/Item';
|
|
4
4
|
import { Container } from '../LayeredIndex';
|
|
5
5
|
declare class Tree extends RBush<Container> {
|
|
6
6
|
toBBox(container: Container): BBox;
|
|
@@ -14,13 +14,18 @@ export declare class RTreeIndex {
|
|
|
14
14
|
change(container: Container): void;
|
|
15
15
|
get(id: string): Item | undefined;
|
|
16
16
|
remove(id: string): void;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
listAll(): Item[];
|
|
18
|
+
listEnclosedBy(rect: Mbr): Item[];
|
|
19
|
+
listEnclosedOrCrossedBy(rect: Mbr): Item[];
|
|
20
|
+
listUnderPoint(point: Point, tolerance?: number): Item[];
|
|
21
|
+
listRectsEnclosedOrCrossedBy(rect: Mbr): Item[];
|
|
22
22
|
isAnyEnclosedOrCrossedBy(rect: Mbr): boolean;
|
|
23
|
-
|
|
23
|
+
listNearestTo(point: Point, maxItems: number, filter: (item: Item) => boolean, maxDistance: number): Item[];
|
|
24
|
+
getById(id: string): Item | undefined;
|
|
25
|
+
findById(id: string): Item | undefined;
|
|
26
|
+
getByZIndex(index: number): Item;
|
|
27
|
+
getLastZIndex(): number;
|
|
28
|
+
copy(): ItemDataWithId[];
|
|
24
29
|
batchInsert(batch: Container[]): void;
|
|
25
30
|
batchChange(batch: Container[]): void;
|
|
26
31
|
}
|