@mocanvas/editor 4.4.3 → 4.5.0

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/index.js CHANGED
@@ -4,7 +4,7 @@ import { createRecordType, isIndexKey, createMigrationIds, uniqueId, isRecordsDi
4
4
  export { ZERO_INDEX_KEY, createComputedCache, getGraphemeLength, getGraphemes, getIndexAbove, getIndexBelow, getIndexBetween, getIndices, getIndicesAbove, getIndicesBelow, getIndicesBetween, iterateGraphemes, sortByIndex } from '@mocanvas/store';
5
5
  import { PATH_OP, FLAG, GEO_FLAG, EngineBridge, VERTEX_FLOATS, BATCH_WORDS, readClip } from '@mocanvas/wasm';
6
6
  export { EngineBridge, FLAG, GEO_FLAG, GEO_KIND, PATH_OP, getLoadedEngine, loadEngine, loadEngineSync } from '@mocanvas/wasm';
7
- import { createContext, useEffect, useRef, useLayoutEffect, useContext, useMemo, useId, useCallback, useState, Component } from 'react';
7
+ import { createContext, useEffect, useRef, useLayoutEffect, useContext, Component, useMemo, useId, useCallback, useState } from 'react';
8
8
  import { track as track$1, useValue } from '@mocanvas/state/react';
9
9
  export { track, useAtom, useComputed, useQuickReactor, useReactor, useStateTracking, useValue } from '@mocanvas/state/react';
10
10
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -2521,7 +2521,10 @@ var InstanceRecordType = createRecordType("instance", { scope: "session" }).with
2521
2521
  isFocusMode: false,
2522
2522
  isDebugMode: false,
2523
2523
  isToolLocked: false,
2524
- isGridMode: false,
2524
+ // On by default: a canvas is a drawing surface and the grid is how a
2525
+ // person judges size and alignment on one. An app that wants a blank page
2526
+ // sets it false on its instance record.
2527
+ isGridMode: true,
2525
2528
  isReadonly: false,
2526
2529
  isFocused: false,
2527
2530
  isPenMode: false,
@@ -5202,7 +5205,7 @@ var LIGHT_SURFACE = {
5202
5205
  selectFill: "rgba(68, 101, 233, 0.10)",
5203
5206
  selectStroke: "#4465e9",
5204
5207
  hint: "#cc00cc",
5205
- grid: "#dfe2e5"
5208
+ grid: "#b4bcc4"
5206
5209
  };
5207
5210
  var DARK_SURFACE = {
5208
5211
  background: "#101011",
@@ -5211,7 +5214,7 @@ var DARK_SURFACE = {
5211
5214
  selectFill: "rgba(122, 151, 245, 0.14)",
5212
5215
  selectStroke: "#7a97f5",
5213
5216
  hint: "#ff66ff",
5214
- grid: "#2a2a2e"
5217
+ grid: "#46464d"
5215
5218
  };
5216
5219
  var DARK_INKS = {
5217
5220
  black: "#f2f2f2",
@@ -14458,15 +14461,30 @@ function DefaultGrid({ x, y, z, size }) {
14458
14461
  const id = useSharedSafeId("grid");
14459
14462
  const step = size * z;
14460
14463
  const fineOpacity = Math.min(1, Math.max(0, (step - 4) / 12));
14464
+ const FINE = 0.7;
14465
+ const MAJOR = 0.9;
14461
14466
  return /* @__PURE__ */ jsxs("svg", { className: "mocanvas-grid", style: { position: "absolute", inset: 0, width: "100%", height: "100%", pointerEvents: "none" }, "aria-hidden": "true", children: [
14462
14467
  /* @__PURE__ */ jsxs("defs", { children: [
14463
- /* @__PURE__ */ jsx("pattern", { id, width: step, height: step, patternUnits: "userSpaceOnUse", patternTransform: `translate(${x * z} ${y * z})`, children: /* @__PURE__ */ jsx("circle", { cx: 0, cy: 0, r: 1, fill: "var(--mocanvas-grid, currentColor)", opacity: fineOpacity * 0.5 }) }),
14464
- /* @__PURE__ */ jsx("pattern", { id: `${id}_major`, width: step * 5, height: step * 5, patternUnits: "userSpaceOnUse", patternTransform: `translate(${x * z} ${y * z})`, children: /* @__PURE__ */ jsx("circle", { cx: 0, cy: 0, r: 1.5, fill: "var(--mocanvas-grid, currentColor)", opacity: 0.8 }) })
14468
+ /* @__PURE__ */ jsx("pattern", { id, width: step, height: step, patternUnits: "userSpaceOnUse", patternTransform: `translate(${x * z} ${y * z})`, children: /* @__PURE__ */ jsx("circle", { cx: 0, cy: 0, r: 1, fill: "var(--mocanvas-grid, currentColor)", opacity: fineOpacity * FINE }) }),
14469
+ /* @__PURE__ */ jsx("pattern", { id: `${id}_major`, width: step * 5, height: step * 5, patternUnits: "userSpaceOnUse", patternTransform: `translate(${x * z} ${y * z})`, children: /* @__PURE__ */ jsx("circle", { cx: 0, cy: 0, r: 1.5, fill: "var(--mocanvas-grid, currentColor)", opacity: MAJOR }) })
14465
14470
  ] }),
14466
14471
  /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` }),
14467
14472
  /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id}_major)` })
14468
14473
  ] });
14469
14474
  }
14475
+ function DefaultShapeErrorFallback({ error }) {
14476
+ const message = error instanceof Error ? error.message : String(error);
14477
+ return /* @__PURE__ */ jsx(
14478
+ "div",
14479
+ {
14480
+ className: "mocanvas-shape-error",
14481
+ role: "img",
14482
+ "aria-label": `This shape could not be drawn: ${message}`,
14483
+ title: message,
14484
+ style: { position: "absolute", inset: 0, border: "1px dashed var(--mocanvas-selection, #e03131)", borderRadius: 2, opacity: 0.6, pointerEvents: "none" }
14485
+ }
14486
+ );
14487
+ }
14470
14488
  function DefaultSvgDefs({ children }) {
14471
14489
  return /* @__PURE__ */ jsx("svg", { className: "mocanvas-svg-defs", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, "aria-hidden": "true", children: /* @__PURE__ */ jsx("defs", { children }) });
14472
14490
  }
@@ -14505,6 +14523,62 @@ function useIsCropping(shapeId) {
14505
14523
  if (shapeId === void 0) return true;
14506
14524
  return editor.getOnlySelectedShape()?.id === shapeId;
14507
14525
  }
14526
+ var ErrorBoundary = class extends Component {
14527
+ state = { error: null, hasError: false };
14528
+ static getDerivedStateFromError(error) {
14529
+ return { error, hasError: true };
14530
+ }
14531
+ componentDidCatch(error, info) {
14532
+ this.props.onError?.(error, info);
14533
+ }
14534
+ resetError = () => {
14535
+ this.setState({ error: null, hasError: false });
14536
+ };
14537
+ render() {
14538
+ if (this.state.hasError) {
14539
+ return this.props.fallback({ error: this.state.error, resetError: this.resetError });
14540
+ }
14541
+ return this.props.children;
14542
+ }
14543
+ };
14544
+ function DefaultErrorFallback({ error, resetError }) {
14545
+ const message = error instanceof Error ? error.message : String(error);
14546
+ return /* @__PURE__ */ jsxs("div", { className: "mocanvas-error-fallback", role: "alert", style: { padding: 16, font: "13px/1.5 system-ui, sans-serif" }, children: [
14547
+ /* @__PURE__ */ jsx("h2", { style: { margin: "0 0 8px", fontSize: 15 }, children: "Something went wrong" }),
14548
+ /* @__PURE__ */ jsx("p", { style: { margin: "0 0 12px", whiteSpace: "pre-wrap" }, children: message }),
14549
+ resetError ? /* @__PURE__ */ jsx("button", { type: "button", onClick: resetError, children: "Try again" }) : null
14550
+ ] });
14551
+ }
14552
+ function ErrorScreen({ children }) {
14553
+ return /* @__PURE__ */ jsx(
14554
+ "div",
14555
+ {
14556
+ className: "mocanvas-error-screen",
14557
+ role: "alert",
14558
+ style: { position: "absolute", inset: 0, display: "grid", placeItems: "center", font: "13px/1.5 system-ui, sans-serif" },
14559
+ children: /* @__PURE__ */ jsx("div", { children })
14560
+ }
14561
+ );
14562
+ }
14563
+ function DefaultSpinner() {
14564
+ return /* @__PURE__ */ jsx("svg", { className: "mocanvas-spinner", width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsxs("g", { strokeWidth: "2", fill: "none", stroke: "currentColor", children: [
14565
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6", opacity: "0.25" }),
14566
+ /* @__PURE__ */ jsx("path", { d: "M14 8a6 6 0 0 0-6-6", strokeLinecap: "round", children: /* @__PURE__ */ jsx("animateTransform", { attributeName: "transform", type: "rotate", from: "0 8 8", to: "360 8 8", dur: "0.75s", repeatCount: "indefinite" }) })
14567
+ ] }) });
14568
+ }
14569
+ function LoadingScreen({ children }) {
14570
+ return /* @__PURE__ */ jsx(
14571
+ "div",
14572
+ {
14573
+ className: "mocanvas-loading-screen",
14574
+ role: "progressbar",
14575
+ "aria-busy": "true",
14576
+ "aria-label": "Loading",
14577
+ style: { position: "absolute", inset: 0, display: "grid", placeItems: "center", font: "13px/1.5 system-ui, sans-serif" },
14578
+ children: children ?? /* @__PURE__ */ jsx(DefaultSpinner, {})
14579
+ }
14580
+ );
14581
+ }
14508
14582
 
14509
14583
  // src/react/translations.ts
14510
14584
  function getLocaleChain(locale) {
@@ -14828,6 +14902,13 @@ function isEditableTarget(t) {
14828
14902
  const tag = t.tagName;
14829
14903
  return tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || t.isContentEditable;
14830
14904
  }
14905
+ var CanvasComponentsContext = createContext(void 0);
14906
+ function useErrorSlot(key, fallback) {
14907
+ const local = useContext(CanvasComponentsContext);
14908
+ const provided = useEditorComponents();
14909
+ const slot = local?.[key] !== void 0 ? local[key] : provided[key];
14910
+ return slot === void 0 ? fallback : slot;
14911
+ }
14831
14912
  var containerStyle = {
14832
14913
  position: "relative",
14833
14914
  width: "100%",
@@ -14855,7 +14936,21 @@ var MAX_TICK_MS = 64;
14855
14936
  function hasFrameWork(editor) {
14856
14937
  return editor.scribbles.hasPendingWork() || editor.edgeScrollManager.getIsEnabled();
14857
14938
  }
14858
- function Canvas({ editor, className, style, children, components, indicatorOverlayUtil }) {
14939
+ function Canvas(props) {
14940
+ return /* @__PURE__ */ jsx(CanvasComponentsContext.Provider, { value: props.components, children: /* @__PURE__ */ jsx(EditorBoundary, { children: /* @__PURE__ */ jsx(CanvasBody, { ...props }) }) });
14941
+ }
14942
+ function EditorBoundary({ children }) {
14943
+ const Fallback = useErrorSlot("ErrorFallback", DefaultErrorFallback);
14944
+ return /* @__PURE__ */ jsx(
14945
+ ErrorBoundary,
14946
+ {
14947
+ fallback: (fallbackProps) => Fallback ? /* @__PURE__ */ jsx(Fallback, { ...fallbackProps }) : null,
14948
+ onError: (error) => console.error("mocanvas: the editor stopped", error),
14949
+ children
14950
+ }
14951
+ );
14952
+ }
14953
+ function CanvasBody({ editor, className, style, children, components, indicatorOverlayUtil }) {
14859
14954
  const containerRef = useRef(null);
14860
14955
  const canvasRef = useRef(null);
14861
14956
  const [backend, setBackend] = useState(null);
@@ -15062,7 +15157,7 @@ var OverlayShape = track$1(function OverlayShape2({
15062
15157
  const m = editor.getShapePageTransform(shape);
15063
15158
  const bounds = editor.getShapeGeometryBounds(shape);
15064
15159
  const offset = clip ? `translate(${-clip[0]}px, ${-clip[1]}px) ` : "";
15065
- const el = /* @__PURE__ */ jsxs(
15160
+ const el = /* @__PURE__ */ jsx(
15066
15161
  "div",
15067
15162
  {
15068
15163
  className: "mocanvas-shape",
@@ -15079,10 +15174,10 @@ var OverlayShape = track$1(function OverlayShape2({
15079
15174
  opacity: shape.opacity,
15080
15175
  pointerEvents: isEditing ? "auto" : "none"
15081
15176
  },
15082
- children: [
15083
- util.component(shape),
15177
+ children: /* @__PURE__ */ jsxs(ShapeBoundary, { shape, children: [
15178
+ /* @__PURE__ */ jsx(ShapeBody, { editor, shape }),
15084
15179
  util.getContentElement ? /* @__PURE__ */ jsx(ContentElementSlot, { editor, shape }) : null
15085
- ]
15180
+ ] })
15086
15181
  }
15087
15182
  );
15088
15183
  if (!clip) return el;
@@ -15267,6 +15362,22 @@ var DefaultBrush = track$1(function DefaultBrush2({ editor }) {
15267
15362
  }
15268
15363
  );
15269
15364
  });
15365
+ var ShapeBody = track$1(function ShapeBody2({ editor, shape }) {
15366
+ return /* @__PURE__ */ jsx(Fragment, { children: editor.getShapeUtil(shape).component(shape) });
15367
+ });
15368
+ function ShapeBoundary({ shape, children }) {
15369
+ const Fallback = useErrorSlot("ShapeErrorFallback", DefaultShapeErrorFallback);
15370
+ return /* @__PURE__ */ jsx(
15371
+ ErrorBoundary,
15372
+ {
15373
+ fallback: ({ error }) => Fallback ? /* @__PURE__ */ jsx(Fallback, { error }) : null,
15374
+ onError: (error) => {
15375
+ console.error(`mocanvas: the "${shape.type}" shape ${shape.id} failed to render`, error);
15376
+ },
15377
+ children
15378
+ }
15379
+ );
15380
+ }
15270
15381
  var CONTAINER_BOX = {
15271
15382
  position: "absolute",
15272
15383
  top: 0,
@@ -15306,62 +15417,6 @@ function AssetUrlsProvider({ assetUrls, children }) {
15306
15417
  function useAssetUrls() {
15307
15418
  return useContext(AssetUrlsContext);
15308
15419
  }
15309
- var ErrorBoundary = class extends Component {
15310
- state = { error: null, hasError: false };
15311
- static getDerivedStateFromError(error) {
15312
- return { error, hasError: true };
15313
- }
15314
- componentDidCatch(error, info) {
15315
- this.props.onError?.(error, info);
15316
- }
15317
- resetError = () => {
15318
- this.setState({ error: null, hasError: false });
15319
- };
15320
- render() {
15321
- if (this.state.hasError) {
15322
- return this.props.fallback({ error: this.state.error, resetError: this.resetError });
15323
- }
15324
- return this.props.children;
15325
- }
15326
- };
15327
- function DefaultErrorFallback({ error, resetError }) {
15328
- const message = error instanceof Error ? error.message : String(error);
15329
- return /* @__PURE__ */ jsxs("div", { className: "mocanvas-error-fallback", role: "alert", style: { padding: 16, font: "13px/1.5 system-ui, sans-serif" }, children: [
15330
- /* @__PURE__ */ jsx("h2", { style: { margin: "0 0 8px", fontSize: 15 }, children: "Something went wrong" }),
15331
- /* @__PURE__ */ jsx("p", { style: { margin: "0 0 12px", whiteSpace: "pre-wrap" }, children: message }),
15332
- resetError ? /* @__PURE__ */ jsx("button", { type: "button", onClick: resetError, children: "Try again" }) : null
15333
- ] });
15334
- }
15335
- function ErrorScreen({ children }) {
15336
- return /* @__PURE__ */ jsx(
15337
- "div",
15338
- {
15339
- className: "mocanvas-error-screen",
15340
- role: "alert",
15341
- style: { position: "absolute", inset: 0, display: "grid", placeItems: "center", font: "13px/1.5 system-ui, sans-serif" },
15342
- children: /* @__PURE__ */ jsx("div", { children })
15343
- }
15344
- );
15345
- }
15346
- function DefaultSpinner() {
15347
- return /* @__PURE__ */ jsx("svg", { className: "mocanvas-spinner", width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsxs("g", { strokeWidth: "2", fill: "none", stroke: "currentColor", children: [
15348
- /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6", opacity: "0.25" }),
15349
- /* @__PURE__ */ jsx("path", { d: "M14 8a6 6 0 0 0-6-6", strokeLinecap: "round", children: /* @__PURE__ */ jsx("animateTransform", { attributeName: "transform", type: "rotate", from: "0 8 8", to: "360 8 8", dur: "0.75s", repeatCount: "indefinite" }) })
15350
- ] }) });
15351
- }
15352
- function LoadingScreen({ children }) {
15353
- return /* @__PURE__ */ jsx(
15354
- "div",
15355
- {
15356
- className: "mocanvas-loading-screen",
15357
- role: "progressbar",
15358
- "aria-busy": "true",
15359
- "aria-label": "Loading",
15360
- style: { position: "absolute", inset: 0, display: "grid", placeItems: "center", font: "13px/1.5 system-ui, sans-serif" },
15361
- children: children ?? /* @__PURE__ */ jsx(DefaultSpinner, {})
15362
- }
15363
- );
15364
- }
15365
15420
  var ContainerContext = createContext(null);
15366
15421
  function ContainerProvider({ container, children }) {
15367
15422
  return /* @__PURE__ */ jsx(ContainerContext.Provider, { value: container, children });
@@ -15786,6 +15841,6 @@ function setDefaultCdnBaseUrl(url) {
15786
15841
  cdnBaseUrl = url.replace(/\/+$/, "");
15787
15842
  }
15788
15843
 
15789
- export { ARROWHEAD_KINDS, ARROW_SHAPE_KINDS, ASSET_MIGRATION_SEQUENCE_PREFIX, Arc2d, ArrayOfValidator, ArrowShapeArrowheadEndStyle, ArrowShapeArrowheadStartStyle, ArrowShapeKindStyle, AssetRecordType, AssetUrlsProvider, AssetUtil, AssetUtilRegistry, BINDING_MIGRATION_SEQUENCE_PREFIX, BUILTIN_ASSET_MIGRATION_SEQUENCE_PREFIX, BUILTIN_BINDING_MIGRATION_SEQUENCE_PREFIX, BUILTIN_SHAPE_MIGRATION_SEQUENCE_PREFIX, BaseBoxShapeUtil, BaseFrameLikeShapeUtil, BindingRecordType, BindingUtil, BoundsSnaps, Box, CANVAS_THEME_VARS, COLLABORATOR_INACTIVE_TIMEOUT, CURRENT_SESSION_SCHEMA_VERSION, CURSOR_TYPES, CUSTOM_RECORD_MIGRATION_SEQUENCE_PREFIX, CUSTOM_RECORD_TYPE_NAME, CameraRecordType, CameraStateTracker, Canvas, Circle2d, ClickManager, CollaboratorsManager, CommentReactionRecordType, CommentRecordType, CommentThreadRecordType, ContainerProvider, ContentElementManager, CubicBezier2d, CubicSpline2d, DEFAULT_ASSET_CONTEXT, DEFAULT_CAMERA_OPTIONS, DEFAULT_COLORS, DEFAULT_DARK_COLORS, DEFAULT_DASHES, DEFAULT_EDITOR_CONFIG, DEFAULT_FILLS, DEFAULT_FILL_TOKENS, DEFAULT_FONTS, DEFAULT_FONT_FAMILIES, DEFAULT_H_ALIGNS, DEFAULT_LIGHT_COLORS, DEFAULT_LINE_HEIGHT, DEFAULT_MENU_CONTEXT, DEFAULT_PAGE_ID, DEFAULT_SHAPE_INDICATOR_OPTIONS, DEFAULT_SIZES, DEFAULT_TEXT_ALIGNS, DEFAULT_THEME, DEFAULT_TIME_CONTEXT, DEFAULT_V_ALIGNS, DIM_2D, DIM_3D, DOCUMENT_ID, DefaultBackground, DefaultCanvas, DefaultColorStyle, DefaultCursor, DefaultDashStyle, DefaultErrorFallback, DefaultFillStyle, DefaultFontFaces, DefaultFontFamilies, DefaultFontStyle, DefaultGrid, DefaultHorizontalAlignStyle, DefaultLabelColorStyle, DefaultShapeWrapper, DefaultSizeStyle, DefaultSpinner, DefaultSvgDefs, DefaultTextAlignStyle, DefaultVerticalAlignStyle, DictValidator, DocumentRecordType, EASINGS, ELBOW_ARROW_SNAP_MODES, EVENT_NAME_MAP, Edge2d, EdgeScrollManager, Editor, EditorAtom, EditorContext, EditorManager, EditorPortal, EditorProvider, ElbowArrowSnap, Ellipse2d, EnumStyleProp, ErrorBoundary, ErrorScreen, EventEmitter, FIRST_PAGE_INDEX, FONT_SIZES, FontManager, GEO_SHAPE_KINDS, GeoShapeGeoStyle, Geometry2d, Geometry2dFilters, Group2d, HALF_PI, HANDLE_HIT_RADIUS, HTMLContainer, HandleSnaps, HandleTable, HistoryManager, INSTANCE_ID, ImageShapeCrop, InputsManager, InstancePageStateRecordType, InstancePresenceRecordType, InstanceRecordType, LIGHT_THEME, LINE_SPLINE_KINDS, LOCAL_STATE_PREFIX, LineShapeSplineStyle, LoadingScreen, MAX_TEXTURE_RESOLUTION, MAX_TEXTURE_ZOOM, Mat, MenuClickCapture, MenuManager, MocanvasUiProvider, ObjectValidator, OverlayManager, OverlayUtil, PI, PI2, PRESENCE_COLORS, PageRecordType, PerformanceApiAdapter, PerformanceManager, Point2d, PointerRecordType, Polygon2d, Polyline2d, ROTATE_CORNER_TO_SELECTION_CORNER, ROTATE_HANDLE_OFFSET, ReadonlySharedStyleMap, Rectangle2d, RootState, SHAPE_MIGRATION_SEQUENCE_PREFIX, SIDES, SIN, STROKE_SIZES, SVGContainer, ScribbleManager, ShapeIndicatorCompositor, ShapeRecordType, ShapeUtil, SharedStyleMap, SnapManager, Stadium2d, StateNode, StyleProp, SvgExportContextProvider, T, TAB_ID, TLEditorsRegistry, TLPOINTER_ID, TL_CANVAS_UI_COLOR_TYPES, TL_CURSOR_TYPES, TL_HANDLE_TYPES, TL_SCRIBBLE_STATES, TextManager, TextureManager, ThemeManager, Timers, TransformedGeometry2d, UNKNOWN_EDIT_START_INFO, USER_PREFERENCES_DEFAULTS, UnionValidator, UserPreferencesManager, UserRecordType, ValidationError, Validator, Vec, WebGL2Backend, angleDistance, animateShape, animateShapes, applyThemePatch, approximately, areAnglesCompatible, arrowBindingVersions, assetIdValidator, assetMigrations, assetPropsMigrationSequenceId, assetValidator, assetValidators, average, b64Vecs, bindingIdValidator, bindingPropsMigrationSequenceId, bookmarkAssetMigrations, bookmarkAssetProps, bookmarkAssetPropsValidator, bookmarkAssetValidator, boundsIndicatorPath, boxModelValidator, bucketTextureResolution, canBindShapes, canBuildIndicatorPaths, canCreateShape, canCreateShapes, canCropShape, canEditShape, canonicalizeRotation, canvasUiColorTypeValidator, centerOfCircleFromThreePoints, clamp, clampRadians, clockwiseAngleDist, commentAnchorValidator, commentReactionRecordConfig, commentReactionValidator, commentRecordConfig, commentSchemaRecords, commentThreadRecordConfig, commentThreadValidator, commentValidator, compressLegacySegments, coreShapes, counterClockwiseAngleDist, createAssetId, createAssetPropsMigrationIds, createAssetPropsMigrationSequence, createAssetPropsValidator, createAssetValidator, createBackend, createBaseAssetValidator, createBaseBindingValidator, createBaseShapeValidator, createBindingId, createBindingPropsMigrationIds, createBindingPropsMigrationSequence, createBindingValidator, createBuiltInAssetPropsMigrationIds, createBuiltInBindingPropsMigrationIds, createBuiltInShapePropsMigrationIds, createCachedUserResolve, createComment, createCommentId, createCommentReaction, createCommentReactionId, createCommentThread, createCommentThreadId, createCurrentUser, createCustomRecord, createCustomRecordId, createCustomRecordMigrationIds, createCustomRecordMigrationSequence, createCustomRecordMigrationSequences, createCustomRecordType, createCustomRecordTypeMap, createCustomRecordValidator, createDeepLinkString, createInMemoryAssetStore, createMemoryUserStore, createPresenceStateDerivation, createPropsMigrationSequences, createRootState, createSchema, createSessionStateSnapshotSignal, createShapeId, createShapePropsMigrationIds, createShapePropsMigrationSequence, createShapeValidator, createStore, createTLCurrentUser, createTLSchemaFromUtils, createTheme, createUserId, createUserPreferences, createUserRecordType, cursorTypeValidator, cursorValidator, customRecordMigrationSequenceId, dataUrlToFile, decodeDrawSegmentPath, defaultAssetMigrations, defaultAssetSchemas, defaultBindingSchemas, defaultShapeSchemas, defaultTldrawOptions, defaultUserPreferences, defaultUserStore, degreesToRadians, deselect, drawShapeSegmentValidator, dropShapesOnFrameLike, duplicatePage, easeInOutCubic, fileToBase64DataUrl, fileToDataUrl, findCommonAncestor, findShapeAncestor, fontKey, formatValidationPath, getArcMeasure, getAssetSrc, getBaseZoomForCameraOptions, getCameraCssVars, getColorNamesFromThemes, getColorValue, getCulledShapes, getCurrentPageRenderingShapesSorted, getCurrentPageShapesInReadingOrder, getCursor, getCustomRecordIdType, getDefaultAssetContext, getDefaultCdnBaseUrl, getDefaultCrop, getDefaultDisplayValues, getDefaultUserPresence, getDefaultUserProperties, getDisplayValues, getDroppedShapesToNewParents, getEngineProvider, getExportImplementation, getFocusedGroup, getFocusedGroupId, getFontNamesFromThemes, getFontsFromRichText, getFrameLikeDropTarget, getFreshUserPreferences, getHandleHitRadius, getIncrementedName, getIndicatorSource, getInitialMetaForShape, getLocaleChain, getNearestAdjacentShape, getNotVisibleShapes, getOnlySelectedShapeId, getOverlayDisplayValues, getOwnerDocument, getOwnerWindow, getPageStates, getPaletteEntries, getPerfectDashProps, getPointInArcT, getPointOnCircle, getPointerInfo, getPointsOnArc, getPolygonVertices, getRenderingShapes, getSelectedShapeAtPoint, getSelectionHandlePositions, getSelectionRotatedPageBounds, getSelectionRotatedScreenBounds, getSelectionScreenBounds, getSessionStateSnapshot, getSessionStateSnapshotFromStore, getShapeAndDescendantIds, getShapeClipPath, getShapeHandles, getShapeIdsInsideBounds, getShapeIndicatorNode, getShapeIndicatorPath, getShapeMaskedPageBounds, getShapeStyleIfExists, getShapesPageBounds, getSharedOpacity, getSnapshot, getStylePropsOf, getSvgAsImage, getSvgPathFromPoints, getTextMeasureProvider, getThemeCssVars, getUncroppedSize, getUserPreferences, handleTypeValidator, hardReset, hardResetEditor, hasAncestor, hexToRgba, hitTestSelectionBounds, hitTestSelectionHandles, idValidator, imageAssetMigrations, imageAssetProps, imageAssetPropsValidator, imageAssetValidator, inlineBase64AssetStore, intersectCircleCircle, intersectCirclePolygon, intersectCirclePolyline, intersectLineSegmentCircle, intersectLineSegmentLineSegment, intersectLineSegmentPolygon, intersectLineSegmentPolyline, intersectPolygonBounds, intersectPolygonPolygon, isAncestorSelected, isAsset, isAssetId, isBinding, isBindingId, isCommentId, isCommentReactionId, isCommentThreadId, isCursorInViewport, isCustomRecord, isCustomRecordId, isDocument, isFullCrop, isInstancePresenceId, isOptionalValidator, isPage, isPageId, isPointInShape, isPropsMigrations, isSafeFloat, isShape, isShapeHidden, isShapeId, isShapeInPage, isUserId, isValidProps, kickoutOccludedShapes, lerp, linesIntersect, loadSessionStateSnapshotIntoStore, loadSnapshot, loopToHtmlElement, maybeSnapToGrid, mixHexColors, moveElementInto, moveShapesToPage, normalizeIndicatorPath, normalizeLoadedRecords, noteReactivePointerType, opacityValidator, openWindow, packShapes, pageIdValidator, parentIdValidator, parseDeepLinkString, perimeterOfEllipse, pointInPolygon, pointerValidator, polygonIntersectsPolyline, polygonsIntersect, popFocusedGroupId, precise, prefixError, preventDefault, radiansToDegrees, randomPresenceColor, rangeIntersection, refreshPage, refreshReactiveEnvironment, registerColorsFromThemes, registerCoreShape, registerDefaultAssetSchema, registerDefaultBindingSchema, registerDefaultShapeSchema, registerEngineProvider, registerExportImplementation, registerFontsFromThemes, registerTextMeasureImplementation, releasePointerCapture, resizeBox, resizeScaled, resizeToBounds, resolveAssetUrl, resolveLineHeightPx, resolveShape, resolveThemes, resolveUiMessage, richTextToPlainText, rootBindingMigrations, rootShapeMigrations, rotateSelectionHandle, runtime, sanitizeId, scribbleValidator, selectAdjacentShape, selectFirstChildShape, selectParentShape, setDefaultCdnBaseUrl, setFocusedGroup, setOpacityForNextShapes, setOpacityForSelectedShapes, setPointerCapture, setRuntimeOverrides, setUserPreferences, shapeIdValidator, shapePropsMigrationSequenceId, shortAngleDist, snapAngle, stopEventPropagation, strokeShapeIndicators, suffixSafeId, tleditors, tlenv, tlenvReactive, tlmenus, tltime, toCustomRecordMigrationSequence, toDomPrecision, toFixed, toMigrationSequence, toPrecision, trackPointer, uniq, updatePage, useActions, useAssetUrls, useCameraCssVars, useColorMode, useContainer, useContainerIfExists, useCurrentTheme, useCurrentUser, useDelaySvgExport, useEditor, useEditorComponents, useEditorPortalHost, useGlobalMenuIsOpen, useIsCropping, useIsEditing, useIsToolSelected, useMaybeEditor, useMocanvasUi, usePassThroughWheelEvents, useSharedSafeId, useSvgExportContext, useTLSchemaFromUtils, useTLStore, useThemeColors, useThemeCssVars, useTools, useTransform, useUniqueSafeId, useViewportHeight, userIdValidator, userPreferencesValidator, userTypeValidator, userValidator, validateCustomRecordInfos, validateProps, vecModelValidator, videoAssetMigrations, videoAssetProps, videoAssetValidator, visitDescendants, warnOnce, withCoreShapes };
15844
+ export { ARROWHEAD_KINDS, ARROW_SHAPE_KINDS, ASSET_MIGRATION_SEQUENCE_PREFIX, Arc2d, ArrayOfValidator, ArrowShapeArrowheadEndStyle, ArrowShapeArrowheadStartStyle, ArrowShapeKindStyle, AssetRecordType, AssetUrlsProvider, AssetUtil, AssetUtilRegistry, BINDING_MIGRATION_SEQUENCE_PREFIX, BUILTIN_ASSET_MIGRATION_SEQUENCE_PREFIX, BUILTIN_BINDING_MIGRATION_SEQUENCE_PREFIX, BUILTIN_SHAPE_MIGRATION_SEQUENCE_PREFIX, BaseBoxShapeUtil, BaseFrameLikeShapeUtil, BindingRecordType, BindingUtil, BoundsSnaps, Box, CANVAS_THEME_VARS, COLLABORATOR_INACTIVE_TIMEOUT, CURRENT_SESSION_SCHEMA_VERSION, CURSOR_TYPES, CUSTOM_RECORD_MIGRATION_SEQUENCE_PREFIX, CUSTOM_RECORD_TYPE_NAME, CameraRecordType, CameraStateTracker, Canvas, Circle2d, ClickManager, CollaboratorsManager, CommentReactionRecordType, CommentRecordType, CommentThreadRecordType, ContainerProvider, ContentElementManager, CubicBezier2d, CubicSpline2d, DEFAULT_ASSET_CONTEXT, DEFAULT_CAMERA_OPTIONS, DEFAULT_COLORS, DEFAULT_DARK_COLORS, DEFAULT_DASHES, DEFAULT_EDITOR_CONFIG, DEFAULT_FILLS, DEFAULT_FILL_TOKENS, DEFAULT_FONTS, DEFAULT_FONT_FAMILIES, DEFAULT_H_ALIGNS, DEFAULT_LIGHT_COLORS, DEFAULT_LINE_HEIGHT, DEFAULT_MENU_CONTEXT, DEFAULT_PAGE_ID, DEFAULT_SHAPE_INDICATOR_OPTIONS, DEFAULT_SIZES, DEFAULT_TEXT_ALIGNS, DEFAULT_THEME, DEFAULT_TIME_CONTEXT, DEFAULT_V_ALIGNS, DIM_2D, DIM_3D, DOCUMENT_ID, DefaultBackground, DefaultCanvas, DefaultColorStyle, DefaultCursor, DefaultDashStyle, DefaultErrorFallback, DefaultFillStyle, DefaultFontFaces, DefaultFontFamilies, DefaultFontStyle, DefaultGrid, DefaultHorizontalAlignStyle, DefaultLabelColorStyle, DefaultShapeErrorFallback, DefaultShapeWrapper, DefaultSizeStyle, DefaultSpinner, DefaultSvgDefs, DefaultTextAlignStyle, DefaultVerticalAlignStyle, DictValidator, DocumentRecordType, EASINGS, ELBOW_ARROW_SNAP_MODES, EVENT_NAME_MAP, Edge2d, EdgeScrollManager, Editor, EditorAtom, EditorContext, EditorManager, EditorPortal, EditorProvider, ElbowArrowSnap, Ellipse2d, EnumStyleProp, ErrorBoundary, ErrorScreen, EventEmitter, FIRST_PAGE_INDEX, FONT_SIZES, FontManager, GEO_SHAPE_KINDS, GeoShapeGeoStyle, Geometry2d, Geometry2dFilters, Group2d, HALF_PI, HANDLE_HIT_RADIUS, HTMLContainer, HandleSnaps, HandleTable, HistoryManager, INSTANCE_ID, ImageShapeCrop, InputsManager, InstancePageStateRecordType, InstancePresenceRecordType, InstanceRecordType, LIGHT_THEME, LINE_SPLINE_KINDS, LOCAL_STATE_PREFIX, LineShapeSplineStyle, LoadingScreen, MAX_TEXTURE_RESOLUTION, MAX_TEXTURE_ZOOM, Mat, MenuClickCapture, MenuManager, MocanvasUiProvider, ObjectValidator, OverlayManager, OverlayUtil, PI, PI2, PRESENCE_COLORS, PageRecordType, PerformanceApiAdapter, PerformanceManager, Point2d, PointerRecordType, Polygon2d, Polyline2d, ROTATE_CORNER_TO_SELECTION_CORNER, ROTATE_HANDLE_OFFSET, ReadonlySharedStyleMap, Rectangle2d, RootState, SHAPE_MIGRATION_SEQUENCE_PREFIX, SIDES, SIN, STROKE_SIZES, SVGContainer, ScribbleManager, ShapeIndicatorCompositor, ShapeRecordType, ShapeUtil, SharedStyleMap, SnapManager, Stadium2d, StateNode, StyleProp, SvgExportContextProvider, T, TAB_ID, TLEditorsRegistry, TLPOINTER_ID, TL_CANVAS_UI_COLOR_TYPES, TL_CURSOR_TYPES, TL_HANDLE_TYPES, TL_SCRIBBLE_STATES, TextManager, TextureManager, ThemeManager, Timers, TransformedGeometry2d, UNKNOWN_EDIT_START_INFO, USER_PREFERENCES_DEFAULTS, UnionValidator, UserPreferencesManager, UserRecordType, ValidationError, Validator, Vec, WebGL2Backend, angleDistance, animateShape, animateShapes, applyThemePatch, approximately, areAnglesCompatible, arrowBindingVersions, assetIdValidator, assetMigrations, assetPropsMigrationSequenceId, assetValidator, assetValidators, average, b64Vecs, bindingIdValidator, bindingPropsMigrationSequenceId, bookmarkAssetMigrations, bookmarkAssetProps, bookmarkAssetPropsValidator, bookmarkAssetValidator, boundsIndicatorPath, boxModelValidator, bucketTextureResolution, canBindShapes, canBuildIndicatorPaths, canCreateShape, canCreateShapes, canCropShape, canEditShape, canonicalizeRotation, canvasUiColorTypeValidator, centerOfCircleFromThreePoints, clamp, clampRadians, clockwiseAngleDist, commentAnchorValidator, commentReactionRecordConfig, commentReactionValidator, commentRecordConfig, commentSchemaRecords, commentThreadRecordConfig, commentThreadValidator, commentValidator, compressLegacySegments, coreShapes, counterClockwiseAngleDist, createAssetId, createAssetPropsMigrationIds, createAssetPropsMigrationSequence, createAssetPropsValidator, createAssetValidator, createBackend, createBaseAssetValidator, createBaseBindingValidator, createBaseShapeValidator, createBindingId, createBindingPropsMigrationIds, createBindingPropsMigrationSequence, createBindingValidator, createBuiltInAssetPropsMigrationIds, createBuiltInBindingPropsMigrationIds, createBuiltInShapePropsMigrationIds, createCachedUserResolve, createComment, createCommentId, createCommentReaction, createCommentReactionId, createCommentThread, createCommentThreadId, createCurrentUser, createCustomRecord, createCustomRecordId, createCustomRecordMigrationIds, createCustomRecordMigrationSequence, createCustomRecordMigrationSequences, createCustomRecordType, createCustomRecordTypeMap, createCustomRecordValidator, createDeepLinkString, createInMemoryAssetStore, createMemoryUserStore, createPresenceStateDerivation, createPropsMigrationSequences, createRootState, createSchema, createSessionStateSnapshotSignal, createShapeId, createShapePropsMigrationIds, createShapePropsMigrationSequence, createShapeValidator, createStore, createTLCurrentUser, createTLSchemaFromUtils, createTheme, createUserId, createUserPreferences, createUserRecordType, cursorTypeValidator, cursorValidator, customRecordMigrationSequenceId, dataUrlToFile, decodeDrawSegmentPath, defaultAssetMigrations, defaultAssetSchemas, defaultBindingSchemas, defaultShapeSchemas, defaultTldrawOptions, defaultUserPreferences, defaultUserStore, degreesToRadians, deselect, drawShapeSegmentValidator, dropShapesOnFrameLike, duplicatePage, easeInOutCubic, fileToBase64DataUrl, fileToDataUrl, findCommonAncestor, findShapeAncestor, fontKey, formatValidationPath, getArcMeasure, getAssetSrc, getBaseZoomForCameraOptions, getCameraCssVars, getColorNamesFromThemes, getColorValue, getCulledShapes, getCurrentPageRenderingShapesSorted, getCurrentPageShapesInReadingOrder, getCursor, getCustomRecordIdType, getDefaultAssetContext, getDefaultCdnBaseUrl, getDefaultCrop, getDefaultDisplayValues, getDefaultUserPresence, getDefaultUserProperties, getDisplayValues, getDroppedShapesToNewParents, getEngineProvider, getExportImplementation, getFocusedGroup, getFocusedGroupId, getFontNamesFromThemes, getFontsFromRichText, getFrameLikeDropTarget, getFreshUserPreferences, getHandleHitRadius, getIncrementedName, getIndicatorSource, getInitialMetaForShape, getLocaleChain, getNearestAdjacentShape, getNotVisibleShapes, getOnlySelectedShapeId, getOverlayDisplayValues, getOwnerDocument, getOwnerWindow, getPageStates, getPaletteEntries, getPerfectDashProps, getPointInArcT, getPointOnCircle, getPointerInfo, getPointsOnArc, getPolygonVertices, getRenderingShapes, getSelectedShapeAtPoint, getSelectionHandlePositions, getSelectionRotatedPageBounds, getSelectionRotatedScreenBounds, getSelectionScreenBounds, getSessionStateSnapshot, getSessionStateSnapshotFromStore, getShapeAndDescendantIds, getShapeClipPath, getShapeHandles, getShapeIdsInsideBounds, getShapeIndicatorNode, getShapeIndicatorPath, getShapeMaskedPageBounds, getShapeStyleIfExists, getShapesPageBounds, getSharedOpacity, getSnapshot, getStylePropsOf, getSvgAsImage, getSvgPathFromPoints, getTextMeasureProvider, getThemeCssVars, getUncroppedSize, getUserPreferences, handleTypeValidator, hardReset, hardResetEditor, hasAncestor, hexToRgba, hitTestSelectionBounds, hitTestSelectionHandles, idValidator, imageAssetMigrations, imageAssetProps, imageAssetPropsValidator, imageAssetValidator, inlineBase64AssetStore, intersectCircleCircle, intersectCirclePolygon, intersectCirclePolyline, intersectLineSegmentCircle, intersectLineSegmentLineSegment, intersectLineSegmentPolygon, intersectLineSegmentPolyline, intersectPolygonBounds, intersectPolygonPolygon, isAncestorSelected, isAsset, isAssetId, isBinding, isBindingId, isCommentId, isCommentReactionId, isCommentThreadId, isCursorInViewport, isCustomRecord, isCustomRecordId, isDocument, isFullCrop, isInstancePresenceId, isOptionalValidator, isPage, isPageId, isPointInShape, isPropsMigrations, isSafeFloat, isShape, isShapeHidden, isShapeId, isShapeInPage, isUserId, isValidProps, kickoutOccludedShapes, lerp, linesIntersect, loadSessionStateSnapshotIntoStore, loadSnapshot, loopToHtmlElement, maybeSnapToGrid, mixHexColors, moveElementInto, moveShapesToPage, normalizeIndicatorPath, normalizeLoadedRecords, noteReactivePointerType, opacityValidator, openWindow, packShapes, pageIdValidator, parentIdValidator, parseDeepLinkString, perimeterOfEllipse, pointInPolygon, pointerValidator, polygonIntersectsPolyline, polygonsIntersect, popFocusedGroupId, precise, prefixError, preventDefault, radiansToDegrees, randomPresenceColor, rangeIntersection, refreshPage, refreshReactiveEnvironment, registerColorsFromThemes, registerCoreShape, registerDefaultAssetSchema, registerDefaultBindingSchema, registerDefaultShapeSchema, registerEngineProvider, registerExportImplementation, registerFontsFromThemes, registerTextMeasureImplementation, releasePointerCapture, resizeBox, resizeScaled, resizeToBounds, resolveAssetUrl, resolveLineHeightPx, resolveShape, resolveThemes, resolveUiMessage, richTextToPlainText, rootBindingMigrations, rootShapeMigrations, rotateSelectionHandle, runtime, sanitizeId, scribbleValidator, selectAdjacentShape, selectFirstChildShape, selectParentShape, setDefaultCdnBaseUrl, setFocusedGroup, setOpacityForNextShapes, setOpacityForSelectedShapes, setPointerCapture, setRuntimeOverrides, setUserPreferences, shapeIdValidator, shapePropsMigrationSequenceId, shortAngleDist, snapAngle, stopEventPropagation, strokeShapeIndicators, suffixSafeId, tleditors, tlenv, tlenvReactive, tlmenus, tltime, toCustomRecordMigrationSequence, toDomPrecision, toFixed, toMigrationSequence, toPrecision, trackPointer, uniq, updatePage, useActions, useAssetUrls, useCameraCssVars, useColorMode, useContainer, useContainerIfExists, useCurrentTheme, useCurrentUser, useDelaySvgExport, useEditor, useEditorComponents, useEditorPortalHost, useGlobalMenuIsOpen, useIsCropping, useIsEditing, useIsToolSelected, useMaybeEditor, useMocanvasUi, usePassThroughWheelEvents, useSharedSafeId, useSvgExportContext, useTLSchemaFromUtils, useTLStore, useThemeColors, useThemeCssVars, useTools, useTransform, useUniqueSafeId, useViewportHeight, userIdValidator, userPreferencesValidator, userTypeValidator, userValidator, validateCustomRecordInfos, validateProps, vecModelValidator, videoAssetMigrations, videoAssetProps, videoAssetValidator, visitDescendants, warnOnce, withCoreShapes };
15790
15845
  //# sourceMappingURL=index.js.map
15791
15846
  //# sourceMappingURL=index.js.map