@excalidraw/common 0.18.0-3bdaafe → 0.18.0-4e0441e
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/dev/index.js +82 -32
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/index.js +3 -3
- package/dist/types/common/src/constants.d.ts +21 -4
- package/dist/types/common/src/utils.d.ts +3 -1
- package/dist/types/element/src/renderElement.d.ts +4 -1
- package/dist/types/element/src/transformHandles.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +21 -6
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +14 -4
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +92 -40
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +42 -12
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +7 -2
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +21 -6
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +7 -2
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +14 -4
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +7 -2
- package/dist/types/excalidraw/actions/actionExport.d.ts +63 -18
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +14 -4
- package/dist/types/excalidraw/actions/actionFrame.d.ts +28 -8
- package/dist/types/excalidraw/actions/actionGroup.d.ts +14 -4
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +8 -3
- package/dist/types/excalidraw/actions/actionLink.d.ts +6 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +7 -368
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +14 -4
- package/dist/types/excalidraw/actions/actionProperties.d.ts +122 -38
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +7 -2
- package/dist/types/excalidraw/actions/actionStyles.d.ts +7 -2
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +7 -2
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +7 -2
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +7 -2
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +7 -2
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +7 -2
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +7 -2
- package/dist/types/excalidraw/actions/index.d.ts +2 -2
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +5 -1
- package/dist/types/excalidraw/clipboard.d.ts +63 -1
- package/dist/types/excalidraw/components/Actions.d.ts +17 -3
- package/dist/types/excalidraw/components/App.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +1 -0
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
- package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
- package/dist/types/excalidraw/components/Popover.d.ts +2 -1
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/TextField.d.ts +1 -0
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +5 -0
- package/dist/types/excalidraw/data/blob.d.ts +2 -9
- package/dist/types/excalidraw/data/types.d.ts +4 -1
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/shortcut.d.ts +1 -0
- package/dist/types/excalidraw/types.d.ts +10 -3
- package/dist/types/math/src/segment.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CaretPosition = {
|
|
2
|
+
start: number;
|
|
3
|
+
end: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const saveCaretPosition: () => CaretPosition | null;
|
|
6
|
+
export declare const restoreCaretPosition: (position: CaretPosition | null) => void;
|
|
7
|
+
export declare const withCaretPositionPreservation: (callback: () => void, isCompactMode: boolean, isEditingText: boolean, onPreventClose?: () => void) => void;
|
|
8
|
+
export declare const useTextEditorFocus: () => {
|
|
9
|
+
saveCaretPosition: () => void;
|
|
10
|
+
restoreCaretPosition: () => void;
|
|
11
|
+
clearSavedPosition: () => void;
|
|
12
|
+
hasSavedPosition: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const temporarilyDisableTextEditorBlur: (duration?: number) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getShortcutKey: (shortcut: string) => string;
|
|
@@ -221,6 +221,10 @@ export interface AppState {
|
|
|
221
221
|
locked: boolean;
|
|
222
222
|
fromSelection: boolean;
|
|
223
223
|
} & ActiveTool;
|
|
224
|
+
preferredSelectionTool: {
|
|
225
|
+
type: "selection" | "lasso";
|
|
226
|
+
initialized: boolean;
|
|
227
|
+
};
|
|
224
228
|
penMode: boolean;
|
|
225
229
|
penDetected: boolean;
|
|
226
230
|
exportBackground: boolean;
|
|
@@ -251,8 +255,8 @@ export interface AppState {
|
|
|
251
255
|
isResizing: boolean;
|
|
252
256
|
isRotating: boolean;
|
|
253
257
|
zoom: Zoom;
|
|
254
|
-
openMenu: "canvas" |
|
|
255
|
-
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | null;
|
|
258
|
+
openMenu: "canvas" | null;
|
|
259
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
256
260
|
openSidebar: {
|
|
257
261
|
name: SidebarName;
|
|
258
262
|
tab?: SidebarTabName;
|
|
@@ -351,6 +355,8 @@ export interface AppState {
|
|
|
351
355
|
lockedMultiSelections: {
|
|
352
356
|
[groupId: string]: true;
|
|
353
357
|
};
|
|
358
|
+
/** properties sidebar mode - determines whether to show compact or complete sidebar */
|
|
359
|
+
stylesPanelMode: "compact" | "full" | "mobile";
|
|
354
360
|
}
|
|
355
361
|
export type SearchMatch = {
|
|
356
362
|
id: string;
|
|
@@ -441,6 +447,7 @@ export interface ExcalidrawProps {
|
|
|
441
447
|
onDuplicate?: (nextElements: readonly ExcalidrawElement[],
|
|
442
448
|
/** excludes the duplicated elements */
|
|
443
449
|
prevElements: readonly ExcalidrawElement[]) => ExcalidrawElement[] | void;
|
|
450
|
+
renderTopLeftUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
444
451
|
renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
445
452
|
langCode?: Language["code"];
|
|
446
453
|
viewModeEnabled?: boolean;
|
|
@@ -557,7 +564,7 @@ export type AppClassProperties = {
|
|
|
557
564
|
excalidrawContainerValue: App["excalidrawContainerValue"];
|
|
558
565
|
onPointerUpEmitter: App["onPointerUpEmitter"];
|
|
559
566
|
updateEditorAtom: App["updateEditorAtom"];
|
|
560
|
-
|
|
567
|
+
onPointerDownEmitter: App["onPointerDownEmitter"];
|
|
561
568
|
};
|
|
562
569
|
export type PointerDownState = Readonly<{
|
|
563
570
|
origin: Readonly<{
|
|
@@ -37,3 +37,4 @@ export declare const distanceToLineSegment: <Point extends GlobalPoint | LocalPo
|
|
|
37
37
|
* @returns
|
|
38
38
|
*/
|
|
39
39
|
export declare function lineSegmentIntersectionPoints<Point extends GlobalPoint | LocalPoint>(l: LineSegment<Point>, s: LineSegment<Point>, threshold?: number): Point | null;
|
|
40
|
+
export declare function lineSegmentsDistance<Point extends GlobalPoint | LocalPoint>(s1: LineSegment<Point>, s2: LineSegment<Point>): number;
|