@tldraw/editor
Version:
tldraw infinite canvas SDK (editor).
76 lines (75 loc) • 2.16 kB
JavaScript
import { Fragment } from "react";
import { DEFAULT_CAMERA_OPTIONS } from "./constants.mjs";
const defaultTldrawOptions = {
maxShapesPerPage: 4e3,
maxFilesAtOnce: 100,
maxPages: 40,
animationMediumMs: 320,
followChaseViewportSnap: 2,
doubleClickDurationMs: 450,
multiClickDurationMs: 200,
coarseDragDistanceSquared: 36,
// 6 squared
dragDistanceSquared: 16,
// 4 squared
uiDragDistanceSquared: 16,
// 4 squared
// it's really easy to accidentally drag from the toolbar on mobile, so we use a much larger
// threshold than usual here to try and prevent accidental drags.
uiCoarseDragDistanceSquared: 625,
// 25 squared
defaultSvgPadding: 32,
cameraSlideFriction: 0.09,
gridSteps: [
{ min: -1, mid: 0.15, step: 64 },
{ min: 0.05, mid: 0.375, step: 16 },
{ min: 0.15, mid: 1, step: 4 },
{ min: 0.7, mid: 2.5, step: 1 }
],
collaboratorInactiveTimeoutMs: 6e4,
collaboratorIdleTimeoutMs: 3e3,
collaboratorCheckIntervalMs: 1200,
cameraMovingTimeoutMs: 64,
hitTestMargin: 8,
edgeScrollDelay: 200,
edgeScrollEaseDuration: 200,
edgeScrollSpeed: 25,
edgeScrollDistance: 8,
coarsePointerWidth: 12,
coarseHandleRadius: 20,
handleRadius: 12,
longPressDurationMs: 500,
textShadowLod: 0.35,
adjacentShapeMargin: 10,
flattenImageBoundsExpand: 64,
flattenImageBoundsPadding: 16,
laserDelayMs: 1200,
laserFadeoutMs: 500,
maxExportDelayMs: 5e3,
tooltipDelayMs: 700,
temporaryAssetPreviewLifetimeMs: 18e4,
actionShortcutsLocation: "swap",
createTextOnCanvasDoubleClick: true,
exportProvider: Fragment,
enableToolbarKeyboardShortcuts: true,
maxFontsToLoadBeforeRender: Infinity,
nonce: void 0,
debouncedZoom: true,
debouncedZoomThreshold: 500,
spacebarPanning: true,
rightClickPanning: true,
zoomToFitPadding: 128,
snapThreshold: 8,
camera: DEFAULT_CAMERA_OPTIONS,
text: {},
deepLinks: void 0,
quickZoomPreservesScreenBounds: true,
onBeforeCopyToClipboard: void 0,
onBeforePasteFromClipboard: void 0,
onClipboardPasteRaw: void 0,
experimental__onDropOnCanvas: void 0
};
export {
defaultTldrawOptions
};
//# sourceMappingURL=options.mjs.map