@cratis/components 4.21.1 → 4.22.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.
Files changed (197) hide show
  1. package/compat-manifest.json +16 -16
  2. package/dist/esm/Canvas/Canvas.d.ts +12 -81
  3. package/dist/esm/Canvas/Canvas.d.ts.map +1 -1
  4. package/dist/esm/Canvas/Canvas.js +83 -676
  5. package/dist/esm/Canvas/Canvas.js.map +1 -1
  6. package/dist/esm/Canvas/CanvasCaptureAttributes.d.ts +10 -0
  7. package/dist/esm/Canvas/CanvasCaptureAttributes.d.ts.map +1 -0
  8. package/dist/esm/Canvas/CanvasCaptureAttributes.js +4 -0
  9. package/dist/esm/Canvas/CanvasCaptureAttributes.js.map +1 -0
  10. package/dist/esm/Canvas/CanvasContext.d.ts +9 -0
  11. package/dist/esm/Canvas/CanvasContext.d.ts.map +1 -0
  12. package/dist/esm/Canvas/CanvasContext.js +4 -0
  13. package/dist/esm/Canvas/CanvasContext.js.map +1 -0
  14. package/dist/esm/Canvas/CanvasHandle.d.ts +13 -0
  15. package/dist/esm/Canvas/CanvasHandle.d.ts.map +1 -0
  16. package/dist/esm/Canvas/CanvasHandle.js +4 -0
  17. package/dist/esm/Canvas/CanvasHandle.js.map +1 -0
  18. package/dist/esm/Canvas/CanvasItem.js +4 -1
  19. package/dist/esm/Canvas/CanvasItem.js.map +1 -1
  20. package/dist/esm/Canvas/CanvasItemData.d.ts +10 -0
  21. package/dist/esm/Canvas/CanvasItemData.d.ts.map +1 -0
  22. package/dist/esm/Canvas/CanvasItemData.js +4 -0
  23. package/dist/esm/Canvas/CanvasItemData.js.map +1 -0
  24. package/dist/esm/Canvas/CanvasItemRegistryContext.d.ts +5 -0
  25. package/dist/esm/Canvas/CanvasItemRegistryContext.d.ts.map +1 -0
  26. package/dist/esm/Canvas/CanvasItemRegistryContext.js +6 -0
  27. package/dist/esm/Canvas/CanvasItemRegistryContext.js.map +1 -0
  28. package/dist/esm/Canvas/CanvasItemRegistryContextValue.d.ts +26 -0
  29. package/dist/esm/Canvas/CanvasItemRegistryContextValue.d.ts.map +1 -0
  30. package/dist/esm/Canvas/CanvasItemRegistryContextValue.js +4 -0
  31. package/dist/esm/Canvas/CanvasItemRegistryContextValue.js.map +1 -0
  32. package/dist/esm/Canvas/CanvasItemRegistryEntry.d.ts +19 -0
  33. package/dist/esm/Canvas/CanvasItemRegistryEntry.d.ts.map +1 -0
  34. package/dist/esm/Canvas/CanvasItemRegistryEntry.js +4 -0
  35. package/dist/esm/Canvas/CanvasItemRegistryEntry.js.map +1 -0
  36. package/dist/esm/Canvas/WebKitGestureEvent.d.ts +13 -0
  37. package/dist/esm/Canvas/WebKitGestureEvent.d.ts.map +1 -0
  38. package/dist/esm/Canvas/WebKitGestureEvent.js +4 -0
  39. package/dist/esm/Canvas/WebKitGestureEvent.js.map +1 -0
  40. package/dist/esm/Canvas/canvasEasing.d.ts +8 -0
  41. package/dist/esm/Canvas/canvasEasing.d.ts.map +1 -0
  42. package/dist/esm/Canvas/canvasEasing.js +8 -0
  43. package/dist/esm/Canvas/canvasEasing.js.map +1 -0
  44. package/dist/esm/Canvas/canvasGestureTuning.d.ts +6 -0
  45. package/dist/esm/Canvas/canvasGestureTuning.d.ts.map +1 -0
  46. package/dist/esm/Canvas/canvasGestureTuning.js +7 -0
  47. package/dist/esm/Canvas/canvasGestureTuning.js.map +1 -0
  48. package/dist/esm/Canvas/index.js +2 -1
  49. package/dist/esm/Canvas/index.js.map +1 -1
  50. package/dist/esm/Canvas/shapes/Region/Region.js +4 -1
  51. package/dist/esm/Canvas/shapes/Region/Region.js.map +1 -1
  52. package/dist/esm/Canvas/useCanvasCamera.d.ts +37 -0
  53. package/dist/esm/Canvas/useCanvasCamera.d.ts.map +1 -0
  54. package/dist/esm/Canvas/useCanvasCamera.js +79 -0
  55. package/dist/esm/Canvas/useCanvasCamera.js.map +1 -0
  56. package/dist/esm/Canvas/useCanvasItemRegistry.d.ts +14 -0
  57. package/dist/esm/Canvas/useCanvasItemRegistry.d.ts.map +1 -0
  58. package/dist/esm/Canvas/useCanvasItemRegistry.js +59 -0
  59. package/dist/esm/Canvas/useCanvasItemRegistry.js.map +1 -0
  60. package/dist/esm/Canvas/useCanvasNavigation.d.ts +36 -0
  61. package/dist/esm/Canvas/useCanvasNavigation.d.ts.map +1 -0
  62. package/dist/esm/Canvas/useCanvasNavigation.js +186 -0
  63. package/dist/esm/Canvas/useCanvasNavigation.js.map +1 -0
  64. package/dist/esm/Canvas/useCanvasPointerGestures.d.ts +34 -0
  65. package/dist/esm/Canvas/useCanvasPointerGestures.d.ts.map +1 -0
  66. package/dist/esm/Canvas/useCanvasPointerGestures.js +178 -0
  67. package/dist/esm/Canvas/useCanvasPointerGestures.js.map +1 -0
  68. package/dist/esm/Canvas/useCanvasWheelZoom.d.ts +23 -0
  69. package/dist/esm/Canvas/useCanvasWheelZoom.d.ts.map +1 -0
  70. package/dist/esm/Canvas/useCanvasWheelZoom.js +146 -0
  71. package/dist/esm/Canvas/useCanvasWheelZoom.js.map +1 -0
  72. package/dist/esm/Canvas/useLatestRef.d.ts +8 -0
  73. package/dist/esm/Canvas/useLatestRef.d.ts.map +1 -0
  74. package/dist/esm/Canvas/useLatestRef.js +12 -0
  75. package/dist/esm/Canvas/useLatestRef.js.map +1 -0
  76. package/dist/esm/Canvas/usePixiApplication.d.ts +32 -0
  77. package/dist/esm/Canvas/usePixiApplication.d.ts.map +1 -0
  78. package/dist/esm/Canvas/usePixiApplication.js +92 -0
  79. package/dist/esm/Canvas/usePixiApplication.js.map +1 -0
  80. package/dist/esm/Canvas/usePixiItems.d.ts +19 -0
  81. package/dist/esm/Canvas/usePixiItems.d.ts.map +1 -0
  82. package/dist/esm/Canvas/usePixiItems.js +49 -0
  83. package/dist/esm/Canvas/usePixiItems.js.map +1 -0
  84. package/dist/esm/Chat/ChatSidebar.d.ts.map +1 -1
  85. package/dist/esm/Chat/ChatSidebar.js +1 -1
  86. package/dist/esm/Chat/ChatSidebar.js.map +1 -1
  87. package/dist/esm/ClassNames/classNames.d.ts +7 -0
  88. package/dist/esm/ClassNames/classNames.d.ts.map +1 -0
  89. package/dist/esm/ClassNames/classNames.js.map +1 -0
  90. package/dist/esm/Common/Breadcrumbs.d.ts.map +1 -1
  91. package/dist/esm/Common/Breadcrumbs.js +1 -1
  92. package/dist/esm/Common/Breadcrumbs.js.map +1 -1
  93. package/dist/esm/Common/ComboBox.d.ts.map +1 -1
  94. package/dist/esm/Common/ComboBox.js +1 -1
  95. package/dist/esm/Common/ComboBox.js.map +1 -1
  96. package/dist/esm/Common/DatePickerInputImplementation.d.ts.map +1 -1
  97. package/dist/esm/Common/DatePickerInputImplementation.js +1 -1
  98. package/dist/esm/Common/DatePickerInputImplementation.js.map +1 -1
  99. package/dist/esm/Common/NumberInput.d.ts.map +1 -1
  100. package/dist/esm/Common/NumberInput.js +1 -1
  101. package/dist/esm/Common/NumberInput.js.map +1 -1
  102. package/dist/esm/Common/Tabs.d.ts.map +1 -1
  103. package/dist/esm/Common/Tabs.js +1 -1
  104. package/dist/esm/Common/Tabs.js.map +1 -1
  105. package/dist/esm/Common/TagGroup.d.ts.map +1 -1
  106. package/dist/esm/Common/TagGroup.js +1 -1
  107. package/dist/esm/Common/TagGroup.js.map +1 -1
  108. package/dist/esm/Common/ToggleGroup.d.ts.map +1 -1
  109. package/dist/esm/Common/ToggleGroup.js +1 -1
  110. package/dist/esm/Common/ToggleGroup.js.map +1 -1
  111. package/dist/esm/DataTables/ColumnFilterMenu.d.ts.map +1 -1
  112. package/dist/esm/DataTables/ColumnFilterMenu.js +1 -1
  113. package/dist/esm/DataTables/ColumnFilterMenu.js.map +1 -1
  114. package/dist/esm/DataTables/DataTableBody.js +1 -1
  115. package/dist/esm/DataTables/DataTableBody.js.map +1 -1
  116. package/dist/esm/DataTables/DataTableCore.js +1 -1
  117. package/dist/esm/DataTables/DataTableCore.js.map +1 -1
  118. package/dist/esm/DataTables/DataTableHeaderCell.js +1 -1
  119. package/dist/esm/DataTables/DataTableHeaderCell.js.map +1 -1
  120. package/dist/esm/DataTables/DataTableRow.js +1 -1
  121. package/dist/esm/DataTables/DataTableRow.js.map +1 -1
  122. package/dist/esm/DataTables/DataTableSearch.js +1 -1
  123. package/dist/esm/DataTables/DataTableSearch.js.map +1 -1
  124. package/dist/esm/Dialogs/DialogImplementation.d.ts.map +1 -1
  125. package/dist/esm/Dialogs/DialogImplementation.js +1 -1
  126. package/dist/esm/Dialogs/DialogImplementation.js.map +1 -1
  127. package/dist/esm/Display/Message.d.ts +8 -1
  128. package/dist/esm/Display/Message.d.ts.map +1 -1
  129. package/dist/esm/Display/Message.js +1 -1
  130. package/dist/esm/Display/Message.js.map +1 -1
  131. package/dist/esm/Dropdown/DropdownImplementation.d.ts.map +1 -1
  132. package/dist/esm/Dropdown/DropdownImplementation.js +1 -1
  133. package/dist/esm/Dropdown/DropdownImplementation.js.map +1 -1
  134. package/dist/esm/Notifications/Toaster.d.ts.map +1 -1
  135. package/dist/esm/Notifications/Toaster.js +1 -1
  136. package/dist/esm/Notifications/Toaster.js.map +1 -1
  137. package/dist/esm/PivotViewer/components/PivotCanvas.d.ts +7 -50
  138. package/dist/esm/PivotViewer/components/PivotCanvas.d.ts.map +1 -1
  139. package/dist/esm/PivotViewer/components/PivotCanvas.js +34 -433
  140. package/dist/esm/PivotViewer/components/PivotCanvas.js.map +1 -1
  141. package/dist/esm/PivotViewer/components/PivotCanvasProps.d.ts +51 -0
  142. package/dist/esm/PivotViewer/components/PivotCanvasProps.d.ts.map +1 -0
  143. package/dist/esm/PivotViewer/components/PivotCanvasProps.js +4 -0
  144. package/dist/esm/PivotViewer/components/PivotCanvasProps.js.map +1 -0
  145. package/dist/esm/PivotViewer/components/pivot/PivotRenderContext.d.ts +16 -0
  146. package/dist/esm/PivotViewer/components/pivot/PivotRenderContext.d.ts.map +1 -0
  147. package/dist/esm/PivotViewer/components/pivot/PivotRenderContext.js +4 -0
  148. package/dist/esm/PivotViewer/components/pivot/PivotRenderContext.js.map +1 -0
  149. package/dist/esm/PivotViewer/components/pivot/PivotStage.d.ts +19 -0
  150. package/dist/esm/PivotViewer/components/pivot/PivotStage.d.ts.map +1 -0
  151. package/dist/esm/PivotViewer/components/pivot/PivotStage.js +4 -0
  152. package/dist/esm/PivotViewer/components/pivot/PivotStage.js.map +1 -0
  153. package/dist/esm/PivotViewer/components/pivot/PivotTransitionState.d.ts +21 -0
  154. package/dist/esm/PivotViewer/components/pivot/PivotTransitionState.d.ts.map +1 -0
  155. package/dist/esm/PivotViewer/components/pivot/PivotTransitionState.js +4 -0
  156. package/dist/esm/PivotViewer/components/pivot/PivotTransitionState.js.map +1 -0
  157. package/dist/esm/PivotViewer/components/pivot/asReactMouseEvent.d.ts +8 -0
  158. package/dist/esm/PivotViewer/components/pivot/asReactMouseEvent.d.ts.map +1 -0
  159. package/dist/esm/PivotViewer/components/pivot/asReactMouseEvent.js +6 -0
  160. package/dist/esm/PivotViewer/components/pivot/asReactMouseEvent.js.map +1 -0
  161. package/dist/esm/PivotViewer/components/pivot/sprites.js +1 -1
  162. package/dist/esm/PivotViewer/components/pivot/usePivotCardColors.d.ts +22 -0
  163. package/dist/esm/PivotViewer/components/pivot/usePivotCardColors.d.ts.map +1 -0
  164. package/dist/esm/PivotViewer/components/pivot/usePivotCardColors.js +25 -0
  165. package/dist/esm/PivotViewer/components/pivot/usePivotCardColors.js.map +1 -0
  166. package/dist/esm/PivotViewer/components/pivot/usePivotGroupBackgrounds.d.ts +8 -0
  167. package/dist/esm/PivotViewer/components/pivot/usePivotGroupBackgrounds.d.ts.map +1 -0
  168. package/dist/esm/PivotViewer/components/pivot/usePivotGroupBackgrounds.js +53 -0
  169. package/dist/esm/PivotViewer/components/pivot/usePivotGroupBackgrounds.js.map +1 -0
  170. package/dist/esm/PivotViewer/components/pivot/usePivotScrollSync.d.ts +8 -0
  171. package/dist/esm/PivotViewer/components/pivot/usePivotScrollSync.d.ts.map +1 -0
  172. package/dist/esm/PivotViewer/components/pivot/usePivotScrollSync.js +100 -0
  173. package/dist/esm/PivotViewer/components/pivot/usePivotScrollSync.js.map +1 -0
  174. package/dist/esm/PivotViewer/components/pivot/usePivotSelectionHighlight.d.ts +7 -0
  175. package/dist/esm/PivotViewer/components/pivot/usePivotSelectionHighlight.d.ts.map +1 -0
  176. package/dist/esm/PivotViewer/components/pivot/usePivotSelectionHighlight.js +35 -0
  177. package/dist/esm/PivotViewer/components/pivot/usePivotSelectionHighlight.js.map +1 -0
  178. package/dist/esm/PivotViewer/components/pivot/usePivotSpriteSync.d.ts +8 -0
  179. package/dist/esm/PivotViewer/components/pivot/usePivotSpriteSync.d.ts.map +1 -0
  180. package/dist/esm/PivotViewer/components/pivot/usePivotSpriteSync.js +123 -0
  181. package/dist/esm/PivotViewer/components/pivot/usePivotSpriteSync.js.map +1 -0
  182. package/dist/esm/PivotViewer/components/pivot/usePivotStage.d.ts +21 -0
  183. package/dist/esm/PivotViewer/components/pivot/usePivotStage.d.ts.map +1 -0
  184. package/dist/esm/PivotViewer/components/pivot/usePivotStage.js +171 -0
  185. package/dist/esm/PivotViewer/components/pivot/usePivotStage.js.map +1 -0
  186. package/dist/esm/PivotViewer/components/pivot/usePivotTransitionState.d.ts +13 -0
  187. package/dist/esm/PivotViewer/components/pivot/usePivotTransitionState.d.ts.map +1 -0
  188. package/dist/esm/PivotViewer/components/pivot/usePivotTransitionState.js +31 -0
  189. package/dist/esm/PivotViewer/components/pivot/usePivotTransitionState.js.map +1 -0
  190. package/dist/esm/TimeMachine/EventsView.d.ts.map +1 -1
  191. package/dist/esm/TimeMachine/EventsView.js +1 -1
  192. package/dist/esm/TimeMachine/EventsView.js.map +1 -1
  193. package/package.json +1 -1
  194. package/dist/esm/DataTables/classNames.d.ts +0 -7
  195. package/dist/esm/DataTables/classNames.d.ts.map +0 -1
  196. package/dist/esm/DataTables/classNames.js.map +0 -1
  197. /package/dist/esm/{DataTables → ClassNames}/classNames.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Canvas.js","sources":["../../../Canvas/Canvas.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport * as PIXI from 'pixi.js';\nimport {\n CanvasControls,\n type CanvasControlsIcons,\n type CanvasControlsLabels,\n} from './CanvasControls';\nimport type { CanvasMinimapHandle, MinimapItem } from './CanvasMinimap';\nimport { canvasGesture } from './canvasGesture';\nimport { canvasTransformActivity } from './canvasTransformActivity';\nimport { isBackgroundPointerTarget } from './isBackgroundPointerTarget';\nimport { isWithinScrollableContent } from './isWithinScrollableContent';\nimport {\n type PanSample,\n decayVelocity,\n trimSamples,\n velocityFromSamples,\n} from './panMomentum';\nimport {\n type PinchSnapshot,\n type PointerPosition,\n pinchChangeBetween,\n pinchSnapshotOf,\n} from './pinchGesture';\nimport { useDragSelectionGuard } from './useDragSelectionGuard';\nimport {\n applyZoomLayer,\n isMultiTouchCapableDevice,\n shouldUseCssZoom,\n} from './zoomMechanism';\n\n/**\n * The easing curve for programmatic camera moves: a cubic ease-in-out, so the camera picks up speed gently\n * and settles gently instead of starting at full tilt — the difference between a camera move and a yank.\n * @param progress Linear progress through the animation, 0 to 1.\n * @returns The eased progress.\n */\nfunction easeInOutCubic(progress: number): number {\n return progress < 0.5\n ? 4 * progress * progress * progress\n : 1 - (-2 * progress + 2) ** 3 / 2;\n}\n\n/**\n * Safari's non-standard trackpad/touch gesture event — absent from the DOM type library, so typed here\n * rather than asserted through `any`. `scale` is cumulative relative to the gesture's start.\n */\ninterface WebKitGestureEvent extends Event {\n /** The gesture's cumulative scale factor since gesturestart. */\n readonly scale: number;\n\n /** The gesture's horizontal viewport coordinate. */\n readonly clientX: number;\n\n /** The gesture's vertical viewport coordinate. */\n readonly clientY: number;\n}\n\n/** Measured world-space bounds for one registered {@link CanvasItem}. */\nexport interface CanvasItemRegistryEntry {\n /** World-space horizontal position. */\n x: number;\n /** World-space vertical position. */\n y: number;\n /** Measured width. */\n width: number;\n /** Measured height. */\n height: number;\n\n /**\n * Whether this entry is registered under an internally generated id rather than one the caller\n * supplied through {@link CanvasItem}'s `id` prop. An anonymous entry still feeds every consumer\n * of the registry — the minimap, fit-to-content — but `Region` (via `itemsWithinRegion`) never\n * reports it as a region member, since there is no caller-owned id a host could recognize it by.\n */\n anonymous?: boolean;\n}\n\n/** Registry contract used by {@link CanvasItem} to publish measured bounds. */\nexport interface CanvasItemRegistryContextValue {\n /** Adds or updates one measured item. */\n register: (id: string, entry: CanvasItemRegistryEntry) => void;\n /** Removes one measured item. */\n unregister: (id: string) => void;\n\n /**\n * The registry's current content, as a stable-reference snapshot: the returned map's identity only\n * changes when the content actually changed (an item registered, unregistered, or moved/resized),\n * making it safe to feed straight into `useSyncExternalStore`. The map is rebuilt on change — never\n * mutated in place — so a held snapshot stays internally consistent. Optional so a consumer\n * providing its own registry value predating this member keeps type-checking; readers must\n * fall back gracefully when absent.\n */\n getSnapshot?: () => ReadonlyMap<string, CanvasItemRegistryEntry>;\n\n /**\n * Subscribes to registry changes; the listener fires after every register/unregister/bounds-update\n * that actually changed content. Bounds updates can arrive per-frame during a drag — listeners\n * decide how much work to do per notification. Returns the unsubscribe function.\n * `useSyncExternalStore`-compatible. Optional for the same compatibility reason as\n * {@link getSnapshot}.\n */\n subscribe?: (listener: () => void) => () => void;\n}\n\n/** Context carrying the nearest Canvas item registry. */\nexport const CanvasItemRegistryContext =\n React.createContext<CanvasItemRegistryContextValue | null>(null);\n\n/** Minimum data shape for an optional Pixi-rendered canvas item. */\nexport interface CanvasItemData {\n /** Stable item identity. */\n id: string;\n /** World-space horizontal position. */\n x: number;\n /** World-space vertical position. */\n y: number;\n}\n\n/** Pixi objects supplied after the Canvas renderer initializes. */\nexport interface CanvasContext {\n /** Pixi application owned by the Canvas. */\n app: PIXI.Application;\n /** Pixi world container receiving rendered items. */\n world: PIXI.Container;\n}\n\n/** Imperative camera and measurement operations exposed by {@link Canvas}. */\nexport interface CanvasHandle {\n /** Smoothly centers a world point. */\n smoothPanToWorld(worldX: number, worldY: number, durationMs?: number): void;\n /** Smoothly centers a world point while animating to a target zoom. */\n smoothPanZoomToWorld(\n worldX: number,\n worldY: number,\n targetZoom?: number,\n durationMs?: number,\n ): void;\n /** Returns the current viewport rectangle, or `null` before mounting. */\n getContainerRect(): DOMRect | null;\n /** Returns world-space bounds for every registered CanvasItem. */\n getItemBounds(): MinimapItem[];\n}\n\n/** Optional product compositor/capture marker names applied by {@link Canvas}. */\nexport interface CanvasCaptureAttributes {\n /** Attribute placed on the Pixi canvas so a product capture pipeline can exclude it. */\n layer?: string;\n /** Attribute placed on non-plain integrated controls that own composited content. */\n content?: string;\n /** Attribute placed on pan/zoom transform hosts whose churn moves existing layers. */\n transformHost?: string;\n}\n\n/** Props for the pan, zoom, item, minimap, and control surface. */\nexport interface CanvasProps<T extends CanvasItemData = CanvasItemData> {\n /** DOM content positioned inside the transformed world. */\n children?: React.ReactNode;\n /** Optional Pixi-rendered item data. */\n items?: T[];\n /** Builds a Pixi display object for one item. */\n renderItem?: (item: T) => PIXI.Container;\n /** Receives pointer activation for a Pixi-rendered item. */\n onItemPointerDown?: (item: T, event: PIXI.FederatedPointerEvent) => void;\n /** Receives the initialized Pixi application and world. */\n onReady?: (context: CanvasContext) => void;\n /** Reports every camera transform change. */\n onTransformChange?: (zoom: number, pan: { x: number; y: number }) => void;\n /** Initial zoom factor. Defaults to `1`. */\n initialZoom?: number;\n /** Initial viewport translation. Defaults to `{ x: 0, y: 0 }`. */\n initialPan?: { x: number; y: number };\n /** Minimum zoom factor. Defaults to `0.1`. */\n minZoom?: number;\n /** Maximum zoom factor. Defaults to `5`. */\n maxZoom?: number;\n /** Whether integrated zoom controls render. Defaults to `true`. */\n showControls?: boolean;\n /** Whether controls expose the minimap toggle. Defaults to `false`. */\n showMinimap?: boolean;\n /** World width represented by the minimap. */\n minimapWorldWidth?: number;\n /** World height represented by the minimap. */\n minimapWorldHeight?: number;\n /** Explicit minimap item rectangles; measured CanvasItem bounds are used otherwise. */\n minimapItems?: MinimapItem[];\n /** Edge used by the integrated control bar. Defaults to `'bottom-left'`. */\n controlsPlacement?: 'bottom-left' | 'bottom-right';\n /** Extra class name for the Canvas root. */\n className?: string;\n /** Inline style for the Canvas root. */\n style?: React.CSSProperties;\n /** Invoked when the optional help action is activated. */\n onHelp?: () => void;\n /** Accessible label and tooltip for the help action. */\n helpTitle?: string;\n /** Localized labels for integrated zoom/minimap/help controls. */\n controlsLabels?: CanvasControlsLabels;\n /** Replacement glyphs for integrated zoom/minimap/help controls. Unset fields keep the built-in icons. */\n controlsIcons?: CanvasControlsIcons;\n /**\n * Whether the integrated controls step aside by the host's `--canvas-viewport-left`/`--canvas-viewport-right`\n * inset at their edge. Defaults to `true`; set `false` when the host already moves the canvas by that inset.\n */\n controlsFollowViewportInsets?: boolean;\n /** Optional product-owned glass/acrylic surface behind integrated controls. */\n controlsGlassSurface?: React.ReactNode;\n /** Uses a low-cost CSS frosted pill instead of a consumer-supplied glass surface. */\n disableControlsGlass?: boolean;\n /** Product-owned capture/compositor marker names. Canvas has no capture-provider dependency. */\n captureAttributes?: CanvasCaptureAttributes;\n /** Receives imperative camera and measurement operations. */\n onHandleReady?: (handle: CanvasHandle) => void;\n /** Keeps pan/zoom available while absorbing interaction with canvas content. */\n readOnly?: boolean;\n /**\n * Whether mouse/pen drag on empty background pans the board. Disable when\n * the product owns that gesture for selection; wheel, middle-button, and\n * touch panning remain available.\n */\n backgroundDragPans?: boolean;\n}\n\nconst ZOOM_INTENSITY = 0.008;\n\n// How long after the last wheel event a gesture counts as settled - the moment the crisp resting zoom is\n// re-applied and the held-back virtualization updates flush.\nconst GESTURE_SETTLE_MS = 150;\n\n// A trackpad's momentum comes for free — the OS keeps delivering decaying wheel events after the\n// fingers lift. A touch drag has no such thing: `touch-action: none` hands the whole gesture to us,\n// so lifting a finger stops the pan dead unless we fake the same decay ourselves. These tune that feel.\n// Only samples within this trailing window (from the drag's last moment, not its whole history)\n// contribute to the release velocity, so a drag that was moving fast but came to rest before the\n// finger actually lifted correctly produces no momentum.\nconst MOMENTUM_SAMPLE_WINDOW_MS = 100;\n\n// Below this speed (px/ms) momentum is imperceptible — used both to skip starting it on a slow\n// release and to end the decay loop once it coasts down to a stop.\nconst MOMENTUM_MIN_VELOCITY = 0.02;\n\n// Exponential decay rate, chosen so velocity halves roughly every 200ms — fast enough to feel\n// responsive, slow enough to read as a coast rather than a snap.\nconst MOMENTUM_FRICTION = 0.0035;\n\n/**\n * A pan/zoom/Pixi-backed infinite canvas with optional HTML overlay items, integrated minimap, and\n * zoom controls. Renders Pixi-backed sprites and DOM content under one synchronized camera, manages\n * wheel/touch/trackpad gestures, and exposes imperative camera navigation.\n */\nfunction Canvas<T extends CanvasItemData = CanvasItemData>({\n children,\n items = [] as T[],\n renderItem,\n onItemPointerDown,\n onReady,\n onTransformChange,\n onHandleReady,\n initialZoom = 1,\n initialPan = { x: 0, y: 0 },\n minZoom = 0.1,\n maxZoom = 5,\n showControls = true,\n showMinimap = false,\n minimapWorldWidth,\n minimapWorldHeight,\n minimapItems,\n controlsPlacement = 'bottom-left',\n className,\n style,\n onHelp,\n helpTitle,\n controlsLabels,\n controlsIcons,\n controlsFollowViewportInsets = true,\n controlsGlassSurface,\n disableControlsGlass = false,\n captureAttributes,\n readOnly = false,\n backgroundDragPans = true,\n}: CanvasProps<T>): React.ReactElement {\n const containerRef = useRef<HTMLDivElement>(null);\n useDragSelectionGuard(containerRef);\n const appRef = useRef<PIXI.Application | null>(null);\n const worldRef = useRef<PIXI.Container | null>(null);\n const minimapRef = useRef<CanvasMinimapHandle | null>(null);\n const overlayRef = useRef<HTMLDivElement>(null);\n const zoomLayerRef = useRef<HTMLDivElement>(null);\n const spritesRef = useRef<Map<string, PIXI.Container>>(new Map());\n const animationFrameRef = useRef<number | null>(null);\n\n const [pixiReady, setPixiReady] = useState(false);\n\n // Mutable refs so event callbacks always read current values without re-binding\n const panRef = useRef({ x: initialPan.x, y: initialPan.y });\n const zoomRef = useRef(initialZoom);\n\n // The transform styles rendered by JSX are frozen at their first-mount values: after mount the\n // overlay/zoom-layer styles are owned exclusively by the imperative per-frame writes. If the JSX\n // re-rendered them from live props (a parent may persist and echo the transform back through\n // `initialPan`/`initialZoom`), a React commit racing a gesture would rewrite the styles with\n // stale values — visible as the viewport flicking to an old position and back.\n const initialTransformRef = useRef({ pan: initialPan, zoom: initialZoom });\n\n // Wheel gestures coalesce onto animation frames (trackpads deliver several events per frame, and each\n // direct style write would reflow), and while a gesture is in motion the zoom layer stays on the\n // composited transform path with virtualization told to hold still. The settle timer restores the crisp\n // resting state shortly after the last wheel event.\n const gestureActiveRef = useRef(false);\n const gestureSettleTimerRef = useRef<ReturnType<typeof setTimeout> | undefined>(\n undefined,\n );\n const transformFramePendingRef = useRef(false);\n const isPanningRef = useRef(false);\n const lastPointerRef = useRef({ x: 0, y: 0 });\n\n // Direct DOM write, not React state — an idle background should not look grabbable until a drag\n // starts. Swapping to 'grabbing' for the life of a drag-pan is exactly the kind of per-gesture\n // churn this file\n // already avoids re-rendering for elsewhere (see the transform writes below).\n const setPanCursor = useCallback((panning: boolean) => {\n if (containerRef.current)\n containerRef.current.style.cursor = panning ? 'grabbing' : 'default';\n }, []);\n\n // Touch pointers currently down on the canvas, in the order they landed, plus the pinch geometry\n // they had on the previous move. Touch is the only input that can deliver several simultaneous\n // pointers, so mouse/pen never enter this map and keep the single-pointer drag path below.\n const touchPointersRef = useRef<Map<number, PointerPosition>>(new Map());\n const pinchRef = useRef<PinchSnapshot | null>(null);\n\n // Recent positions of the single finger currently panning, newest last, trimmed to\n // MOMENTUM_SAMPLE_WINDOW_MS — the trailing window startTouchMomentum reads the release velocity from.\n const touchPanSamplesRef = useRef<PanSample[]>([]);\n\n // Keep callback refs current to avoid stale closures in PIXI event handlers\n const onReadyRef = useRef(onReady);\n const onItemPointerDownRef = useRef(onItemPointerDown);\n const onTransformChangeRef = useRef(onTransformChange);\n const onHandleReadyRef = useRef(onHandleReady);\n const itemsRef = useRef(items);\n useEffect(() => {\n onReadyRef.current = onReady;\n }, [onReady]);\n useEffect(() => {\n onItemPointerDownRef.current = onItemPointerDown;\n }, [onItemPointerDown]);\n useEffect(() => {\n onTransformChangeRef.current = onTransformChange;\n }, [onTransformChange]);\n useEffect(() => {\n onHandleReadyRef.current = onHandleReady;\n }, [onHandleReady]);\n useEffect(() => {\n itemsRef.current = items;\n }, [items]);\n\n // ── Item registry — auto-builds minimap items from CanvasItem children ──\n\n const itemRegistryRef = useRef<Map<string, CanvasItemRegistryEntry>>(new Map());\n const [itemRegistryVersion, setItemRegistryVersion] = useState(0);\n\n // The read/subscribe side of the registry. The snapshot is a fresh shallow copy taken on every\n // actual content change (register/unregister guard against no-op writes below), so its identity\n // is a faithful change signal for useSyncExternalStore consumers — same reference back means\n // nothing changed. Entry objects are replaced wholesale on update, never mutated, so entries\n // shared between an old snapshot and a new one are safe to hold onto.\n const registrySnapshotRef = useRef<ReadonlyMap<string, CanvasItemRegistryEntry>>(\n new Map(),\n );\n const registryListenersRef = useRef<Set<() => void>>(new Set());\n\n const notifyRegistryChanged = useCallback(() => {\n registrySnapshotRef.current = new Map(itemRegistryRef.current);\n setItemRegistryVersion((version) => version + 1);\n registryListenersRef.current.forEach((listener) => listener());\n }, []);\n\n const registerItem = useCallback(\n (id: string, entry: CanvasItemRegistryEntry) => {\n const existing = itemRegistryRef.current.get(id);\n if (\n existing &&\n existing.x === entry.x &&\n existing.y === entry.y &&\n existing.width === entry.width &&\n existing.height === entry.height &&\n existing.anonymous === entry.anonymous\n )\n return;\n itemRegistryRef.current.set(id, entry);\n notifyRegistryChanged();\n },\n [notifyRegistryChanged],\n );\n\n const unregisterItem = useCallback(\n (id: string) => {\n if (!itemRegistryRef.current.delete(id)) return;\n notifyRegistryChanged();\n },\n [notifyRegistryChanged],\n );\n\n const getRegistrySnapshot = useCallback(\n (): ReadonlyMap<string, CanvasItemRegistryEntry> => registrySnapshotRef.current,\n [],\n );\n\n const subscribeToRegistry = useCallback((listener: () => void): (() => void) => {\n registryListenersRef.current.add(listener);\n return () => {\n registryListenersRef.current.delete(listener);\n };\n }, []);\n\n const registryContextValue = useMemo<CanvasItemRegistryContextValue>(\n () => ({\n register: registerItem,\n unregister: unregisterItem,\n getSnapshot: getRegistrySnapshot,\n subscribe: subscribeToRegistry,\n }),\n [registerItem, unregisterItem, getRegistrySnapshot, subscribeToRegistry],\n );\n\n const autoMinimapItems = useMemo((): MinimapItem[] => {\n void itemRegistryVersion; // subscribe to registry changes\n const result: MinimapItem[] = [];\n itemRegistryRef.current.forEach((entry) => {\n result.push({\n x: entry.x,\n y: entry.y,\n width: entry.width,\n height: entry.height,\n });\n });\n return result;\n }, [itemRegistryVersion]);\n\n const effectiveMinimapItems = minimapItems ?? autoMinimapItems;\n\n const refreshMinimap = useCallback(() => {\n const app = appRef.current;\n if (!app || !minimapRef.current) return;\n minimapRef.current.update(\n panRef.current,\n zoomRef.current,\n app.renderer.width,\n app.renderer.height,\n );\n }, []);\n\n const applyWorldTransform = useCallback(() => {\n const world = worldRef.current;\n if (!world) return;\n world.position.set(panRef.current.x, panRef.current.y);\n world.scale.set(zoomRef.current);\n // Pan is a CSS transform on the outer overlay; zoom is applied to an inner layer. The zoom\n // mechanism is hybrid, split at 100% (the two are identical there, so the switch is seamless):\n // - Above 100% we use CSS `zoom`, which re-lays-out and re-rasterizes at the effective\n // resolution — `transform: scale()` would rasterize once at 1x and stretch, blurring text\n // when UPSCALING in Safari. EXCEPT on multi-touch-capable devices (iPad and friends), which\n // always use `transform: scale()` even above 100% — see zoomMechanism.ts for why.\n // - At or below 100% we use `transform: scale()`, which is GPU-composited: zooming out stays\n // smooth (no per-frame full-board reflow) and text scales down properly. CSS `zoom` instead\n // reflows every step (jerky) and clamps font-size to a floor when zoomed out, so labels stop\n // shrinking and word-wrap. Downscaling never blurs, so the crispness reason does not apply here.\n if (overlayRef.current) {\n overlayRef.current.style.transform = `translate(${panRef.current.x}px, ${panRef.current.y}px)`;\n }\n if (zoomLayerRef.current) {\n applyZoomLayer(\n zoomLayerRef.current,\n zoomRef.current,\n gestureActiveRef.current,\n );\n }\n onTransformChangeRef.current?.(zoomRef.current, panRef.current);\n // Every applied transform frame is announced so followers (cursors, selection toolbar, tour\n // anchors) can ride the transform instead of polling it on their own animation-frame loops.\n canvasTransformActivity.notify();\n }, []);\n\n const render = useCallback(() => {\n const app = appRef.current;\n if (!app) return;\n // Boards that only use the HTML overlay leave the PIXI world empty — skip the per-frame\n // GPU pass entirely rather than clearing and presenting an empty stage on every gesture frame.\n if ((worldRef.current?.children.length ?? 0) === 0) return;\n // The system ticker is stopped (see the init effect below) — drive pixi's scheduled\n // housekeeping (texture GC and friends) from the frames that actually render instead.\n PIXI.Ticker.system.update();\n app.renderer.render(app.stage);\n }, []);\n\n // Initialize PIXI once\n useEffect(() => {\n const container = containerRef.current;\n if (!container || appRef.current) return;\n\n let mounted = true;\n\n (async () => {\n const rect = container.getBoundingClientRect();\n const width = rect.width > 0 ? rect.width : container.clientWidth || 800;\n const height = rect.height > 0 ? rect.height : container.clientHeight || 600;\n\n const app = new PIXI.Application();\n await app.init({\n // Transparent clear: the body carries the surface color and the user-selected\n // appearance background, which must show through the canvas like everywhere else.\n backgroundAlpha: 0,\n antialias: true,\n autoDensity: true,\n resolution: window.devicePixelRatio || 1,\n width,\n height,\n autoStart: false,\n });\n\n if (!mounted || !containerRef.current) {\n app.destroy(true, { children: true });\n return;\n }\n\n appRef.current = app;\n\n // World container - all items live here; zoom/pan applied via transform\n const world = new PIXI.Container();\n world.position.set(panRef.current.x, panRef.current.y);\n world.scale.set(zoomRef.current);\n app.stage.addChild(world);\n worldRef.current = world;\n\n const canvas = app.canvas as HTMLCanvasElement;\n canvas.style.display = 'block';\n canvas.style.touchAction = 'none';\n containerRef.current.appendChild(canvas);\n\n setPixiReady(true);\n app.renderer.render(app.stage);\n\n // Initializing a renderer hooks pixi's SchedulerSystem onto the auto-starting system\n // ticker, which then runs a requestAnimationFrame loop forever even though nothing here\n // renders from a ticker (autoStart is false and every render is explicit) — one of the\n // permanent loops that kept an idle canvas busy. Stop it after every init, because each\n // new renderer restarts it; render() drives the scheduled\n // housekeeping instead.\n PIXI.Ticker.system.stop();\n\n onReadyRef.current?.({ app, world });\n })();\n\n return () => {\n mounted = false;\n if (appRef.current) {\n appRef.current.destroy(true, { children: true });\n appRef.current = null;\n worldRef.current = null;\n }\n spritesRef.current.clear();\n };\n }, []); // intentional: PIXI init runs exactly once\n\n // Products with a capture/compositor pipeline can mark the Pixi canvas without making that\n // provider a Components dependency. Keep the marker synchronized if product configuration changes.\n useEffect(() => {\n const canvas = appRef.current?.canvas as HTMLCanvasElement | undefined;\n const attribute = captureAttributes?.layer;\n if (!canvas || !attribute) return;\n canvas.setAttribute(attribute, 'true');\n return () => canvas.removeAttribute(attribute);\n }, [pixiReady, captureAttributes?.layer]);\n\n // Handle container resize\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n const observer = new ResizeObserver(() => {\n const app = appRef.current;\n if (!app) return;\n app.renderer.resize(container.clientWidth, container.clientHeight);\n render();\n });\n observer.observe(container);\n return () => observer.disconnect();\n }, [render]);\n\n // One transform apply per animation frame, no matter how many wheel events arrived - the refs already\n // hold the latest pan/zoom, so coalescing loses nothing and avoids multiple reflows per frame.\n // No React state is touched here: a gesture must cause zero Canvas re-renders (the controls'\n // zoom readout polls the ref on its own slow interval instead).\n const scheduleTransformApply = useCallback(() => {\n if (transformFramePendingRef.current) return;\n transformFramePendingRef.current = true;\n requestAnimationFrame(() => {\n transformFramePendingRef.current = false;\n applyWorldTransform();\n refreshMinimap();\n render();\n });\n }, [applyWorldTransform, refreshMinimap, render]);\n\n // Marks the gesture active (composited zoom path, virtualization held still) and re-arms the settle\n // timer. On settle the crisp resting hybrid is re-applied through the same applyWorldTransform as\n // every gesture frame — one writer, one atomic style pass — and a new gesture cancels the timer,\n // so a settle can never land in the middle of the next gesture.\n const noteGestureActivity = useCallback(() => {\n gestureActiveRef.current = true;\n canvasGesture.set(true);\n clearTimeout(gestureSettleTimerRef.current);\n gestureSettleTimerRef.current = setTimeout(() => {\n gestureActiveRef.current = false;\n applyWorldTransform();\n canvasGesture.set(false);\n }, GESTURE_SETTLE_MS);\n }, [applyWorldTransform]);\n\n useEffect(\n () => () => {\n clearTimeout(gestureSettleTimerRef.current);\n canvasGesture.set(false);\n },\n [],\n );\n\n // Zooms toward a fixed focus point on the container, holding the world point under it still —\n // the one zoom every input path shares, whether the factor came from a wheel delta or a pinch.\n const zoomTowards = useCallback(\n (focusX: number, focusY: number, factor: number) => {\n const newZoom = Math.max(\n minZoom,\n Math.min(maxZoom, zoomRef.current * factor),\n );\n const worldX = (focusX - panRef.current.x) / zoomRef.current;\n const worldY = (focusY - panRef.current.y) / zoomRef.current;\n panRef.current = {\n x: focusX - worldX * newZoom,\n y: focusY - worldY * newZoom,\n };\n zoomRef.current = newZoom;\n noteGestureActivity();\n scheduleTransformApply();\n },\n [minZoom, maxZoom, noteGestureActivity, scheduleTransformApply],\n );\n\n // Wheel: pan (scroll) or zoom (Ctrl+scroll / pinch)\n const handleWheel = useCallback(\n (e: WheelEvent) => {\n const container = containerRef.current;\n if (!container) return;\n\n // A plain scroll/trackpad gesture landing over a scrollable overlay (a chat's message list\n // and similar) scrolls that content instead of panning the board underneath it. A zoom\n // gesture (ctrl/cmd) always wins — pinch-to-zoom over a chat\n // panel is still a zoom, not a captured scroll.\n if (\n !(e.ctrlKey || e.metaKey) &&\n isWithinScrollableContent(e.target, container)\n )\n return;\n\n e.preventDefault();\n\n // A fresh gesture always wins over a still-coasting one from the last touch pan.\n if (animationFrameRef.current !== null) {\n cancelAnimationFrame(animationFrameRef.current);\n animationFrameRef.current = null;\n }\n\n const rect = container.getBoundingClientRect();\n const mouseX = e.clientX - rect.left;\n const mouseY = e.clientY - rect.top;\n\n if (e.ctrlKey || e.metaKey) {\n zoomTowards(mouseX, mouseY, Math.exp(-e.deltaY * ZOOM_INTENSITY));\n } else {\n panRef.current = {\n x: panRef.current.x - e.deltaX,\n y: panRef.current.y - e.deltaY,\n };\n noteGestureActivity();\n scheduleTransformApply();\n }\n },\n [zoomTowards, noteGestureActivity, scheduleTransformApply],\n );\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n container.addEventListener('wheel', handleWheel, { passive: false });\n return () => container.removeEventListener('wheel', handleWheel);\n }, [handleWheel]);\n\n // Safari/WebKit reports a trackpad pinch through its own non-standard gesture events —\n // including on iPadOS with a Magic Keyboard trackpad — separately from the wheel+ctrlKey path\n // above, which Safari never fires for a trackpad pinch. Left unhandled, Safari's default action\n // is to zoom the whole page instead of the canvas — but canceling that alone would swallow the\n // pinch entirely, so gesturechange also drives the same zoom-towards-focus the ctrl+wheel path\n // applies. A touchscreen pinch fires these gesture events too, alongside the pointer events the\n // touch path already zooms from — with touch pointers down, this handler only cancels the page\n // zoom and leaves the zooming to the touch path. The events don't exist outside WebKit, so all\n // of this is a no-op everywhere else.\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n let lastScale = 1;\n const handleGestureStart = (event: Event) => {\n event.preventDefault();\n lastScale = (event as WebKitGestureEvent).scale || 1;\n };\n const handleGestureChange = (event: Event) => {\n event.preventDefault();\n if (touchPointersRef.current.size > 0) return;\n\n const gesture = event as WebKitGestureEvent;\n if (!gesture.scale || !lastScale) return;\n\n const rect = container.getBoundingClientRect();\n zoomTowards(\n gesture.clientX - rect.left,\n gesture.clientY - rect.top,\n gesture.scale / lastScale,\n );\n lastScale = gesture.scale;\n };\n const handleGestureEnd = (event: Event) => event.preventDefault();\n\n // Explicitly non-passive: WebKit is free to treat an options-less gesture listener as\n // passive, silently ignoring preventDefault() — which would zoom the browser page instead\n // of the canvas on an iPad Magic Keyboard trackpad.\n container.addEventListener('gesturestart', handleGestureStart, {\n passive: false,\n });\n container.addEventListener('gesturechange', handleGestureChange, {\n passive: false,\n });\n container.addEventListener('gestureend', handleGestureEnd, { passive: false });\n return () => {\n container.removeEventListener('gesturestart', handleGestureStart);\n container.removeEventListener('gesturechange', handleGestureChange);\n container.removeEventListener('gestureend', handleGestureEnd);\n };\n }, [zoomTowards]);\n\n // The two handlers above only ever see events that bubble through the canvas surface's own DOM\n // subtree — but a toolbar, panel, or minimap floating over the canvas is frequently portalled to\n // document.body (or otherwise rendered as a sibling, not a descendant), so a pinch or Ctrl/Cmd+\n // wheel with the cursor sitting over one of those never reaches the listeners above at all, and\n // the browser is free to zoom the whole page instead. Listen at the window level too, and go\n // purely by screen position — no matter what element actually receives the\n // event, if it lands within the canvas's own rectangle the browser's native zoom is canceled.\n // For events whose target sits inside the canvas subtree this only cancels the browser zoom —\n // the container's own listeners drive the canvas zoom, so applying it here too would double up.\n // For a pinch whose target is a portalled sibling (never reaching the container listeners), it\n // also drives the same zoom-towards-focus, so a pinch over a floating panel zooms the board\n // instead of being swallowed after the browser zoom is canceled.\n useEffect(() => {\n const isWithinCanvas = (x: number, y: number) => {\n const rect = containerRef.current?.getBoundingClientRect();\n return (\n !!rect &&\n x >= rect.left &&\n x <= rect.right &&\n y >= rect.top &&\n y <= rect.bottom\n );\n };\n const reachesContainerListeners = (event: Event) =>\n event.target instanceof Node &&\n !!containerRef.current?.contains(event.target);\n const handleWindowWheel = (event: WheelEvent) => {\n if (\n (event.ctrlKey || event.metaKey) &&\n isWithinCanvas(event.clientX, event.clientY)\n ) {\n event.preventDefault();\n }\n };\n\n let lastScale = 1;\n const handleWindowGestureStart = (event: Event) => {\n const gesture = event as WebKitGestureEvent;\n if (!isWithinCanvas(gesture.clientX, gesture.clientY)) return;\n event.preventDefault();\n lastScale = gesture.scale || 1;\n };\n const handleWindowGestureChange = (event: Event) => {\n const gesture = event as WebKitGestureEvent;\n if (!isWithinCanvas(gesture.clientX, gesture.clientY)) return;\n event.preventDefault();\n if (reachesContainerListeners(event)) return;\n if (touchPointersRef.current.size > 0) return;\n if (!gesture.scale || !lastScale) return;\n\n const rect = containerRef.current?.getBoundingClientRect();\n if (!rect) return;\n zoomTowards(\n gesture.clientX - rect.left,\n gesture.clientY - rect.top,\n gesture.scale / lastScale,\n );\n lastScale = gesture.scale;\n };\n const handleWindowGestureEnd = (event: Event) => {\n const gesture = event as WebKitGestureEvent;\n if (isWithinCanvas(gesture.clientX, gesture.clientY)) event.preventDefault();\n };\n\n // Non-passive everywhere: WebKit treating any of these as passive is what lets the page\n // zoom through, and window-level listeners are exactly where it is most inclined to.\n window.addEventListener('wheel', handleWindowWheel, { passive: false });\n window.addEventListener('gesturestart', handleWindowGestureStart, {\n passive: false,\n });\n window.addEventListener('gesturechange', handleWindowGestureChange, {\n passive: false,\n });\n window.addEventListener('gestureend', handleWindowGestureEnd, { passive: false });\n return () => {\n window.removeEventListener('wheel', handleWindowWheel);\n window.removeEventListener('gesturestart', handleWindowGestureStart);\n window.removeEventListener('gesturechange', handleWindowGestureChange);\n window.removeEventListener('gestureend', handleWindowGestureEnd);\n };\n }, [zoomTowards]);\n\n // Touch: two fingers pan and zoom together, anywhere on the surface — the trackpad's\n // wheel/ctrl+wheel equivalent for a tablet. The world point under the pinch midpoint stays put\n // while the midpoint itself drags the board, so zooming and panning feel like one gesture.\n const applyPinch = useCallback(() => {\n const container = containerRef.current;\n const snapshot = pinchSnapshotOf(touchPointersRef.current.values());\n if (!container || !snapshot) return;\n\n const previous = pinchRef.current;\n pinchRef.current = snapshot;\n // The first move of a gesture only establishes the baseline — there is nothing to move yet.\n if (!previous) return;\n\n const change = pinchChangeBetween(previous, snapshot);\n const rect = container.getBoundingClientRect();\n const focusX = snapshot.center.x - rect.left;\n const focusY = snapshot.center.y - rect.top;\n const newZoom = Math.max(\n minZoom,\n Math.min(maxZoom, zoomRef.current * change.scale),\n );\n // The world point that was under the midpoint BEFORE this step is the one being held, so the\n // midpoint's own movement is what pans — exactly as zoom-towards-cursor does for the wheel.\n const worldX = (focusX - change.panX - panRef.current.x) / zoomRef.current;\n const worldY = (focusY - change.panY - panRef.current.y) / zoomRef.current;\n panRef.current = { x: focusX - worldX * newZoom, y: focusY - worldY * newZoom };\n zoomRef.current = newZoom;\n\n noteGestureActivity();\n scheduleTransformApply();\n }, [minZoom, maxZoom, noteGestureActivity, scheduleTransformApply]);\n\n // Coasts the board after a touch pan release, decaying the release velocity to a stop — the\n // manual equivalent of the momentum a trackpad's own wheel-event stream gives panning for free.\n // Shares animationFrameRef with smoothPanToWorld/smoothPanZoomToWorld so only one of the three\n // ever drives the transform at once; each cancels whichever of the others was still running.\n const startTouchMomentum = useCallback(() => {\n const initialVelocity = velocityFromSamples(\n touchPanSamplesRef.current,\n MOMENTUM_MIN_VELOCITY,\n );\n if (!initialVelocity) return;\n\n if (animationFrameRef.current !== null) {\n cancelAnimationFrame(animationFrameRef.current);\n animationFrameRef.current = null;\n }\n\n let velocity = initialVelocity;\n let lastFrameTime = performance.now();\n\n const animate = (currentTime: number) => {\n const frameElapsedMs = currentTime - lastFrameTime;\n lastFrameTime = currentTime;\n\n panRef.current = {\n x: panRef.current.x + velocity.x * frameElapsedMs,\n y: panRef.current.y + velocity.y * frameElapsedMs,\n };\n velocity = decayVelocity(velocity, frameElapsedMs, MOMENTUM_FRICTION);\n\n applyWorldTransform();\n refreshMinimap();\n render();\n noteGestureActivity();\n\n if (Math.hypot(velocity.x, velocity.y) > MOMENTUM_MIN_VELOCITY) {\n animationFrameRef.current = requestAnimationFrame(animate);\n } else {\n animationFrameRef.current = null;\n }\n };\n\n animationFrameRef.current = requestAnimationFrame(animate);\n }, [applyWorldTransform, refreshMinimap, render, noteGestureActivity]);\n\n // Pointer: pan via middle mouse, left-click on empty background, or a single finger on it\n const handlePointerDown = useCallback(\n (e: React.PointerEvent<HTMLDivElement>) => {\n // A fresh gesture always wins over a still-coasting one from the last touch pan.\n if (animationFrameRef.current !== null) {\n cancelAnimationFrame(animationFrameRef.current);\n animationFrameRef.current = null;\n }\n\n if (e.pointerType === 'touch') {\n touchPointersRef.current.set(e.pointerId, { x: e.clientX, y: e.clientY });\n if (touchPointersRef.current.size > 1) {\n // A second finger turns whatever was happening into a pinch: end the one-finger drag\n // so the two paths never both move the board in the same frame.\n isPanningRef.current = false;\n setPanCursor(false);\n pinchRef.current = pinchSnapshotOf(touchPointersRef.current.values());\n return;\n }\n }\n\n const isBackground = isBackgroundPointerTarget(\n e.pointerType,\n readOnly,\n e.target,\n containerRef.current,\n );\n // A host that claims the background drag for itself only gives up the mouse/pen gesture: touch\n // has no middle button and no wheel, so one finger must keep panning or the board is stuck.\n const mayDragPan = backgroundDragPans || e.pointerType === 'touch';\n if (e.button === 1 || (e.button === 0 && isBackground && mayDragPan)) {\n if (e.button === 1) e.preventDefault();\n isPanningRef.current = true;\n setPanCursor(true);\n lastPointerRef.current = { x: e.clientX, y: e.clientY };\n if (e.pointerType === 'touch') {\n touchPanSamplesRef.current = [\n { x: e.clientX, y: e.clientY, time: performance.now() },\n ];\n }\n e.currentTarget.setPointerCapture(e.pointerId);\n }\n },\n [readOnly, backgroundDragPans, setPanCursor],\n );\n\n const handlePointerMove = useCallback(\n (e: React.PointerEvent<HTMLDivElement>) => {\n if (e.pointerType === 'touch' && touchPointersRef.current.has(e.pointerId)) {\n touchPointersRef.current.set(e.pointerId, { x: e.clientX, y: e.clientY });\n if (touchPointersRef.current.size > 1) {\n applyPinch();\n return;\n }\n }\n if (!isPanningRef.current) return;\n const deltaX = e.clientX - lastPointerRef.current.x;\n const deltaY = e.clientY - lastPointerRef.current.y;\n lastPointerRef.current = { x: e.clientX, y: e.clientY };\n panRef.current = {\n x: panRef.current.x + deltaX,\n y: panRef.current.y + deltaY,\n };\n\n if (e.pointerType === 'touch') {\n const samples = [\n ...touchPanSamplesRef.current,\n { x: e.clientX, y: e.clientY, time: performance.now() },\n ];\n touchPanSamplesRef.current = trimSamples(\n samples,\n MOMENTUM_SAMPLE_WINDOW_MS,\n );\n }\n\n // Same gesture path as wheel pan: coalesce onto one rAF and signal the gesture so\n // virtualization holds still during a drag-pan too.\n noteGestureActivity();\n scheduleTransformApply();\n },\n [applyPinch, noteGestureActivity, scheduleTransformApply],\n );\n\n const handlePointerUp = useCallback(\n (e: React.PointerEvent<HTMLDivElement>) => {\n if (touchPointersRef.current.delete(e.pointerId)) {\n // Re-baseline on the fingers that are left: keeping the old geometry would register the\n // lifted finger's absence as a huge pinch/pan step on the next move.\n pinchRef.current = pinchSnapshotOf(touchPointersRef.current.values());\n const [remaining] = [...touchPointersRef.current.values()];\n if (remaining) {\n // Lifting back down to one finger continues the same gesture as a plain drag-pan\n // rather than stopping dead until the user lifts and starts over.\n isPanningRef.current = true;\n setPanCursor(true);\n lastPointerRef.current = { x: remaining.x, y: remaining.y };\n touchPanSamplesRef.current = [\n { x: remaining.x, y: remaining.y, time: performance.now() },\n ];\n return;\n }\n }\n\n const wasPanningTouch = e.pointerType === 'touch' && isPanningRef.current;\n isPanningRef.current = false;\n setPanCursor(false);\n if (wasPanningTouch) startTouchMomentum();\n },\n [startTouchMomentum, setPanCursor],\n );\n\n // Sync items → PIXI containers\n useEffect(() => {\n const world = worldRef.current;\n if (!pixiReady || !world || !renderItem) return;\n\n const incoming = new Map(items.map((item) => [item.id, item]));\n\n // Remove deleted items\n spritesRef.current.forEach((container, id) => {\n if (!incoming.has(id)) {\n world.removeChild(container);\n container.destroy({ children: true });\n spritesRef.current.delete(id);\n }\n });\n\n // Add new items; update positions of existing ones\n items.forEach((item) => {\n const existing = spritesRef.current.get(item.id);\n if (existing) {\n existing.position.set(item.x, item.y);\n // Refresh handler so it always references the latest item object\n existing.removeAllListeners('pointerdown');\n existing.on('pointerdown', (event: PIXI.FederatedPointerEvent) => {\n onItemPointerDownRef.current?.(item, event);\n });\n } else {\n const container = renderItem(item);\n container.position.set(item.x, item.y);\n container.eventMode = 'static';\n container.on('pointerdown', (event: PIXI.FederatedPointerEvent) => {\n onItemPointerDownRef.current?.(item, event);\n });\n world.addChild(container);\n spritesRef.current.set(item.id, container);\n }\n });\n\n // Render directly (not via the empty-world-skipping render()) so removing the last item\n // still clears its pixels from the canvas.\n appRef.current?.renderer.render(appRef.current.stage);\n }, [pixiReady, items, renderItem]);\n\n // Controls handlers\n const handleZoomIn = useCallback(() => {\n const container = containerRef.current;\n if (!container) return;\n const cx = container.clientWidth / 2;\n const cy = container.clientHeight / 2;\n const factor = 1.2;\n const newZoom = Math.min(maxZoom, zoomRef.current * factor);\n const worldX = (cx - panRef.current.x) / zoomRef.current;\n const worldY = (cy - panRef.current.y) / zoomRef.current;\n panRef.current = { x: cx - worldX * newZoom, y: cy - worldY * newZoom };\n zoomRef.current = newZoom;\n applyWorldTransform();\n refreshMinimap();\n render();\n }, [maxZoom, applyWorldTransform, refreshMinimap, render]);\n\n const handleZoomOut = useCallback(() => {\n const container = containerRef.current;\n if (!container) return;\n const cx = container.clientWidth / 2;\n const cy = container.clientHeight / 2;\n const factor = 1.2;\n const newZoom = Math.max(minZoom, zoomRef.current / factor);\n const worldX = (cx - panRef.current.x) / zoomRef.current;\n const worldY = (cy - panRef.current.y) / zoomRef.current;\n panRef.current = { x: cx - worldX * newZoom, y: cy - worldY * newZoom };\n zoomRef.current = newZoom;\n applyWorldTransform();\n refreshMinimap();\n render();\n }, [minZoom, applyWorldTransform, refreshMinimap, render]);\n\n const handleZoomReset = useCallback(() => {\n zoomRef.current = 1;\n applyWorldTransform();\n refreshMinimap();\n render();\n }, [applyWorldTransform, refreshMinimap, render]);\n\n const handleMinimapPan = useCallback(\n (pan: { x: number; y: number }) => {\n panRef.current = pan;\n applyWorldTransform();\n refreshMinimap();\n render();\n },\n [applyWorldTransform, refreshMinimap, render],\n );\n\n const smoothPanToWorld = useCallback(\n (worldX: number, worldY: number, durationMs = 600) => {\n const container = containerRef.current;\n if (!container) return;\n\n if (animationFrameRef.current !== null) {\n cancelAnimationFrame(animationFrameRef.current);\n animationFrameRef.current = null;\n }\n\n const viewportWidth = container.clientWidth;\n const viewportHeight = container.clientHeight;\n const targetPanX = viewportWidth / 2 - worldX * zoomRef.current;\n const targetPanY = viewportHeight / 2 - worldY * zoomRef.current;\n const startPanX = panRef.current.x;\n const startPanY = panRef.current.y;\n const startTime = performance.now();\n\n const animate = (currentTime: number) => {\n const elapsed = currentTime - startTime;\n const progress = Math.min(elapsed / durationMs, 1);\n const eased = easeInOutCubic(progress);\n panRef.current = {\n x: startPanX + (targetPanX - startPanX) * eased,\n y: startPanY + (targetPanY - startPanY) * eased,\n };\n applyWorldTransform();\n refreshMinimap();\n render();\n if (progress < 1) {\n animationFrameRef.current = requestAnimationFrame(animate);\n } else {\n animationFrameRef.current = null;\n }\n };\n\n animationFrameRef.current = requestAnimationFrame(animate);\n },\n [applyWorldTransform, refreshMinimap, render],\n );\n\n const smoothPanZoomToWorld = useCallback(\n (worldX: number, worldY: number, targetZoom = 1, durationMs = 600) => {\n const container = containerRef.current;\n if (!container) return;\n\n if (animationFrameRef.current !== null) {\n cancelAnimationFrame(animationFrameRef.current);\n animationFrameRef.current = null;\n }\n\n const viewportWidth = container.clientWidth;\n const viewportHeight = container.clientHeight;\n const startZoom = zoomRef.current;\n const endZoom = Math.min(maxZoom, Math.max(minZoom, targetZoom));\n const startPanX = panRef.current.x;\n const startPanY = panRef.current.y;\n // Final pan that centers the world point at the target zoom.\n const endPanX = viewportWidth / 2 - worldX * endZoom;\n const endPanY = viewportHeight / 2 - worldY * endZoom;\n const startTime = performance.now();\n\n const animate = (currentTime: number) => {\n const elapsed = currentTime - startTime;\n const progress = Math.min(elapsed / durationMs, 1);\n const eased = easeInOutCubic(progress);\n zoomRef.current = startZoom + (endZoom - startZoom) * eased;\n panRef.current = {\n x: startPanX + (endPanX - startPanX) * eased,\n y: startPanY + (endPanY - startPanY) * eased,\n };\n applyWorldTransform();\n refreshMinimap();\n render();\n if (progress < 1) {\n animationFrameRef.current = requestAnimationFrame(animate);\n } else {\n animationFrameRef.current = null;\n }\n };\n\n animationFrameRef.current = requestAnimationFrame(animate);\n },\n [maxZoom, minZoom, applyWorldTransform, refreshMinimap, render],\n );\n\n const getContainerRect = useCallback((): DOMRect | null => {\n return containerRef.current?.getBoundingClientRect() ?? null;\n }, []);\n\n // Measured, not estimated: the registry holds what each CanvasItem's ResizeObserver last reported, so a\n // fit-to-content computed from it includes everything an item really renders (specifications under the\n // rows included), unlike the size estimates the minimap falls back to before anything has mounted.\n const getItemBounds = useCallback(\n (): MinimapItem[] =>\n Array.from(itemRegistryRef.current.values(), (entry) => ({\n x: entry.x,\n y: entry.y,\n width: entry.width,\n height: entry.height,\n })),\n [],\n );\n\n // Expose imperative handle once the canvas is set up\n useEffect(() => {\n if (!pixiReady) return;\n onHandleReadyRef.current?.({\n smoothPanToWorld,\n smoothPanZoomToWorld,\n getContainerRect,\n getItemBounds,\n });\n }, [\n pixiReady,\n smoothPanToWorld,\n smoothPanZoomToWorld,\n getContainerRect,\n getItemBounds,\n ]);\n\n return (\n <div\n ref={containerRef}\n className={`canvas-surface cratis:relative cratis:overflow-hidden${className ? ` ${className}` : ''}`}\n style={{ cursor: 'default', ...style }}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerUp}\n >\n {/* HTML overlay — mirrors the PIXI world transform so CanvasItem children\n are positioned in world-space coordinates. Updated via direct DOM style\n mutation during pan/zoom to avoid React re-renders.\n The CanvasItemRegistryContext allows CanvasItem children to report their\n positions and sizes for automatic minimap item generation. */}\n <CanvasItemRegistryContext.Provider value={registryContextValue}>\n {/* Pan (this div's transform) and zoom (the inner div's `zoom`) are\n rewritten every interaction frame. Marking both as glass transform\n hosts tells the capture pipeline to treat that churn as movement,\n not content change: it stops re-rasterizing the page on every frame\n and instead refreshes once the gesture settles. */}\n <div\n ref={overlayRef}\n {...(captureAttributes?.transformHost\n ? { [captureAttributes.transformHost]: 'true' }\n : {})}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n transformOrigin: '0 0',\n transform: `translate(${initialTransformRef.current.pan.x}px, ${initialTransformRef.current.pan.y}px)`,\n pointerEvents: 'none',\n }}\n >\n <div\n ref={zoomLayerRef}\n {...(captureAttributes?.transformHost\n ? { [captureAttributes.transformHost]: 'true' }\n : {})}\n // The read-only overlay below keeps pointers off the board; `inert` keeps the keyboard\n // and assistive tech off it too, so nothing on a read-only board can be tabbed to and\n // activated (a public viewer must never be able to fire a command).\n inert={readOnly}\n style={\n shouldUseCssZoom(\n initialTransformRef.current.zoom,\n false,\n isMultiTouchCapableDevice,\n )\n ? { zoom: initialTransformRef.current.zoom }\n : {\n transform: `scale(${initialTransformRef.current.zoom})`,\n transformOrigin: '0 0',\n }\n }\n >\n {children}\n </div>\n </div>\n </CanvasItemRegistryContext.Provider>\n {readOnly && (\n // Sits above every board item (default stacking order beats the content layer's implicit\n // z-index) but below the controls/minimap, which render after it. Nothing underneath can\n // ever become a pointer event's target, so no CanvasItem consumer needs its own read-only\n // handling — this is the entire read-only guarantee.\n <div\n style={{ position: 'absolute', inset: 0, zIndex: 2, cursor: 'grab' }}\n />\n )}\n {showControls && (\n <CanvasControls\n getZoom={() => zoomRef.current}\n onZoomIn={handleZoomIn}\n onZoomOut={handleZoomOut}\n onZoomReset={handleZoomReset}\n showMinimapToggle={showMinimap}\n minimapRef={minimapRef}\n minimapWorldWidth={minimapWorldWidth}\n minimapWorldHeight={minimapWorldHeight}\n minimapItems={effectiveMinimapItems}\n onMinimapPan={handleMinimapPan}\n placement={controlsPlacement}\n onHelp={onHelp}\n helpTitle={helpTitle}\n labels={controlsLabels}\n icons={controlsIcons}\n followViewportInsets={controlsFollowViewportInsets}\n glassSurface={controlsGlassSurface}\n contentCaptureAttribute={captureAttributes?.content}\n disableGlass={disableControlsGlass}\n />\n )}\n </div>\n );\n}\n\nexport { Canvas };\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;AAwCA,SAAS,cAAc,CAAC,QAAgB,EAAA;IACpC,OAAO,QAAQ,GAAG;AACd,UAAE,CAAC,GAAG,QAAQ,GAAG,QAAQ,GAAG;AAC5B,UAAE,CAAC,GAAG,CAAC,EAAE,GAAG,QAAQ,GA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EAAE,MAAM,EAAE,MAAM,EAAE,EAAA,CACtE,CACL,EACA,YAAY,KACTA,GAAA,CAAC,cAAc,EAAA,EACX,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,EAC9B,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,EACxB,WAAW,EAAE,eAAe,EAC5B,iBAAiB,EAAE,WAAW,EAC9B,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,qBAAqB,EACnC,YAAY,EAAE,gBAAgB,EAC9B,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,aAAa,EACpB,oBAAoB,EAAE,4BAA4B,EAClD,YAAY,EAAE,oBAAoB,EAClC,uBAAuB,EAAE,iBAAiB,EAAE,OAAO,EACnD,YAAY,EAAE,oBAAoB,EAAA,CACpC,CACL,CAAA,EAAA,CACC;AAEd;;"}
1
+ {"version":3,"file":"Canvas.js","sources":["../../../Canvas/Canvas.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React, { useRef } from 'react';\nimport type * as PIXI from 'pixi.js';\nimport {\n CanvasControls,\n type CanvasControlsIcons,\n type CanvasControlsLabels,\n} from './CanvasControls';\nimport type { CanvasCaptureAttributes } from './CanvasCaptureAttributes';\nimport type { CanvasContext } from './CanvasContext';\nimport type { CanvasHandle } from './CanvasHandle';\nimport type { CanvasItemData } from './CanvasItemData';\nimport { CanvasItemRegistryContext } from './CanvasItemRegistryContext';\nimport type { CanvasMinimapHandle, MinimapItem } from './CanvasMinimap';\nimport type { PointerPosition } from './pinchGesture';\nimport { useCanvasCamera } from './useCanvasCamera';\nimport { useCanvasItemRegistry } from './useCanvasItemRegistry';\nimport { useCanvasNavigation } from './useCanvasNavigation';\nimport { useCanvasPointerGestures } from './useCanvasPointerGestures';\nimport { useCanvasWheelZoom } from './useCanvasWheelZoom';\nimport { useDragSelectionGuard } from './useDragSelectionGuard';\nimport { useLatestRef } from './useLatestRef';\nimport { usePixiApplication } from './usePixiApplication';\nimport { usePixiItems } from './usePixiItems';\nimport { isMultiTouchCapableDevice, shouldUseCssZoom } from './zoomMechanism';\n\nexport type { CanvasCaptureAttributes } from './CanvasCaptureAttributes';\nexport type { CanvasContext } from './CanvasContext';\nexport type { CanvasHandle } from './CanvasHandle';\nexport type { CanvasItemData } from './CanvasItemData';\nexport { CanvasItemRegistryContext } from './CanvasItemRegistryContext';\nexport type { CanvasItemRegistryContextValue } from './CanvasItemRegistryContextValue';\nexport type { CanvasItemRegistryEntry } from './CanvasItemRegistryEntry';\n\n/** Props for the pan, zoom, item, minimap, and control surface. */\nexport interface CanvasProps<T extends CanvasItemData = CanvasItemData> {\n /** DOM content positioned inside the transformed world. */\n children?: React.ReactNode;\n /** Optional Pixi-rendered item data. */\n items?: T[];\n /** Builds a Pixi display object for one item. */\n renderItem?: (item: T) => PIXI.Container;\n /** Receives pointer activation for a Pixi-rendered item. */\n onItemPointerDown?: (item: T, event: PIXI.FederatedPointerEvent) => void;\n /** Receives the initialized Pixi application and world. */\n onReady?: (context: CanvasContext) => void;\n /** Reports every camera transform change. */\n onTransformChange?: (zoom: number, pan: { x: number; y: number }) => void;\n /** Initial zoom factor. Defaults to `1`. */\n initialZoom?: number;\n /** Initial viewport translation. Defaults to `{ x: 0, y: 0 }`. */\n initialPan?: { x: number; y: number };\n /** Minimum zoom factor. Defaults to `0.1`. */\n minZoom?: number;\n /** Maximum zoom factor. Defaults to `5`. */\n maxZoom?: number;\n /** Whether integrated zoom controls render. Defaults to `true`. */\n showControls?: boolean;\n /** Whether controls expose the minimap toggle. Defaults to `false`. */\n showMinimap?: boolean;\n /** World width represented by the minimap. */\n minimapWorldWidth?: number;\n /** World height represented by the minimap. */\n minimapWorldHeight?: number;\n /** Explicit minimap item rectangles; measured CanvasItem bounds are used otherwise. */\n minimapItems?: MinimapItem[];\n /** Edge used by the integrated control bar. Defaults to `'bottom-left'`. */\n controlsPlacement?: 'bottom-left' | 'bottom-right';\n /** Extra class name for the Canvas root. */\n className?: string;\n /** Inline style for the Canvas root. */\n style?: React.CSSProperties;\n /** Invoked when the optional help action is activated. */\n onHelp?: () => void;\n /** Accessible label and tooltip for the help action. */\n helpTitle?: string;\n /** Localized labels for integrated zoom/minimap/help controls. */\n controlsLabels?: CanvasControlsLabels;\n /** Replacement glyphs for integrated zoom/minimap/help controls. Unset fields keep the built-in icons. */\n controlsIcons?: CanvasControlsIcons;\n /**\n * Whether the integrated controls step aside by the host's `--canvas-viewport-left`/`--canvas-viewport-right`\n * inset at their edge. Defaults to `true`; set `false` when the host already moves the canvas by that inset.\n */\n controlsFollowViewportInsets?: boolean;\n /** Optional product-owned glass/acrylic surface behind integrated controls. */\n controlsGlassSurface?: React.ReactNode;\n /** Uses a low-cost CSS frosted pill instead of a consumer-supplied glass surface. */\n disableControlsGlass?: boolean;\n /** Product-owned capture/compositor marker names. Canvas has no capture-provider dependency. */\n captureAttributes?: CanvasCaptureAttributes;\n /** Receives imperative camera and measurement operations. */\n onHandleReady?: (handle: CanvasHandle) => void;\n /** Keeps pan/zoom available while absorbing interaction with canvas content. */\n readOnly?: boolean;\n /**\n * Whether mouse/pen drag on empty background pans the board. Disable when\n * the product owns that gesture for selection; wheel, middle-button, and\n * touch panning remain available.\n */\n backgroundDragPans?: boolean;\n}\n\n/**\n * A pan/zoom/Pixi-backed infinite canvas with optional HTML overlay items, integrated minimap, and\n * zoom controls. Renders Pixi-backed sprites and DOM content under one synchronized camera, manages\n * wheel/touch/trackpad gestures, and exposes imperative camera navigation.\n */\nfunction Canvas<T extends CanvasItemData = CanvasItemData>({\n children,\n items = [] as T[],\n renderItem,\n onItemPointerDown,\n onReady,\n onTransformChange,\n onHandleReady,\n initialZoom = 1,\n initialPan = { x: 0, y: 0 },\n minZoom = 0.1,\n maxZoom = 5,\n showControls = true,\n showMinimap = false,\n minimapWorldWidth,\n minimapWorldHeight,\n minimapItems,\n controlsPlacement = 'bottom-left',\n className,\n style,\n onHelp,\n helpTitle,\n controlsLabels,\n controlsIcons,\n controlsFollowViewportInsets = true,\n controlsGlassSurface,\n disableControlsGlass = false,\n captureAttributes,\n readOnly = false,\n backgroundDragPans = true,\n}: CanvasProps<T>): React.ReactElement {\n const containerRef = useRef<HTMLDivElement>(null);\n useDragSelectionGuard(containerRef);\n const minimapRef = useRef<CanvasMinimapHandle | null>(null);\n const overlayRef = useRef<HTMLDivElement>(null);\n const zoomLayerRef = useRef<HTMLDivElement>(null);\n // Shared by touch momentum and the animated camera moves, so only one of them ever drives the\n // transform at once; each cancels whichever was still running.\n const animationFrameRef = useRef<number | null>(null);\n\n // Mutable refs so event callbacks always read current values without re-binding\n const panRef = useRef({ x: initialPan.x, y: initialPan.y });\n const zoomRef = useRef(initialZoom);\n\n // The transform styles rendered by JSX are frozen at their first-mount values: after mount the\n // overlay/zoom-layer styles are owned exclusively by the imperative per-frame writes. If the JSX\n // re-rendered them from live props (a parent may persist and echo the transform back through\n // `initialPan`/`initialZoom`), a React commit racing a gesture would rewrite the styles with\n // stale values — visible as the viewport flicking to an old position and back.\n const initialTransformRef = useRef({ pan: initialPan, zoom: initialZoom });\n\n // Touch pointers currently down on the canvas, in the order they landed. Touch is the only input\n // that can deliver several simultaneous pointers, so mouse/pen never enter this map.\n const touchPointersRef = useRef<Map<number, PointerPosition>>(new Map());\n\n // Keep callback refs current to avoid stale closures in PIXI event handlers\n const onReadyRef = useLatestRef(onReady);\n const onItemPointerDownRef = useLatestRef(onItemPointerDown);\n const onTransformChangeRef = useLatestRef(onTransformChange);\n const onHandleReadyRef = useLatestRef(onHandleReady);\n\n const { itemRegistryRef, registryContextValue, autoMinimapItems } =\n useCanvasItemRegistry();\n const effectiveMinimapItems = minimapItems ?? autoMinimapItems;\n\n const { appRef, worldRef, spritesRef, pixiReady, render } = usePixiApplication({\n containerRef,\n panRef,\n zoomRef,\n onReadyRef,\n captureLayer: captureAttributes?.layer,\n });\n\n const {\n applyWorldTransform,\n refreshMinimap,\n scheduleTransformApply,\n noteGestureActivity,\n zoomTowards,\n } = useCanvasCamera({\n appRef,\n worldRef,\n minimapRef,\n overlayRef,\n zoomLayerRef,\n panRef,\n zoomRef,\n onTransformChangeRef,\n render,\n minZoom,\n maxZoom,\n });\n\n useCanvasWheelZoom({\n containerRef,\n animationFrameRef,\n panRef,\n touchPointersRef,\n zoomTowards,\n noteGestureActivity,\n scheduleTransformApply,\n });\n\n const { handlePointerDown, handlePointerMove, handlePointerUp } =\n useCanvasPointerGestures({\n containerRef,\n animationFrameRef,\n panRef,\n zoomRef,\n touchPointersRef,\n minZoom,\n maxZoom,\n readOnly,\n backgroundDragPans,\n applyWorldTransform,\n refreshMinimap,\n render,\n noteGestureActivity,\n scheduleTransformApply,\n });\n\n usePixiItems({\n pixiReady,\n appRef,\n worldRef,\n spritesRef,\n items,\n renderItem,\n onItemPointerDownRef,\n });\n\n const { handleZoomIn, handleZoomOut, handleZoomReset, handleMinimapPan } =\n useCanvasNavigation({\n containerRef,\n animationFrameRef,\n panRef,\n zoomRef,\n itemRegistryRef,\n minZoom,\n maxZoom,\n pixiReady,\n onHandleReadyRef,\n applyWorldTransform,\n refreshMinimap,\n render,\n });\n\n return (\n <div\n ref={containerRef}\n className={`canvas-surface cratis:relative cratis:overflow-hidden${className ? ` ${className}` : ''}`}\n style={{ cursor: 'default', ...style }}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerUp}\n >\n {/* HTML overlay — mirrors the PIXI world transform so CanvasItem children\n are positioned in world-space coordinates. Updated via direct DOM style\n mutation during pan/zoom to avoid React re-renders.\n The CanvasItemRegistryContext allows CanvasItem children to report their\n positions and sizes for automatic minimap item generation. */}\n <CanvasItemRegistryContext.Provider value={registryContextValue}>\n {/* Pan (this div's transform) and zoom (the inner div's `zoom`) are\n rewritten every interaction frame. Marking both as glass transform\n hosts tells the capture pipeline to treat that churn as movement,\n not content change: it stops re-rasterizing the page on every frame\n and instead refreshes once the gesture settles. */}\n <div\n ref={overlayRef}\n {...(captureAttributes?.transformHost\n ? { [captureAttributes.transformHost]: 'true' }\n : {})}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n transformOrigin: '0 0',\n transform: `translate(${initialTransformRef.current.pan.x}px, ${initialTransformRef.current.pan.y}px)`,\n pointerEvents: 'none',\n }}\n >\n <div\n ref={zoomLayerRef}\n {...(captureAttributes?.transformHost\n ? { [captureAttributes.transformHost]: 'true' }\n : {})}\n // The read-only overlay below keeps pointers off the board; `inert` keeps the keyboard\n // and assistive tech off it too, so nothing on a read-only board can be tabbed to and\n // activated (a public viewer must never be able to fire a command).\n inert={readOnly}\n style={\n shouldUseCssZoom(\n initialTransformRef.current.zoom,\n false,\n isMultiTouchCapableDevice,\n )\n ? { zoom: initialTransformRef.current.zoom }\n : {\n transform: `scale(${initialTransformRef.current.zoom})`,\n transformOrigin: '0 0',\n }\n }\n >\n {children}\n </div>\n </div>\n </CanvasItemRegistryContext.Provider>\n {readOnly && (\n // Sits above every board item (default stacking order beats the content layer's implicit\n // z-index) but below the controls/minimap, which render after it. Nothing underneath can\n // ever become a pointer event's target, so no CanvasItem consumer needs its own read-only\n // handling — this is the entire read-only guarantee.\n <div\n style={{ position: 'absolute', inset: 0, zIndex: 2, cursor: 'grab' }}\n />\n )}\n {showControls && (\n <CanvasControls\n getZoom={() => zoomRef.current}\n onZoomIn={handleZoomIn}\n onZoomOut={handleZoomOut}\n onZoomReset={handleZoomReset}\n showMinimapToggle={showMinimap}\n minimapRef={minimapRef}\n minimapWorldWidth={minimapWorldWidth}\n minimapWorldHeight={minimapWorldHeight}\n minimapItems={effectiveMinimapItems}\n onMinimapPan={handleMinimapPan}\n placement={controlsPlacement}\n onHelp={onHelp}\n helpTitle={helpTitle}\n labels={controlsLabels}\n icons={controlsIcons}\n followViewportInsets={controlsFollowViewportInsets}\n glassSurface={controlsGlassSurface}\n contentCaptureAttribute={captureAttributes?.content}\n disableGlass={disableControlsGlass}\n />\n )}\n </div>\n );\n}\n\nexport { Canvas };\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;AA8GA,SAAS,MAAM,CAA4C,EACvD,QAAQ,EACR,KAAK,GAAG,EAAS,EACjB,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,iBAAiB,EACjB,aAAa,EACb,WAAW,GAAG,CAAC,EACf,UAAU,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAC3B,OAAO,GAAG,GAAG,EACb,OAAO,GAAG,CAAC,EACX,YAAY,GAAG,IAAI,EACnB,WAAW,GAAG,KAAK,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,GAAG,aAAa,EACjC,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,EACT,cAAc,EACd,aAAa,EACb,4BAA4B,GAAG,IAAI,EACnC,oBAAoB,EACpB,oBAAoB,GAAG,KAAK,EAC5B,iBAAiB,EACjB,QAAQ,GAAG,KAAK,EAChB,kBAAkB,GAAG,IAAI,GACZ,EAAA;AACb,IAAA,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC;IACjD,qBAAqB,CAAC,YAAY,CAAC;AACnC,IAAA,MAAM,UAAU,GAAG,MAAM,CAA6B,IAAI,CAAC;AAC3D,IAAA,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC;AAC/C,IAAA,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC;AAGjD,IAAA,MAAM,iBAAiB,GAAG,MAAM,CAAgB,IAAI,CAAC;AAGrD,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;AAC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AU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,qBAAqB,EACnC,YAAY,EAAE,gBAAgB,EAC9B,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,aAAa,EACpB,oBAAoB,EAAE,4BAA4B,EAClD,YAAY,EAAE,oBAAoB,EAClC,uBAAuB,EAAE,iBAAiB,EAAE,OAAO,EACnD,YAAY,EAAE,oBAAoB,EAAA,CACpC,CACL,CAAA,EAAA,CACC;AAEd;;"}
@@ -0,0 +1,10 @@
1
+ /** Optional product compositor/capture marker names applied by {@link Canvas}. */
2
+ export interface CanvasCaptureAttributes {
3
+ /** Attribute placed on the Pixi canvas so a product capture pipeline can exclude it. */
4
+ layer?: string;
5
+ /** Attribute placed on non-plain integrated controls that own composited content. */
6
+ content?: string;
7
+ /** Attribute placed on pan/zoom transform hosts whose churn moves existing layers. */
8
+ transformHost?: string;
9
+ }
10
+ //# sourceMappingURL=CanvasCaptureAttributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasCaptureAttributes.d.ts","sourceRoot":"","sources":["../../../Canvas/CanvasCaptureAttributes.ts"],"names":[],"mappings":"AAGA,kFAAkF;AAClF,MAAM,WAAW,uBAAuB;IACpC,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=CanvasCaptureAttributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasCaptureAttributes.js","sourceRoot":"","sources":["../../../Canvas/CanvasCaptureAttributes.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** Optional product compositor/capture marker names applied by {@link Canvas}. */\nexport interface CanvasCaptureAttributes {\n /** Attribute placed on the Pixi canvas so a product capture pipeline can exclude it. */\n layer?: string;\n /** Attribute placed on non-plain integrated controls that own composited content. */\n content?: string;\n /** Attribute placed on pan/zoom transform hosts whose churn moves existing layers. */\n transformHost?: string;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type * as PIXI from 'pixi.js';
2
+ /** Pixi objects supplied after the Canvas renderer initializes. */
3
+ export interface CanvasContext {
4
+ /** Pixi application owned by the Canvas. */
5
+ app: PIXI.Application;
6
+ /** Pixi world container receiving rendered items. */
7
+ world: PIXI.Container;
8
+ }
9
+ //# sourceMappingURL=CanvasContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasContext.d.ts","sourceRoot":"","sources":["../../../Canvas/CanvasContext.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,IAAI,MAAM,SAAS,CAAC;AAErC,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC1B,4CAA4C;IAC5C,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC;IACtB,qDAAqD;IACrD,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC;CACzB"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=CanvasContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasContext.js","sourceRoot":"","sources":["../../../Canvas/CanvasContext.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type * as PIXI from 'pixi.js';\n\n/** Pixi objects supplied after the Canvas renderer initializes. */\nexport interface CanvasContext {\n /** Pixi application owned by the Canvas. */\n app: PIXI.Application;\n /** Pixi world container receiving rendered items. */\n world: PIXI.Container;\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { MinimapItem } from './CanvasMinimap.js';
2
+ /** Imperative camera and measurement operations exposed by {@link Canvas}. */
3
+ export interface CanvasHandle {
4
+ /** Smoothly centers a world point. */
5
+ smoothPanToWorld(worldX: number, worldY: number, durationMs?: number): void;
6
+ /** Smoothly centers a world point while animating to a target zoom. */
7
+ smoothPanZoomToWorld(worldX: number, worldY: number, targetZoom?: number, durationMs?: number): void;
8
+ /** Returns the current viewport rectangle, or `null` before mounting. */
9
+ getContainerRect(): DOMRect | null;
10
+ /** Returns world-space bounds for every registered CanvasItem. */
11
+ getItemBounds(): MinimapItem[];
12
+ }
13
+ //# sourceMappingURL=CanvasHandle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasHandle.d.ts","sourceRoot":"","sources":["../../../Canvas/CanvasHandle.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAiB,CAAC;AAEnD,8EAA8E;AAC9E,MAAM,WAAW,YAAY;IACzB,sCAAsC;IACtC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5E,uEAAuE;IACvE,oBAAoB,CAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GACpB,IAAI,CAAC;IACR,yEAAyE;IACzE,gBAAgB,IAAI,OAAO,GAAG,IAAI,CAAC;IACnC,kEAAkE;IAClE,aAAa,IAAI,WAAW,EAAE,CAAC;CAClC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=CanvasHandle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasHandle.js","sourceRoot":"","sources":["../../../Canvas/CanvasHandle.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { MinimapItem } from './CanvasMinimap';\n\n/** Imperative camera and measurement operations exposed by {@link Canvas}. */\nexport interface CanvasHandle {\n /** Smoothly centers a world point. */\n smoothPanToWorld(worldX: number, worldY: number, durationMs?: number): void;\n /** Smoothly centers a world point while animating to a target zoom. */\n smoothPanZoomToWorld(\n worldX: number,\n worldY: number,\n targetZoom?: number,\n durationMs?: number,\n ): void;\n /** Returns the current viewport rectangle, or `null` before mounting. */\n getContainerRect(): DOMRect | null;\n /** Returns world-space bounds for every registered CanvasItem. */\n getItemBounds(): MinimapItem[];\n}\n"]}
@@ -1,6 +1,9 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { useRef, useContext, useId, useState, useEffect } from 'react';
3
- import { CanvasItemRegistryContext } from './Canvas.js';
3
+ import './CanvasMinimap.js';
4
+ import 'react-icons/fa6';
5
+ import { CanvasItemRegistryContext } from './CanvasItemRegistryContext.js';
6
+ import 'pixi.js';
4
7
 
5
8
  const CanvasItem = ({ id, x, y, zIndex, onSize, children, }) => {
6
9
  const elementRef = useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"CanvasItem.js","sources":["../../../Canvas/CanvasItem.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type React from 'react';\nimport { useContext, useEffect, useId, useRef, useState } from 'react';\nimport { CanvasItemRegistryContext } from './Canvas';\n\n/** Props for a measured DOM item positioned in Canvas world space. */\nexport interface CanvasItemProps {\n /**\n * Registers this item in the Canvas item registry under a caller-chosen key instead of an\n * internally generated one. Opting in makes the item's world-space bounds addressable — a\n * `Region` on the same board can then recognize the item and report region membership for it\n * over the Arc messenger, keyed by exactly this id. Omit for the same behavior as before the\n * prop existed: the item still feeds the minimap and fit-to-content, but is anonymous to\n * everything that matches items by id.\n */\n id?: string;\n\n /** World-space horizontal position. */\n x: number;\n /** World-space vertical position. */\n y: number;\n\n /**\n * Where this item stacks against its sibling canvas items. `CanvasItem` renders with a\n * `transform`, which establishes its own stacking context — a z-index set on something nested\n * inside one item can never win against a *different* item, only against its own siblings, so\n * elevating one item above another has to happen here, on the item root itself. Omit for the\n * default stacking order (DOM order, same as every other item).\n */\n zIndex?: number;\n\n /** Reports measured size changes. */\n onSize?: (width: number, height: number) => void;\n /** Item content. */\n children: React.ReactNode;\n}\n\n/**\n * A measured DOM element positioned in Canvas world space, registered so the Canvas minimap can\n * show it. Observes size changes and reports bounds to the nearest Canvas registry.\n */\nexport const CanvasItem: React.FC<CanvasItemProps> = ({\n id,\n x,\n y,\n zIndex,\n onSize,\n children,\n}) => {\n const elementRef = useRef<HTMLDivElement>(null);\n const onSizeRef = useRef(onSize);\n const registryContext = useContext(CanvasItemRegistryContext);\n // The registry key: the caller's id when given, otherwise a generated one — useId is called\n // unconditionally (rules of hooks), the generated value simply goes unused when overridden.\n // Should `id` change between renders, the effects below unregister the old key and register\n // the new one, so the registry never holds both.\n const generatedId = useId();\n const itemId = id ?? generatedId;\n const [size, setSize] = useState<{ width: number; height: number } | null>(null);\n\n onSizeRef.current = onSize;\n\n useEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const { width, height } = entry.contentRect;\n onSizeRef.current?.(width, height);\n setSize({ width, height });\n }\n });\n observer.observe(element);\n\n // Fire initial measurement\n const { width, height } = element.getBoundingClientRect();\n onSizeRef.current?.(width, height);\n setSize({ width, height });\n\n return () => observer.disconnect();\n }, [itemId]);\n\n // Register with the Canvas registry whenever position or size changes. `anonymous` records\n // whether the caller ever supplied an `id` at all — not just what key ended up in the registry —\n // so a `Region` reading this entry back can tell a generated key from a real one and keep\n // anonymous items out of region-membership reports while still feeding the minimap/fit-to-content.\n useEffect(() => {\n if (!size || !registryContext) return;\n registryContext.register(itemId, {\n x,\n y,\n width: size.width,\n height: size.height,\n anonymous: id === undefined,\n });\n }, [x, y, size, registryContext, itemId, id]);\n\n // Unregister when unmounting\n useEffect(() => {\n return () => {\n registryContext?.unregister(itemId);\n };\n }, [registryContext, itemId]);\n\n return (\n <div\n ref={elementRef}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translate(${x}px, ${y}px)`,\n pointerEvents: 'auto',\n zIndex,\n }}\n >\n {children}\n </div>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;AA2CO,MAAM,UAAU,GAA8B,CAAC,EAClD,EAAE,EACF,CAAC,EACD,CAAC,EACD,MAAM,EACN,MAAM,EACN,QAAQ,GACX,KAAI;AACD,IAAA,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC;AAC/C,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;AAChC,IAAA,MAAM,eAAe,GAAG,UAAU,CAAC,yBAAyB,CAAC;AAK7D,IAAA,MAAM,WAAW,GAAG,KAAK,EAAE;AAC3B,IAAA,MAAM,MAAM,GAAG,EAAE,IAAI,WAAW;IAChC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAA2C,IAAI,CAAC;AAEhF,IAAA,SAAS,CAAC,OAAO,GAAG,MAAM;IAE1B,SAAS,CAAC,MAAK;AACX,QAAA,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO;AAClC,QAAA,IAAI,CAAC,OAAO;YAAE;QAEd,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,CAAC,OAAO,KAAI;AAC5C,YAAA,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;gBACzB,MAAM,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AE,CAAC;AACN,YAAA,IAAI,EAAE,CAAC;AACP,YAAA,SAAS,EAAE,CAAA,UAAA,EAAa,CAAC,CAAA,IAAA,EAAO,CAAC,CAAA,GAAA,CAAK;AACtC,YAAA,aAAa,EAAE,MAAM;YACrB,MAAM;SACT,EAAA,QAAA,EAEA,QAAQ,EAAA,CACP;AAEd;;"}
1
+ {"version":3,"file":"CanvasItem.js","sources":["../../../Canvas/CanvasItem.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type React from 'react';\nimport { useContext, useEffect, useId, useRef, useState } from 'react';\nimport { CanvasItemRegistryContext } from './Canvas';\n\n/** Props for a measured DOM item positioned in Canvas world space. */\nexport interface CanvasItemProps {\n /**\n * Registers this item in the Canvas item registry under a caller-chosen key instead of an\n * internally generated one. Opting in makes the item's world-space bounds addressable — a\n * `Region` on the same board can then recognize the item and report region membership for it\n * over the Arc messenger, keyed by exactly this id. Omit for the same behavior as before the\n * prop existed: the item still feeds the minimap and fit-to-content, but is anonymous to\n * everything that matches items by id.\n */\n id?: string;\n\n /** World-space horizontal position. */\n x: number;\n /** World-space vertical position. */\n y: number;\n\n /**\n * Where this item stacks against its sibling canvas items. `CanvasItem` renders with a\n * `transform`, which establishes its own stacking context — a z-index set on something nested\n * inside one item can never win against a *different* item, only against its own siblings, so\n * elevating one item above another has to happen here, on the item root itself. Omit for the\n * default stacking order (DOM order, same as every other item).\n */\n zIndex?: number;\n\n /** Reports measured size changes. */\n onSize?: (width: number, height: number) => void;\n /** Item content. */\n children: React.ReactNode;\n}\n\n/**\n * A measured DOM element positioned in Canvas world space, registered so the Canvas minimap can\n * show it. Observes size changes and reports bounds to the nearest Canvas registry.\n */\nexport const CanvasItem: React.FC<CanvasItemProps> = ({\n id,\n x,\n y,\n zIndex,\n onSize,\n children,\n}) => {\n const elementRef = useRef<HTMLDivElement>(null);\n const onSizeRef = useRef(onSize);\n const registryContext = useContext(CanvasItemRegistryContext);\n // The registry key: the caller's id when given, otherwise a generated one — useId is called\n // unconditionally (rules of hooks), the generated value simply goes unused when overridden.\n // Should `id` change between renders, the effects below unregister the old key and register\n // the new one, so the registry never holds both.\n const generatedId = useId();\n const itemId = id ?? generatedId;\n const [size, setSize] = useState<{ width: number; height: number } | null>(null);\n\n onSizeRef.current = onSize;\n\n useEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const { width, height } = entry.contentRect;\n onSizeRef.current?.(width, height);\n setSize({ width, height });\n }\n });\n observer.observe(element);\n\n // Fire initial measurement\n const { width, height } = element.getBoundingClientRect();\n onSizeRef.current?.(width, height);\n setSize({ width, height });\n\n return () => observer.disconnect();\n }, [itemId]);\n\n // Register with the Canvas registry whenever position or size changes. `anonymous` records\n // whether the caller ever supplied an `id` at all — not just what key ended up in the registry —\n // so a `Region` reading this entry back can tell a generated key from a real one and keep\n // anonymous items out of region-membership reports while still feeding the minimap/fit-to-content.\n useEffect(() => {\n if (!size || !registryContext) return;\n registryContext.register(itemId, {\n x,\n y,\n width: size.width,\n height: size.height,\n anonymous: id === undefined,\n });\n }, [x, y, size, registryContext, itemId, id]);\n\n // Unregister when unmounting\n useEffect(() => {\n return () => {\n registryContext?.unregister(itemId);\n };\n }, [registryContext, itemId]);\n\n return (\n <div\n ref={elementRef}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translate(${x}px, ${y}px)`,\n pointerEvents: 'auto',\n zIndex,\n }}\n >\n {children}\n </div>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;;AA2CO,MAAM,UAAU,GAA8B,CAAC,EAClD,EAAE,EACF,CAAC,EACD,CAAC,EACD,MAAM,EACN,MAAM,EACN,QAAQ,GACX,KAAI;AACD,IAAA,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC;AAC/C,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;AAChC,IAAA,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,IAAI,CAAC,MAAM;YACnB,SAAS,EAAE,EAAE,KAAK,SAAS;AAC9B,SAAA,CAAC;AACN,IAAA,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IAG7C,SAAS,CAAC,MAAK;AACX,QAAA,OAAO,MAAK;AACR,YAAA,eAAe,EAAE,UAAU,CAAC,MAAM,CAAC;AACvC,QAAA,CAAC;AACL,IAAA,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAE7B,IAAA,QACIA,GAAA,CAAA,KAAA,EAAA,EACI,GAAG,EAAE,UAAU,EACf,KAAK,EAAE;AACH,YAAA,QAAQ,EAAE,UAAU;AACpB,YAAA,GAAG,EAAE,CAAC;AACN,YAAA,IAAI,EAAE,CAAC;AACP,YAAA,SAAS,EAAE,CAAA,UAAA,EAAa,CAAC,CAAA,IAAA,EAAO,CAAC,CAAA,GAAA,CAAK;AACtC,YAAA,aAAa,EAAE,MAAM;YACrB,MAAM;SACT,EAAA,QAAA,EAEA,QAAQ,EAAA,CACP;AAEd;;"}
@@ -0,0 +1,10 @@
1
+ /** Minimum data shape for an optional Pixi-rendered canvas item. */
2
+ export interface CanvasItemData {
3
+ /** Stable item identity. */
4
+ id: string;
5
+ /** World-space horizontal position. */
6
+ x: number;
7
+ /** World-space vertical position. */
8
+ y: number;
9
+ }
10
+ //# sourceMappingURL=CanvasItemData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasItemData.d.ts","sourceRoot":"","sources":["../../../Canvas/CanvasItemData.ts"],"names":[],"mappings":"AAGA,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC3B,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,CAAC,EAAE,MAAM,CAAC;IACV,qCAAqC;IACrC,CAAC,EAAE,MAAM,CAAC;CACb"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=CanvasItemData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasItemData.js","sourceRoot":"","sources":["../../../Canvas/CanvasItemData.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** Minimum data shape for an optional Pixi-rendered canvas item. */\nexport interface CanvasItemData {\n /** Stable item identity. */\n id: string;\n /** World-space horizontal position. */\n x: number;\n /** World-space vertical position. */\n y: number;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { CanvasItemRegistryContextValue } from './CanvasItemRegistryContextValue.js';
3
+ /** Context carrying the nearest Canvas item registry. */
4
+ export declare const CanvasItemRegistryContext: React.Context<CanvasItemRegistryContextValue | null>;
5
+ //# sourceMappingURL=CanvasItemRegistryContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasItemRegistryContext.d.ts","sourceRoot":"","sources":["../../../Canvas/CanvasItemRegistryContext.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAkC,CAAC;AAEvF,yDAAyD;AACzD,eAAO,MAAM,yBAAyB,sDAC8B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+
3
+ const CanvasItemRegistryContext = React.createContext(null);
4
+
5
+ export { CanvasItemRegistryContext };
6
+ //# sourceMappingURL=CanvasItemRegistryContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasItemRegistryContext.js","sources":["../../../Canvas/CanvasItemRegistryContext.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React from 'react';\nimport type { CanvasItemRegistryContextValue } from './CanvasItemRegistryContextValue';\n\n/** Context carrying the nearest Canvas item registry. */\nexport const CanvasItemRegistryContext =\n React.createContext<CanvasItemRegistryContextValue | null>(null);\n"],"names":[],"mappings":";;AAOO,MAAM,yBAAyB,GAClC,KAAK,CAAC,aAAa,CAAwC,IAAI;;"}
@@ -0,0 +1,26 @@
1
+ import type { CanvasItemRegistryEntry } from './CanvasItemRegistryEntry.js';
2
+ /** Registry contract used by {@link CanvasItem} to publish measured bounds. */
3
+ export interface CanvasItemRegistryContextValue {
4
+ /** Adds or updates one measured item. */
5
+ register: (id: string, entry: CanvasItemRegistryEntry) => void;
6
+ /** Removes one measured item. */
7
+ unregister: (id: string) => void;
8
+ /**
9
+ * The registry's current content, as a stable-reference snapshot: the returned map's identity only
10
+ * changes when the content actually changed (an item registered, unregistered, or moved/resized),
11
+ * making it safe to feed straight into `useSyncExternalStore`. The map is rebuilt on change — never
12
+ * mutated in place — so a held snapshot stays internally consistent. Optional so a consumer
13
+ * providing its own registry value predating this member keeps type-checking; readers must
14
+ * fall back gracefully when absent.
15
+ */
16
+ getSnapshot?: () => ReadonlyMap<string, CanvasItemRegistryEntry>;
17
+ /**
18
+ * Subscribes to registry changes; the listener fires after every register/unregister/bounds-update
19
+ * that actually changed content. Bounds updates can arrive per-frame during a drag — listeners
20
+ * decide how much work to do per notification. Returns the unsubscribe function.
21
+ * `useSyncExternalStore`-compatible. Optional for the same compatibility reason as
22
+ * {@link getSnapshot}.
23
+ */
24
+ subscribe?: (listener: () => void) => () => void;
25
+ }
26
+ //# sourceMappingURL=CanvasItemRegistryContextValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasItemRegistryContextValue.d.ts","sourceRoot":"","sources":["../../../Canvas/CanvasItemRegistryContextValue.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA2B,CAAC;AAEzE,+EAA+E;AAC/E,MAAM,WAAW,8BAA8B;IAC3C,yCAAyC;IACzC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC/D,iCAAiC;IACjC,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,WAAW,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IAEjE;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CACpD"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=CanvasItemRegistryContextValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasItemRegistryContextValue.js","sourceRoot":"","sources":["../../../Canvas/CanvasItemRegistryContextValue.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { CanvasItemRegistryEntry } from './CanvasItemRegistryEntry';\n\n/** Registry contract used by {@link CanvasItem} to publish measured bounds. */\nexport interface CanvasItemRegistryContextValue {\n /** Adds or updates one measured item. */\n register: (id: string, entry: CanvasItemRegistryEntry) => void;\n /** Removes one measured item. */\n unregister: (id: string) => void;\n\n /**\n * The registry's current content, as a stable-reference snapshot: the returned map's identity only\n * changes when the content actually changed (an item registered, unregistered, or moved/resized),\n * making it safe to feed straight into `useSyncExternalStore`. The map is rebuilt on change — never\n * mutated in place — so a held snapshot stays internally consistent. Optional so a consumer\n * providing its own registry value predating this member keeps type-checking; readers must\n * fall back gracefully when absent.\n */\n getSnapshot?: () => ReadonlyMap<string, CanvasItemRegistryEntry>;\n\n /**\n * Subscribes to registry changes; the listener fires after every register/unregister/bounds-update\n * that actually changed content. Bounds updates can arrive per-frame during a drag — listeners\n * decide how much work to do per notification. Returns the unsubscribe function.\n * `useSyncExternalStore`-compatible. Optional for the same compatibility reason as\n * {@link getSnapshot}.\n */\n subscribe?: (listener: () => void) => () => void;\n}\n"]}
@@ -0,0 +1,19 @@
1
+ /** Measured world-space bounds for one registered {@link CanvasItem}. */
2
+ export interface CanvasItemRegistryEntry {
3
+ /** World-space horizontal position. */
4
+ x: number;
5
+ /** World-space vertical position. */
6
+ y: number;
7
+ /** Measured width. */
8
+ width: number;
9
+ /** Measured height. */
10
+ height: number;
11
+ /**
12
+ * Whether this entry is registered under an internally generated id rather than one the caller
13
+ * supplied through {@link CanvasItem}'s `id` prop. An anonymous entry still feeds every consumer
14
+ * of the registry — the minimap, fit-to-content — but `Region` (via `itemsWithinRegion`) never
15
+ * reports it as a region member, since there is no caller-owned id a host could recognize it by.
16
+ */
17
+ anonymous?: boolean;
18
+ }
19
+ //# sourceMappingURL=CanvasItemRegistryEntry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasItemRegistryEntry.d.ts","sourceRoot":"","sources":["../../../Canvas/CanvasItemRegistryEntry.ts"],"names":[],"mappings":"AAGA,yEAAyE;AACzE,MAAM,WAAW,uBAAuB;IACpC,uCAAuC;IACvC,CAAC,EAAE,MAAM,CAAC;IACV,qCAAqC;IACrC,CAAC,EAAE,MAAM,CAAC;IACV,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=CanvasItemRegistryEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasItemRegistryEntry.js","sourceRoot":"","sources":["../../../Canvas/CanvasItemRegistryEntry.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** Measured world-space bounds for one registered {@link CanvasItem}. */\nexport interface CanvasItemRegistryEntry {\n /** World-space horizontal position. */\n x: number;\n /** World-space vertical position. */\n y: number;\n /** Measured width. */\n width: number;\n /** Measured height. */\n height: number;\n\n /**\n * Whether this entry is registered under an internally generated id rather than one the caller\n * supplied through {@link CanvasItem}'s `id` prop. An anonymous entry still feeds every consumer\n * of the registry — the minimap, fit-to-content — but `Region` (via `itemsWithinRegion`) never\n * reports it as a region member, since there is no caller-owned id a host could recognize it by.\n */\n anonymous?: boolean;\n}\n"]}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Safari's non-standard trackpad/touch gesture event — absent from the DOM type library, so typed here
3
+ * rather than asserted through `any`. `scale` is cumulative relative to the gesture's start.
4
+ */
5
+ export interface WebKitGestureEvent extends Event {
6
+ /** The gesture's cumulative scale factor since gesturestart. */
7
+ readonly scale: number;
8
+ /** The gesture's horizontal viewport coordinate. */
9
+ readonly clientX: number;
10
+ /** The gesture's vertical viewport coordinate. */
11
+ readonly clientY: number;
12
+ }
13
+ //# sourceMappingURL=WebKitGestureEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebKitGestureEvent.d.ts","sourceRoot":"","sources":["../../../Canvas/WebKitGestureEvent.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,KAAK;IAC7C,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=WebKitGestureEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebKitGestureEvent.js","sourceRoot":"","sources":["../../../Canvas/WebKitGestureEvent.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Safari's non-standard trackpad/touch gesture event — absent from the DOM type library, so typed here\n * rather than asserted through `any`. `scale` is cumulative relative to the gesture's start.\n */\nexport interface WebKitGestureEvent extends Event {\n /** The gesture's cumulative scale factor since gesturestart. */\n readonly scale: number;\n\n /** The gesture's horizontal viewport coordinate. */\n readonly clientX: number;\n\n /** The gesture's vertical viewport coordinate. */\n readonly clientY: number;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The easing curve for programmatic camera moves: a cubic ease-in-out, so the camera picks up speed gently
3
+ * and settles gently instead of starting at full tilt — the difference between a camera move and a yank.
4
+ * @param progress Linear progress through the animation, 0 to 1.
5
+ * @returns The eased progress.
6
+ */
7
+ export declare function easeInOutCubic(progress: number): number;
8
+ //# sourceMappingURL=canvasEasing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvasEasing.d.ts","sourceRoot":"","sources":["../../../Canvas/canvasEasing.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIvD"}
@@ -0,0 +1,8 @@
1
+ function easeInOutCubic(progress) {
2
+ return progress < 0.5
3
+ ? 4 * progress * progress * progress
4
+ : 1 - (-2 * progress + 2) ** 3 / 2;
5
+ }
6
+
7
+ export { easeInOutCubic };
8
+ //# sourceMappingURL=canvasEasing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvasEasing.js","sources":["../../../Canvas/canvasEasing.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The easing curve for programmatic camera moves: a cubic ease-in-out, so the camera picks up speed gently\n * and settles gently instead of starting at full tilt — the difference between a camera move and a yank.\n * @param progress Linear progress through the animation, 0 to 1.\n * @returns The eased progress.\n */\nexport function easeInOutCubic(progress: number): number {\n return progress < 0.5\n ? 4 * progress * progress * progress\n : 1 - (-2 * progress + 2) ** 3 / 2;\n}\n"],"names":[],"mappings":"AASM,SAAU,cAAc,CAAC,QAAgB,EAAA;IAC3C,OAAO,QAAQ,GAAG;AACd,UAAE,CAAC,GAAG,QAAQ,GAAG,QAAQ,GAAG;AAC5B,UAAE,CAAC,GAAG,CAAC,EAAE,GAAG,QAAQ,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;AAC1C;;"}