@excalidraw/excalidraw 0.17.1-7500-ac247a0 → 0.17.1-b7babe5
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/CHANGELOG.md +56 -2
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-2W5GQUR4.js → chunk-6NMK7JTV.js} +13 -6
- package/dist/browser/dev/excalidraw-assets-dev/chunk-6NMK7JTV.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/chunk-CX3RATXT.js +20324 -0
- package/dist/browser/dev/excalidraw-assets-dev/chunk-CX3RATXT.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{en-OC6JWP3X.js → en-BZY7JRTM.js} +4 -2
- package/dist/browser/dev/excalidraw-assets-dev/{image-5TVMINCA.js → image-CVN3YKRW.js} +2 -4
- package/dist/browser/dev/excalidraw-assets-dev/image-LK4UNFRZ.css +6 -0
- package/dist/browser/dev/excalidraw-assets-dev/image-LK4UNFRZ.css.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/roundRect-T5BX56ZF.js +161 -0
- package/dist/browser/dev/excalidraw-assets-dev/roundRect-T5BX56ZF.js.map +7 -0
- package/dist/browser/dev/index.css +189 -129
- package/dist/browser/dev/index.css.map +3 -3
- package/dist/browser/dev/index.js +34964 -37
- package/dist/browser/dev/index.js.map +4 -4
- package/dist/browser/prod/excalidraw-assets/chunk-VJAIK3AX.js +55 -0
- package/dist/browser/prod/excalidraw-assets/chunk-YYO5DFUW.js +11 -0
- package/dist/browser/prod/excalidraw-assets/en-O2YCQM2W.js +1 -0
- package/dist/browser/prod/excalidraw-assets/image-6FKY54X5.js +1 -0
- package/dist/browser/prod/excalidraw-assets/image-X66R2EM5.css +1 -0
- package/dist/browser/prod/excalidraw-assets/roundRect-2ACQK4DA.js +1 -0
- package/dist/browser/prod/index.css +1 -1
- package/dist/browser/prod/index.js +203 -1
- package/dist/{prod/en-RLIAOBCI.json → dev/en-EY7E2L5O.json} +10 -5
- package/dist/dev/index.css +189 -129
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +38702 -39409
- package/dist/dev/index.js.map +4 -4
- package/dist/excalidraw/actions/actionAddToLibrary.d.ts +15 -15
- package/dist/excalidraw/actions/actionAlign.d.ts +6 -6
- package/dist/excalidraw/actions/actionAlign.js +2 -1
- package/dist/excalidraw/actions/actionBoundText.d.ts +10 -10
- package/dist/excalidraw/actions/actionBoundText.js +8 -8
- package/dist/excalidraw/actions/actionCanvas.d.ts +58 -58
- package/dist/excalidraw/actions/actionClipboard.d.ts +34 -34
- package/dist/excalidraw/actions/actionClipboard.js +9 -2
- package/dist/excalidraw/actions/actionDeleteSelected.d.ts +15 -15
- package/dist/excalidraw/actions/actionDeleteSelected.js +3 -2
- package/dist/excalidraw/actions/actionDistribute.d.ts +2 -2
- package/dist/excalidraw/actions/actionDistribute.js +1 -1
- package/dist/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
- package/dist/excalidraw/actions/actionDuplicateSelection.js +4 -3
- package/dist/excalidraw/actions/actionElementLock.d.ts +10 -10
- package/dist/excalidraw/actions/actionExport.d.ts +43 -43
- package/dist/excalidraw/actions/actionExport.js +4 -4
- package/dist/excalidraw/actions/actionFinalize.d.ts +9 -9
- package/dist/excalidraw/actions/actionFinalize.js +7 -6
- package/dist/excalidraw/actions/actionFlip.d.ts +2 -2
- package/dist/excalidraw/actions/actionFlip.js +11 -11
- package/dist/excalidraw/actions/actionFrame.d.ts +16 -16
- package/dist/excalidraw/actions/actionFrame.js +1 -1
- package/dist/excalidraw/actions/actionGroup.d.ts +10 -10
- package/dist/excalidraw/actions/actionGroup.js +3 -2
- package/dist/excalidraw/actions/actionLinearEditor.d.ts +5 -5
- package/dist/excalidraw/actions/actionLinearEditor.js +1 -1
- package/dist/excalidraw/{element/Hyperlink.d.ts → actions/actionLink.d.ts} +29 -51
- package/dist/excalidraw/actions/actionLink.js +40 -0
- package/dist/excalidraw/actions/actionMenu.d.ts +13 -13
- package/dist/excalidraw/actions/actionNavigate.d.ts +10 -10
- package/dist/excalidraw/actions/actionNavigate.js +1 -1
- package/dist/excalidraw/actions/actionProperties.d.ts +77 -77
- package/dist/excalidraw/actions/actionProperties.js +32 -27
- package/dist/excalidraw/actions/actionSelectAll.d.ts +5 -5
- package/dist/excalidraw/actions/actionSelectAll.js +1 -1
- package/dist/excalidraw/actions/actionStyles.d.ts +7 -7
- package/dist/excalidraw/actions/actionStyles.js +4 -4
- package/dist/excalidraw/actions/actionToggleGridMode.d.ts +5 -5
- package/dist/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +5 -5
- package/dist/excalidraw/actions/actionToggleStats.d.ts +5 -5
- package/dist/excalidraw/actions/actionToggleViewMode.d.ts +5 -5
- package/dist/excalidraw/actions/actionToggleZenMode.d.ts +5 -5
- package/dist/excalidraw/actions/index.d.ts +1 -1
- package/dist/excalidraw/actions/index.js +1 -1
- package/dist/excalidraw/actions/manager.js +2 -1
- package/dist/excalidraw/align.d.ts +2 -2
- package/dist/excalidraw/align.js +2 -2
- package/dist/excalidraw/animated-trail.d.ts +33 -0
- package/dist/excalidraw/animated-trail.js +96 -0
- package/dist/excalidraw/animation-frame-handler.d.ts +16 -0
- package/dist/excalidraw/animation-frame-handler.js +55 -0
- package/dist/excalidraw/appState.d.ts +1 -1
- package/dist/excalidraw/appState.js +1 -3
- package/dist/excalidraw/clipboard.js +5 -5
- package/dist/excalidraw/components/Actions.d.ts +3 -3
- package/dist/excalidraw/components/Actions.js +18 -7
- package/dist/excalidraw/components/App.d.ts +23 -16
- package/dist/excalidraw/components/App.js +387 -272
- package/dist/excalidraw/components/Button.d.ts +1 -1
- package/dist/excalidraw/components/FilledButton.d.ts +2 -2
- package/dist/excalidraw/components/FilledButton.js +27 -3
- package/dist/excalidraw/components/FollowMode/FollowMode.js +1 -1
- package/dist/excalidraw/components/ImageExportDialog.d.ts +2 -1
- package/dist/excalidraw/components/ImageExportDialog.js +17 -13
- package/dist/excalidraw/components/JSONExportDialog.js +1 -1
- package/dist/excalidraw/components/{LaserTool/LaserPointerButton.d.ts → LaserPointerButton.d.ts} +1 -1
- package/dist/excalidraw/components/{LaserTool/LaserPointerButton.js → LaserPointerButton.js} +2 -2
- package/dist/excalidraw/components/LayerUI.js +3 -3
- package/dist/excalidraw/components/MobileMenu.js +1 -1
- package/dist/excalidraw/components/ProjectName.d.ts +0 -1
- package/dist/excalidraw/components/ProjectName.js +1 -1
- package/dist/excalidraw/components/PublishLibrary.js +1 -1
- package/dist/excalidraw/components/SVGLayer.d.ts +8 -0
- package/dist/excalidraw/components/SVGLayer.js +20 -0
- package/dist/excalidraw/components/ShareableLinkDialog.js +10 -10
- package/dist/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/excalidraw/components/Stack.d.ts +2 -2
- package/dist/excalidraw/components/TTDDialog/common.js +10 -1
- package/dist/excalidraw/components/TextField.d.ts +5 -2
- package/dist/excalidraw/components/TextField.js +6 -3
- package/dist/excalidraw/components/Toast.d.ts +3 -2
- package/dist/excalidraw/components/Toast.js +2 -2
- package/dist/excalidraw/components/ToolButton.js +2 -1
- package/dist/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -2
- package/dist/excalidraw/components/canvases/InteractiveCanvas.js +6 -5
- package/dist/excalidraw/components/canvases/StaticCanvas.d.ts +4 -3
- package/dist/excalidraw/components/canvases/StaticCanvas.js +7 -5
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuContent.js +22 -2
- package/dist/excalidraw/components/hyperlink/Hyperlink.d.ts +19 -0
- package/dist/excalidraw/{element → components/hyperlink}/Hyperlink.js +40 -115
- package/dist/excalidraw/components/hyperlink/helpers.d.ts +7 -0
- package/dist/excalidraw/components/hyperlink/helpers.js +49 -0
- package/dist/excalidraw/components/icons.d.ts +2 -1
- package/dist/excalidraw/components/icons.js +2 -1
- package/dist/excalidraw/components/live-collaboration/LiveCollaborationTrigger.js +3 -2
- package/dist/excalidraw/components/main-menu/DefaultItems.js +5 -2
- package/dist/excalidraw/constants.d.ts +6 -0
- package/dist/excalidraw/constants.js +6 -0
- package/dist/excalidraw/data/blob.js +13 -14
- package/dist/excalidraw/data/filesystem.d.ts +1 -1
- package/dist/excalidraw/data/index.d.ts +2 -1
- package/dist/excalidraw/data/index.js +20 -16
- package/dist/excalidraw/data/json.d.ts +1 -1
- package/dist/excalidraw/data/json.js +5 -3
- package/dist/excalidraw/data/library.d.ts +60 -8
- package/dist/excalidraw/data/library.js +302 -33
- package/dist/excalidraw/data/resave.d.ts +1 -1
- package/dist/excalidraw/data/resave.js +2 -2
- package/dist/excalidraw/data/restore.js +8 -13
- package/dist/excalidraw/data/transform.js +13 -9
- package/dist/excalidraw/distribute.d.ts +2 -2
- package/dist/excalidraw/distribute.js +2 -2
- package/dist/excalidraw/element/ElementCanvasButtons.d.ts +3 -2
- package/dist/excalidraw/element/ElementCanvasButtons.js +4 -4
- package/dist/excalidraw/element/binding.d.ts +9 -9
- package/dist/excalidraw/element/binding.js +61 -59
- package/dist/excalidraw/element/bounds.d.ts +5 -5
- package/dist/excalidraw/element/bounds.js +29 -32
- package/dist/excalidraw/element/collision.d.ts +11 -11
- package/dist/excalidraw/element/collision.js +49 -46
- package/dist/excalidraw/element/containerCache.d.ts +11 -0
- package/dist/excalidraw/element/containerCache.js +14 -0
- package/dist/excalidraw/element/dragElements.js +10 -19
- package/dist/excalidraw/element/embeddable.d.ts +12 -13
- package/dist/excalidraw/element/embeddable.js +17 -27
- package/dist/excalidraw/element/image.js +1 -2
- package/dist/excalidraw/element/index.d.ts +8 -1
- package/dist/excalidraw/element/index.js +23 -1
- package/dist/excalidraw/element/linearElementEditor.d.ts +36 -36
- package/dist/excalidraw/element/linearElementEditor.js +79 -80
- package/dist/excalidraw/element/newElement.d.ts +4 -6
- package/dist/excalidraw/element/newElement.js +11 -16
- package/dist/excalidraw/element/resizeElements.d.ts +6 -6
- package/dist/excalidraw/element/resizeElements.js +40 -46
- package/dist/excalidraw/element/resizeTest.d.ts +3 -3
- package/dist/excalidraw/element/resizeTest.js +4 -4
- package/dist/excalidraw/element/sizeHelpers.d.ts +2 -2
- package/dist/excalidraw/element/sizeHelpers.js +2 -2
- package/dist/excalidraw/element/textElement.d.ts +34 -21
- package/dist/excalidraw/element/textElement.js +87 -111
- package/dist/excalidraw/element/textWysiwyg.d.ts +1 -6
- package/dist/excalidraw/element/textWysiwyg.js +15 -37
- package/dist/excalidraw/element/transformHandles.d.ts +4 -4
- package/dist/excalidraw/element/transformHandles.js +6 -6
- package/dist/excalidraw/element/typeChecks.js +4 -1
- package/dist/excalidraw/element/types.d.ts +24 -11
- package/dist/excalidraw/frame.d.ts +26 -20
- package/dist/excalidraw/frame.js +157 -84
- package/dist/excalidraw/groups.d.ts +3 -3
- package/dist/excalidraw/groups.js +11 -3
- package/dist/excalidraw/history.d.ts +1 -1
- package/dist/excalidraw/hooks/useLibraryItemSvg.js +1 -1
- package/dist/excalidraw/index.d.ts +9 -10
- package/dist/excalidraw/index.js +16 -12
- package/dist/excalidraw/laser-trails.d.ts +19 -0
- package/dist/excalidraw/laser-trails.js +95 -0
- package/dist/excalidraw/locales/en.json +10 -5
- package/dist/excalidraw/queue.d.ts +9 -0
- package/dist/excalidraw/queue.js +27 -0
- package/dist/excalidraw/reactUtils.d.ts +14 -0
- package/dist/excalidraw/reactUtils.js +45 -0
- package/dist/excalidraw/renderer/helpers.d.ts +13 -0
- package/dist/excalidraw/renderer/helpers.js +39 -0
- package/dist/excalidraw/renderer/interactiveScene.d.ts +20 -0
- package/dist/excalidraw/renderer/{renderScene.js → interactiveScene.js} +199 -474
- package/dist/excalidraw/renderer/renderElement.d.ts +6 -6
- package/dist/excalidraw/renderer/renderElement.js +54 -366
- package/dist/excalidraw/renderer/staticScene.d.ts +11 -0
- package/dist/excalidraw/renderer/staticScene.js +205 -0
- package/dist/excalidraw/renderer/staticSvgScene.d.ts +5 -0
- package/dist/excalidraw/renderer/staticSvgScene.js +385 -0
- package/dist/excalidraw/scene/Fonts.js +2 -1
- package/dist/excalidraw/scene/Renderer.d.ts +1 -1
- package/dist/excalidraw/scene/Renderer.js +32 -20
- package/dist/excalidraw/scene/Scene.d.ts +10 -9
- package/dist/excalidraw/scene/Scene.js +45 -21
- package/dist/excalidraw/scene/Shape.d.ts +3 -1
- package/dist/excalidraw/scene/Shape.js +7 -5
- package/dist/excalidraw/scene/ShapeCache.d.ts +2 -1
- package/dist/excalidraw/scene/ShapeCache.js +1 -0
- package/dist/excalidraw/scene/comparisons.js +2 -1
- package/dist/excalidraw/scene/export.d.ts +3 -0
- package/dist/excalidraw/scene/export.js +20 -40
- package/dist/excalidraw/scene/index.d.ts +0 -1
- package/dist/excalidraw/scene/index.js +0 -1
- package/dist/excalidraw/scene/scrollbars.d.ts +1 -1
- package/dist/excalidraw/scene/scrollbars.js +1 -1
- package/dist/excalidraw/scene/selection.d.ts +5 -5
- package/dist/excalidraw/scene/selection.js +16 -14
- package/dist/excalidraw/scene/types.d.ts +11 -5
- package/dist/excalidraw/snapping.d.ts +7 -7
- package/dist/excalidraw/snapping.js +21 -20
- package/dist/excalidraw/types.d.ts +16 -17
- package/dist/excalidraw/utility-types.d.ts +7 -0
- package/dist/excalidraw/utils.d.ts +21 -16
- package/dist/excalidraw/utils.js +43 -45
- package/dist/{dev/en-RLIAOBCI.json → prod/en-EY7E2L5O.json} +10 -5
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +42 -42
- package/dist/utils/bbox.d.ts +2 -2
- package/dist/utils/export.d.ts +3 -3
- package/dist/utils/export.js +3 -13
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +2 -2
- package/dist/utils/withinBounds.d.ts +1 -1
- package/dist/utils/withinBounds.js +5 -2
- package/package.json +4 -4
- package/dist/browser/dev/excalidraw-assets-dev/chunk-2W5GQUR4.js.map +0 -7
- package/dist/browser/dev/excalidraw-assets-dev/chunk-KGZXLFLR.js +0 -53497
- package/dist/browser/dev/excalidraw-assets-dev/chunk-KGZXLFLR.js.map +0 -7
- package/dist/browser/dev/excalidraw-assets-dev/image-3MFRCKYM.css +0 -5797
- package/dist/browser/dev/excalidraw-assets-dev/image-3MFRCKYM.css.map +0 -7
- package/dist/browser/prod/excalidraw-assets/chunk-4YN2HN3S.js +0 -257
- package/dist/browser/prod/excalidraw-assets/chunk-OWLL6VOG.js +0 -11
- package/dist/browser/prod/excalidraw-assets/en-ERQOR3OC.js +0 -1
- package/dist/browser/prod/excalidraw-assets/image-LTLHTTSE.js +0 -1
- package/dist/browser/prod/excalidraw-assets/image-QBL334OA.css +0 -1
- package/dist/excalidraw/components/LaserTool/LaserPathManager.d.ts +0 -28
- package/dist/excalidraw/components/LaserTool/LaserPathManager.js +0 -225
- package/dist/excalidraw/components/LaserTool/LaserTool.d.ts +0 -8
- package/dist/excalidraw/components/LaserTool/LaserTool.js +0 -15
- package/dist/excalidraw/renderer/renderScene.d.ts +0 -25
- package/dist/excalidraw/vite.config.d.mts +0 -2
- package/dist/excalidraw/vite.config.mjs +0 -13
- /package/dist/browser/dev/excalidraw-assets-dev/{en-OC6JWP3X.js.map → en-BZY7JRTM.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{image-5TVMINCA.js.map → image-CVN3YKRW.js.map} +0 -0
|
@@ -8,16 +8,18 @@ import MainMenu from "./components/main-menu/MainMenu";
|
|
|
8
8
|
import WelcomeScreen from "./components/welcome-screen/WelcomeScreen";
|
|
9
9
|
import LiveCollaborationTrigger from "./components/live-collaboration/LiveCollaborationTrigger";
|
|
10
10
|
export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawProps) => JSX.Element>;
|
|
11
|
-
export { getSceneVersion, isInvisiblySmallElement, getNonDeletedElements, } from "./element";
|
|
11
|
+
export { getSceneVersion, hashElementsVersion, hashString, isInvisiblySmallElement, getNonDeletedElements, } from "./element";
|
|
12
12
|
export { defaultLang, useI18n, languages } from "./i18n";
|
|
13
13
|
export { restore, restoreAppState, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
14
|
-
export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "../utils/
|
|
14
|
+
export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "../utils/export";
|
|
15
15
|
export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
|
|
16
|
-
export {
|
|
16
|
+
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
|
|
17
|
+
export { getFreeDrawSvgPath } from "./renderer/renderElement";
|
|
18
|
+
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
17
19
|
export { isLinearElement } from "./element/typeChecks";
|
|
18
|
-
export { FONT_FAMILY, THEME, MIME_TYPES } from "./constants";
|
|
20
|
+
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS } from "./constants";
|
|
19
21
|
export { mutateElement, newElementWith, bumpVersion, } from "./element/mutateElement";
|
|
20
|
-
export { parseLibraryTokensFromUrl, useHandleLibrary
|
|
22
|
+
export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
|
|
21
23
|
export { sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, } from "./utils";
|
|
22
24
|
export { Sidebar } from "./components/Sidebar/Sidebar";
|
|
23
25
|
export { Button } from "./components/Button";
|
|
@@ -32,8 +34,5 @@ export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger";
|
|
|
32
34
|
export { normalizeLink } from "./data/url";
|
|
33
35
|
export { zoomToFitBounds } from "./actions/actionCanvas";
|
|
34
36
|
export { convertToExcalidrawElements } from "./data/transform";
|
|
35
|
-
export { getCommonBounds, getVisibleSceneBounds
|
|
36
|
-
export {
|
|
37
|
-
export { isValueInRange, rotatePoint } from "./math";
|
|
38
|
-
export { isArrowElement, isExcalidrawElement, isFreeDrawElement, isTextElement, } from "./element/typeChecks";
|
|
39
|
-
export { getFreeDrawSvgPath } from "./renderer/renderElement";
|
|
37
|
+
export { getCommonBounds, getVisibleSceneBounds } from "./element/bounds";
|
|
38
|
+
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "../utils/withinBounds";
|
package/dist/excalidraw/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import WelcomeScreen from "./components/welcome-screen/WelcomeScreen";
|
|
|
17
17
|
import LiveCollaborationTrigger from "./components/live-collaboration/LiveCollaborationTrigger";
|
|
18
18
|
polyfill();
|
|
19
19
|
const ExcalidrawBase = (props) => {
|
|
20
|
-
const { onChange, initialData, excalidrawAPI, isCollaborating = false, onPointerUpdate, renderTopRightUI, langCode = defaultLang.code, viewModeEnabled, zenModeEnabled, gridModeEnabled, libraryReturnUrl, theme, name, renderCustomStats, onPaste, detectScroll = true, handleKeyboardGlobally = false, onLibraryChange, autoFocus = false, generateIdForFile, onLinkOpen, onPointerDown, onScrollChange, children, validateEmbeddable, renderEmbeddable, aiEnabled, } = props;
|
|
20
|
+
const { onChange, initialData, excalidrawAPI, isCollaborating = false, onPointerUpdate, renderTopRightUI, langCode = defaultLang.code, viewModeEnabled, zenModeEnabled, gridModeEnabled, libraryReturnUrl, theme, name, renderCustomStats, onPaste, detectScroll = true, handleKeyboardGlobally = false, onLibraryChange, autoFocus = false, generateIdForFile, onLinkOpen, onPointerDown, onPointerUp, onScrollChange, children, validateEmbeddable, renderEmbeddable, aiEnabled, } = props;
|
|
21
21
|
const canvasActions = props.UIOptions?.canvasActions;
|
|
22
22
|
// FIXME normalize/set defaults in parent component so that the memo resolver
|
|
23
23
|
// compares the same values
|
|
@@ -41,6 +41,11 @@ const ExcalidrawBase = (props) => {
|
|
|
41
41
|
UIOptions.canvasActions.toggleTheme = true;
|
|
42
42
|
}
|
|
43
43
|
useEffect(() => {
|
|
44
|
+
const importPolyfill = async () => {
|
|
45
|
+
//@ts-ignore
|
|
46
|
+
await import("canvas-roundrect-polyfill");
|
|
47
|
+
};
|
|
48
|
+
importPolyfill();
|
|
44
49
|
// Block pinch-zooming on iOS outside of the content area
|
|
45
50
|
const handleTouchMove = (event) => {
|
|
46
51
|
// @ts-ignore
|
|
@@ -55,7 +60,7 @@ const ExcalidrawBase = (props) => {
|
|
|
55
60
|
document.removeEventListener("touchmove", handleTouchMove);
|
|
56
61
|
};
|
|
57
62
|
}, []);
|
|
58
|
-
return (_jsx(Provider, { unstable_createStore: () => jotaiStore, scope: jotaiScope, children: _jsx(InitializeApp, { langCode: langCode, theme: theme, children: _jsx(App, { onChange: onChange, initialData: initialData, excalidrawAPI: excalidrawAPI, isCollaborating: isCollaborating, onPointerUpdate: onPointerUpdate, renderTopRightUI: renderTopRightUI, langCode: langCode, viewModeEnabled: viewModeEnabled, zenModeEnabled: zenModeEnabled, gridModeEnabled: gridModeEnabled, libraryReturnUrl: libraryReturnUrl, theme: theme, name: name, renderCustomStats: renderCustomStats, UIOptions: UIOptions, onPaste: onPaste, detectScroll: detectScroll, handleKeyboardGlobally: handleKeyboardGlobally, onLibraryChange: onLibraryChange, autoFocus: autoFocus, generateIdForFile: generateIdForFile, onLinkOpen: onLinkOpen, onPointerDown: onPointerDown, onScrollChange: onScrollChange, validateEmbeddable: validateEmbeddable, renderEmbeddable: renderEmbeddable, aiEnabled: aiEnabled !== false, children: children }) }) }));
|
|
63
|
+
return (_jsx(Provider, { unstable_createStore: () => jotaiStore, scope: jotaiScope, children: _jsx(InitializeApp, { langCode: langCode, theme: theme, children: _jsx(App, { onChange: onChange, initialData: initialData, excalidrawAPI: excalidrawAPI, isCollaborating: isCollaborating, onPointerUpdate: onPointerUpdate, renderTopRightUI: renderTopRightUI, langCode: langCode, viewModeEnabled: viewModeEnabled, zenModeEnabled: zenModeEnabled, gridModeEnabled: gridModeEnabled, libraryReturnUrl: libraryReturnUrl, theme: theme, name: name, renderCustomStats: renderCustomStats, UIOptions: UIOptions, onPaste: onPaste, detectScroll: detectScroll, handleKeyboardGlobally: handleKeyboardGlobally, onLibraryChange: onLibraryChange, autoFocus: autoFocus, generateIdForFile: generateIdForFile, onLinkOpen: onLinkOpen, onPointerDown: onPointerDown, onPointerUp: onPointerUp, onScrollChange: onScrollChange, validateEmbeddable: validateEmbeddable, renderEmbeddable: renderEmbeddable, aiEnabled: aiEnabled !== false, children: children }) }) }));
|
|
59
64
|
};
|
|
60
65
|
const areEqual = (prevProps, nextProps) => {
|
|
61
66
|
// short-circuit early
|
|
@@ -90,16 +95,18 @@ const areEqual = (prevProps, nextProps) => {
|
|
|
90
95
|
};
|
|
91
96
|
export const Excalidraw = React.memo(ExcalidrawBase, areEqual);
|
|
92
97
|
Excalidraw.displayName = "Excalidraw";
|
|
93
|
-
export { getSceneVersion, isInvisiblySmallElement, getNonDeletedElements, } from "./element";
|
|
98
|
+
export { getSceneVersion, hashElementsVersion, hashString, isInvisiblySmallElement, getNonDeletedElements, } from "./element";
|
|
94
99
|
export { defaultLang, useI18n, languages } from "./i18n";
|
|
95
100
|
export { restore, restoreAppState, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
96
|
-
export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "../utils/
|
|
101
|
+
export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "../utils/export";
|
|
97
102
|
export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
|
|
98
|
-
export {
|
|
103
|
+
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
|
|
104
|
+
export { getFreeDrawSvgPath } from "./renderer/renderElement";
|
|
105
|
+
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
99
106
|
export { isLinearElement } from "./element/typeChecks";
|
|
100
|
-
export { FONT_FAMILY, THEME, MIME_TYPES } from "./constants";
|
|
107
|
+
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS } from "./constants";
|
|
101
108
|
export { mutateElement, newElementWith, bumpVersion, } from "./element/mutateElement";
|
|
102
|
-
export { parseLibraryTokensFromUrl, useHandleLibrary
|
|
109
|
+
export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
|
|
103
110
|
export { sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, } from "./utils";
|
|
104
111
|
export { Sidebar } from "./components/Sidebar/Sidebar";
|
|
105
112
|
export { Button } from "./components/Button";
|
|
@@ -114,8 +121,5 @@ export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger";
|
|
|
114
121
|
export { normalizeLink } from "./data/url";
|
|
115
122
|
export { zoomToFitBounds } from "./actions/actionCanvas";
|
|
116
123
|
export { convertToExcalidrawElements } from "./data/transform";
|
|
117
|
-
export { getCommonBounds, getVisibleSceneBounds
|
|
118
|
-
export {
|
|
119
|
-
export { isValueInRange, rotatePoint } from "./math";
|
|
120
|
-
export { isArrowElement, isExcalidrawElement, isFreeDrawElement, isTextElement, } from "./element/typeChecks";
|
|
121
|
-
export { getFreeDrawSvgPath } from "./renderer/renderElement";
|
|
124
|
+
export { getCommonBounds, getVisibleSceneBounds } from "./element/bounds";
|
|
125
|
+
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "../utils/withinBounds";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AnimatedTrail, Trail } from "./animated-trail";
|
|
2
|
+
import { AnimationFrameHandler } from "./animation-frame-handler";
|
|
3
|
+
import type App from "./components/App";
|
|
4
|
+
export declare class LaserTrails implements Trail {
|
|
5
|
+
private animationFrameHandler;
|
|
6
|
+
private app;
|
|
7
|
+
localTrail: AnimatedTrail;
|
|
8
|
+
private collabTrails;
|
|
9
|
+
private container?;
|
|
10
|
+
constructor(animationFrameHandler: AnimationFrameHandler, app: App);
|
|
11
|
+
private getTrailOptions;
|
|
12
|
+
startPath(x: number, y: number): void;
|
|
13
|
+
addPointToPath(x: number, y: number): void;
|
|
14
|
+
endPath(): void;
|
|
15
|
+
start(container: SVGSVGElement): void;
|
|
16
|
+
stop(): void;
|
|
17
|
+
onFrame(): void;
|
|
18
|
+
private updateCollabTrails;
|
|
19
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { AnimatedTrail } from "./animated-trail";
|
|
2
|
+
import { easeOut } from "./utils";
|
|
3
|
+
import { getClientColor } from "./clients";
|
|
4
|
+
export class LaserTrails {
|
|
5
|
+
animationFrameHandler;
|
|
6
|
+
app;
|
|
7
|
+
localTrail;
|
|
8
|
+
collabTrails = new Map();
|
|
9
|
+
container;
|
|
10
|
+
constructor(animationFrameHandler, app) {
|
|
11
|
+
this.animationFrameHandler = animationFrameHandler;
|
|
12
|
+
this.app = app;
|
|
13
|
+
this.animationFrameHandler.register(this, this.onFrame.bind(this));
|
|
14
|
+
this.localTrail = new AnimatedTrail(animationFrameHandler, app, {
|
|
15
|
+
...this.getTrailOptions(),
|
|
16
|
+
fill: () => "red",
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
getTrailOptions() {
|
|
20
|
+
return {
|
|
21
|
+
simplify: 0,
|
|
22
|
+
streamline: 0.4,
|
|
23
|
+
sizeMapping: (c) => {
|
|
24
|
+
const DECAY_TIME = 1000;
|
|
25
|
+
const DECAY_LENGTH = 50;
|
|
26
|
+
const t = Math.max(0, 1 - (performance.now() - c.pressure) / DECAY_TIME);
|
|
27
|
+
const l = (DECAY_LENGTH -
|
|
28
|
+
Math.min(DECAY_LENGTH, c.totalLength - c.currentIndex)) /
|
|
29
|
+
DECAY_LENGTH;
|
|
30
|
+
return Math.min(easeOut(l), easeOut(t));
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
startPath(x, y) {
|
|
35
|
+
this.localTrail.startPath(x, y);
|
|
36
|
+
}
|
|
37
|
+
addPointToPath(x, y) {
|
|
38
|
+
this.localTrail.addPointToPath(x, y);
|
|
39
|
+
}
|
|
40
|
+
endPath() {
|
|
41
|
+
this.localTrail.endPath();
|
|
42
|
+
}
|
|
43
|
+
start(container) {
|
|
44
|
+
this.container = container;
|
|
45
|
+
this.animationFrameHandler.start(this);
|
|
46
|
+
this.localTrail.start(container);
|
|
47
|
+
}
|
|
48
|
+
stop() {
|
|
49
|
+
this.animationFrameHandler.stop(this);
|
|
50
|
+
this.localTrail.stop();
|
|
51
|
+
}
|
|
52
|
+
onFrame() {
|
|
53
|
+
this.updateCollabTrails();
|
|
54
|
+
}
|
|
55
|
+
updateCollabTrails() {
|
|
56
|
+
if (!this.container || this.app.state.collaborators.size === 0) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
for (const [key, collabolator] of this.app.state.collaborators.entries()) {
|
|
60
|
+
let trail;
|
|
61
|
+
if (!this.collabTrails.has(key)) {
|
|
62
|
+
trail = new AnimatedTrail(this.animationFrameHandler, this.app, {
|
|
63
|
+
...this.getTrailOptions(),
|
|
64
|
+
fill: () => getClientColor(key),
|
|
65
|
+
});
|
|
66
|
+
trail.start(this.container);
|
|
67
|
+
this.collabTrails.set(key, trail);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
trail = this.collabTrails.get(key);
|
|
71
|
+
}
|
|
72
|
+
if (collabolator.pointer && collabolator.pointer.tool === "laser") {
|
|
73
|
+
if (collabolator.button === "down" && !trail.hasCurrentTrail) {
|
|
74
|
+
trail.startPath(collabolator.pointer.x, collabolator.pointer.y);
|
|
75
|
+
}
|
|
76
|
+
if (collabolator.button === "down" &&
|
|
77
|
+
trail.hasCurrentTrail &&
|
|
78
|
+
!trail.hasLastPoint(collabolator.pointer.x, collabolator.pointer.y)) {
|
|
79
|
+
trail.addPointToPath(collabolator.pointer.x, collabolator.pointer.y);
|
|
80
|
+
}
|
|
81
|
+
if (collabolator.button === "up" && trail.hasCurrentTrail) {
|
|
82
|
+
trail.addPointToPath(collabolator.pointer.x, collabolator.pointer.y);
|
|
83
|
+
trail.endPath();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
for (const key of this.collabTrails.keys()) {
|
|
88
|
+
if (!this.app.state.collaborators.has(key)) {
|
|
89
|
+
const trail = this.collabTrails.get(key);
|
|
90
|
+
trail.stop();
|
|
91
|
+
this.collabTrails.delete(key);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -138,7 +138,9 @@
|
|
|
138
138
|
"removeAllElementsFromFrame": "Remove all elements from frame",
|
|
139
139
|
"eyeDropper": "Pick color from canvas",
|
|
140
140
|
"textToDiagram": "Text to diagram",
|
|
141
|
-
"prompt": "Prompt"
|
|
141
|
+
"prompt": "Prompt",
|
|
142
|
+
"followUs": "Follow us",
|
|
143
|
+
"discordChat": "Discord chat"
|
|
142
144
|
},
|
|
143
145
|
"library": {
|
|
144
146
|
"noItems": "No items added yet...",
|
|
@@ -212,9 +214,9 @@
|
|
|
212
214
|
"fileTooBig": "File is too big. Maximum allowed size is {{maxSize}}.",
|
|
213
215
|
"svgImageInsertError": "Couldn't insert SVG image. The SVG markup looks invalid.",
|
|
214
216
|
"failedToFetchImage": "Failed to fetch image.",
|
|
215
|
-
"invalidSVGString": "Invalid SVG.",
|
|
216
217
|
"cannotResolveCollabServer": "Couldn't connect to the collab server. Please reload the page and try again.",
|
|
217
218
|
"importLibraryError": "Couldn't load library",
|
|
219
|
+
"saveLibraryError": "Couldn't save library to storage. Please save your library to a file locally to make sure you don't lose changes.",
|
|
218
220
|
"collabSaveFailed": "Couldn't save to the backend database. If problems persist, you should save your file locally to ensure you don't lose your work.",
|
|
219
221
|
"collabSaveFailed_sizeExceeded": "Couldn't save to the backend database, the canvas seems to be too big. You should save the file locally to ensure you don't lose your work.",
|
|
220
222
|
"imageToolNotSupported": "Images are disabled.",
|
|
@@ -246,7 +248,7 @@
|
|
|
246
248
|
"library": "Library",
|
|
247
249
|
"lock": "Keep selected tool active after drawing",
|
|
248
250
|
"penMode": "Pen mode - prevent touch",
|
|
249
|
-
"link": "Add/ Update link for a selected shape",
|
|
251
|
+
"link": "Add / Update link for a selected shape",
|
|
250
252
|
"eraser": "Eraser",
|
|
251
253
|
"frame": "Frame tool",
|
|
252
254
|
"magicframe": "Wireframe to code",
|
|
@@ -299,9 +301,12 @@
|
|
|
299
301
|
"openIssueMessage": "We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our <button>bug tracker</button>. Please include information below by copying and pasting into the GitHub issue.",
|
|
300
302
|
"sceneContent": "Scene content:"
|
|
301
303
|
},
|
|
304
|
+
"shareDialog": {
|
|
305
|
+
"or": "Or"
|
|
306
|
+
},
|
|
302
307
|
"roomDialog": {
|
|
303
|
-
"desc_intro": "
|
|
304
|
-
"desc_privacy": "Don't worry, the session
|
|
308
|
+
"desc_intro": "Invite people to collaborate on your drawing.",
|
|
309
|
+
"desc_privacy": "Don't worry, the session is end-to-end encrypted, and fully private. Not even our server can see what you draw.",
|
|
305
310
|
"button_startSession": "Start session",
|
|
306
311
|
"button_stopSession": "Stop session",
|
|
307
312
|
"desc_inProgressIntro": "Live-collaboration session is now in progress.",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MaybePromise } from "./utility-types";
|
|
2
|
+
type Job<T, TArgs extends unknown[]> = (...args: TArgs) => MaybePromise<T>;
|
|
3
|
+
export declare class Queue {
|
|
4
|
+
private jobs;
|
|
5
|
+
private running;
|
|
6
|
+
private tick;
|
|
7
|
+
push<TValue, TArgs extends unknown[]>(jobFactory: Job<TValue, TArgs>, ...args: TArgs): Promise<TValue>;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { promiseTry, resolvablePromise } from "./utils";
|
|
2
|
+
export class Queue {
|
|
3
|
+
jobs = [];
|
|
4
|
+
running = false;
|
|
5
|
+
tick() {
|
|
6
|
+
if (this.running) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const job = this.jobs.shift();
|
|
10
|
+
if (job) {
|
|
11
|
+
this.running = true;
|
|
12
|
+
job.promise.resolve(promiseTry(job.jobFactory, ...job.args).finally(() => {
|
|
13
|
+
this.running = false;
|
|
14
|
+
this.tick();
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.running = false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
push(jobFactory, ...args) {
|
|
22
|
+
const promise = resolvablePromise();
|
|
23
|
+
this.jobs.push({ jobFactory, promise, args });
|
|
24
|
+
this.tick();
|
|
25
|
+
return promise;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param func handler taking at most single parameter (event).
|
|
3
|
+
*/
|
|
4
|
+
export declare const withBatchedUpdates: <TFunction extends ((event: any) => void) | (() => void)>(func: Parameters<TFunction>["length"] extends 0 | 1 ? TFunction : never) => TFunction;
|
|
5
|
+
/**
|
|
6
|
+
* barches React state updates and throttles the calls to a single call per
|
|
7
|
+
* animation frame
|
|
8
|
+
*/
|
|
9
|
+
export declare const withBatchedUpdatesThrottled: <TFunction extends ((event: any) => void) | (() => void)>(func: Parameters<TFunction>["length"] extends 0 | 1 ? TFunction : never) => {
|
|
10
|
+
(...args: Parameters<TFunction>): void;
|
|
11
|
+
flush(): void;
|
|
12
|
+
cancel(): void;
|
|
13
|
+
};
|
|
14
|
+
export declare const isRenderThrottlingEnabled: () => boolean;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param func handler taking at most single parameter (event).
|
|
3
|
+
*/
|
|
4
|
+
import { unstable_batchedUpdates } from "react-dom";
|
|
5
|
+
import { version as ReactVersion } from "react";
|
|
6
|
+
import { throttleRAF } from "./utils";
|
|
7
|
+
export const withBatchedUpdates = (func) => ((event) => {
|
|
8
|
+
unstable_batchedUpdates(func, event);
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* barches React state updates and throttles the calls to a single call per
|
|
12
|
+
* animation frame
|
|
13
|
+
*/
|
|
14
|
+
export const withBatchedUpdatesThrottled = (func) => {
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
return throttleRAF(((event) => {
|
|
17
|
+
unstable_batchedUpdates(func, event);
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
export const isRenderThrottlingEnabled = (() => {
|
|
21
|
+
// we don't want to throttle in react < 18 because of #5439 and it was
|
|
22
|
+
// getting more complex to maintain the fix
|
|
23
|
+
let IS_REACT_18_AND_UP;
|
|
24
|
+
try {
|
|
25
|
+
const version = ReactVersion.split(".");
|
|
26
|
+
IS_REACT_18_AND_UP = Number(version[0]) > 17;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
IS_REACT_18_AND_UP = false;
|
|
30
|
+
}
|
|
31
|
+
let hasWarned = false;
|
|
32
|
+
return () => {
|
|
33
|
+
if (window.EXCALIDRAW_THROTTLE_RENDER === true) {
|
|
34
|
+
if (!IS_REACT_18_AND_UP) {
|
|
35
|
+
if (!hasWarned) {
|
|
36
|
+
hasWarned = true;
|
|
37
|
+
console.warn("Excalidraw: render throttling is disabled on React versions < 18.");
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StaticCanvasAppState, AppState } from "../types";
|
|
2
|
+
import { StaticCanvasRenderConfig } from "../scene/types";
|
|
3
|
+
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke?: boolean) => void;
|
|
4
|
+
export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
|
|
5
|
+
export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }: {
|
|
6
|
+
canvas: HTMLCanvasElement;
|
|
7
|
+
scale: number;
|
|
8
|
+
normalizedWidth: number;
|
|
9
|
+
normalizedHeight: number;
|
|
10
|
+
theme?: import("../element/types").Theme | undefined;
|
|
11
|
+
isExporting?: boolean | undefined;
|
|
12
|
+
viewBackgroundColor?: string | null | undefined;
|
|
13
|
+
}) => CanvasRenderingContext2D;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { THEME_FILTER } from "../constants";
|
|
2
|
+
export const fillCircle = (context, cx, cy, radius, stroke = true) => {
|
|
3
|
+
context.beginPath();
|
|
4
|
+
context.arc(cx, cy, radius, 0, Math.PI * 2);
|
|
5
|
+
context.fill();
|
|
6
|
+
if (stroke) {
|
|
7
|
+
context.stroke();
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
export const getNormalizedCanvasDimensions = (canvas, scale) => {
|
|
11
|
+
// When doing calculations based on canvas width we should used normalized one
|
|
12
|
+
return [canvas.width / scale, canvas.height / scale];
|
|
13
|
+
};
|
|
14
|
+
export const bootstrapCanvas = ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }) => {
|
|
15
|
+
const context = canvas.getContext("2d");
|
|
16
|
+
context.setTransform(1, 0, 0, 1, 0, 0);
|
|
17
|
+
context.scale(scale, scale);
|
|
18
|
+
if (isExporting && theme === "dark") {
|
|
19
|
+
context.filter = THEME_FILTER;
|
|
20
|
+
}
|
|
21
|
+
// Paint background
|
|
22
|
+
if (typeof viewBackgroundColor === "string") {
|
|
23
|
+
const hasTransparence = viewBackgroundColor === "transparent" ||
|
|
24
|
+
viewBackgroundColor.length === 5 || // #RGBA
|
|
25
|
+
viewBackgroundColor.length === 9 || // #RRGGBBA
|
|
26
|
+
/(hsla|rgba)\(/.test(viewBackgroundColor);
|
|
27
|
+
if (hasTransparence) {
|
|
28
|
+
context.clearRect(0, 0, normalizedWidth, normalizedHeight);
|
|
29
|
+
}
|
|
30
|
+
context.save();
|
|
31
|
+
context.fillStyle = viewBackgroundColor;
|
|
32
|
+
context.fillRect(0, 0, normalizedWidth, normalizedHeight);
|
|
33
|
+
context.restore();
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
context.clearRect(0, 0, normalizedWidth, normalizedHeight);
|
|
37
|
+
}
|
|
38
|
+
return context;
|
|
39
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InteractiveSceneRenderConfig, RenderableElementsMap } from "../scene/types";
|
|
2
|
+
/** throttled to animation framerate */
|
|
3
|
+
export declare const renderInteractiveSceneThrottled: {
|
|
4
|
+
(config: InteractiveSceneRenderConfig): void;
|
|
5
|
+
flush(): void;
|
|
6
|
+
cancel(): void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Interactive scene is the ui-canvas where we render bounding boxes, selections
|
|
10
|
+
* and other ui stuff.
|
|
11
|
+
*/
|
|
12
|
+
export declare const renderInteractiveScene: <U extends ({ canvas, elementsMap, visibleElements, selectedElements, scale, appState, renderConfig, }: InteractiveSceneRenderConfig) => {
|
|
13
|
+
atLeastOneVisibleElement: boolean;
|
|
14
|
+
elementsMap: RenderableElementsMap;
|
|
15
|
+
scrollBars?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
scrollBars: import("../scene/types").ScrollBars | undefined;
|
|
18
|
+
atLeastOneVisibleElement: boolean;
|
|
19
|
+
elementsMap: RenderableElementsMap;
|
|
20
|
+
}, T extends boolean = false>(renderConfig: InteractiveSceneRenderConfig, throttle?: T | undefined) => T extends true ? void : ReturnType<U>;
|