microboard-temp 0.1.11 → 0.1.13

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.
@@ -1,2 +1,2 @@
1
- import type { HotkeyName } from './types';
1
+ import type { HotkeyName } from "./types";
2
2
  export declare function getHotkeyLabel(hotkey: HotkeyName): string;
@@ -1,5 +1,5 @@
1
- import { SelectionContext } from 'Selection';
2
- import type { HotkeyCb, HotkeyConfig, HotkeyName } from './types';
3
- type HotkeyStatus = 'triggered' | 'canceledBySingleItemOnly' | 'canceledBySelectionContext' | 'canceledByAllItemsType';
1
+ import { SelectionContext } from "Selection";
2
+ import type { HotkeyCb, HotkeyConfig, HotkeyName } from "./types";
3
+ type HotkeyStatus = "triggered" | "canceledBySingleItemOnly" | "canceledBySelectionContext" | "canceledByAllItemsType";
4
4
  export declare function logHotkey(hotkeyConfig: HotkeyCb | HotkeyConfig, hotkeyName: HotkeyName, status: HotkeyStatus, context: SelectionContext): void;
5
5
  export {};
@@ -1,7 +1,8 @@
1
- import { DocumentFactory } from "./api/DocumentFactory";
2
1
  import { Path2DFactory } from "./api/Path2DFactory";
3
2
  import { BoardSnapshot } from "./Board";
3
+ import { BrowserDocumentFactory } from "./api/BrowserDocumentFactory";
4
4
  import { BrowserPath2D } from "./api/BrowserPath2DFactory";
5
+ import { MockDocumentFactory } from "./api/MockDocumentFactory";
5
6
  export interface Connection {
6
7
  connectionId: number;
7
8
  getCurrentUser: () => string;
@@ -117,7 +118,7 @@ type ReactEditorToSlatePoint = (editor: any, domNode: Node, offset: number, opti
117
118
  export declare const conf: {
118
119
  connection: Connection;
119
120
  path2DFactory: typeof BrowserPath2D | typeof MockPath2D;
120
- documentFactory: DocumentFactory;
121
+ documentFactory: BrowserDocumentFactory | MockDocumentFactory;
121
122
  getDOMParser: GetDOMParser;
122
123
  measureCtx: CanvasRenderingContext2D;
123
124
  i18n: I18NextInterface;
@@ -215,20 +216,11 @@ export declare const conf: {
215
216
  LISTMARK_NUMBERS: string[];
216
217
  LISTMARK_LETTERS: string[];
217
218
  LISTMARK_ROMAN: string[];
218
- DEFAULT_TEXT_STYLES: {
219
- fontFamily: string;
220
- fontSize: number;
221
- fontColor: string;
222
- fontHighlight: string;
223
- lineHeight: number;
224
- bold: boolean;
225
- underline: boolean;
226
- italic: boolean;
227
- "line-through": boolean;
228
- overline: boolean;
229
- subscript: boolean;
230
- superscript: boolean;
231
- };
219
+ DEFAULT_TEXT_STYLES: DefaultTextStyles;
220
+ LOG_HOTKEYS: boolean;
221
+ FORCE_HOTKEYS: "auto" | "windows" | "macos";
222
+ debug: boolean;
223
+ FALLBACK_LNG: string;
232
224
  };
233
225
  export type Settings = typeof conf;
234
226
  export {};
@@ -0,0 +1,8 @@
1
+ import { DocumentFactory } from "./DocumentFactory";
2
+ export declare class MockDocumentFactory implements DocumentFactory {
3
+ private logPreInitializationCall;
4
+ createElement(tagName: string): HTMLElement;
5
+ createElementNS(namespace: string, tagName: string): Element;
6
+ caretPositionFromPoint(x: number, y: number, options?: CaretPositionFromPointOptions): CaretPosition | null;
7
+ caretRangeFromPoint(x: number, y: number): Range | null;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",