@excalidraw/common 0.18.0-063e025 → 0.18.0-1acf66e
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 +9 -5
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/index.js +3 -3
- package/dist/types/common/src/constants.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/arrowEndpointText.d.ts +49 -0
- package/dist/types/element/src/arrows/focus.d.ts +5 -2
- package/dist/types/element/src/binding.d.ts +12 -3
- 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/dragElements.d.ts +27 -0
- package/dist/types/element/src/flowchart.d.ts +6 -6
- package/dist/types/element/src/groups.d.ts +1 -1
- package/dist/types/element/src/index.d.ts +2 -0
- package/dist/types/element/src/linearElementEditor.d.ts +7 -0
- package/dist/types/element/src/newElement.d.ts +13 -0
- package/dist/types/element/src/selection.d.ts +1 -1
- package/dist/types/element/src/textElement.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +15 -3
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +99 -565
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +16 -3
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionExport.d.ts +15 -7
- package/dist/types/excalidraw/actions/actionFrame.d.ts +15 -178
- package/dist/types/excalidraw/actions/actionGroup.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +6 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +6 -2
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +5 -1
- package/dist/types/excalidraw/actions/index.d.ts +0 -1
- 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 +5 -1
- package/dist/types/excalidraw/appState.d.ts +5 -5
- package/dist/types/excalidraw/components/Actions.d.ts +16 -10
- package/dist/types/excalidraw/components/App.arrowText.d.ts +72 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +31 -0
- package/dist/types/excalidraw/components/App.d.ts +322 -76
- 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/{ToolButton.d.ts → IconButton.d.ts} +16 -19
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +4 -2
- package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
- package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
- 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/ToolPopover.d.ts +3 -6
- package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
- package/dist/types/excalidraw/components/Tools.d.ts +145 -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/icons.d.ts +1 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -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/data/blob.d.ts +20 -12
- package/dist/types/excalidraw/data/json.d.ts +10 -6
- package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
- package/dist/types/excalidraw/scene/types.d.ts +3 -0
- package/dist/types/excalidraw/types.d.ts +199 -13
- package/dist/types/excalidraw/viewport.d.ts +20 -64
- 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/package.json +1 -1
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -173
- package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -10
- package/dist/types/excalidraw/components/shapes.d.ts +0 -270
- package/dist/types/excalidraw/cursor.d.ts +0 -5
- package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AppEventBus, type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
|
|
3
|
-
import { LinearElementEditor,
|
|
4
|
-
import type {
|
|
3
|
+
import { LinearElementEditor, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
|
|
4
|
+
import type { LocalPoint, Radians } from "@excalidraw/math";
|
|
5
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawTextContainer, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, Arrowhead, SceneElementsMap } from "@excalidraw/element/types";
|
|
5
6
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
6
7
|
import { ActionManager } from "../actions/manager";
|
|
7
8
|
import { History } from "../history";
|
|
@@ -13,10 +14,15 @@ import { LaserTrails } from "../laserTrails";
|
|
|
13
14
|
import { isOverScrollBars } from "../scene/scrollbars";
|
|
14
15
|
import { LassoTrail } from "../lasso";
|
|
15
16
|
import { EraserTrail } from "../eraser";
|
|
17
|
+
import { AppArrowText } from "./App.arrowText";
|
|
18
|
+
import { AppCursor } from "./App.cursor";
|
|
19
|
+
import { AppDrawShape } from "./App.drawshape";
|
|
20
|
+
import { AppFlowchart } from "./App.flowchart";
|
|
21
|
+
import { AppViewport } from "./App.viewport";
|
|
16
22
|
import { CursorHints } from "./CursorHint";
|
|
17
23
|
import { type OnStateChange } from "./AppStateObserver";
|
|
18
24
|
import type { ExportedElements } from "../data";
|
|
19
|
-
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize,
|
|
25
|
+
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, UIConfig } from "../types";
|
|
20
26
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
21
27
|
import type { ActionResult } from "../actions/types";
|
|
22
28
|
declare const editorLifecycleEventBehavior: {
|
|
@@ -74,12 +80,6 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
74
80
|
actionManager: ActionManager;
|
|
75
81
|
editorInterface: EditorInterface;
|
|
76
82
|
private stylesPanelMode;
|
|
77
|
-
/**
|
|
78
|
-
* Last-measured footprints of named viewport UI surfaces
|
|
79
|
-
* (`data-viewport-ui-name`), so `getViewportOffsets` can reserve space
|
|
80
|
-
* for them while they're hidden.
|
|
81
|
-
*/
|
|
82
|
-
private viewportUILastMeasured;
|
|
83
83
|
private excalidrawContainerRef;
|
|
84
84
|
scene: Scene;
|
|
85
85
|
fonts: Fonts;
|
|
@@ -117,9 +117,12 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
117
117
|
onEvent: AppEventBus<ExcalidrawImperativeAPIEventMap, typeof editorLifecycleEventBehavior>["on"];
|
|
118
118
|
private appStateObserver;
|
|
119
119
|
onStateChange: OnStateChange;
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
flowchart: AppFlowchart;
|
|
121
|
+
cursor: AppCursor;
|
|
122
|
+
arrowText: AppArrowText;
|
|
123
|
+
viewport: AppViewport;
|
|
122
124
|
bindModeHandler: ReturnType<typeof setTimeout> | null;
|
|
125
|
+
private textWysiwygSubmitHandler;
|
|
123
126
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
124
127
|
lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
|
|
125
128
|
lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
@@ -139,10 +142,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
139
142
|
x: number;
|
|
140
143
|
y: number;
|
|
141
144
|
} | null;
|
|
142
|
-
|
|
143
|
-
x: number;
|
|
144
|
-
y: number;
|
|
145
|
-
};
|
|
145
|
+
drawShape: AppDrawShape;
|
|
146
146
|
laserTrails: LaserTrails;
|
|
147
147
|
eraserTrail: EraserTrail;
|
|
148
148
|
lassoTrail: LassoTrail;
|
|
@@ -281,6 +281,74 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
281
281
|
api: ExcalidrawImperativeAPI;
|
|
282
282
|
private createExcalidrawAPI;
|
|
283
283
|
constructor(props: AppProps);
|
|
284
|
+
/**
|
|
285
|
+
* Whether the editor accepts user input (pointer, keyboard, wheel, touch,
|
|
286
|
+
* clipboard, drag&drop). When `false`, the editor is fully inert for the
|
|
287
|
+
* user, but remains controllable through the imperative API.
|
|
288
|
+
*
|
|
289
|
+
* All user-input entry points must consult this getter (directly or by
|
|
290
|
+
* not being attached/rendered at all).
|
|
291
|
+
*/
|
|
292
|
+
isInteractionEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
293
|
+
/**
|
|
294
|
+
* Whether element links render their link icon and are clickable.
|
|
295
|
+
* True when fully interactive, or when `interaction: { enabled: { links:
|
|
296
|
+
* true } }`
|
|
297
|
+
* (in which case clicking anywhere on a linked element opens the link,
|
|
298
|
+
* same as in view mode).
|
|
299
|
+
*/
|
|
300
|
+
isLinksEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Whether canvas navigation — panning & zooming, view-mode style — is
|
|
303
|
+
* enabled. True when fully interactive, or when `interaction: { enabled:
|
|
304
|
+
* { navigation: true } }`. Respects `appState.scrollConstraints`.
|
|
305
|
+
*/
|
|
306
|
+
isNavigationEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Whether embeddable & iframe elements are interactive (hover & click to
|
|
309
|
+
* activate, view-mode style). True when fully interactive, or when
|
|
310
|
+
* allowed via `interaction.enabled.embeds` / `.interactiveContent`.
|
|
311
|
+
*/
|
|
312
|
+
isEmbedsEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Whether the browser's own zoom (ctrl/cmd + wheel, pinch, keyboard
|
|
315
|
+
* shortcuts) stays available over the non-interactive editor.
|
|
316
|
+
* Prevented by default.
|
|
317
|
+
*/
|
|
318
|
+
isBrowserZoomEnabled(props?: Pick<AppProps, "interaction">): boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Whether the tool can be activated & driven by user input. False when
|
|
321
|
+
* disabled via `UIOptions.tools`, or when the editor is non-interactive
|
|
322
|
+
* and the tool isn't kept user-driven via `interaction.enabled.tools`.
|
|
323
|
+
*
|
|
324
|
+
* (Once UI tool availability is split from input availability — e.g.
|
|
325
|
+
* `props.ui.tools` vs `interaction.disabled.tools` — the UI axis moves
|
|
326
|
+
* out into its own predicate.)
|
|
327
|
+
*
|
|
328
|
+
* We purposely widen the `tool` type so this helper can be called with
|
|
329
|
+
* any tool without having to type check it.
|
|
330
|
+
*/
|
|
331
|
+
isToolSupported: <T extends ToolType | "custom">(tool: T, props?: Pick<AppProps, "interaction" | "UIOptions">) => boolean;
|
|
332
|
+
/**
|
|
333
|
+
* Whether the active tool is locked in place — via the tool lock
|
|
334
|
+
* (padlock / Q) or by being host-forced (`props.activeTool`). A locked
|
|
335
|
+
* tool doesn't revert to the selection tool after use, and elements drawn
|
|
336
|
+
* with it aren't selected. Forcing deliberately does not mutate
|
|
337
|
+
* `activeTool.locked`, which is the user's persisted padlock preference.
|
|
338
|
+
*/
|
|
339
|
+
isToolLocked(): boolean;
|
|
340
|
+
/**
|
|
341
|
+
* Whether the active tool captures the primary pointer instead of the
|
|
342
|
+
* view-mode drag-to-pan — the laser always does; while non-interactive,
|
|
343
|
+
* any tool allowed via `interaction.enabled.tools` does. (Editing tools
|
|
344
|
+
* capture the pointer trivially since view mode implies they're not
|
|
345
|
+
* active; this predicate only matters where view-mode gates apply.)
|
|
346
|
+
*/
|
|
347
|
+
isActiveToolPointerCapturing(): boolean;
|
|
348
|
+
/** Whether Excalidraw's full default UI is rendered. */
|
|
349
|
+
isDefaultUIEnabled(props?: Pick<AppProps, "ui">): boolean;
|
|
350
|
+
/** Whether an individual default UI control is rendered. */
|
|
351
|
+
isUIControlEnabled(control: keyof UIConfig["enabled"], props?: Pick<AppProps, "ui">): boolean;
|
|
284
352
|
updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
285
353
|
private onWindowMessage;
|
|
286
354
|
private handleSkipBindMode;
|
|
@@ -334,6 +402,30 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
334
402
|
private onBlur;
|
|
335
403
|
private onUnload;
|
|
336
404
|
private disableEvent;
|
|
405
|
+
private preventBrowserZoomWheel;
|
|
406
|
+
private handleNavigationModeKeyDown;
|
|
407
|
+
/**
|
|
408
|
+
* PageUp/PageDown scroll the canvas by a page — vertically, or
|
|
409
|
+
* horizontally with shift. Respects `appState.scrollConstraints`
|
|
410
|
+
* (via `viewport.translate`).
|
|
411
|
+
*/
|
|
412
|
+
private maybeHandlePageScrollKeyDown;
|
|
413
|
+
private preventBrowserZoomKeyDown;
|
|
414
|
+
/** Ends active input sessions before switching to a view-mode/non-interactive
|
|
415
|
+
* mode. */
|
|
416
|
+
private terminateActiveInteraction;
|
|
417
|
+
private handleInteractionStateChange;
|
|
418
|
+
/** whether the two values reference the same tool (incl. custom subtype) */
|
|
419
|
+
private isSameForcedTool;
|
|
420
|
+
/**
|
|
421
|
+
* Keeps `state.activeTool` synced to the host-controlled
|
|
422
|
+
* `props.activeTool`. `setActiveTool` refuses non-matching activations
|
|
423
|
+
* while forced (user input, API); this backstop covers the writers that
|
|
424
|
+
* bypass the funnel (`actionFinalize`/`actionDeselect`, `restore()` on
|
|
425
|
+
* scene load, ...) and re-applies the tool once it becomes activatable
|
|
426
|
+
* (e.g. `interaction` config changes).
|
|
427
|
+
*/
|
|
428
|
+
private handleForcedToolChange;
|
|
337
429
|
private resetHistory;
|
|
338
430
|
private resetStore;
|
|
339
431
|
/**
|
|
@@ -383,46 +475,8 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
383
475
|
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
384
476
|
updateFrameRendering: (opts: Partial<AppState["frameRendering"]> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
385
477
|
togglePenMode: (force: boolean | null) => void;
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* Zooms on canvas viewport center
|
|
389
|
-
*/
|
|
390
|
-
zoomCanvas: (
|
|
391
|
-
/**
|
|
392
|
-
* Decimal fraction, auto-clamped between MIN_ZOOM and MAX_ZOOM.
|
|
393
|
-
* 1 = 100% zoom, 2 = 200% zoom, 0.5 = 50% zoom
|
|
394
|
-
*/
|
|
395
|
-
value: number) => void;
|
|
396
|
-
/**
|
|
397
|
-
* Navigates the viewport to a target and, optionally, locks pan/zoom to it.
|
|
398
|
-
* The resolved target box drives both the navigation (pan + zoom per
|
|
399
|
-
* `fit`) and the lock: the operations chain — the viewport animates onto
|
|
400
|
-
* the target, then the lock is installed against the settled viewport.
|
|
401
|
-
*
|
|
402
|
-
* Passing `null` clears any active lock without navigating.
|
|
403
|
-
*/
|
|
404
|
-
/**
|
|
405
|
-
* Resolves user-supplied viewport offsets ({@link ViewportOffsets}) into
|
|
406
|
-
* concrete per-side pixel values: static sides are used as-is, and when
|
|
407
|
-
* `ui` is set, the remaining sides are derived from the currently
|
|
408
|
-
* rendered editor UI (via `getViewportOffsets`).
|
|
409
|
-
*
|
|
410
|
-
* Must be called at the time the offsets are applied (not e.g. cached at
|
|
411
|
-
* props-definition time), so the UI-derived values reflect the actual
|
|
412
|
-
* rendered UI.
|
|
413
|
-
*/
|
|
414
|
-
private resolveViewportOffsets;
|
|
415
|
-
setViewport: (opts: SetViewportOptions | null) => void;
|
|
478
|
+
revealIfHidden: (elements: NonDeletedExcalidrawElement[]) => void;
|
|
416
479
|
private maybeUnfollowRemoteUser;
|
|
417
|
-
/** use when changing scrollX/scrollY/zoom based on user interaction */
|
|
418
|
-
private translateCanvas;
|
|
419
|
-
/** clamps scroll/zoom back into `appState.scrollConstraints` (no-op when
|
|
420
|
-
* unconstrained). Runs as a queued update, so it sees the preceding change.
|
|
421
|
-
* `overscroll` (screen px) relaxes the bounds for rubberbanding. */
|
|
422
|
-
private constrainViewportToScrollConstraints;
|
|
423
|
-
/** animates an overscrolled viewport back inside the constraint box */
|
|
424
|
-
private snapBackToScrollConstraints;
|
|
425
|
-
private snapBackToScrollConstraintsDebounced;
|
|
426
480
|
setToast: (toast: AppState["toast"]) => void;
|
|
427
481
|
restoreFileFromShare: () => Promise<void>;
|
|
428
482
|
/**
|
|
@@ -450,7 +504,9 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
450
504
|
}) => void;
|
|
451
505
|
applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
|
|
452
506
|
mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
|
|
453
|
-
|
|
507
|
+
triggerRender: (
|
|
508
|
+
/** force always re-renders canvas even if no change */
|
|
509
|
+
force?: boolean) => void;
|
|
454
510
|
/**
|
|
455
511
|
* @returns whether the menu was toggled on or off
|
|
456
512
|
*/
|
|
@@ -460,20 +516,8 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
460
516
|
force?: boolean;
|
|
461
517
|
}) => boolean;
|
|
462
518
|
private updateCurrentCursorPosition;
|
|
463
|
-
/**
|
|
464
|
-
* top/right/bottom/left override the final offsets for those sides.
|
|
465
|
-
*
|
|
466
|
-
* Default side offsets are measured from the currently rendered UI
|
|
467
|
-
* surfaces marked with the `data-viewport-ui` attribute (see
|
|
468
|
-
* {@link ViewportUIDock}), plus padding.
|
|
469
|
-
*
|
|
470
|
-
* See {@link ViewportOffsetsOptions} for the individual options
|
|
471
|
-
* (padding, per-side overrides, reserving space for hidden surfaces).
|
|
472
|
-
*/
|
|
473
|
-
getViewportOffsets: (opts?: ViewportOffsetsOptions) => Offsets;
|
|
474
519
|
private onKeyDown;
|
|
475
520
|
private onKeyUp;
|
|
476
|
-
private isToolSupported;
|
|
477
521
|
setActiveTool: (tool: ({
|
|
478
522
|
type: ToolType;
|
|
479
523
|
} | {
|
|
@@ -482,10 +526,18 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
482
526
|
}) & {
|
|
483
527
|
locked?: boolean;
|
|
484
528
|
fromSelection?: boolean;
|
|
485
|
-
},
|
|
529
|
+
}, opts?: {
|
|
530
|
+
keepSelection?: boolean;
|
|
531
|
+
/**
|
|
532
|
+
* When `true`, re-activating an already-active toggle tool (see
|
|
533
|
+
* `TOGGLE_TOOLS`) switches back to the previously active tool.
|
|
534
|
+
* Activation is idempotent by default; toggle tools always record the
|
|
535
|
+
* previously active tool regardless (so ESC and the next `toggle`
|
|
536
|
+
* activation can switch back to it).
|
|
537
|
+
*/
|
|
538
|
+
toggle?: boolean;
|
|
539
|
+
}) => void;
|
|
486
540
|
setOpenDialog: (dialogType: AppState["openDialog"]) => void;
|
|
487
|
-
private setCursor;
|
|
488
|
-
private resetCursor;
|
|
489
541
|
/**
|
|
490
542
|
* returns whether user is making a gesture with >= 2 fingers (points)
|
|
491
543
|
* on o touch screen (not on a trackpad). Currently only relates to Darwin
|
|
@@ -501,14 +553,177 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
501
553
|
private deselectElements;
|
|
502
554
|
private getSelectedTextElement;
|
|
503
555
|
private getSelectedTextEditingContainerAtPosition;
|
|
504
|
-
|
|
556
|
+
getTextElementAtPosition(x: number, y: number): NonDeleted<ExcalidrawTextElement> | null;
|
|
505
557
|
private isHittingTextAutoResizeHandle;
|
|
506
558
|
private handleTextAutoResizeHandlePointerDown;
|
|
507
|
-
|
|
559
|
+
getElementAtPosition(x: number, y: number, opts?: ({
|
|
560
|
+
includeBoundTextElement?: boolean;
|
|
561
|
+
includeLockedElements?: boolean;
|
|
562
|
+
} | {
|
|
563
|
+
allHitElements: NonDeleted<ExcalidrawElement>[];
|
|
564
|
+
}) & {
|
|
565
|
+
preferSelected?: boolean;
|
|
566
|
+
}): NonDeleted<ExcalidrawElement> | null;
|
|
508
567
|
private getElementsAtPosition;
|
|
509
568
|
getElementHitThreshold(element: ExcalidrawElement): number;
|
|
510
569
|
private hitElement;
|
|
511
|
-
|
|
570
|
+
getTextBindableContainerAtPosition(x: number, y: number): (Readonly<{
|
|
571
|
+
id: string;
|
|
572
|
+
x: number;
|
|
573
|
+
y: number;
|
|
574
|
+
strokeColor: string;
|
|
575
|
+
backgroundColor: string;
|
|
576
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
577
|
+
strokeWidth: number;
|
|
578
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
579
|
+
roundness: null | {
|
|
580
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
581
|
+
value?: number;
|
|
582
|
+
};
|
|
583
|
+
roughness: number;
|
|
584
|
+
opacity: number;
|
|
585
|
+
width: number;
|
|
586
|
+
height: number;
|
|
587
|
+
angle: Radians;
|
|
588
|
+
seed: number;
|
|
589
|
+
version: number;
|
|
590
|
+
versionNonce: number;
|
|
591
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
592
|
+
isDeleted: boolean;
|
|
593
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
594
|
+
frameId: string | null;
|
|
595
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
596
|
+
updated: number;
|
|
597
|
+
link: string | null;
|
|
598
|
+
locked: boolean;
|
|
599
|
+
customData?: Record<string, any>;
|
|
600
|
+
}> & {
|
|
601
|
+
type: "rectangle";
|
|
602
|
+
} & {
|
|
603
|
+
isDeleted: false;
|
|
604
|
+
}) | (Readonly<{
|
|
605
|
+
id: string;
|
|
606
|
+
x: number;
|
|
607
|
+
y: number;
|
|
608
|
+
strokeColor: string;
|
|
609
|
+
backgroundColor: string;
|
|
610
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
611
|
+
strokeWidth: number;
|
|
612
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
613
|
+
roundness: null | {
|
|
614
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
615
|
+
value?: number;
|
|
616
|
+
};
|
|
617
|
+
roughness: number;
|
|
618
|
+
opacity: number;
|
|
619
|
+
width: number;
|
|
620
|
+
height: number;
|
|
621
|
+
angle: Radians;
|
|
622
|
+
seed: number;
|
|
623
|
+
version: number;
|
|
624
|
+
versionNonce: number;
|
|
625
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
626
|
+
isDeleted: boolean;
|
|
627
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
628
|
+
frameId: string | null;
|
|
629
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
630
|
+
updated: number;
|
|
631
|
+
link: string | null;
|
|
632
|
+
locked: boolean;
|
|
633
|
+
customData?: Record<string, any>;
|
|
634
|
+
}> & {
|
|
635
|
+
type: "diamond";
|
|
636
|
+
} & {
|
|
637
|
+
isDeleted: false;
|
|
638
|
+
}) | (Readonly<{
|
|
639
|
+
id: string;
|
|
640
|
+
x: number;
|
|
641
|
+
y: number;
|
|
642
|
+
strokeColor: string;
|
|
643
|
+
backgroundColor: string;
|
|
644
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
645
|
+
strokeWidth: number;
|
|
646
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
647
|
+
roundness: null | {
|
|
648
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
649
|
+
value?: number;
|
|
650
|
+
};
|
|
651
|
+
roughness: number;
|
|
652
|
+
opacity: number;
|
|
653
|
+
width: number;
|
|
654
|
+
height: number;
|
|
655
|
+
angle: Radians;
|
|
656
|
+
seed: number;
|
|
657
|
+
version: number;
|
|
658
|
+
versionNonce: number;
|
|
659
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
660
|
+
isDeleted: boolean;
|
|
661
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
662
|
+
frameId: string | null;
|
|
663
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
664
|
+
updated: number;
|
|
665
|
+
link: string | null;
|
|
666
|
+
locked: boolean;
|
|
667
|
+
customData?: Record<string, any>;
|
|
668
|
+
}> & {
|
|
669
|
+
type: "ellipse";
|
|
670
|
+
} & {
|
|
671
|
+
isDeleted: false;
|
|
672
|
+
}) | (Readonly<{
|
|
673
|
+
id: string;
|
|
674
|
+
x: number;
|
|
675
|
+
y: number;
|
|
676
|
+
strokeColor: string;
|
|
677
|
+
backgroundColor: string;
|
|
678
|
+
fillStyle: import("@excalidraw/element/types").FillStyle;
|
|
679
|
+
strokeWidth: number;
|
|
680
|
+
strokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
681
|
+
roundness: null | {
|
|
682
|
+
type: import("@excalidraw/element/types").RoundnessType;
|
|
683
|
+
value?: number;
|
|
684
|
+
};
|
|
685
|
+
roughness: number;
|
|
686
|
+
opacity: number;
|
|
687
|
+
width: number;
|
|
688
|
+
height: number;
|
|
689
|
+
angle: Radians;
|
|
690
|
+
seed: number;
|
|
691
|
+
version: number;
|
|
692
|
+
versionNonce: number;
|
|
693
|
+
index: import("@excalidraw/element/types").FractionalIndex | null;
|
|
694
|
+
isDeleted: boolean;
|
|
695
|
+
groupIds: readonly import("@excalidraw/element/types").GroupId[];
|
|
696
|
+
frameId: string | null;
|
|
697
|
+
boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
|
|
698
|
+
updated: number;
|
|
699
|
+
link: string | null;
|
|
700
|
+
locked: boolean;
|
|
701
|
+
customData?: Record<string, any>;
|
|
702
|
+
}> & Readonly<{
|
|
703
|
+
type: "line" | "arrow";
|
|
704
|
+
points: readonly LocalPoint[];
|
|
705
|
+
startBinding: import("@excalidraw/element/types").FixedPointBinding | null;
|
|
706
|
+
endBinding: import("@excalidraw/element/types").FixedPointBinding | null;
|
|
707
|
+
startArrowhead: Arrowhead | null;
|
|
708
|
+
endArrowhead: Arrowhead | null;
|
|
709
|
+
}> & Readonly<{
|
|
710
|
+
type: "arrow";
|
|
711
|
+
elbowed: boolean;
|
|
712
|
+
}> & {
|
|
713
|
+
isDeleted: false;
|
|
714
|
+
}) | null;
|
|
715
|
+
/**
|
|
716
|
+
* Whether a text element's content is still being authored.
|
|
717
|
+
*
|
|
718
|
+
* Creating a text reverts the tool to selection during pointerdown, so the
|
|
719
|
+
* pointerup that follows looks like an ordinary canvas click and would
|
|
720
|
+
* capture the still-empty element as a history entry of its own. Undo would
|
|
721
|
+
* then rewind only the typing, restoring an invisible, zero-content element
|
|
722
|
+
* (and, for an endpoint label, leaving the arrow bound to it) rather than
|
|
723
|
+
* removing it. The editor's own submit captures the finished text instead,
|
|
724
|
+
* so the whole create-and-type lands in a single entry.
|
|
725
|
+
*/
|
|
726
|
+
private isEditingTextContent;
|
|
512
727
|
private startTextEditing;
|
|
513
728
|
private startImageCropping;
|
|
514
729
|
private finishImageCropping;
|
|
@@ -523,6 +738,27 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
523
738
|
private handleCanvasClick;
|
|
524
739
|
private getElementLinkAtPosition;
|
|
525
740
|
private handleElementLinkClick;
|
|
741
|
+
/**
|
|
742
|
+
* Applies (or clears) the element-link hover affordances — pointer cursor
|
|
743
|
+
* and tooltip — based on the current `hitLinkElement`. Returns whether a
|
|
744
|
+
* link is being hovered.
|
|
745
|
+
*/
|
|
746
|
+
private applyElementLinkHoverAffordance;
|
|
747
|
+
/**
|
|
748
|
+
* On touchscreens (where no hover precedes the tap) re-derives
|
|
749
|
+
* `hitLinkElement`, then opens the hit element link, if any.
|
|
750
|
+
* Returns whether a link click was handled.
|
|
751
|
+
*/
|
|
752
|
+
private maybeHandleElementLinkClick;
|
|
753
|
+
/**
|
|
754
|
+
* Restricted pointer handling for the non-interactive editor with links
|
|
755
|
+
* and/or embeds allowed (`interaction.enabled.links` / `.embeds` /
|
|
756
|
+
* `.interactiveContent`) — runs only the element-link & embed concerns
|
|
757
|
+
* (shared with the full pointer handlers above) so they behave like in
|
|
758
|
+
* view mode without the rest of the canvas pointer machinery.
|
|
759
|
+
*/
|
|
760
|
+
private handleInteractiveContentPointerMove;
|
|
761
|
+
private handleInteractiveContentPointerUp;
|
|
526
762
|
/**
|
|
527
763
|
* finds candidate frame under cursor (when dragging frame children/elements
|
|
528
764
|
* inside frames)
|
|
@@ -530,8 +766,8 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
530
766
|
private getTopLayerFrameAtSceneCoords;
|
|
531
767
|
private updateFrameToHighlight;
|
|
532
768
|
private maybeUpdateFrameToHighlightOnPointerMove;
|
|
533
|
-
|
|
534
|
-
|
|
769
|
+
insertNewElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
770
|
+
insertNewElement: (element: ExcalidrawElement) => void;
|
|
535
771
|
private handleCanvasPointerMove;
|
|
536
772
|
private handleEraser;
|
|
537
773
|
private handleTouchMove;
|
|
@@ -548,6 +784,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
548
784
|
private maybeCleanupAfterMissingPointerUp;
|
|
549
785
|
handleCanvasPanUsingWheelOrSpaceDrag: (event: React.PointerEvent<HTMLElement> | MouseEvent) => boolean;
|
|
550
786
|
private updateGestureOnPointerDown;
|
|
787
|
+
/**
|
|
788
|
+
* Tracks the pointer within the ongoing multi-touch gesture and applies
|
|
789
|
+
* the two-finger pinch zoom/pan, if any.
|
|
790
|
+
*/
|
|
791
|
+
private updateMultiTouchGesture;
|
|
551
792
|
private initialPointerDownState;
|
|
552
793
|
private handleDraggingScrollBar;
|
|
553
794
|
private clearSelectionIfNotUsingSelection;
|
|
@@ -613,7 +854,12 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
613
854
|
private maybeHandleResize;
|
|
614
855
|
private getContextMenuItems;
|
|
615
856
|
private handleWheel;
|
|
616
|
-
|
|
857
|
+
getTextWysiwygSnappedToCenterPosition(x: number, y: number, appState: AppState, container?: ExcalidrawTextContainer | null): {
|
|
858
|
+
viewportX: number;
|
|
859
|
+
viewportY: number;
|
|
860
|
+
elementCenterX: number;
|
|
861
|
+
elementCenterY: number;
|
|
862
|
+
} | undefined;
|
|
617
863
|
private savePointer;
|
|
618
864
|
private resetShouldCacheIgnoreZoomDebounced;
|
|
619
865
|
private updateDOMRect;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { DrawShapeTrail } from "../drawShapeTrail";
|
|
2
|
+
import type App from "./App";
|
|
3
|
+
import type { PointerDownState } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Captures the App state management for the drawShape tool (free-form
|
|
6
|
+
* sketch converted into a recognized excalidraw element). Pointer events
|
|
7
|
+
* are piped here from App.
|
|
8
|
+
*
|
|
9
|
+
* The gesture is committed by `finalize()` — recognize → (maybe upgrade
|
|
10
|
+
* line to arrow) → insert → bind endpoints — which is invoked from within
|
|
11
|
+
* `actionFinalize`, the editor's single finalization funnel. Whatever
|
|
12
|
+
* triggers a finalize (the gesture's own pointerup, a mid-gesture paste
|
|
13
|
+
* switching tools, …), the pending sketch resolves there exactly once.
|
|
14
|
+
*/
|
|
15
|
+
export declare class AppDrawShape {
|
|
16
|
+
private app;
|
|
17
|
+
trail: DrawShapeTrail;
|
|
18
|
+
/** a pointerdown started a sketch that `finalize()` hasn't resolved yet */
|
|
19
|
+
private gestureInProgress;
|
|
20
|
+
constructor(app: App);
|
|
21
|
+
stop: () => void;
|
|
22
|
+
hasPendingGesture: () => boolean;
|
|
23
|
+
handlePointerDown: (pointerDownState: PointerDownState) => void;
|
|
24
|
+
/** returns true when the pointermove was consumed by the shape preview */
|
|
25
|
+
handlePointerMove: (pointerCoords: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
}) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Binds both endpoints of a freshly inserted drawShape arrow to the
|
|
31
|
+
* bindable elements they hover, if any.
|
|
32
|
+
*
|
|
33
|
+
* Endpoints bind in "orbit" mode — the arrow starts/ends at the target's
|
|
34
|
+
* outline — even when the stroke was started or released inside the shape
|
|
35
|
+
* (a sketched connector aims at the shape, not at a point inside it). The
|
|
36
|
+
* exception is a sketch contained in a single shape: both ends then bind
|
|
37
|
+
* "inside" and stay where they were drawn, like the interactive
|
|
38
|
+
* inside→inside flow.
|
|
39
|
+
*/
|
|
40
|
+
private bindRecognizedArrow;
|
|
41
|
+
/**
|
|
42
|
+
* A sketched line that connects a bindable element with something else —
|
|
43
|
+
* another element or blank canvas — was meant as a connector: upgrade it
|
|
44
|
+
* to an arrow (called before insertion). A line touching no shape, or
|
|
45
|
+
* contained in a single shape (an annotation, not a connector), stays a
|
|
46
|
+
* line.
|
|
47
|
+
*/
|
|
48
|
+
private maybeUpgradeLineToArrow;
|
|
49
|
+
/**
|
|
50
|
+
* Commits the pending sketch, if any, and clears the trail. Invoked from
|
|
51
|
+
* within `actionFinalize` — never call directly, execute `actionFinalize`
|
|
52
|
+
* instead so element insertion flows into the action's returned elements.
|
|
53
|
+
*/
|
|
54
|
+
finalize: () => void;
|
|
55
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type App from "./App";
|
|
3
|
+
import type { PendingExcalidrawElements } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Captures the App state management for the flowchart functionality.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AppFlowchart {
|
|
8
|
+
private app;
|
|
9
|
+
private creator;
|
|
10
|
+
private navigator;
|
|
11
|
+
constructor(app: App);
|
|
12
|
+
get pendingNodes(): PendingExcalidrawElements | null;
|
|
13
|
+
get isCreatingChart(): boolean;
|
|
14
|
+
/** ends any in-progress flowchart creation/navigation session */
|
|
15
|
+
clear: () => void;
|
|
16
|
+
handleKeyEvent: (event: React.KeyboardEvent | KeyboardEvent) => boolean;
|
|
17
|
+
private resolveKeyboardEventToOperation;
|
|
18
|
+
private selectAndReveal;
|
|
19
|
+
private captureUpdate;
|
|
20
|
+
private static getLinkDirectionFromKey;
|
|
21
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type StylesPanelMode } from "@excalidraw/common";
|
|
2
|
+
import type { NonDeletedSceneElementsMap } from "@excalidraw/element/types";
|
|
3
|
+
import { type SetViewportOptions } from "../viewport";
|
|
4
|
+
import type { AppProps, AppState, Offsets, ScrollConstraints, ViewportOffsets, ViewportOffsetsOptions, ViewportUIName } from "../types";
|
|
5
|
+
import type App from "./App";
|
|
6
|
+
export declare const SCROLL_TO_CONTENT_ANIMATION_KEY = "animateScrollToContent";
|
|
7
|
+
export declare const SCROLL_CONSTRAINTS_SNAP_BACK_ANIMATION_KEY = "animateScrollConstraintsSnapBack";
|
|
8
|
+
/** single source of truth for the `--right-sidebar-width` CSS variable */
|
|
9
|
+
export declare const RIGHT_SIDEBAR_WIDTH = 302;
|
|
10
|
+
type Viewport = Pick<AppState, "scrollX" | "scrollY" | "zoom">;
|
|
11
|
+
type AppViewportDependencies = {
|
|
12
|
+
getContainer: () => HTMLDivElement | null;
|
|
13
|
+
getStylesPanelMode: () => StylesPanelMode;
|
|
14
|
+
isGestureActive: () => boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Rubberband snap-back: animates the viewport from its current (possibly
|
|
18
|
+
* overscrolled) position back inside the lock box via the shared
|
|
19
|
+
* AnimationController. No-op when already within the hard bounds (or when
|
|
20
|
+
* there is no lock).
|
|
21
|
+
*/
|
|
22
|
+
export declare const snapBackToConstraints: (state: Pick<AppState, "scrollX" | "scrollY" | "zoom" | "width" | "height" | "scrollConstraints">, onFrame: (updater: (state: Pick<AppState, "scrollX" | "scrollY" | "zoom" | "width" | "height" | "scrollConstraints">) => Viewport | null) => void, duration?: number) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Owns viewport state transitions and App-bound viewport concerns. Pure
|
|
25
|
+
* viewport geometry remains in `viewport.ts` so actions and public helpers can
|
|
26
|
+
* calculate state without an App instance.
|
|
27
|
+
*/
|
|
28
|
+
export declare class AppViewport {
|
|
29
|
+
private app;
|
|
30
|
+
private dependencies;
|
|
31
|
+
lastPosition: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
};
|
|
35
|
+
private activeTransition;
|
|
36
|
+
private uiLastMeasured;
|
|
37
|
+
constructor(app: App, dependencies: AppViewportDependencies);
|
|
38
|
+
get isAnimating(): boolean;
|
|
39
|
+
/** Whether a programmatic transition into a locked viewport currently owns
|
|
40
|
+
* user pan/zoom input. */
|
|
41
|
+
get isLockedTransitionPending(): boolean;
|
|
42
|
+
invalidateUIOffset: (name: ViewportUIName) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Resolves user-supplied viewport offsets into concrete per-side pixel
|
|
45
|
+
* values. Static sides take precedence over UI-derived sides.
|
|
46
|
+
*/
|
|
47
|
+
resolveOffsets: (offsets: ViewportOffsets | undefined) => Offsets | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Measures the currently rendered editor UI and returns the usable viewport
|
|
50
|
+
* offsets, including optional padding and reserved hidden surfaces.
|
|
51
|
+
*/
|
|
52
|
+
getOffsets: (opts?: ViewportOffsetsOptions) => Offsets;
|
|
53
|
+
/** Resolves the host-supplied initial viewport against restored scene data. */
|
|
54
|
+
resolveInitialViewport: (opts: Omit<SetViewportOptions, "animation">, elementsMap: NonDeletedSceneElementsMap, appState: AppState) => (Viewport & {
|
|
55
|
+
scrollConstraints: ScrollConstraints | null;
|
|
56
|
+
}) | null;
|
|
57
|
+
/** Navigates to a target and optionally installs scroll/zoom constraints. */
|
|
58
|
+
setViewport: (opts: SetViewportOptions | null) => void;
|
|
59
|
+
/** Use when changing scrollX/scrollY/zoom based on user interaction. */
|
|
60
|
+
translate: <K extends keyof AppState>(state: AppState | Pick<AppState, K> | null | ((prevState: Readonly<AppState>, props: Readonly<AppProps>) => AppState | Pick<AppState, K> | null), opts?: {
|
|
61
|
+
zoomPreConstrained?: boolean;
|
|
62
|
+
preserveScrollConstraintsSnapBack?: boolean;
|
|
63
|
+
}) => boolean;
|
|
64
|
+
/** Clamps the viewport into the active scroll constraints. */
|
|
65
|
+
constrain: (overscroll?: number) => void;
|
|
66
|
+
/** Releases a held rubberband overscroll. */
|
|
67
|
+
releaseOverscroll: () => void;
|
|
68
|
+
private snapBack;
|
|
69
|
+
private snapBackDebounced;
|
|
70
|
+
private cancelTransition;
|
|
71
|
+
destroy: () => void;
|
|
72
|
+
}
|
|
73
|
+
export {};
|