@cratis/components 4.21.1 → 4.22.1

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 (199) hide show
  1. package/README.md +19 -9
  2. package/compat-manifest.json +16 -16
  3. package/dist/esm/Canvas/Canvas.d.ts +12 -81
  4. package/dist/esm/Canvas/Canvas.d.ts.map +1 -1
  5. package/dist/esm/Canvas/Canvas.js +83 -676
  6. package/dist/esm/Canvas/Canvas.js.map +1 -1
  7. package/dist/esm/Canvas/CanvasCaptureAttributes.d.ts +10 -0
  8. package/dist/esm/Canvas/CanvasCaptureAttributes.d.ts.map +1 -0
  9. package/dist/esm/Canvas/CanvasCaptureAttributes.js +4 -0
  10. package/dist/esm/Canvas/CanvasCaptureAttributes.js.map +1 -0
  11. package/dist/esm/Canvas/CanvasContext.d.ts +9 -0
  12. package/dist/esm/Canvas/CanvasContext.d.ts.map +1 -0
  13. package/dist/esm/Canvas/CanvasContext.js +4 -0
  14. package/dist/esm/Canvas/CanvasContext.js.map +1 -0
  15. package/dist/esm/Canvas/CanvasHandle.d.ts +13 -0
  16. package/dist/esm/Canvas/CanvasHandle.d.ts.map +1 -0
  17. package/dist/esm/Canvas/CanvasHandle.js +4 -0
  18. package/dist/esm/Canvas/CanvasHandle.js.map +1 -0
  19. package/dist/esm/Canvas/CanvasItem.js +4 -1
  20. package/dist/esm/Canvas/CanvasItem.js.map +1 -1
  21. package/dist/esm/Canvas/CanvasItemData.d.ts +10 -0
  22. package/dist/esm/Canvas/CanvasItemData.d.ts.map +1 -0
  23. package/dist/esm/Canvas/CanvasItemData.js +4 -0
  24. package/dist/esm/Canvas/CanvasItemData.js.map +1 -0
  25. package/dist/esm/Canvas/CanvasItemRegistryContext.d.ts +5 -0
  26. package/dist/esm/Canvas/CanvasItemRegistryContext.d.ts.map +1 -0
  27. package/dist/esm/Canvas/CanvasItemRegistryContext.js +6 -0
  28. package/dist/esm/Canvas/CanvasItemRegistryContext.js.map +1 -0
  29. package/dist/esm/Canvas/CanvasItemRegistryContextValue.d.ts +26 -0
  30. package/dist/esm/Canvas/CanvasItemRegistryContextValue.d.ts.map +1 -0
  31. package/dist/esm/Canvas/CanvasItemRegistryContextValue.js +4 -0
  32. package/dist/esm/Canvas/CanvasItemRegistryContextValue.js.map +1 -0
  33. package/dist/esm/Canvas/CanvasItemRegistryEntry.d.ts +19 -0
  34. package/dist/esm/Canvas/CanvasItemRegistryEntry.d.ts.map +1 -0
  35. package/dist/esm/Canvas/CanvasItemRegistryEntry.js +4 -0
  36. package/dist/esm/Canvas/CanvasItemRegistryEntry.js.map +1 -0
  37. package/dist/esm/Canvas/WebKitGestureEvent.d.ts +13 -0
  38. package/dist/esm/Canvas/WebKitGestureEvent.d.ts.map +1 -0
  39. package/dist/esm/Canvas/WebKitGestureEvent.js +4 -0
  40. package/dist/esm/Canvas/WebKitGestureEvent.js.map +1 -0
  41. package/dist/esm/Canvas/canvasEasing.d.ts +8 -0
  42. package/dist/esm/Canvas/canvasEasing.d.ts.map +1 -0
  43. package/dist/esm/Canvas/canvasEasing.js +8 -0
  44. package/dist/esm/Canvas/canvasEasing.js.map +1 -0
  45. package/dist/esm/Canvas/canvasGestureTuning.d.ts +6 -0
  46. package/dist/esm/Canvas/canvasGestureTuning.d.ts.map +1 -0
  47. package/dist/esm/Canvas/canvasGestureTuning.js +7 -0
  48. package/dist/esm/Canvas/canvasGestureTuning.js.map +1 -0
  49. package/dist/esm/Canvas/index.js +2 -1
  50. package/dist/esm/Canvas/index.js.map +1 -1
  51. package/dist/esm/Canvas/shapes/Region/Region.js +4 -1
  52. package/dist/esm/Canvas/shapes/Region/Region.js.map +1 -1
  53. package/dist/esm/Canvas/useCanvasCamera.d.ts +37 -0
  54. package/dist/esm/Canvas/useCanvasCamera.d.ts.map +1 -0
  55. package/dist/esm/Canvas/useCanvasCamera.js +79 -0
  56. package/dist/esm/Canvas/useCanvasCamera.js.map +1 -0
  57. package/dist/esm/Canvas/useCanvasItemRegistry.d.ts +14 -0
  58. package/dist/esm/Canvas/useCanvasItemRegistry.d.ts.map +1 -0
  59. package/dist/esm/Canvas/useCanvasItemRegistry.js +59 -0
  60. package/dist/esm/Canvas/useCanvasItemRegistry.js.map +1 -0
  61. package/dist/esm/Canvas/useCanvasNavigation.d.ts +36 -0
  62. package/dist/esm/Canvas/useCanvasNavigation.d.ts.map +1 -0
  63. package/dist/esm/Canvas/useCanvasNavigation.js +186 -0
  64. package/dist/esm/Canvas/useCanvasNavigation.js.map +1 -0
  65. package/dist/esm/Canvas/useCanvasPointerGestures.d.ts +34 -0
  66. package/dist/esm/Canvas/useCanvasPointerGestures.d.ts.map +1 -0
  67. package/dist/esm/Canvas/useCanvasPointerGestures.js +178 -0
  68. package/dist/esm/Canvas/useCanvasPointerGestures.js.map +1 -0
  69. package/dist/esm/Canvas/useCanvasWheelZoom.d.ts +23 -0
  70. package/dist/esm/Canvas/useCanvasWheelZoom.d.ts.map +1 -0
  71. package/dist/esm/Canvas/useCanvasWheelZoom.js +146 -0
  72. package/dist/esm/Canvas/useCanvasWheelZoom.js.map +1 -0
  73. package/dist/esm/Canvas/useLatestRef.d.ts +8 -0
  74. package/dist/esm/Canvas/useLatestRef.d.ts.map +1 -0
  75. package/dist/esm/Canvas/useLatestRef.js +12 -0
  76. package/dist/esm/Canvas/useLatestRef.js.map +1 -0
  77. package/dist/esm/Canvas/usePixiApplication.d.ts +32 -0
  78. package/dist/esm/Canvas/usePixiApplication.d.ts.map +1 -0
  79. package/dist/esm/Canvas/usePixiApplication.js +92 -0
  80. package/dist/esm/Canvas/usePixiApplication.js.map +1 -0
  81. package/dist/esm/Canvas/usePixiItems.d.ts +19 -0
  82. package/dist/esm/Canvas/usePixiItems.d.ts.map +1 -0
  83. package/dist/esm/Canvas/usePixiItems.js +49 -0
  84. package/dist/esm/Canvas/usePixiItems.js.map +1 -0
  85. package/dist/esm/Chat/ChatSidebar.d.ts.map +1 -1
  86. package/dist/esm/Chat/ChatSidebar.js +1 -1
  87. package/dist/esm/Chat/ChatSidebar.js.map +1 -1
  88. package/dist/esm/ClassNames/classNames.d.ts +7 -0
  89. package/dist/esm/ClassNames/classNames.d.ts.map +1 -0
  90. package/dist/esm/ClassNames/classNames.js.map +1 -0
  91. package/dist/esm/Common/Breadcrumbs.d.ts.map +1 -1
  92. package/dist/esm/Common/Breadcrumbs.js +1 -1
  93. package/dist/esm/Common/Breadcrumbs.js.map +1 -1
  94. package/dist/esm/Common/ComboBox.d.ts.map +1 -1
  95. package/dist/esm/Common/ComboBox.js +1 -1
  96. package/dist/esm/Common/ComboBox.js.map +1 -1
  97. package/dist/esm/Common/DatePickerInputImplementation.d.ts.map +1 -1
  98. package/dist/esm/Common/DatePickerInputImplementation.js +1 -1
  99. package/dist/esm/Common/DatePickerInputImplementation.js.map +1 -1
  100. package/dist/esm/Common/NumberInput.d.ts.map +1 -1
  101. package/dist/esm/Common/NumberInput.js +1 -1
  102. package/dist/esm/Common/NumberInput.js.map +1 -1
  103. package/dist/esm/Common/Tabs.d.ts.map +1 -1
  104. package/dist/esm/Common/Tabs.js +1 -1
  105. package/dist/esm/Common/Tabs.js.map +1 -1
  106. package/dist/esm/Common/TagGroup.d.ts.map +1 -1
  107. package/dist/esm/Common/TagGroup.js +1 -1
  108. package/dist/esm/Common/TagGroup.js.map +1 -1
  109. package/dist/esm/Common/ToggleGroup.d.ts.map +1 -1
  110. package/dist/esm/Common/ToggleGroup.js +1 -1
  111. package/dist/esm/Common/ToggleGroup.js.map +1 -1
  112. package/dist/esm/DataTables/ColumnFilterMenu.d.ts.map +1 -1
  113. package/dist/esm/DataTables/ColumnFilterMenu.js +1 -1
  114. package/dist/esm/DataTables/ColumnFilterMenu.js.map +1 -1
  115. package/dist/esm/DataTables/DataTableBody.js +1 -1
  116. package/dist/esm/DataTables/DataTableBody.js.map +1 -1
  117. package/dist/esm/DataTables/DataTableCore.js +1 -1
  118. package/dist/esm/DataTables/DataTableCore.js.map +1 -1
  119. package/dist/esm/DataTables/DataTableHeaderCell.js +1 -1
  120. package/dist/esm/DataTables/DataTableHeaderCell.js.map +1 -1
  121. package/dist/esm/DataTables/DataTableRow.js +1 -1
  122. package/dist/esm/DataTables/DataTableRow.js.map +1 -1
  123. package/dist/esm/DataTables/DataTableSearch.js +1 -1
  124. package/dist/esm/DataTables/DataTableSearch.js.map +1 -1
  125. package/dist/esm/Dialogs/DialogImplementation.d.ts.map +1 -1
  126. package/dist/esm/Dialogs/DialogImplementation.js +1 -1
  127. package/dist/esm/Dialogs/DialogImplementation.js.map +1 -1
  128. package/dist/esm/Display/Message.d.ts +8 -1
  129. package/dist/esm/Display/Message.d.ts.map +1 -1
  130. package/dist/esm/Display/Message.js +1 -1
  131. package/dist/esm/Display/Message.js.map +1 -1
  132. package/dist/esm/Dropdown/DropdownImplementation.d.ts.map +1 -1
  133. package/dist/esm/Dropdown/DropdownImplementation.js +1 -1
  134. package/dist/esm/Dropdown/DropdownImplementation.js.map +1 -1
  135. package/dist/esm/Notifications/Toaster.d.ts.map +1 -1
  136. package/dist/esm/Notifications/Toaster.js +1 -1
  137. package/dist/esm/Notifications/Toaster.js.map +1 -1
  138. package/dist/esm/PivotViewer/components/PivotCanvas.d.ts +7 -50
  139. package/dist/esm/PivotViewer/components/PivotCanvas.d.ts.map +1 -1
  140. package/dist/esm/PivotViewer/components/PivotCanvas.js +34 -433
  141. package/dist/esm/PivotViewer/components/PivotCanvas.js.map +1 -1
  142. package/dist/esm/PivotViewer/components/PivotCanvasProps.d.ts +51 -0
  143. package/dist/esm/PivotViewer/components/PivotCanvasProps.d.ts.map +1 -0
  144. package/dist/esm/PivotViewer/components/PivotCanvasProps.js +4 -0
  145. package/dist/esm/PivotViewer/components/PivotCanvasProps.js.map +1 -0
  146. package/dist/esm/PivotViewer/components/pivot/PivotRenderContext.d.ts +16 -0
  147. package/dist/esm/PivotViewer/components/pivot/PivotRenderContext.d.ts.map +1 -0
  148. package/dist/esm/PivotViewer/components/pivot/PivotRenderContext.js +4 -0
  149. package/dist/esm/PivotViewer/components/pivot/PivotRenderContext.js.map +1 -0
  150. package/dist/esm/PivotViewer/components/pivot/PivotStage.d.ts +19 -0
  151. package/dist/esm/PivotViewer/components/pivot/PivotStage.d.ts.map +1 -0
  152. package/dist/esm/PivotViewer/components/pivot/PivotStage.js +4 -0
  153. package/dist/esm/PivotViewer/components/pivot/PivotStage.js.map +1 -0
  154. package/dist/esm/PivotViewer/components/pivot/PivotTransitionState.d.ts +21 -0
  155. package/dist/esm/PivotViewer/components/pivot/PivotTransitionState.d.ts.map +1 -0
  156. package/dist/esm/PivotViewer/components/pivot/PivotTransitionState.js +4 -0
  157. package/dist/esm/PivotViewer/components/pivot/PivotTransitionState.js.map +1 -0
  158. package/dist/esm/PivotViewer/components/pivot/asReactMouseEvent.d.ts +8 -0
  159. package/dist/esm/PivotViewer/components/pivot/asReactMouseEvent.d.ts.map +1 -0
  160. package/dist/esm/PivotViewer/components/pivot/asReactMouseEvent.js +6 -0
  161. package/dist/esm/PivotViewer/components/pivot/asReactMouseEvent.js.map +1 -0
  162. package/dist/esm/PivotViewer/components/pivot/sprites.js +1 -1
  163. package/dist/esm/PivotViewer/components/pivot/usePivotCardColors.d.ts +22 -0
  164. package/dist/esm/PivotViewer/components/pivot/usePivotCardColors.d.ts.map +1 -0
  165. package/dist/esm/PivotViewer/components/pivot/usePivotCardColors.js +25 -0
  166. package/dist/esm/PivotViewer/components/pivot/usePivotCardColors.js.map +1 -0
  167. package/dist/esm/PivotViewer/components/pivot/usePivotGroupBackgrounds.d.ts +8 -0
  168. package/dist/esm/PivotViewer/components/pivot/usePivotGroupBackgrounds.d.ts.map +1 -0
  169. package/dist/esm/PivotViewer/components/pivot/usePivotGroupBackgrounds.js +53 -0
  170. package/dist/esm/PivotViewer/components/pivot/usePivotGroupBackgrounds.js.map +1 -0
  171. package/dist/esm/PivotViewer/components/pivot/usePivotScrollSync.d.ts +8 -0
  172. package/dist/esm/PivotViewer/components/pivot/usePivotScrollSync.d.ts.map +1 -0
  173. package/dist/esm/PivotViewer/components/pivot/usePivotScrollSync.js +100 -0
  174. package/dist/esm/PivotViewer/components/pivot/usePivotScrollSync.js.map +1 -0
  175. package/dist/esm/PivotViewer/components/pivot/usePivotSelectionHighlight.d.ts +7 -0
  176. package/dist/esm/PivotViewer/components/pivot/usePivotSelectionHighlight.d.ts.map +1 -0
  177. package/dist/esm/PivotViewer/components/pivot/usePivotSelectionHighlight.js +35 -0
  178. package/dist/esm/PivotViewer/components/pivot/usePivotSelectionHighlight.js.map +1 -0
  179. package/dist/esm/PivotViewer/components/pivot/usePivotSpriteSync.d.ts +8 -0
  180. package/dist/esm/PivotViewer/components/pivot/usePivotSpriteSync.d.ts.map +1 -0
  181. package/dist/esm/PivotViewer/components/pivot/usePivotSpriteSync.js +123 -0
  182. package/dist/esm/PivotViewer/components/pivot/usePivotSpriteSync.js.map +1 -0
  183. package/dist/esm/PivotViewer/components/pivot/usePivotStage.d.ts +21 -0
  184. package/dist/esm/PivotViewer/components/pivot/usePivotStage.d.ts.map +1 -0
  185. package/dist/esm/PivotViewer/components/pivot/usePivotStage.js +171 -0
  186. package/dist/esm/PivotViewer/components/pivot/usePivotStage.js.map +1 -0
  187. package/dist/esm/PivotViewer/components/pivot/usePivotTransitionState.d.ts +13 -0
  188. package/dist/esm/PivotViewer/components/pivot/usePivotTransitionState.d.ts.map +1 -0
  189. package/dist/esm/PivotViewer/components/pivot/usePivotTransitionState.js +31 -0
  190. package/dist/esm/PivotViewer/components/pivot/usePivotTransitionState.js.map +1 -0
  191. package/dist/esm/TimeMachine/EventsView.d.ts.map +1 -1
  192. package/dist/esm/TimeMachine/EventsView.js +1 -1
  193. package/dist/esm/TimeMachine/EventsView.js.map +1 -1
  194. package/dist/esm/theme.css +11 -0
  195. package/package.json +1 -1
  196. package/dist/esm/DataTables/classNames.d.ts +0 -7
  197. package/dist/esm/DataTables/classNames.d.ts.map +0 -1
  198. package/dist/esm/DataTables/classNames.js.map +0 -1
  199. /package/dist/esm/{DataTables → ClassNames}/classNames.js +0 -0
@@ -0,0 +1,51 @@
1
+ import type { GroupingResult, ItemId, LayoutResult } from '../engine/types.js';
2
+ import type { PivotViewerColors } from '../types.js';
3
+ import type { ViewMode } from './Toolbar.js';
4
+ /** Props for the Pixi card renderer inside a PivotViewer viewport. */
5
+ export interface PivotCanvasProps<TItem extends object> {
6
+ /** Original items array */
7
+ items: TItem[];
8
+ /** Layout positions */
9
+ layout: LayoutResult;
10
+ /** Grouping information */
11
+ grouping: GroupingResult;
12
+ /** Visible item IDs */
13
+ visibleIds: Uint32Array;
14
+ /** Card dimensions */
15
+ cardWidth: number;
16
+ cardHeight: number;
17
+ /** Zoom level */
18
+ zoomLevel: number;
19
+ /** Pan offset */
20
+ panX: number;
21
+ panY: number;
22
+ /** Viewport dimensions (visible area) */
23
+ viewportWidth: number;
24
+ viewportHeight: number;
25
+ /** Selected item ID */
26
+ selectedId: ItemId | null;
27
+ /** Hovered group index */
28
+ hoveredGroupIndex: number | null;
29
+ /** Current view mode */
30
+ viewMode: ViewMode;
31
+ /** Is zooming animation in progress */
32
+ isZooming?: boolean;
33
+ /** Card renderer function - returns structured data for display */
34
+ cardRenderer: (item: TItem) => {
35
+ title: string;
36
+ labels?: string[];
37
+ values?: string[];
38
+ };
39
+ /** Public color overrides; changes trigger a Pixi color refresh. */
40
+ colorOverrides?: Partial<PivotViewerColors>;
41
+ /** ID resolver */
42
+ resolveId: (item: TItem, index: number) => string | number;
43
+ /** Click handler */
44
+ onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void;
45
+ /** Pan handlers */
46
+ onPanStart: (e: React.MouseEvent) => void;
47
+ onPanMove: (e: React.MouseEvent) => void;
48
+ onPanEnd: () => void;
49
+ containerRef: React.RefObject<HTMLDivElement | null>;
50
+ }
51
+ //# sourceMappingURL=PivotCanvasProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PivotCanvasProps.d.ts","sourceRoot":"","sources":["../../../../PivotViewer/components/PivotCanvasProps.ts"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,SAAS,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAAC;IAE3D,oBAAoB;IACpB,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAEvE,mBAAmB;IACnB,UAAU,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC1C,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CACxD"}
@@ -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=PivotCanvasProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PivotCanvasProps.js","sourceRoot":"","sources":["../../../../PivotViewer/components/PivotCanvasProps.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 { GroupingResult, ItemId, LayoutResult } from '../engine/types';\nimport type { PivotViewerColors } from '../types';\nimport type { ViewMode } from './Toolbar';\n\n/** Props for the Pixi card renderer inside a PivotViewer viewport. */\nexport interface PivotCanvasProps<TItem extends object> {\n /** Original items array */\n items: TItem[];\n\n /** Layout positions */\n layout: LayoutResult;\n\n /** Grouping information */\n grouping: GroupingResult;\n\n /** Visible item IDs */\n visibleIds: Uint32Array;\n\n /** Card dimensions */\n cardWidth: number;\n cardHeight: number;\n\n /** Zoom level */\n zoomLevel: number;\n\n /** Pan offset */\n panX: number;\n panY: number;\n\n /** Viewport dimensions (visible area) */\n viewportWidth: number;\n viewportHeight: number;\n\n /** Selected item ID */\n selectedId: ItemId | null;\n\n /** Hovered group index */\n hoveredGroupIndex: number | null;\n\n /** Current view mode */\n viewMode: ViewMode;\n\n /** Is zooming animation in progress */\n isZooming?: boolean;\n\n /** Card renderer function - returns structured data for display */\n cardRenderer: (item: TItem) => {\n title: string;\n labels?: string[];\n values?: string[];\n };\n\n /** Public color overrides; changes trigger a Pixi color refresh. */\n colorOverrides?: Partial<PivotViewerColors>;\n\n /** ID resolver */\n resolveId: (item: TItem, index: number) => string | number;\n\n /** Click handler */\n onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void;\n\n /** Pan handlers */\n onPanStart: (e: React.MouseEvent) => void;\n onPanMove: (e: React.MouseEvent) => void;\n onPanEnd: () => void;\n containerRef: React.RefObject<HTMLDivElement | null>;\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import type { RefObject } from 'react';
2
+ import type { PivotCanvasProps } from '../PivotCanvasProps.js';
3
+ import type { CardColors } from './constants.js';
4
+ import type { PivotStage } from './PivotStage.js';
5
+ import type { PivotTransitionState } from './PivotTransitionState.js';
6
+ /** Everything the PivotCanvas render hooks read: props, stage, transition state and colors. */
7
+ export interface PivotRenderContext<TItem extends object> {
8
+ props: PivotCanvasProps<TItem>;
9
+ stage: PivotStage;
10
+ transition: PivotTransitionState;
11
+ cardColorsRef: RefObject<CardColors>;
12
+ colorRevision: number;
13
+ onCardClickRef: RefObject<PivotCanvasProps<TItem>['onCardClick']>;
14
+ onPanStartRef: RefObject<PivotCanvasProps<TItem>['onPanStart']>;
15
+ }
16
+ //# sourceMappingURL=PivotRenderContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PivotRenderContext.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/PivotRenderContext.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAAwB,CAAC;AAEnE,+FAA+F;AAC/F,MAAM,WAAW,kBAAkB,CAAC,KAAK,SAAS,MAAM;IACpD,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC/B,KAAK,EAAE,UAAU,CAAC;IAClB,UAAU,EAAE,oBAAoB,CAAC;IACjC,aAAa,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;IAClE,aAAa,EAAE,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;CACnE"}
@@ -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=PivotRenderContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PivotRenderContext.js","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/PivotRenderContext.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 { RefObject } from 'react';\nimport type { PivotCanvasProps } from '../PivotCanvasProps';\nimport type { CardColors } from './constants';\nimport type { PivotStage } from './PivotStage';\nimport type { PivotTransitionState } from './PivotTransitionState';\n\n/** Everything the PivotCanvas render hooks read: props, stage, transition state and colors. */\nexport interface PivotRenderContext<TItem extends object> {\n props: PivotCanvasProps<TItem>;\n stage: PivotStage;\n transition: PivotTransitionState;\n cardColorsRef: RefObject<CardColors>;\n colorRevision: number;\n onCardClickRef: RefObject<PivotCanvasProps<TItem>['onCardClick']>;\n onPanStartRef: RefObject<PivotCanvasProps<TItem>['onPanStart']>;\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import type { RefObject } from 'react';
2
+ import type * as PIXI from 'pixi.js';
3
+ import type { ItemId } from '../../engine/types.js';
4
+ import type { CardSprite } from './constants.js';
5
+ /** The Pixi application and containers a PivotCanvas renders into. */
6
+ export interface PivotStage {
7
+ appRef: RefObject<PIXI.Application | null>;
8
+ rootRef: RefObject<PIXI.Container | null>;
9
+ groupsContainerRef: RefObject<PIXI.Container | null>;
10
+ canvasRef: RefObject<HTMLCanvasElement | null>;
11
+ spritesRef: RefObject<Map<ItemId, CardSprite>>;
12
+ animationFrameRef: RefObject<number>;
13
+ mountedRef: RefObject<boolean>;
14
+ /** Set when the stage has changed and needs another render. */
15
+ needsRenderRef: RefObject<boolean>;
16
+ /** Whether the Pixi application is initialized. */
17
+ pixiReady: boolean;
18
+ }
19
+ //# sourceMappingURL=PivotStage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PivotStage.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/PivotStage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,KAAK,IAAI,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAa,CAAC;AAE9C,sEAAsE;AACtE,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC3C,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAC1C,kBAAkB,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACrD,SAAS,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC/C,UAAU,EAAE,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/C,iBAAiB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACrC,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/B,+DAA+D;IAC/D,cAAc,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACnC,mDAAmD;IACnD,SAAS,EAAE,OAAO,CAAC;CACtB"}
@@ -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=PivotStage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PivotStage.js","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/PivotStage.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 { RefObject } from 'react';\nimport type * as PIXI from 'pixi.js';\nimport type { ItemId } from '../../engine/types';\nimport type { CardSprite } from './constants';\n\n/** The Pixi application and containers a PivotCanvas renders into. */\nexport interface PivotStage {\n appRef: RefObject<PIXI.Application | null>;\n rootRef: RefObject<PIXI.Container | null>;\n groupsContainerRef: RefObject<PIXI.Container | null>;\n canvasRef: RefObject<HTMLCanvasElement | null>;\n spritesRef: RefObject<Map<ItemId, CardSprite>>;\n animationFrameRef: RefObject<number>;\n mountedRef: RefObject<boolean>;\n /** Set when the stage has changed and needs another render. */\n needsRenderRef: RefObject<boolean>;\n /** Whether the Pixi application is initialized. */\n pixiReady: boolean;\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import type { RefObject } from 'react';
2
+ import type { GroupingResult, ItemId, LayoutResult } from '../../engine/types.js';
3
+ import type { ViewMode } from '../Toolbar.js';
4
+ /** What a PivotCanvas remembers between renders to animate view, grouping and layout changes. */
5
+ export interface PivotTransitionState {
6
+ isAnimatingRef: RefObject<boolean>;
7
+ isViewTransitionRef: RefObject<boolean>;
8
+ lastViewChangeTimeRef: RefObject<number>;
9
+ previousViewModeRef: RefObject<ViewMode>;
10
+ prevLayoutRef: RefObject<LayoutResult | null>;
11
+ transitionLayoutRef: RefObject<LayoutResult | null>;
12
+ transitionSeenIdsRef: RefObject<Set<ItemId>>;
13
+ prevGroupingRef: RefObject<GroupingResult | null>;
14
+ prevScrollTopRef: RefObject<number>;
15
+ prevScrollLeftRef: RefObject<number>;
16
+ prevPanRef: RefObject<{
17
+ x: number;
18
+ y: number;
19
+ }>;
20
+ }
21
+ //# sourceMappingURL=PivotTransitionState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PivotTransitionState.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/PivotTransitionState.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,uBAAoB,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAY,CAAC;AAE3C,iGAAiG;AACjG,MAAM,WAAW,oBAAoB;IACjC,cAAc,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACnC,mBAAmB,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACxC,qBAAqB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzC,mBAAmB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IACzC,aAAa,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAC9C,mBAAmB,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACpD,oBAAoB,EAAE,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,eAAe,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAClD,gBAAgB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACpC,iBAAiB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACrC,UAAU,EAAE,SAAS,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnD"}
@@ -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=PivotTransitionState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PivotTransitionState.js","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/PivotTransitionState.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 { RefObject } from 'react';\nimport type { GroupingResult, ItemId, LayoutResult } from '../../engine/types';\nimport type { ViewMode } from '../Toolbar';\n\n/** What a PivotCanvas remembers between renders to animate view, grouping and layout changes. */\nexport interface PivotTransitionState {\n isAnimatingRef: RefObject<boolean>;\n isViewTransitionRef: RefObject<boolean>;\n lastViewChangeTimeRef: RefObject<number>;\n previousViewModeRef: RefObject<ViewMode>;\n prevLayoutRef: RefObject<LayoutResult | null>;\n transitionLayoutRef: RefObject<LayoutResult | null>;\n transitionSeenIdsRef: RefObject<Set<ItemId>>;\n prevGroupingRef: RefObject<GroupingResult | null>;\n prevScrollTopRef: RefObject<number>;\n prevScrollLeftRef: RefObject<number>;\n prevPanRef: RefObject<{ x: number; y: number }>;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Treats the browser pointer event Pixi exposes as the React mouse event PivotViewer's pan
3
+ * callbacks take; they read only the coordinates and modifiers both share.
4
+ * @param event The originating browser event.
5
+ * @returns The same event, typed for the pan callbacks.
6
+ */
7
+ export declare const asReactMouseEvent: (event: unknown) => React.MouseEvent;
8
+ //# sourceMappingURL=asReactMouseEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asReactMouseEvent.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/asReactMouseEvent.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,UAAW,OAAO,KAAG,KAAK,CAAC,UAIxD,CAAC"}
@@ -0,0 +1,6 @@
1
+ const asReactMouseEvent = (event) => {
2
+ return event;
3
+ };
4
+
5
+ export { asReactMouseEvent };
6
+ //# sourceMappingURL=asReactMouseEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asReactMouseEvent.js","sources":["../../../../../PivotViewer/components/pivot/asReactMouseEvent.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 * Treats the browser pointer event Pixi exposes as the React mouse event PivotViewer's pan\n * callbacks take; they read only the coordinates and modifiers both share.\n * @param event The originating browser event.\n * @returns The same event, typed for the pan callbacks.\n */\nexport const asReactMouseEvent = (event: unknown): React.MouseEvent => {\n // SAFETY: Pixi exposes the originating browser pointer event. PivotViewer's pan\n // callbacks consume only coordinates/modifiers shared with React.MouseEvent.\n return event as React.MouseEvent;\n};\n"],"names":[],"mappings":"AASO,MAAM,iBAAiB,GAAG,CAAC,KAAc,KAAsB;AAGlE,IAAA,OAAO,KAAyB;AACpC;;"}
@@ -1,5 +1,5 @@
1
1
  import * as PIXI from 'pixi.js';
2
- import { CARD_RADIUS, CARD_PADDING, CARD_GAP } from './constants.js';
2
+ import { CARD_RADIUS, CARD_GAP, CARD_PADDING } from './constants.js';
3
3
  import { ellipsizeLine, ellipsizeBlock } from './ellipsize.js';
4
4
 
5
5
  const VALUES_INSET = 65;
@@ -0,0 +1,22 @@
1
+ import { type RefObject } from 'react';
2
+ import type { PivotViewerColors } from '../../types.js';
3
+ /**
4
+ * Resolves the card colors from the viewport's CSS and refreshes them when the color environment
5
+ * or the overrides change.
6
+ * @param parentContainerRef The viewport whose CSS supplies the colors.
7
+ * @param colorOverrides The public color overrides; a change triggers a refresh.
8
+ * @param needsRenderRef Set when the colors change, so the stage renders again.
9
+ * @returns The current card colors and a revision that changes with them.
10
+ */
11
+ export declare const usePivotCardColors: (parentContainerRef: RefObject<HTMLDivElement | null>, colorOverrides: Partial<PivotViewerColors> | undefined, needsRenderRef: RefObject<boolean>) => {
12
+ cardColorsRef: RefObject<{
13
+ base: string;
14
+ mid: string;
15
+ gradient: string;
16
+ border: string;
17
+ text: string;
18
+ textSecondary: string;
19
+ }>;
20
+ colorRevision: number;
21
+ };
22
+ //# sourceMappingURL=usePivotCardColors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePivotCardColors.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/usePivotCardColors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAa,CAAC;AAQrD;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,uBACP,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,kBACpC,OAAO,CAAC,iBAAiB,CAAC,GAAG,SAAS,kBACtC,SAAS,CAAC,OAAO,CAAC;;;;;;;;;;CAqBrC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { useState, useRef, useMemo, useEffect } from 'react';
2
+ import { createCssColorResolver, observeColorEnvironment, resolveCardColors } from './colorResolver.js';
3
+ import { DEFAULT_COLORS } from './constants.js';
4
+
5
+ const usePivotCardColors = (parentContainerRef, colorOverrides, needsRenderRef) => {
6
+ const [colorRevision, setColorRevision] = useState(0);
7
+ const cardColorsRef = useRef(DEFAULT_COLORS);
8
+ const cssColorResolver = useMemo(() => createCssColorResolver(), []);
9
+ useEffect(() => {
10
+ const element = parentContainerRef.current;
11
+ if (!element)
12
+ return;
13
+ const refreshColors = () => {
14
+ cardColorsRef.current = resolveCardColors(cssColorResolver, element);
15
+ needsRenderRef.current = true;
16
+ setColorRevision((revision) => revision + 1);
17
+ };
18
+ refreshColors();
19
+ return observeColorEnvironment(element, refreshColors);
20
+ }, [cssColorResolver, parentContainerRef, colorOverrides, needsRenderRef]);
21
+ return { cardColorsRef, colorRevision };
22
+ };
23
+
24
+ export { usePivotCardColors };
25
+ //# sourceMappingURL=usePivotCardColors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePivotCardColors.js","sources":["../../../../../PivotViewer/components/pivot/usePivotCardColors.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 { useEffect, useMemo, useRef, useState, type RefObject } from 'react';\nimport type { PivotViewerColors } from '../../types';\nimport {\n createCssColorResolver,\n observeColorEnvironment,\n resolveCardColors,\n} from './colorResolver';\nimport { DEFAULT_COLORS, type CardColors } from './constants';\n\n/**\n * Resolves the card colors from the viewport's CSS and refreshes them when the color environment\n * or the overrides change.\n * @param parentContainerRef The viewport whose CSS supplies the colors.\n * @param colorOverrides The public color overrides; a change triggers a refresh.\n * @param needsRenderRef Set when the colors change, so the stage renders again.\n * @returns The current card colors and a revision that changes with them.\n */\nexport const usePivotCardColors = (\n parentContainerRef: RefObject<HTMLDivElement | null>,\n colorOverrides: Partial<PivotViewerColors> | undefined,\n needsRenderRef: RefObject<boolean>,\n) => {\n const [colorRevision, setColorRevision] = useState(0);\n const cardColorsRef = useRef<CardColors>(DEFAULT_COLORS);\n const cssColorResolver = useMemo(() => createCssColorResolver(), []);\n\n useEffect(() => {\n const element = parentContainerRef.current;\n if (!element) return;\n\n const refreshColors = () => {\n cardColorsRef.current = resolveCardColors(cssColorResolver, element);\n needsRenderRef.current = true;\n setColorRevision((revision) => revision + 1);\n };\n\n refreshColors();\n return observeColorEnvironment(element, refreshColors);\n }, [cssColorResolver, parentContainerRef, colorOverrides, needsRenderRef]);\n\n return { cardColorsRef, colorRevision };\n};\n"],"names":[],"mappings":";;;;AAoBO,MAAM,kBAAkB,GAAG,CAC9B,kBAAoD,EACpD,cAAsD,EACtD,cAAkC,KAClC;IACA,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;AACrD,IAAA,MAAM,aAAa,GAAG,MAAM,CAAa,cAAc,CAAC;AACxD,IAAA,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,sBAAsB,EAAE,EAAE,EAAE,CAAC;IAEpE,SAAS,CAAC,MAAK;AACX,QAAA,MAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO;AAC1C,QAAA,IAAI,CAAC,OAAO;YAAE;QAEd,MAAM,aAAa,GAAG,MAAK;YACvB,aAAa,CAAC,OAAO,GAAG,iBAAiB,CAAC,gBAAgB,EAAE,OAAO,CAAC;AACpE,YAAA,cAAc,CAAC,OAAO,GAAG,IAAI;YAC7B,gBAAgB,CAAC,CAAC,QAAQ,KAAK,QAAQ,GAAG,CAAC,CAAC;AAChD,QAAA,CAAC;AAED,QAAA,aAAa,EAAE;AACf,QAAA,OAAO,uBAAuB,CAAC,OAAO,EAAE,aAAa,CAAC;IAC1D,CAAC,EAAE,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;AAE1E,IAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE;AAC3C;;"}
@@ -0,0 +1,8 @@
1
+ import type { PivotRenderContext } from './PivotRenderContext.js';
2
+ /**
3
+ * Draws the group backgrounds when the layout, grouping or colors change, and fades them in and out
4
+ * when switching between grouped and collection view.
5
+ * @param context The props, stage, and colors.
6
+ */
7
+ export declare const usePivotGroupBackgrounds: <TItem extends object>({ props, stage, cardColorsRef, colorRevision, }: PivotRenderContext<TItem>) => void;
8
+ //# sourceMappingURL=usePivotGroupBackgrounds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePivotGroupBackgrounds.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/usePivotGroupBackgrounds.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAsB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,KAAK,SAAS,MAAM,mDAK1D,kBAAkB,CAAC,KAAK,CAAC,SA+D3B,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { useEffect } from 'react';
2
+ import { updateGroupBackgrounds } from './groups.js';
3
+
4
+ const usePivotGroupBackgrounds = ({ props, stage, cardColorsRef, colorRevision, }) => {
5
+ const { layout, grouping, zoomLevel, viewMode, colorOverrides, containerRef: parentContainerRef, } = props;
6
+ const { groupsContainerRef, appRef, needsRenderRef, pixiReady } = stage;
7
+ useEffect(() => {
8
+ if (!groupsContainerRef.current || !parentContainerRef.current || !pixiReady)
9
+ return;
10
+ updateGroupBackgrounds(groupsContainerRef.current, parentContainerRef.current, grouping, layout, zoomLevel, cardColorsRef.current, viewMode);
11
+ needsRenderRef.current = true;
12
+ appRef.current?.renderer?.render(appRef.current.stage);
13
+ }, [
14
+ grouping,
15
+ layout,
16
+ zoomLevel,
17
+ viewMode,
18
+ pixiReady,
19
+ colorOverrides,
20
+ colorRevision,
21
+ appRef,
22
+ cardColorsRef,
23
+ groupsContainerRef,
24
+ needsRenderRef,
25
+ parentContainerRef,
26
+ ]);
27
+ useEffect(() => {
28
+ const gc = groupsContainerRef.current;
29
+ const app = appRef.current;
30
+ if (!gc || !app)
31
+ return;
32
+ const target = viewMode === 'grouped' ? 1 : 0;
33
+ const start = typeof gc.alpha === 'number' ? gc.alpha : 1;
34
+ const duration = 200;
35
+ if (Math.abs(start - target) < 0.01) {
36
+ gc.alpha = target;
37
+ return;
38
+ }
39
+ const t0 = performance.now();
40
+ const step = () => {
41
+ const u = Math.min(1, (performance.now() - t0) / duration);
42
+ const eased = u * (2 - u);
43
+ gc.alpha = start + (target - start) * eased;
44
+ app.renderer?.render(app.stage);
45
+ if (u < 1)
46
+ requestAnimationFrame(step);
47
+ };
48
+ requestAnimationFrame(step);
49
+ }, [viewMode, appRef, groupsContainerRef]);
50
+ };
51
+
52
+ export { usePivotGroupBackgrounds };
53
+ //# sourceMappingURL=usePivotGroupBackgrounds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePivotGroupBackgrounds.js","sources":["../../../../../PivotViewer/components/pivot/usePivotGroupBackgrounds.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 { useEffect } from 'react';\nimport { updateGroupBackgrounds as updateGroupBackgroundsExternal } from './groups';\nimport type { PivotRenderContext } from './PivotRenderContext';\n\n/**\n * Draws the group backgrounds when the layout, grouping or colors change, and fades them in and out\n * when switching between grouped and collection view.\n * @param context The props, stage, and colors.\n */\nexport const usePivotGroupBackgrounds = <TItem extends object>({\n props,\n stage,\n cardColorsRef,\n colorRevision,\n}: PivotRenderContext<TItem>) => {\n const {\n layout,\n grouping,\n zoomLevel,\n viewMode,\n colorOverrides,\n containerRef: parentContainerRef,\n } = props;\n const { groupsContainerRef, appRef, needsRenderRef, pixiReady } = stage;\n\n // Update group backgrounds only when layout/grouping changes\n useEffect(() => {\n if (!groupsContainerRef.current || !parentContainerRef.current || !pixiReady)\n return;\n updateGroupBackgroundsExternal(\n groupsContainerRef.current,\n parentContainerRef.current,\n grouping,\n layout,\n zoomLevel,\n cardColorsRef.current,\n viewMode,\n );\n needsRenderRef.current = true;\n appRef.current?.renderer?.render(appRef.current.stage);\n }, [\n grouping,\n layout,\n zoomLevel,\n viewMode,\n pixiReady,\n colorOverrides,\n colorRevision,\n appRef,\n cardColorsRef,\n groupsContainerRef,\n needsRenderRef,\n parentContainerRef,\n ]);\n\n // Fade buckets background when switching view modes\n useEffect(() => {\n const gc = groupsContainerRef.current;\n const app = appRef.current;\n if (!gc || !app) return;\n const target = viewMode === 'grouped' ? 1 : 0;\n const start = typeof gc.alpha === 'number' ? gc.alpha : 1;\n const duration = 200; // ms\n if (Math.abs(start - target) < 0.01) {\n gc.alpha = target;\n return;\n }\n const t0 = performance.now();\n const step = () => {\n const u = Math.min(1, (performance.now() - t0) / duration);\n const eased = u * (2 - u);\n gc.alpha = start + (target - start) * eased;\n app.renderer?.render(app.stage);\n if (u < 1) requestAnimationFrame(step);\n };\n requestAnimationFrame(step);\n }, [viewMode, appRef, groupsContainerRef]);\n};\n"],"names":["updateGroupBackgroundsExternal"],"mappings":";;;AAYO,MAAM,wBAAwB,GAAG,CAAuB,EAC3D,KAAK,EACL,KAAK,EACL,aAAa,EACb,aAAa,GACW,KAAI;AAC5B,IAAA,MAAM,EACF,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,EAAE,kBAAkB,GACnC,GAAG,KAAK;IACT,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,KAAK;IAGvE,SAAS,CAAC,MAAK;QACX,IAAI,CAAC,kBAAkB,CAAC,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,IAAI,CAAC,SAAS;YACxE;QACJA,sBAA8B,CAC1B,kBAAkB,CAAC,OAAO,EAC1B,kBAAkB,CAAC,OAAO,EAC1B,QAAQ,EACR,MAAM,EACN,SAAS,EACT,aAAa,CAAC,OAAO,EACrB,QAAQ,CACX;AACD,QAAA,cAAc,CAAC,OAAO,GAAG,IAAI;AAC7B,QAAA,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;AAC1D,IAAA,CAAC,EAAE;QACC,QAAQ;QACR,MAAM;QACN,SAAS;QACT,QAAQ;QACR,SAAS;QACT,cA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}
@@ -0,0 +1,8 @@
1
+ import type { PivotRenderContext } from './PivotRenderContext.js';
2
+ /**
3
+ * Syncs the card sprites once per animation frame while the viewport scrolls, natively or
4
+ * programmatically.
5
+ * @param context The props, stage, transition state and colors.
6
+ */
7
+ export declare const usePivotScrollSync: <TItem extends object>({ props, stage, transition, cardColorsRef, onCardClickRef, onPanStartRef, }: PivotRenderContext<TItem>) => void;
8
+ //# sourceMappingURL=usePivotScrollSync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePivotScrollSync.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/usePivotScrollSync.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAsB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,SAAS,MAAM,+EAOpD,kBAAkB,CAAC,KAAK,CAAC,SAoK3B,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { useEffect } from 'react';
2
+ import { asReactMouseEvent } from './asReactMouseEvent.js';
3
+ import { updateCardContent, createCardSprite } from './sprites.js';
4
+ import { syncScrollSprites } from './syncScrollSprites.js';
5
+
6
+ const usePivotScrollSync = ({ props, stage, transition, cardColorsRef, onCardClickRef, onPanStartRef, }) => {
7
+ const { items, layout, grouping, visibleIds, cardWidth, cardHeight, zoomLevel, panX, panY, viewportWidth, viewportHeight, selectedId, viewMode, cardRenderer, resolveId, onPanStart, onCardClick, containerRef: parentContainerRef, } = props;
8
+ const { rootRef, groupsContainerRef, spritesRef, appRef, needsRenderRef, pixiReady } = stage;
9
+ const { isViewTransitionRef, transitionLayoutRef, transitionSeenIdsRef, prevScrollTopRef, prevScrollLeftRef, } = transition;
10
+ useEffect(() => {
11
+ if (!pixiReady ||
12
+ !parentContainerRef ||
13
+ !parentContainerRef.current ||
14
+ !appRef.current ||
15
+ !rootRef.current)
16
+ return;
17
+ const container = parentContainerRef.current;
18
+ const app = appRef.current;
19
+ const pendingRef = { scheduled: false };
20
+ const processScroll = () => {
21
+ pendingRef.scheduled = false;
22
+ try {
23
+ syncScrollSprites({
24
+ root: rootRef.current,
25
+ groupsContainer: groupsContainerRef.current,
26
+ container: parentContainerRef.current,
27
+ sprites: spritesRef.current,
28
+ layout,
29
+ visibleIds,
30
+ items,
31
+ cardWidth,
32
+ cardHeight,
33
+ panX,
34
+ panY,
35
+ zoomLevel,
36
+ viewportWidth,
37
+ viewportHeight,
38
+ createCardSprite: (id, x, y) => createCardSprite(id, x, y, items, (item, e, id) => onCardClickRef.current(item, e, id), (e) => onPanStartRef.current(asReactMouseEvent(e)), cardWidth, cardHeight, cardColorsRef.current, cardRenderer, resolveId),
39
+ updateCardContent: (sprite, item) => updateCardContent(sprite, item, selectedId, cardWidth, cardHeight, cardColorsRef.current, cardRenderer),
40
+ isViewTransition: isViewTransitionRef.current,
41
+ viewMode,
42
+ transitionSeenIds: transitionSeenIdsRef.current,
43
+ prevScrollTop: prevScrollTopRef.current,
44
+ prevScrollLeft: prevScrollLeftRef.current,
45
+ }, transitionLayoutRef.current);
46
+ prevScrollTopRef.current = container.scrollTop || 0;
47
+ prevScrollLeftRef.current = container.scrollLeft || 0;
48
+ needsRenderRef.current = true;
49
+ app.renderer?.render(app.stage);
50
+ }
51
+ catch (e) {
52
+ console.error('[PivotCanvas] processScroll error', e);
53
+ }
54
+ };
55
+ const onScroll = () => {
56
+ if (!pendingRef.scheduled) {
57
+ pendingRef.scheduled = true;
58
+ requestAnimationFrame(processScroll);
59
+ }
60
+ };
61
+ container.addEventListener('scroll', onScroll, { passive: true });
62
+ return () => {
63
+ container.removeEventListener('scroll', onScroll);
64
+ };
65
+ }, [
66
+ pixiReady,
67
+ layout,
68
+ visibleIds,
69
+ items,
70
+ cardWidth,
71
+ cardHeight,
72
+ zoomLevel,
73
+ viewportWidth,
74
+ viewportHeight,
75
+ panX,
76
+ panY,
77
+ grouping,
78
+ viewMode,
79
+ selectedId,
80
+ onCardClick,
81
+ onPanStart,
82
+ appRef,
83
+ cardColorsRef,
84
+ groupsContainerRef,
85
+ isViewTransitionRef,
86
+ needsRenderRef,
87
+ onCardClickRef,
88
+ onPanStartRef,
89
+ parentContainerRef,
90
+ prevScrollLeftRef,
91
+ prevScrollTopRef,
92
+ rootRef,
93
+ spritesRef,
94
+ transitionLayoutRef,
95
+ transitionSeenIdsRef,
96
+ ]);
97
+ };
98
+
99
+ export { usePivotScrollSync };
100
+ //# sourceMappingURL=usePivotScrollSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePivotScrollSync.js","sources":["../../../../../PivotViewer/components/pivot/usePivotScrollSync.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 { useEffect } from 'react';\nimport { asReactMouseEvent } from './asReactMouseEvent';\nimport type { CardSprite } from './constants';\nimport {\n createCardSprite as createCardSpriteExternal,\n updateCardContent as updateCardContentExternal,\n} from './sprites';\nimport { syncScrollSprites } from './syncScrollSprites';\nimport type { PivotRenderContext } from './PivotRenderContext';\n\n/**\n * Syncs the card sprites once per animation frame while the viewport scrolls, natively or\n * programmatically.\n * @param context The props, stage, transition state and colors.\n */\nexport const usePivotScrollSync = <TItem extends object>({\n props,\n stage,\n transition,\n cardColorsRef,\n onCardClickRef,\n onPanStartRef,\n}: PivotRenderContext<TItem>) => {\n const {\n items,\n layout,\n grouping,\n visibleIds,\n cardWidth,\n cardHeight,\n zoomLevel,\n panX,\n panY,\n viewportWidth,\n viewportHeight,\n selectedId,\n viewMode,\n cardRenderer,\n resolveId,\n onPanStart,\n onCardClick,\n containerRef: parentContainerRef,\n } = props;\n const { rootRef, groupsContainerRef, spritesRef, appRef, needsRenderRef, pixiReady } =\n stage;\n const {\n isViewTransitionRef,\n transitionLayoutRef,\n transitionSeenIdsRef,\n prevScrollTopRef,\n prevScrollLeftRef,\n } = transition;\n\n // Listen to native scroll events on the parent container so we update the\n // Pixi world immediately when the user scrolls (native scrollbar or\n // programmatic). This ensures `syncSpritesToViewport` runs on scroll and\n // creates/destroys sprites as the viewport moves.\n useEffect(() => {\n if (\n !pixiReady ||\n !parentContainerRef ||\n !parentContainerRef.current ||\n !appRef.current ||\n !rootRef.current\n )\n return;\n\n const container = parentContainerRef.current;\n const app = appRef.current;\n\n // rAF-batched scroll handling: process scroll once per animation frame to avoid heavy synchronous work inside\n // the scroll event which causes jank and de-synchronisation between the\n // compositor and Pixi render updates.\n const pendingRef = { scheduled: false } as { scheduled: boolean };\n\n const processScroll = () => {\n pendingRef.scheduled = false;\n try {\n // Note: We delegate root/groups container positioning to syncSpritesToViewport\n // because it encapsulates the logic for conditional vertical alignment (offsetY)\n // in different view modes. Manually setting position here would overwrite that logic.\n\n syncScrollSprites(\n {\n root: rootRef.current,\n groupsContainer: groupsContainerRef.current,\n container: parentContainerRef.current,\n sprites: spritesRef.current,\n layout,\n visibleIds,\n items,\n cardWidth,\n cardHeight,\n panX,\n panY,\n zoomLevel,\n viewportWidth,\n viewportHeight,\n createCardSprite: (id: string | number, x: number, y: number) =>\n createCardSpriteExternal(\n id,\n x,\n y,\n items as TItem[],\n (item, e, id) => onCardClickRef.current(item, e, id),\n (e) => onPanStartRef.current(asReactMouseEvent(e)),\n cardWidth,\n cardHeight,\n cardColorsRef.current,\n cardRenderer,\n resolveId,\n ),\n updateCardContent: (sprite: CardSprite, item: TItem) =>\n updateCardContentExternal(\n sprite,\n item,\n selectedId,\n cardWidth,\n cardHeight,\n cardColorsRef.current,\n cardRenderer,\n ),\n isViewTransition: isViewTransitionRef.current,\n viewMode,\n transitionSeenIds: transitionSeenIdsRef.current,\n prevScrollTop: prevScrollTopRef.current,\n prevScrollLeft: prevScrollLeftRef.current,\n },\n transitionLayoutRef.current,\n );\n\n // Update previous scroll position for next frame\n prevScrollTopRef.current = container.scrollTop || 0;\n prevScrollLeftRef.current = container.scrollLeft || 0;\n needsRenderRef.current = true;\n app.renderer?.render(app.stage);\n } catch (e) {\n console.error('[PivotCanvas] processScroll error', e);\n }\n };\n\n const onScroll = () => {\n // schedule the work for the next animation frame\n if (!pendingRef.scheduled) {\n pendingRef.scheduled = true;\n requestAnimationFrame(processScroll);\n }\n };\n\n container.addEventListener('scroll', onScroll, { passive: true });\n\n return () => {\n container.removeEventListener('scroll', onScroll);\n };\n }, [\n pixiReady,\n layout,\n visibleIds,\n items,\n cardWidth,\n cardHeight,\n zoomLevel,\n viewportWidth,\n viewportHeight,\n panX,\n panY,\n grouping,\n viewMode,\n selectedId,\n onCardClick,\n onPanStart,\n appRef,\n cardColorsRef,\n groupsContainerRef,\n isViewTransitionRef,\n needsRenderRef,\n onCardClickRef,\n onPanStartRef,\n parentContainerRef,\n prevScrollLeftRef,\n prevScrollTopRef,\n rootRef,\n spritesRef,\n transitionLayoutRef,\n transitionSeenIdsRef,\n ]);\n};\n"],"names":["createCardSpriteExternal","updateCardContentExternal"],"mappings":";;;;;AAkBO,MAAM,kBAAkB,GAAG,CAAuB,EACrD,KAAK,EACL,KAAK,EACL,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,GACW,KAAI;AAC5B,IAAA,MAAM,EACF,KAAK,EACL,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,cAAc,EACd,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EAAE,kBAAkB,GACnC,GAAG,KAAK;AACT,IAAA,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,GAChF,KAAK;AACT,IAAA,MAAM,EACF,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,GACpB,GAAG,UAAU;IAMd,SAAS,CAAC,MAAK;AACX,QAAA,IACI,CAAC,SAAS;AACV,YAAA,CAAC,kBAAkB;YACnB,CA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AkB;QAClB,iBAAiB;QACjB,gBAAgB;QAChB,OAAO;QACP,UAAU;QACV,mBAAmB;QACnB,oBAAoB;AACvB,KAAA,CAAC;AACN;;"}
@@ -0,0 +1,7 @@
1
+ import type { PivotRenderContext } from './PivotRenderContext.js';
2
+ /**
3
+ * Redraws the cards when the selection changes and the group highlight when the hovered group changes.
4
+ * @param context The props, stage and colors.
5
+ */
6
+ export declare const usePivotSelectionHighlight: <TItem extends object>({ props, stage, cardColorsRef, }: PivotRenderContext<TItem>) => void;
7
+ //# sourceMappingURL=usePivotSelectionHighlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePivotSelectionHighlight.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/usePivotSelectionHighlight.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAsB,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAI,KAAK,SAAS,MAAM,oCAI5D,kBAAkB,CAAC,KAAK,CAAC,SAyD3B,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { useEffect } from 'react';
2
+ import { updateHighlight } from './groups.js';
3
+ import { updateCardContent } from './sprites.js';
4
+
5
+ const usePivotSelectionHighlight = ({ props, stage, cardColorsRef, }) => {
6
+ const { items, layout, grouping, cardWidth, cardHeight, zoomLevel, selectedId, hoveredGroupIndex, cardRenderer, containerRef: parentContainerRef, } = props;
7
+ const { rootRef, groupsContainerRef, spritesRef, appRef, needsRenderRef } = stage;
8
+ useEffect(() => {
9
+ if (!rootRef.current)
10
+ return;
11
+ updateSelection();
12
+ needsRenderRef.current = true;
13
+ appRef.current?.renderer.render(appRef.current.stage);
14
+ }, [selectedId, items, appRef, needsRenderRef, rootRef]);
15
+ useEffect(() => {
16
+ if (!rootRef.current)
17
+ return;
18
+ updateHighlight$1();
19
+ needsRenderRef.current = true;
20
+ appRef.current?.renderer.render(appRef.current.stage);
21
+ }, [hoveredGroupIndex, layout, grouping, appRef, needsRenderRef, rootRef]);
22
+ function updateSelection() {
23
+ const sprites = spritesRef.current;
24
+ for (const sprite of sprites.values()) {
25
+ const val = items[Number(sprite.itemId)];
26
+ updateCardContent(sprite, val, selectedId, cardWidth, cardHeight, cardColorsRef.current, cardRenderer);
27
+ }
28
+ }
29
+ function updateHighlight$1() {
30
+ updateHighlight(groupsContainerRef.current, parentContainerRef.current, grouping, layout, hoveredGroupIndex, cardWidth, zoomLevel);
31
+ }
32
+ };
33
+
34
+ export { usePivotSelectionHighlight };
35
+ //# sourceMappingURL=usePivotSelectionHighlight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePivotSelectionHighlight.js","sources":["../../../../../PivotViewer/components/pivot/usePivotSelectionHighlight.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 { useEffect } from 'react';\nimport { updateHighlight as updateHighlightExternal } from './groups';\nimport { updateCardContent as updateCardContentExternal } from './sprites';\nimport type { PivotRenderContext } from './PivotRenderContext';\n\n/**\n * Redraws the cards when the selection changes and the group highlight when the hovered group changes.\n * @param context The props, stage and colors.\n */\nexport const usePivotSelectionHighlight = <TItem extends object>({\n props,\n stage,\n cardColorsRef,\n}: PivotRenderContext<TItem>) => {\n const {\n items,\n layout,\n grouping,\n cardWidth,\n cardHeight,\n zoomLevel,\n selectedId,\n hoveredGroupIndex,\n cardRenderer,\n containerRef: parentContainerRef,\n } = props;\n const { rootRef, groupsContainerRef, spritesRef, appRef, needsRenderRef } = stage;\n\n useEffect(() => {\n if (!rootRef.current) return;\n updateSelection();\n needsRenderRef.current = true;\n appRef.current?.renderer.render(appRef.current.stage);\n }, [selectedId, items, appRef, needsRenderRef, rootRef]);\n\n useEffect(() => {\n if (!rootRef.current) return;\n updateHighlight();\n needsRenderRef.current = true;\n appRef.current?.renderer.render(appRef.current.stage);\n }, [hoveredGroupIndex, layout, grouping, appRef, needsRenderRef, rootRef]);\n\n function updateSelection() {\n const sprites = spritesRef.current;\n\n for (const sprite of sprites.values()) {\n const val = (items as TItem[])[Number(sprite.itemId)];\n updateCardContentExternal(\n sprite,\n val,\n selectedId,\n cardWidth,\n cardHeight,\n cardColorsRef.current,\n cardRenderer,\n );\n }\n }\n\n function updateHighlight() {\n updateHighlightExternal(\n groupsContainerRef.current,\n parentContainerRef.current,\n grouping,\n layout,\n hoveredGroupIndex,\n cardWidth,\n zoomLevel,\n );\n }\n};\n"],"names":["updateHighlight","updateCardContentExternal","updateHighlightExternal"],"mappings":";;;;AAYO,MAAM,0BAA0B,GAAG,CAAuB,EAC7D,KAAK,EACL,KAAK,EACL,aAAa,GACW,KAAI;IAC5B,MAAM,EACF,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,YAAY,EAAE,kBAAkB,GACnC,GAAG,KAAK;AACT,IAAA,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK;IAEjF,SAAS,CAAC,MAAK;QACX,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE;AACtB,QAAA,eAAe,EAAE;AACjB,QAAA,cAAc,CAAC,OAAO,GAAG,IAAI;AAC7B,QAAA,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;AACzD,IAAA,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAExD,SAAS,CAAC,MAAK;QACX,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE;AACtB,QAAAA,iBAAe,EAAE;AACjB,QAAA,cAAc,CAAC,OAAO,GAAG,IAAI;AAC7B,QAAA,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;AACzD,IAAA,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;AAE1E,IAAA,SAAS,eAAe,GAAA;AACpB,QAAA,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO;QAElC,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE;YACnC,MAAM,GAAG,GAAI,KAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACrD,YAAAC,iBAAyB,CACrB,MAAM,EACN,GAAG,EACH,UAAU,EACV,SAAS,EACT,UAAU,EACV,aAAa,CAAC,OAAO,EACrB,YAAY,CACf;QACL;IACJ;AAEA,IAAA,SAASD,iBAAe,GAAA;AACpB,QAAAE,eAAuB,CACnB,kBAAkB,CAAC,OAAO,EAC1B,kBAAkB,CAAC,OAAO,EAC1B,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,SAAS,CACZ;IACL;AACJ;;"}
@@ -0,0 +1,8 @@
1
+ import type { PivotRenderContext } from './PivotRenderContext.js';
2
+ /**
3
+ * Keeps the card sprites in step with the layout, filter, zoom and pan, starting transitions when the
4
+ * view, grouping or layout changes and running the animation loop.
5
+ * @param context The props, stage, transition state and colors.
6
+ */
7
+ export declare const usePivotSpriteSync: <TItem extends object>({ props, stage, transition, cardColorsRef, colorRevision, onCardClickRef, }: PivotRenderContext<TItem>) => void;
8
+ //# sourceMappingURL=usePivotSpriteSync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePivotSpriteSync.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/usePivotSpriteSync.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAsB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,SAAS,MAAM,+EAOpD,kBAAkB,CAAC,KAAK,CAAC,SAuM3B,CAAC"}