@myoc/math 0.19.521 → 0.19.522
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 +261 -92
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +1 -1
- package/dist/types/common/src/colors.d.ts +14 -0
- package/dist/types/common/src/constants.d.ts +3 -0
- package/dist/types/common/src/keys.d.ts +2 -0
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/utils.d.ts +1 -1
- package/dist/types/element/src/Scene.d.ts +1 -1
- package/dist/types/element/src/align.d.ts +2 -2
- package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
- package/dist/types/element/src/arrows/focus.d.ts +5 -2
- package/dist/types/element/src/binding.d.ts +17 -8
- package/dist/types/element/src/bounds.d.ts +5 -9
- package/dist/types/element/src/bucketFill.d.ts +110 -0
- package/dist/types/element/src/collision.d.ts +1 -1
- package/dist/types/element/src/comparisons.d.ts +4 -4
- package/dist/types/element/src/convertToShape.d.ts +23 -0
- package/dist/types/element/src/distribute.d.ts +2 -2
- package/dist/types/element/src/dragElements.d.ts +27 -0
- package/dist/types/element/src/duplicate.d.ts +3 -3
- package/dist/types/element/src/embeddable.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +7 -7
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +4 -4
- package/dist/types/element/src/groups.d.ts +9 -9
- package/dist/types/element/src/index.d.ts +4 -1
- package/dist/types/element/src/linearElementEditor.d.ts +17 -10
- package/dist/types/element/src/newElement.d.ts +13 -0
- package/dist/types/element/src/renderElement.d.ts +0 -3
- package/dist/types/element/src/resizeElements.d.ts +2 -2
- package/dist/types/element/src/selection.d.ts +5 -5
- package/dist/types/element/src/shape.d.ts +12 -0
- package/dist/types/element/src/sortElements.d.ts +10 -0
- package/dist/types/element/src/textElement.d.ts +12 -9
- package/dist/types/element/src/transform.d.ts +2 -2
- package/dist/types/element/src/typeChecks.d.ts +25 -25
- package/dist/types/element/src/types.d.ts +2 -1
- package/dist/types/element/src/zindex.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +24 -8
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +128 -961
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +24 -8
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +38 -13
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +9 -4
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +25 -9
- package/dist/types/excalidraw/actions/actionExport.d.ts +26 -10
- package/dist/types/excalidraw/actions/actionFrame.d.ts +47 -205
- package/dist/types/excalidraw/actions/actionGroup.d.ts +39 -23
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +15 -6
- package/dist/types/excalidraw/actions/actionLink.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionMenu.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionProperties.d.ts +43 -24
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +17 -9
- package/dist/types/excalidraw/actions/actionStyles.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +16 -9
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +16 -9
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -5
- package/dist/types/excalidraw/actions/index.d.ts +1 -2
- package/dist/types/excalidraw/actions/manager.d.ts +1 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +8 -4
- package/dist/types/excalidraw/appState.d.ts +10 -5
- package/dist/types/excalidraw/components/Actions.d.ts +17 -12
- package/dist/types/excalidraw/components/App.arrowText.d.ts +72 -0
- package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +30 -0
- package/dist/types/excalidraw/components/App.d.ts +384 -60
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -3
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/{ToolButton.d.ts → IconButton.d.ts} +16 -19
- package/dist/types/excalidraw/components/Island.d.ts +7 -0
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
- package/dist/types/excalidraw/components/LockButton.d.ts +9 -0
- package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
- package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
- package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
- package/dist/types/excalidraw/components/Popover.d.ts +1 -3
- package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
- package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
- package/dist/types/excalidraw/components/Tools.d.ts +146 -0
- package/dist/types/excalidraw/components/UserList.d.ts +3 -2
- package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -0
- package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
- package/dist/types/excalidraw/components/icons.d.ts +4 -1
- package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
- package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
- package/dist/types/excalidraw/context/tunnels.d.ts +0 -1
- package/dist/types/excalidraw/data/blob.d.ts +14 -6
- package/dist/types/excalidraw/data/index.d.ts +4 -4
- package/dist/types/excalidraw/data/json.d.ts +20 -12
- package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +10 -3
- package/dist/types/excalidraw/scene/Renderer.d.ts +11 -11
- package/dist/types/excalidraw/scene/export.d.ts +3 -3
- package/dist/types/excalidraw/scene/index.d.ts +1 -1
- package/dist/types/excalidraw/scene/types.d.ts +4 -3
- package/dist/types/excalidraw/snapping.d.ts +7 -7
- package/dist/types/excalidraw/types.d.ts +423 -27
- package/dist/types/excalidraw/viewport.d.ts +283 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -3
- package/dist/types/laser-pointer/src/state.d.ts +1 -0
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/pca.d.ts +79 -0
- package/dist/types/math/src/polygon.d.ts +25 -1
- package/dist/types/utils/src/export.d.ts +3 -3
- package/package.json +2 -2
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -180
- package/dist/types/excalidraw/actions/actionSmartZoom.d.ts +0 -16
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +0 -27
- package/dist/types/excalidraw/components/ElementCanvasButtons.d.ts +0 -7
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
- package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
- package/dist/types/excalidraw/components/MagicButton.d.ts +0 -10
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -12
- package/dist/types/excalidraw/cursor.d.ts +0 -5
- package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
- package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
- package/dist/types/excalidraw/scroll.d.ts +0 -46
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { MarkOptional } from "@excalidraw/common/utility-types";
|
|
2
|
-
import "../components/dropdownMenu/DropdownMenu.scss";
|
|
3
|
-
import type { SidebarProps, SidebarTriggerProps } from "./Sidebar/common";
|
|
4
|
-
export declare const DefaultSidebar: import("react").FC<Omit<MarkOptional<Omit<{
|
|
5
|
-
name: import("../types").SidebarName;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
onStateChange?: (state: import("../types").AppState["openSidebar"]) => void;
|
|
8
|
-
onDock?: (docked: boolean) => void;
|
|
9
|
-
docked?: boolean;
|
|
10
|
-
className?: string;
|
|
11
|
-
__fallback?: boolean;
|
|
12
|
-
}, "name">, "children">, "onDock"> & {
|
|
13
|
-
/** pass `false` to disable docking */
|
|
14
|
-
onDock?: SidebarProps["onDock"] | false;
|
|
15
|
-
} & {
|
|
16
|
-
__fallback?: boolean;
|
|
17
|
-
}> & {
|
|
18
|
-
Trigger: import("react").FC<Omit<SidebarTriggerProps, "name"> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
19
|
-
__fallback?: boolean;
|
|
20
|
-
}>;
|
|
21
|
-
TabTriggers: {
|
|
22
|
-
({ children }: {
|
|
23
|
-
children: React.ReactNode;
|
|
24
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
displayName: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ElementsMap, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import "./ElementCanvasButtons.scss";
|
|
3
|
-
export declare const ElementCanvasButtons: ({ children, element, elementsMap, }: {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
element: NonDeletedExcalidrawElement;
|
|
6
|
-
elementsMap: ElementsMap;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./FollowMode.scss";
|
|
2
|
-
import type { UserToFollow } from "../../types";
|
|
3
|
-
interface FollowModeProps {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
userToFollow: UserToFollow;
|
|
7
|
-
onDisconnect: () => void;
|
|
8
|
-
}
|
|
9
|
-
declare const FollowMode: ({ height, width, userToFollow, onDisconnect, }: FollowModeProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export default FollowMode;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./ToolIcon.scss";
|
|
2
|
-
type LockIconProps = {
|
|
3
|
-
title?: string;
|
|
4
|
-
name?: string;
|
|
5
|
-
checked: boolean;
|
|
6
|
-
onChange?(): void;
|
|
7
|
-
isMobile?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare const HandButton: (props: LockIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./ToolIcon.scss";
|
|
2
|
-
import type { JSX } from "react";
|
|
3
|
-
export declare const ElementCanvasButton: (props: {
|
|
4
|
-
title?: string;
|
|
5
|
-
icon: JSX.Element;
|
|
6
|
-
name?: string;
|
|
7
|
-
checked: boolean;
|
|
8
|
-
onChange?(): void;
|
|
9
|
-
isMobile?: boolean;
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import "./ToolIcon.scss";
|
|
2
|
-
import "./MobileToolBar.scss";
|
|
3
|
-
import type { ActionManager } from "../actions/manager";
|
|
4
|
-
import type { AppClassProperties, UIAppState } from "../types";
|
|
5
|
-
type MobileToolBarProps = {
|
|
6
|
-
app: AppClassProperties;
|
|
7
|
-
actionManager: ActionManager;
|
|
8
|
-
onHandToolToggle: () => void;
|
|
9
|
-
setAppState: React.Component<any, UIAppState>["setState"];
|
|
10
|
-
};
|
|
11
|
-
export declare const MobileToolBar: ({ app, actionManager, onHandToolToggle, setAppState, }: MobileToolBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { AppState } from "./types";
|
|
2
|
-
export declare const resetCursor: (interactiveCanvas: HTMLCanvasElement | null) => void;
|
|
3
|
-
export declare const setCursor: (interactiveCanvas: HTMLCanvasElement | null, cursor: string) => void;
|
|
4
|
-
export declare const setEraserCursor: (interactiveCanvas: HTMLCanvasElement | null, theme: AppState["theme"]) => void;
|
|
5
|
-
export declare const setCursorForShape: (interactiveCanvas: HTMLCanvasElement | null, appState: Pick<AppState, "activeTool" | "theme">) => void;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type { AppState, Offsets, PointerCoords, Zoom } from "../types";
|
|
3
|
-
export declare const centerScrollOn: ({ scenePoint, viewportDimensions, zoom, offsets, }: {
|
|
4
|
-
scenePoint: PointerCoords;
|
|
5
|
-
viewportDimensions: {
|
|
6
|
-
height: number;
|
|
7
|
-
width: number;
|
|
8
|
-
};
|
|
9
|
-
zoom: Zoom;
|
|
10
|
-
offsets?: Offsets;
|
|
11
|
-
}) => {
|
|
12
|
-
scrollX: number;
|
|
13
|
-
scrollY: number;
|
|
14
|
-
};
|
|
15
|
-
export declare const calculateScrollCenter: (elements: readonly ExcalidrawElement[], appState: AppState) => {
|
|
16
|
-
scrollX: number;
|
|
17
|
-
scrollY: number;
|
|
18
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AppState, NormalizedZoomValue } from "../types";
|
|
2
|
-
export declare const getStateForZoom: ({ viewportX, viewportY, nextZoom, }: {
|
|
3
|
-
viewportX: number;
|
|
4
|
-
viewportY: number;
|
|
5
|
-
nextZoom: NormalizedZoomValue;
|
|
6
|
-
}, appState: AppState) => {
|
|
7
|
-
scrollX: number;
|
|
8
|
-
scrollY: number;
|
|
9
|
-
zoom: {
|
|
10
|
-
value: NormalizedZoomValue;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type { AppState, Offsets } from "./types";
|
|
3
|
-
export declare const SCROLL_TO_CONTENT_ANIMATION_KEY = "animateScrollToContent";
|
|
4
|
-
export type ScrollToContentOptions = ({
|
|
5
|
-
fitToContent?: boolean;
|
|
6
|
-
fitToViewport?: never;
|
|
7
|
-
viewportZoomFactor?: number;
|
|
8
|
-
animate?: boolean;
|
|
9
|
-
duration?: number;
|
|
10
|
-
} | {
|
|
11
|
-
fitToContent?: never;
|
|
12
|
-
fitToViewport?: boolean;
|
|
13
|
-
/** when fitToViewport=true, how much screen should the content cover,
|
|
14
|
-
* between 0.1 (10%) and 1 (100%) */
|
|
15
|
-
viewportZoomFactor?: number;
|
|
16
|
-
animate?: boolean;
|
|
17
|
-
duration?: number;
|
|
18
|
-
}) & {
|
|
19
|
-
minZoom?: number;
|
|
20
|
-
maxZoom?: number;
|
|
21
|
-
canvasOffsets?: Offsets;
|
|
22
|
-
};
|
|
23
|
-
type Viewport = Pick<AppState, "scrollX" | "scrollY" | "zoom">;
|
|
24
|
-
/**
|
|
25
|
-
* Scrolls (and optionally zooms) the viewport so that the given target is in
|
|
26
|
-
* view, optionally animating the transition.
|
|
27
|
-
*/
|
|
28
|
-
export declare const scrollToElements: (state: AppState, target: readonly ExcalidrawElement[], onFrame: (state: Pick<AppState, "scrollX" | "scrollY" | "zoom" | "shouldCacheIgnoreZoom">) => void, opts?: ScrollToContentOptions) => void;
|
|
29
|
-
/**
|
|
30
|
-
* Interpolates the viewport from `from` to `target` at the (already-eased)
|
|
31
|
-
* blend amount `factor` (0 = `from`, 1 = `target`).
|
|
32
|
-
*
|
|
33
|
-
* Zoom is interpolated geometrically (so it feels uniform), and rather than
|
|
34
|
-
* tweening scrollX/scrollY directly we tween the *focal point* — the scene
|
|
35
|
-
* point under the viewport center — and derive scroll from it. Mixing a linear
|
|
36
|
-
* scroll with a geometric zoom makes the focal point swoop sideways
|
|
37
|
-
* mid-animation (most visible when zooming out); gliding the focal point keeps
|
|
38
|
-
* it steady. `width/2/zoom - scroll` is the inverse of `centerScrollOn` without
|
|
39
|
-
* offsets, so factor 0/1 land exactly on `from`/`target`.
|
|
40
|
-
*/
|
|
41
|
-
export declare const interpolateViewport: ({ from, target, factor, }: {
|
|
42
|
-
from: Pick<AppState, "scrollX" | "scrollY" | "zoom" | "width" | "height">;
|
|
43
|
-
target: Viewport;
|
|
44
|
-
factor: number;
|
|
45
|
-
}) => Viewport;
|
|
46
|
-
export {};
|