@cratis/components 0.1.15 → 0.1.17

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 (103) hide show
  1. package/dist/cjs/PivotViewer/PivotViewer.css +32 -19
  2. package/dist/cjs/PivotViewer/PivotViewer.js +44 -8
  3. package/dist/cjs/PivotViewer/PivotViewer.js.map +1 -1
  4. package/dist/cjs/PivotViewer/components/PivotCanvas.js +32 -51
  5. package/dist/cjs/PivotViewer/components/PivotCanvas.js.map +1 -1
  6. package/dist/cjs/PivotViewer/components/PivotViewerMain.js +4 -2
  7. package/dist/cjs/PivotViewer/components/PivotViewerMain.js.map +1 -1
  8. package/dist/cjs/PivotViewer/components/Toolbar.js +1 -1
  9. package/dist/cjs/PivotViewer/components/Toolbar.js.map +1 -1
  10. package/dist/cjs/PivotViewer/components/pivot/animation.js +4 -3
  11. package/dist/cjs/PivotViewer/components/pivot/animation.js.map +1 -1
  12. package/dist/cjs/PivotViewer/components/pivot/groups.js +151 -0
  13. package/dist/cjs/PivotViewer/components/pivot/groups.js.map +1 -0
  14. package/dist/cjs/PivotViewer/components/pivot/sprites.js +1 -15
  15. package/dist/cjs/PivotViewer/components/pivot/sprites.js.map +1 -1
  16. package/dist/cjs/PivotViewer/components/pivot/visibility.js +50 -27
  17. package/dist/cjs/PivotViewer/components/pivot/visibility.js.map +1 -1
  18. package/dist/cjs/PivotViewer/engine/layout.js +11 -7
  19. package/dist/cjs/PivotViewer/engine/layout.js.map +1 -1
  20. package/dist/cjs/PivotViewer/hooks/useCurrentFilters.js.map +1 -1
  21. package/dist/cjs/PivotViewer/hooks/usePanning.js +8 -4
  22. package/dist/cjs/PivotViewer/hooks/usePanning.js.map +1 -1
  23. package/dist/cjs/PivotViewer/hooks/usePivotEngine.js +1 -31
  24. package/dist/cjs/PivotViewer/hooks/usePivotEngine.js.map +1 -1
  25. package/dist/cjs/PivotViewer/hooks/useViewModeScrollHandling.js +4 -3
  26. package/dist/cjs/PivotViewer/hooks/useViewModeScrollHandling.js.map +1 -1
  27. package/dist/cjs/PivotViewer/types.js.map +1 -1
  28. package/dist/cjs/PivotViewer/utils/animations.js +11 -19
  29. package/dist/cjs/PivotViewer/utils/animations.js.map +1 -1
  30. package/dist/cjs/PivotViewer/utils/cardPosition.js +0 -3
  31. package/dist/cjs/PivotViewer/utils/cardPosition.js.map +1 -1
  32. package/dist/cjs/PivotViewer/utils/constants.js +2 -2
  33. package/dist/cjs/PivotViewer/utils/constants.js.map +1 -1
  34. package/dist/esm/PivotViewer/PivotViewer.css +32 -19
  35. package/dist/esm/PivotViewer/PivotViewer.d.ts +1 -1
  36. package/dist/esm/PivotViewer/PivotViewer.d.ts.map +1 -1
  37. package/dist/esm/PivotViewer/PivotViewer.js +45 -9
  38. package/dist/esm/PivotViewer/PivotViewer.js.map +1 -1
  39. package/dist/esm/PivotViewer/PivotViewer.stories.d.ts.map +1 -1
  40. package/dist/esm/PivotViewer/PivotViewer.stories.js +5 -2
  41. package/dist/esm/PivotViewer/PivotViewer.stories.js.map +1 -1
  42. package/dist/esm/PivotViewer/components/PivotCanvas.d.ts.map +1 -1
  43. package/dist/esm/PivotViewer/components/PivotCanvas.js +33 -52
  44. package/dist/esm/PivotViewer/components/PivotCanvas.js.map +1 -1
  45. package/dist/esm/PivotViewer/components/PivotViewerMain.d.ts +2 -1
  46. package/dist/esm/PivotViewer/components/PivotViewerMain.d.ts.map +1 -1
  47. package/dist/esm/PivotViewer/components/PivotViewerMain.js +4 -2
  48. package/dist/esm/PivotViewer/components/PivotViewerMain.js.map +1 -1
  49. package/dist/esm/PivotViewer/components/Toolbar.js +1 -1
  50. package/dist/esm/PivotViewer/components/Toolbar.js.map +1 -1
  51. package/dist/esm/PivotViewer/components/pivot/animation.d.ts.map +1 -1
  52. package/dist/esm/PivotViewer/components/pivot/animation.js +4 -3
  53. package/dist/esm/PivotViewer/components/pivot/animation.js.map +1 -1
  54. package/dist/esm/PivotViewer/components/pivot/groups.d.ts +6 -0
  55. package/dist/esm/PivotViewer/components/pivot/groups.d.ts.map +1 -0
  56. package/dist/esm/PivotViewer/components/pivot/groups.js +129 -0
  57. package/dist/esm/PivotViewer/components/pivot/groups.js.map +1 -0
  58. package/dist/esm/PivotViewer/components/pivot/sprites.d.ts.map +1 -1
  59. package/dist/esm/PivotViewer/components/pivot/sprites.js +2 -15
  60. package/dist/esm/PivotViewer/components/pivot/sprites.js.map +1 -1
  61. package/dist/esm/PivotViewer/components/pivot/visibility.d.ts +4 -0
  62. package/dist/esm/PivotViewer/components/pivot/visibility.d.ts.map +1 -1
  63. package/dist/esm/PivotViewer/components/pivot/visibility.js +50 -27
  64. package/dist/esm/PivotViewer/components/pivot/visibility.js.map +1 -1
  65. package/dist/esm/PivotViewer/engine/layout.js +11 -7
  66. package/dist/esm/PivotViewer/engine/layout.js.map +1 -1
  67. package/dist/esm/PivotViewer/engine/pivot.worker.d.ts.map +1 -1
  68. package/dist/esm/PivotViewer/engine/pivot.worker.js +0 -8
  69. package/dist/esm/PivotViewer/engine/pivot.worker.js.map +1 -1
  70. package/dist/esm/PivotViewer/engine/types.d.ts +1 -0
  71. package/dist/esm/PivotViewer/engine/types.d.ts.map +1 -1
  72. package/dist/esm/PivotViewer/hooks/useCurrentFilters.js.map +1 -1
  73. package/dist/esm/PivotViewer/hooks/useFilteredData.d.ts +1 -1
  74. package/dist/esm/PivotViewer/hooks/useFilteredData.js +4 -4
  75. package/dist/esm/PivotViewer/hooks/useFilteredData.js.map +1 -1
  76. package/dist/esm/PivotViewer/hooks/usePanning.d.ts.map +1 -1
  77. package/dist/esm/PivotViewer/hooks/usePanning.js +8 -4
  78. package/dist/esm/PivotViewer/hooks/usePanning.js.map +1 -1
  79. package/dist/esm/PivotViewer/hooks/usePivotEngine.d.ts.map +1 -1
  80. package/dist/esm/PivotViewer/hooks/usePivotEngine.js +1 -31
  81. package/dist/esm/PivotViewer/hooks/usePivotEngine.js.map +1 -1
  82. package/dist/esm/PivotViewer/hooks/useViewModeScrollHandling.d.ts.map +1 -1
  83. package/dist/esm/PivotViewer/hooks/useViewModeScrollHandling.js +4 -3
  84. package/dist/esm/PivotViewer/hooks/useViewModeScrollHandling.js.map +1 -1
  85. package/dist/esm/PivotViewer/types.d.ts +16 -0
  86. package/dist/esm/PivotViewer/types.d.ts.map +1 -1
  87. package/dist/esm/PivotViewer/types.js.map +1 -1
  88. package/dist/esm/PivotViewer/utils/animations.js +11 -19
  89. package/dist/esm/PivotViewer/utils/animations.js.map +1 -1
  90. package/dist/esm/PivotViewer/utils/cardPosition.js +1 -4
  91. package/dist/esm/PivotViewer/utils/cardPosition.js.map +1 -1
  92. package/dist/esm/PivotViewer/utils/constants.d.ts +4 -4
  93. package/dist/esm/PivotViewer/utils/constants.d.ts.map +1 -1
  94. package/dist/esm/PivotViewer/utils/constants.js +2 -2
  95. package/dist/esm/PivotViewer/utils/constants.js.map +1 -1
  96. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  97. package/package.json +1 -1
  98. package/dist/cjs/PivotViewer/components/pivot/buckets.js +0 -124
  99. package/dist/cjs/PivotViewer/components/pivot/buckets.js.map +0 -1
  100. package/dist/esm/PivotViewer/components/pivot/buckets.d.ts +0 -6
  101. package/dist/esm/PivotViewer/components/pivot/buckets.d.ts.map +0 -1
  102. package/dist/esm/PivotViewer/components/pivot/buckets.js +0 -102
  103. package/dist/esm/PivotViewer/components/pivot/buckets.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groups.js","sources":["../../../../../PivotViewer/components/pivot/groups.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 * as PIXI from 'pixi.js';\nimport type { CardColors } from './constants';\nimport type { GroupingResult, LayoutResult } from '../../engine/types';\n\nexport function updateGroupBackgrounds(\n groupsContainer: PIXI.Container | null,\n container: HTMLDivElement | null,\n grouping: GroupingResult,\n layout: LayoutResult,\n zoomLevel: number,\n cardColors: CardColors,\n viewMode: string,\n) {\n if (!groupsContainer) return;\n\n // keep parameter referenced to avoid unused param lint when callers pass zoomLevel\n void zoomLevel;\n\n if (!container || grouping.groups.length === 0 || viewMode === 'collection') {\n // If we shouldn't show anything, hide all existing backgrounds\n // We keep the highlight if it exists\n for (const child of groupsContainer.children) {\n if ((child as unknown as { name?: string }).name !== 'highlight') {\n child.visible = false;\n }\n }\n return;\n }\n\n // Derive a world-space height that always covers the visible viewport even when zoomed out.\n const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;\n const containerWorldHeight = Math.max(\n (container.scrollHeight || container.clientHeight) * invScale,\n container.clientHeight * invScale,\n );\n const baseWorldHeight = Math.max(layout.totalHeight || 0, containerWorldHeight);\n // Use larger buffer and extend further above the viewport to ensure full coverage\n // when zoomed out and cards are positioned at the bottom\n const bufferWorld = Math.max(500, baseWorldHeight * 0.5, containerWorldHeight);\n const worldHeight = baseWorldHeight + bufferWorld * 3;\n const startY = -bufferWorld * 2;\n\n // Get existing background graphics (excluding highlight)\n const backgroundGraphics = groupsContainer.children.filter(c => (c as unknown as { name?: string }).name !== 'highlight') as PIXI.Graphics[];\n let bgIndex = 0;\n\n // Instead of re-deriving bucket geometry from constants, compute bucket bounds\n // directly from the positions stored in the layout so backgrounds align exactly.\n for (let index = 0; index < grouping.groups.length; index++) {\n const group = grouping.groups[index];\n let minX = Infinity;\n let maxX = -Infinity;\n\n for (let j = 0; j < group.ids.length; j++) {\n const id = group.ids[j];\n const pos = layout.positions.get(id);\n if (pos) {\n minX = Math.min(minX, pos.x);\n maxX = Math.max(maxX, pos.x);\n }\n }\n\n if (minX === Infinity && (!layout.groupXs || layout.groupXs[index] === undefined)) continue;\n\n // Prefer explicit bucket width and position from layout when available\n const bucketWidths = layout.bucketWidths || [];\n const groupXs = layout.groupXs || [];\n const widthFromLayout = bucketWidths[index];\n const xFromLayout = groupXs[index];\n\n const width = widthFromLayout && widthFromLayout > 0 ? widthFromLayout : ((maxX - minX) || 0);\n const x = xFromLayout !== undefined ? xFromLayout : minX;\n\n if (index % 2 === 0 && width > 0) {\n let bg: PIXI.Graphics;\n\n if (bgIndex < backgroundGraphics.length) {\n bg = backgroundGraphics[bgIndex];\n bg.clear();\n } else {\n bg = new PIXI.Graphics();\n // Insert before highlight if it exists, otherwise at end\n const highlightIndex = groupsContainer.children.findIndex(c => (c as unknown as { name?: string }).name === 'highlight');\n if (highlightIndex >= 0) {\n groupsContainer.addChildAt(bg, highlightIndex);\n } else {\n groupsContainer.addChild(bg);\n }\n }\n\n bg.rect(x, startY, width, worldHeight);\n bg.fill(cardColors.base);\n bg.alpha = 0.15;\n bg.visible = true;\n bgIndex++;\n }\n }\n\n // Hide unused background graphics\n for (let i = bgIndex; i < backgroundGraphics.length; i++) {\n backgroundGraphics[i].visible = false;\n }\n}\n\nexport function updateHighlight(\n groupsContainer: PIXI.Container | null,\n container: HTMLDivElement | null,\n grouping: GroupingResult,\n layout: LayoutResult,\n hoveredGroupIndex: number | null,\n cardWidth: number,\n zoomLevel: number,\n) {\n if (!groupsContainer || !container || grouping.groups.length === 0) return;\n\n const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;\n\n let highlight = groupsContainer.children.find(child => (child as unknown as { name?: string }).name === 'highlight') as PIXI.Graphics;\n\n if (!highlight) {\n highlight = new PIXI.Graphics();\n (highlight as unknown as { name: string }).name = 'highlight';\n groupsContainer.addChild(highlight);\n }\n\n highlight.clear();\n\n if (hoveredGroupIndex === null || hoveredGroupIndex < 0) {\n highlight.visible = false;\n return;\n }\n\n const group = grouping.groups[hoveredGroupIndex];\n if (!group || group.ids.length === 0) {\n highlight.visible = false;\n return;\n }\n\n // Use layout info if available\n const bucketWidths = layout.bucketWidths || [];\n const groupXs = layout.groupXs || [];\n const widthFromLayout = bucketWidths[hoveredGroupIndex];\n const xFromLayout = groupXs[hoveredGroupIndex];\n\n let rectX = 0;\n let rectWidth = 0;\n\n if (widthFromLayout !== undefined && xFromLayout !== undefined) {\n rectX = xFromLayout;\n rectWidth = widthFromLayout;\n } else {\n // Fallback: derive from items bounding box\n let minX = Infinity;\n let maxX = -Infinity;\n\n for (let j = 0; j < group.ids.length; j++) {\n const id = group.ids[j];\n const pos = layout.positions.get(id);\n if (pos) {\n minX = Math.min(minX, pos.x);\n maxX = Math.max(maxX, pos.x + cardWidth);\n }\n }\n\n if (minX === Infinity) {\n highlight.visible = false;\n return;\n }\n rectX = minX;\n rectWidth = maxX - minX;\n }\n\n const containerWorldHeight = Math.max(\n (container.scrollHeight || container.clientHeight) * invScale,\n container.clientHeight * invScale,\n );\n const baseWorldHeight = Math.max(layout.totalHeight || 0, containerWorldHeight);\n const bufferWorld = Math.max(200, baseWorldHeight * 0.25);\n const worldHeight = baseWorldHeight + bufferWorld * 2;\n const startY = -bufferWorld;\n\n highlight.rect(rectX, startY, rectWidth, worldHeight);\n highlight.fill(0xffffff);\n highlight.alpha = 0.05;\n highlight.visible = true;\n}\n"],"names":[],"mappings":";;AAOM,SAAU,sBAAsB,CACpC,eAAsC,EACtC,SAAgC,EAChC,QAAwB,EACxB,MAAoB,EACpB,SAAiB,EACjB,UAAsB,EACtB,QAAgB,EAAA;AAEhB,IAAA,IAAI,CAAC,eAAe;QAAE;AAKtB,IAAA,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,KAAK,YAAY,EAAE;AAG3E,QAAA,KAAK,MAAM,KAAK,IAAI,eAAe,CAAC,QAAQ,EAAE;AAC5C,YAAA,IAAK,KAAsC,CAAC,IAAI,KAAK,WAAW,EAAE;AAChE,gBAAA,KAAK,CAAC,OAAO,GAAG,KAAK;YACvB;QACF;QACA;IACF;AAGA,IAAA,MAAM,QAAQ,GAAG,SAAS,IAAI,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,GAAG,CAAC;IACjE,MAAM,oBAAoB,GAAG,IAAI,CAAC,GAAG,CACnC,CAAC,SAAS,CAAC,YAAY,IAA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79,7 @@ function createCardSprite(id, x, y, items, onCardClick, onPanStart, cardWidth, c
79
79
  container.eventMode = 'static';
80
80
  container.cursor = 'pointer';
81
81
  container.position.set(x, y);
82
+ container.hitArea = new PIXI.Rectangle(CARD_GAP / 2, CARD_GAP / 2, cardWidth - CARD_GAP, cardHeight - CARD_GAP);
82
83
  container._eventContext = { items, onCardClick, id };
83
84
  const graphics = new PIXI.Graphics();
84
85
  const actualWidth = cardWidth - CARD_GAP;
@@ -151,20 +152,6 @@ function destroySprite(sprite) {
151
152
  }
152
153
  spritePool.push(sprite);
153
154
  }
154
- function clearSpritePool() {
155
- for (const sprite of spritePool) {
156
- try {
157
- sprite.graphics?.destroy();
158
- sprite.titleText?.destroy();
159
- sprite.labelsText?.destroy();
160
- sprite.valuesText?.destroy();
161
- sprite.container?.destroy();
162
- }
163
- catch (e) {
164
- }
165
- }
166
- spritePool.length = 0;
167
- }
168
155
  function updateCardContent(sprite, item, selectedId, cardWidth, cardHeight, cardColors) {
169
156
  if (!item)
170
157
  return;
@@ -263,5 +250,5 @@ function updateCardContent(sprite, item, selectedId, cardWidth, cardHeight, card
263
250
  }
264
251
  }
265
252
 
266
- export { clearSpritePool, createCardSprite, destroySprite, updateCardContent };
253
+ export { createCardSprite, destroySprite, updateCardContent };
267
254
  //# sourceMappingURL=sprites.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sprites.js","sources":["../../../../../PivotViewer/components/pivot/sprites.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 * as PIXI from 'pixi.js';\nimport { CARD_GAP, CARD_PADDING, CARD_RADIUS } from './constants';\nimport type { CardSprite, CardColors } from './constants';\n\nconst spritePool: CardSprite[] = [];\n\nexport function createCardSprite<TItem extends object>(\n id: number | string,\n x: number,\n y: number,\n items: TItem[],\n onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void,\n onPanStart: (e: MouseEvent) => void,\n cardWidth: number,\n cardHeight: number,\n cardColors: CardColors,\n): CardSprite {\n if (spritePool.length > 0) {\n const sprite = spritePool.pop()!;\n if (sprite.container) {\n sprite.container.visible = true;\n sprite.container.alpha = 1;\n sprite.container.position.set(x, y);\n }\n sprite.itemId = id;\n sprite.targetX = x;\n sprite.targetY = y;\n sprite.currentX = x;\n sprite.currentY = y;\n\n // Reset animation state\n delete sprite.animationStartTime;\n delete sprite.animationDelay;\n delete sprite.startX;\n delete sprite.startY;\n\n // Reset cache\n sprite.lastSelectedId = null;\n sprite.lastCardColors = undefined;\n sprite.lastTitle = undefined;\n sprite.lastLabels = undefined;\n sprite.lastValues = undefined;\n\n // Recreate graphics if it was destroyed\n if (!sprite.graphics || sprite.graphics.destroyed) {\n sprite.graphics = new PIXI.Graphics();\n if (sprite.container) {\n sprite.container.addChildAt(sprite.graphics, 0);\n }\n }\n\n // Recreate text objects if they were destroyed\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n \n if (!sprite.titleText || sprite.titleText.destroyed) {\n sprite.titleText = new PIXI.Text('', {\n fontSize: 13,\n fill: cardColors.text as string | number,\n fontWeight: '600',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n sprite.titleText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING);\n if (sprite.container) {\n sprite.container.addChild(sprite.titleText);\n }\n }\n\n if (!sprite.labelsText || sprite.labelsText.destroyed) {\n sprite.labelsText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.textSecondary as string | number,\n fontWeight: '400',\n lineHeight: 18,\n } as PIXI.TextStyle);\n sprite.labelsText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING + 40);\n if (sprite.container) {\n sprite.container.addChild(sprite.labelsText);\n }\n }\n\n if (!sprite.valuesText || sprite.valuesText.destroyed) {\n sprite.valuesText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.text as string | number,\n fontWeight: '500',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n sprite.valuesText.position.set(offsetX + CARD_PADDING + 65, offsetY + CARD_PADDING + 40);\n if (sprite.container) {\n sprite.container.addChild(sprite.valuesText);\n }\n }\n\n // Update event context\n if (sprite.container) {\n (sprite.container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string } })._eventContext = { items, onCardClick, id };\n }\n\n return sprite;\n }\n\n const container = new PIXI.Container();\n container.eventMode = 'static';\n container.cursor = 'pointer';\n container.position.set(x, y);\n\n // Store context for event handlers\n (container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string } })._eventContext = { items, onCardClick, id };\n\n const graphics = new PIXI.Graphics();\n\n const actualWidth = cardWidth - CARD_GAP;\n const actualHeight = cardHeight - CARD_GAP;\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n\n const gradient = new PIXI.FillGradient(0, offsetY, 0, offsetY + actualHeight);\n gradient.addColorStop(0, cardColors.mid);\n gradient.addColorStop(1, cardColors.base);\n\n graphics.roundRect(offsetX, offsetY, actualWidth, actualHeight, CARD_RADIUS);\n graphics.fill(gradient);\n\n container.addChild(graphics);\n\n const titleText = new PIXI.Text('', {\n fontSize: 13,\n fill: cardColors.text as string | number,\n fontWeight: '600',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n titleText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING);\n container.addChild(titleText);\n\n const labelsText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.textSecondary as string | number,\n fontWeight: '400',\n lineHeight: 18,\n } as PIXI.TextStyle);\n labelsText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING + 40);\n container.addChild(labelsText);\n\n const valuesText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.text as string | number,\n fontWeight: '500',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n valuesText.position.set(offsetX + CARD_PADDING + 65, offsetY + CARD_PADDING + 40);\n container.addChild(valuesText);\n\n container.on('click', (e: PIXI.FederatedPointerEvent) => {\n e.stopPropagation();\n const ctx = (container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string } })._eventContext;\n const itemsArray = ctx.items;\n const item = itemsArray[Number(ctx.id)];\n if (item) {\n ctx.onCardClick(item, e.nativeEvent as MouseEvent, ctx.id);\n }\n });\n\n container.on('pointerdown', (e: PIXI.FederatedPointerEvent) => {\n e.stopPropagation();\n // onPanStart(e.nativeEvent as MouseEvent);\n });\n\n return {\n container,\n graphics,\n titleText,\n labelsText,\n valuesText,\n itemId: id,\n targetX: x,\n targetY: y,\n currentX: x,\n currentY: y,\n };\n}\n\nexport function destroySprite(sprite: CardSprite) {\n if (sprite.container && sprite.container.parent) {\n sprite.container.parent.removeChild(sprite.container);\n }\n // Reset visibility to ensure it doesn't ghost if something goes wrong\n if (sprite.container) {\n sprite.container.visible = false;\n }\n spritePool.push(sprite);\n}\n\nexport function clearSpritePool() {\n for (const sprite of spritePool) {\n try {\n sprite.graphics?.destroy();\n sprite.titleText?.destroy();\n sprite.labelsText?.destroy();\n sprite.valuesText?.destroy();\n sprite.container?.destroy();\n } catch (e) {\n void e;\n }\n }\n spritePool.length = 0;\n}\n\n// Updated: Text objects now recreated when recycling pooled sprites\nexport function updateCardContent<TItem extends object>(\n sprite: CardSprite,\n item: TItem,\n selectedId: string | number | null,\n cardWidth: number,\n cardHeight: number,\n cardColors: CardColors,\n) {\n if (!item) return;\n\n const event = item as unknown as Record<string, unknown>;\n const eventType = String(event.type || event.name || event.title || 'Event');\n\n const timeStr = event.occurred ? new Date(event.occurred as string | number | Date).toLocaleString('en-US', {\n month: '2-digit',\n day: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n hour12: false\n }).replace(',', '') : '';\n\n const correlation = event.correlationId || event.correlation || '';\n const correlationShort = correlation ? String(correlation).substring(0, 12) + '...' : '';\n\n const maxTitleLength = 20;\n const titleDisplay = eventType.length > maxTitleLength\n ? eventType.substring(0, maxTitleLength) + '...'\n : eventType;\n\n const maxTypeLength = 16;\n const typeDisplay = eventType.length > maxTypeLength\n ? eventType.substring(0, maxTypeLength) + '...'\n : eventType;\n\n const colors = cardColors;\n const labelsText = 'Type\\nOccurred\\nCorrelation';\n const valuesText = `${typeDisplay}\\n${timeStr}\\n${correlationShort}`;\n const colorsChanged = sprite.lastCardColors !== colors;\n\n // Ensure text objects exist before using them\n if (!sprite.titleText || sprite.titleText.destroyed) return;\n if (!sprite.labelsText || sprite.labelsText.destroyed) return;\n if (!sprite.valuesText || sprite.valuesText.destroyed) return;\n\n if (sprite.lastTitle !== titleDisplay) {\n sprite.titleText.text = titleDisplay;\n sprite.lastTitle = titleDisplay;\n }\n\n if (sprite.lastLabels !== labelsText) {\n sprite.labelsText.text = labelsText;\n sprite.lastLabels = labelsText;\n }\n\n if (colorsChanged && sprite.labelsText.style) {\n (sprite.labelsText.style as unknown as { fill: string | number }).fill = colors.textSecondary;\n }\n\n if (sprite.lastValues !== valuesText) {\n sprite.valuesText.text = valuesText;\n sprite.lastValues = valuesText;\n }\n\n if (colorsChanged && sprite.valuesText.style) {\n (sprite.valuesText.style as unknown as { fill: string | number }).fill = colors.text;\n }\n\n sprite.titleText.visible = true;\n sprite.labelsText.visible = true;\n sprite.valuesText.visible = true;\n\n const isSelected = sprite.itemId === selectedId;\n\n // Only redraw graphics if selection state or colors changed\n if (sprite.lastSelectedId === selectedId && !colorsChanged && sprite.graphics) {\n return;\n }\n\n sprite.lastSelectedId = selectedId;\n sprite.lastCardColors = cardColors;\n\n // Ensure graphics exists before attempting to use it\n if (!sprite.graphics || sprite.graphics.destroyed) {\n sprite.graphics = new PIXI.Graphics();\n if (sprite.container) {\n sprite.container.addChildAt(sprite.graphics, 0);\n }\n } else {\n sprite.graphics.clear();\n }\n\n const actualWidth = cardWidth - CARD_GAP;\n const actualHeight = cardHeight - CARD_GAP;\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n\n const gradient = new PIXI.FillGradient(0, offsetY, 0, offsetY + actualHeight);\n if (isSelected) {\n gradient.addColorStop(0, colors.gradient);\n gradient.addColorStop(1, colors.mid);\n } else {\n gradient.addColorStop(0, colors.mid);\n gradient.addColorStop(1, colors.base);\n }\n\n sprite.graphics.roundRect(offsetX, offsetY, actualWidth, actualHeight, CARD_RADIUS);\n \n // Ensure graphics is still valid before filling\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.fill(gradient);\n }\n\n if (isSelected) {\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.stroke({ width: 2, color: colors.border });\n }\n } else {\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.stroke({ width: 1, color: colors.border, alpha: 0.35 });\n }\n }\n}\n"],"names":[],"mappings":";;;AAOA,MAAM,UAAU,GAAiB,EAAE;SAEnB,gBAAgB,CAC9B,EAAmB,EACnB,CAAS,EACT,CAAS,EACT,KAAc,EACd,WAAsE,EACtE,UAAmC,EACnC,SAAiB,EACjB,UAAkB,EAClB,UAAsB,EAAA;AAEtB,IAAA,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;AACzB,QAAA,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,EAAG;AAChC,QAAA,IAAI,MAAM,CAAC,SAAS,EAAE;AACpB,YAAA,MAAM,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI;AAC/B,YAAA,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC;YAC1B,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACrC;AACA,QAAA,MAAM,CAAC,MAAM,GAAG,EAAE;AAClB,QAAA,MAAM,CAAC,OAAO,GAAG,CAAC;AAClB,QAAA,MAAM,CAAC,OAAO,GAAG,CAAC;AAClB,QAAA,MAAM,CAAC,QAAQ,GAAG,CAAC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ACd,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;QACzC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC;IACtC;SAAO;QACL,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC;QACpC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC;IACvC;AAEA,IAAA,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC;IAGnF,IAAI,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE;AACjD,QAAA,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;IAChC;IAEA,IAAI,UAAU,EAAE;QACd,IAAI,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE;AACjD,YAAA,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;QAC5D;IACF;SAAO;QACL,IAAI,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE;YACjD,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzE;IACF;AACF;;;;"}
1
+ {"version":3,"file":"sprites.js","sources":["../../../../../PivotViewer/components/pivot/sprites.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 * as PIXI from 'pixi.js';\nimport { CARD_GAP, CARD_PADDING, CARD_RADIUS } from './constants';\nimport type { CardSprite, CardColors } from './constants';\n\nconst spritePool: CardSprite[] = [];\n\nexport function createCardSprite<TItem extends object>(\n id: number | string,\n x: number,\n y: number,\n items: TItem[],\n onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void,\n onPanStart: (e: MouseEvent) => void,\n cardWidth: number,\n cardHeight: number,\n cardColors: CardColors,\n): CardSprite {\n if (spritePool.length > 0) {\n const sprite = spritePool.pop()!;\n if (sprite.container) {\n sprite.container.visible = true;\n sprite.container.alpha = 1;\n sprite.container.position.set(x, y);\n }\n sprite.itemId = id;\n sprite.targetX = x;\n sprite.targetY = y;\n sprite.currentX = x;\n sprite.currentY = y;\n\n // Reset animation state\n delete sprite.animationStartTime;\n delete sprite.animationDelay;\n delete sprite.startX;\n delete sprite.startY;\n\n // Reset cache\n sprite.lastSelectedId = null;\n sprite.lastCardColors = undefined;\n sprite.lastTitle = undefined;\n sprite.lastLabels = undefined;\n sprite.lastValues = undefined;\n\n // Recreate graphics if it was destroyed\n if (!sprite.graphics || sprite.graphics.destroyed) {\n sprite.graphics = new PIXI.Graphics();\n if (sprite.container) {\n sprite.container.addChildAt(sprite.graphics, 0);\n }\n }\n\n // Recreate text objects if they were destroyed\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n \n if (!sprite.titleText || sprite.titleText.destroyed) {\n sprite.titleText = new PIXI.Text('', {\n fontSize: 13,\n fill: cardColors.text as string | number,\n fontWeight: '600',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n sprite.titleText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING);\n if (sprite.container) {\n sprite.container.addChild(sprite.titleText);\n }\n }\n\n if (!sprite.labelsText || sprite.labelsText.destroyed) {\n sprite.labelsText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.textSecondary as string | number,\n fontWeight: '400',\n lineHeight: 18,\n } as PIXI.TextStyle);\n sprite.labelsText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING + 40);\n if (sprite.container) {\n sprite.container.addChild(sprite.labelsText);\n }\n }\n\n if (!sprite.valuesText || sprite.valuesText.destroyed) {\n sprite.valuesText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.text as string | number,\n fontWeight: '500',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n sprite.valuesText.position.set(offsetX + CARD_PADDING + 65, offsetY + CARD_PADDING + 40);\n if (sprite.container) {\n sprite.container.addChild(sprite.valuesText);\n }\n }\n\n // Update event context\n if (sprite.container) {\n (sprite.container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string } })._eventContext = { items, onCardClick, id };\n }\n\n return sprite;\n }\n\n const container = new PIXI.Container();\n container.eventMode = 'static';\n container.cursor = 'pointer';\n container.position.set(x, y);\n\n // Define hit area to match the visible card size (excluding gaps)\n // This ensures the entire card is clickable and avoids issues with text blocking hits\n container.hitArea = new PIXI.Rectangle(\n CARD_GAP / 2,\n CARD_GAP / 2,\n cardWidth - CARD_GAP,\n cardHeight - CARD_GAP\n );\n\n // Store context for event handlers\n (container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string } })._eventContext = { items, onCardClick, id };\n\n const graphics = new PIXI.Graphics();\n\n const actualWidth = cardWidth - CARD_GAP;\n const actualHeight = cardHeight - CARD_GAP;\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n\n const gradient = new PIXI.FillGradient(0, offsetY, 0, offsetY + actualHeight);\n gradient.addColorStop(0, cardColors.mid);\n gradient.addColorStop(1, cardColors.base);\n\n graphics.roundRect(offsetX, offsetY, actualWidth, actualHeight, CARD_RADIUS);\n graphics.fill(gradient);\n\n container.addChild(graphics);\n\n const titleText = new PIXI.Text('', {\n fontSize: 13,\n fill: cardColors.text as string | number,\n fontWeight: '600',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n titleText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING);\n container.addChild(titleText);\n\n const labelsText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.textSecondary as string | number,\n fontWeight: '400',\n lineHeight: 18,\n } as PIXI.TextStyle);\n labelsText.position.set(offsetX + CARD_PADDING, offsetY + CARD_PADDING + 40);\n container.addChild(labelsText);\n\n const valuesText = new PIXI.Text('', {\n fontSize: 11,\n fill: cardColors.text as string | number,\n fontWeight: '500',\n lineHeight: 18,\n wordWrap: false,\n } as PIXI.TextStyle);\n valuesText.position.set(offsetX + CARD_PADDING + 65, offsetY + CARD_PADDING + 40);\n container.addChild(valuesText);\n\n container.on('click', (e: PIXI.FederatedPointerEvent) => {\n e.stopPropagation();\n const ctx = (container as unknown as { _eventContext: { items: TItem[]; onCardClick: (item: TItem, e: MouseEvent, id: number | string) => void; id: number | string } })._eventContext;\n const itemsArray = ctx.items;\n const item = itemsArray[Number(ctx.id)];\n if (item) {\n ctx.onCardClick(item, e.nativeEvent as MouseEvent, ctx.id);\n }\n });\n\n container.on('pointerdown', (e: PIXI.FederatedPointerEvent) => {\n e.stopPropagation();\n // onPanStart(e.nativeEvent as MouseEvent);\n });\n\n return {\n container,\n graphics,\n titleText,\n labelsText,\n valuesText,\n itemId: id,\n targetX: x,\n targetY: y,\n currentX: x,\n currentY: y,\n };\n}\n\nexport function destroySprite(sprite: CardSprite) {\n if (sprite.container && sprite.container.parent) {\n sprite.container.parent.removeChild(sprite.container);\n }\n // Reset visibility to ensure it doesn't ghost if something goes wrong\n if (sprite.container) {\n sprite.container.visible = false;\n }\n spritePool.push(sprite);\n}\n\nexport function clearSpritePool() {\n for (const sprite of spritePool) {\n try {\n sprite.graphics?.destroy();\n sprite.titleText?.destroy();\n sprite.labelsText?.destroy();\n sprite.valuesText?.destroy();\n sprite.container?.destroy();\n } catch (e) {\n void e;\n }\n }\n spritePool.length = 0;\n}\n\n// Updated: Text objects now recreated when recycling pooled sprites\nexport function updateCardContent<TItem extends object>(\n sprite: CardSprite,\n item: TItem,\n selectedId: string | number | null,\n cardWidth: number,\n cardHeight: number,\n cardColors: CardColors,\n) {\n if (!item) return;\n\n const event = item as unknown as Record<string, unknown>;\n const eventType = String(event.type || event.name || event.title || 'Event');\n\n const timeStr = event.occurred ? new Date(event.occurred as string | number | Date).toLocaleString('en-US', {\n month: '2-digit',\n day: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n hour12: false\n }).replace(',', '') : '';\n\n const correlation = event.correlationId || event.correlation || '';\n const correlationShort = correlation ? String(correlation).substring(0, 12) + '...' : '';\n\n const maxTitleLength = 20;\n const titleDisplay = eventType.length > maxTitleLength\n ? eventType.substring(0, maxTitleLength) + '...'\n : eventType;\n\n const maxTypeLength = 16;\n const typeDisplay = eventType.length > maxTypeLength\n ? eventType.substring(0, maxTypeLength) + '...'\n : eventType;\n\n const colors = cardColors;\n const labelsText = 'Type\\nOccurred\\nCorrelation';\n const valuesText = `${typeDisplay}\\n${timeStr}\\n${correlationShort}`;\n const colorsChanged = sprite.lastCardColors !== colors;\n\n // Ensure text objects exist before using them\n if (!sprite.titleText || sprite.titleText.destroyed) return;\n if (!sprite.labelsText || sprite.labelsText.destroyed) return;\n if (!sprite.valuesText || sprite.valuesText.destroyed) return;\n\n if (sprite.lastTitle !== titleDisplay) {\n sprite.titleText.text = titleDisplay;\n sprite.lastTitle = titleDisplay;\n }\n\n if (sprite.lastLabels !== labelsText) {\n sprite.labelsText.text = labelsText;\n sprite.lastLabels = labelsText;\n }\n\n if (colorsChanged && sprite.labelsText.style) {\n (sprite.labelsText.style as unknown as { fill: string | number }).fill = colors.textSecondary;\n }\n\n if (sprite.lastValues !== valuesText) {\n sprite.valuesText.text = valuesText;\n sprite.lastValues = valuesText;\n }\n\n if (colorsChanged && sprite.valuesText.style) {\n (sprite.valuesText.style as unknown as { fill: string | number }).fill = colors.text;\n }\n\n sprite.titleText.visible = true;\n sprite.labelsText.visible = true;\n sprite.valuesText.visible = true;\n\n const isSelected = sprite.itemId === selectedId;\n\n // Only redraw graphics if selection state or colors changed\n if (sprite.lastSelectedId === selectedId && !colorsChanged && sprite.graphics) {\n return;\n }\n\n sprite.lastSelectedId = selectedId;\n sprite.lastCardColors = cardColors;\n\n // Ensure graphics exists before attempting to use it\n if (!sprite.graphics || sprite.graphics.destroyed) {\n sprite.graphics = new PIXI.Graphics();\n if (sprite.container) {\n sprite.container.addChildAt(sprite.graphics, 0);\n }\n } else {\n sprite.graphics.clear();\n }\n\n const actualWidth = cardWidth - CARD_GAP;\n const actualHeight = cardHeight - CARD_GAP;\n const offsetX = CARD_GAP / 2;\n const offsetY = CARD_GAP / 2;\n\n const gradient = new PIXI.FillGradient(0, offsetY, 0, offsetY + actualHeight);\n if (isSelected) {\n gradient.addColorStop(0, colors.gradient);\n gradient.addColorStop(1, colors.mid);\n } else {\n gradient.addColorStop(0, colors.mid);\n gradient.addColorStop(1, colors.base);\n }\n\n sprite.graphics.roundRect(offsetX, offsetY, actualWidth, actualHeight, CARD_RADIUS);\n \n // Ensure graphics is still valid before filling\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.fill(gradient);\n }\n\n if (isSelected) {\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.stroke({ width: 2, color: colors.border });\n }\n } else {\n if (sprite.graphics && !sprite.graphics.destroyed) {\n sprite.graphics.stroke({ width: 1, color: colors.border, alpha: 0.35 });\n }\n }\n}\n"],"names":[],"mappings":";;;AAOA,MAAM,UAAU,GAAiB,EAAE;SAEnB,gBAAgB,CAC9B,EAAmB,EACnB,CAAS,EACT,CAAS,EACT,KAAc,EACd,WAAsE,EACtE,UAAmC,EACnC,SAAiB,EACjB,UAAkB,EAClB,UAAsB,EAAA;AAEtB,IAAA,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;AACzB,QAAA,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,EAAG;AAChC,QAAA,IAAI,MAAM,CAAC,SAAS,EAAE;AACpB,Y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container | null;
6
+ groupsContainer?: PIXI.Container | null;
6
7
  container: HTMLDivElement | null;
7
8
  sprites: Map<string | number, CardSprite>;
8
9
  layout: LayoutResult;
@@ -20,7 +21,10 @@ export interface SyncParams<TItem> {
20
21
  createCardSprite: (id: string | number, x: number, y: number) => CardSprite;
21
22
  updateCardContent: (sprite: CardSprite, item: TItem) => void;
22
23
  isViewTransition?: boolean;
24
+ viewMode: string;
23
25
  prevLayout?: LayoutResult | null;
26
+ prevScrollTop?: number;
27
+ prevScrollLeft?: number;
24
28
  }
25
29
  export declare function syncSpritesToViewport<TItem>(params: SyncParams<TItem>): void;
26
30
  //# sourceMappingURL=visibility.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../../../PivotViewer/components/pivot/visibility.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,MAAM,WAAW,UAAU,CAAC,KAAK;IAC7B,IAAI,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,cAAc,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,UAAU,CAAC,CAAC;IAC1C,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,WAAW,CAAC;IACxB,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,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AAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,UAAU,CAAC;IAC5E,iBAAiB,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IAC7D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,QAqXrE"}
@@ -2,17 +2,26 @@ import { CARD_GAP } from './constants.js';
2
2
  import { destroySprite } from './sprites.js';
3
3
 
4
4
  function syncSpritesToViewport(params) {
5
- const { root, container, sprites, layout, visibleIds, items, cardWidth, cardHeight, panX, panY, panDeltaX, panDeltaY, viewportWidth, viewportHeight, createCardSprite, updateCardContent, zoomLevel, isViewTransition, prevLayout } = params;
5
+ const { root, groupsContainer, container, sprites, layout, visibleIds: _visibleIds, items, cardWidth, cardHeight, panX, panY, panDeltaX, panDeltaY, viewportWidth, viewportHeight, createCardSprite, updateCardContent, zoomLevel, isViewTransition, viewMode, prevLayout, prevScrollTop, prevScrollLeft } = params;
6
6
  if (!root || !container)
7
7
  return;
8
- console.log('[syncSpritesToViewport] Called with', {
9
- layoutPositionsSize: layout.positions.size,
10
- visibleIdsSize: visibleIds.length,
11
- spritesSize: sprites.size,
12
- itemsLength: items.length,
13
- isViewTransition,
14
- zoomLevel
15
- });
8
+ const viewportPxWidth = container.clientWidth || viewportWidth;
9
+ const viewportPxHeight = container.clientHeight || viewportHeight;
10
+ const contentHeightPx = (layout.totalHeight || 0) * zoomLevel;
11
+ let offsetY = 0;
12
+ if (viewMode === 'grouped' && contentHeightPx < viewportPxHeight) {
13
+ offsetY = viewportPxHeight - contentHeightPx;
14
+ }
15
+ const actualScrollX = typeof container.scrollLeft === 'number' ? container.scrollLeft : (panX || 0);
16
+ const actualScrollY = typeof container.scrollTop === 'number' ? container.scrollTop : (panY || 0);
17
+ if (root) {
18
+ root.scale.set(zoomLevel);
19
+ root.position.set(-actualScrollX, offsetY - actualScrollY);
20
+ }
21
+ if (groupsContainer) {
22
+ groupsContainer.scale.set(zoomLevel);
23
+ groupsContainer.position.set(-actualScrollX, offsetY - actualScrollY);
24
+ }
16
25
  if (isViewTransition && (panDeltaX || panDeltaY)) {
17
26
  const dx = (panDeltaX || 0) / (zoomLevel || 1);
18
27
  const dy = (panDeltaY || 0) / (zoomLevel || 1);
@@ -33,10 +42,9 @@ function syncSpritesToViewport(params) {
33
42
  const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;
34
43
  const effectivePanX = typeof container.scrollLeft === 'number' ? container.scrollLeft : (panX || 0);
35
44
  const effectivePanY = typeof container.scrollTop === 'number' ? container.scrollTop : (panY || 0);
45
+ const effectivePanYWithOffset = effectivePanY - offsetY;
36
46
  const panWorldX = effectivePanX * invScale;
37
- const panWorldY = effectivePanY * invScale;
38
- const viewportPxWidth = container.clientWidth || viewportWidth;
39
- const viewportPxHeight = container.clientHeight || viewportHeight;
47
+ const panWorldY = effectivePanYWithOffset * invScale;
40
48
  const viewportWorldWidth = viewportPxWidth * invScale;
41
49
  const viewportWorldHeight = viewportPxHeight * invScale;
42
50
  const bufferWorld = Math.max(baseBufferWorld * invScale, Math.max(viewportWorldWidth, viewportWorldHeight) * 2.0, baseBufferWorld);
@@ -61,6 +69,16 @@ function syncSpritesToViewport(params) {
61
69
  visibleSet.add(id);
62
70
  }
63
71
  }
72
+ if (isViewTransition && inViewportIds.length === 0 && layout.positions.size > 0) {
73
+ let count = 0;
74
+ for (const [id, position] of layout.positions) {
75
+ if (count < 5 && position) {
76
+ inViewportIds.push(id);
77
+ visibleSet.add(id);
78
+ count++;
79
+ }
80
+ }
81
+ }
64
82
  try {
65
83
  const slotHeight = cardHeight + (CARD_GAP || 8);
66
84
  const totalRows = Math.ceil((layout.totalHeight || 0) / slotHeight) || 0;
@@ -79,9 +97,26 @@ function syncSpritesToViewport(params) {
79
97
  }
80
98
  catch (e) {
81
99
  }
82
- const scrollStabilized = Math.abs(panWorldY - (container.scrollTop * invScale)) < 10;
83
- const aggressiveCull = (!isViewTransition && sprites.size > Math.max(120, Math.ceil(inViewportIds.length * 1.5))) ||
84
- (isViewTransition && !scrollStabilized);
100
+ let injectedFallback = false;
101
+ const fallbackCount = isViewTransition ? 30 : 12;
102
+ if (inViewportIds.length === 0 && layout.positions.size > 0) {
103
+ injectedFallback = true;
104
+ let count = 0;
105
+ for (const [id] of layout.positions) {
106
+ inViewportIds.push(id);
107
+ visibleSet.add(id);
108
+ count++;
109
+ if (count >= fallbackCount)
110
+ break;
111
+ }
112
+ }
113
+ const currentScrollTop = container.scrollTop || 0;
114
+ const currentScrollLeft = container.scrollLeft || 0;
115
+ const scrollTopDelta = Math.abs(currentScrollTop - (prevScrollTop || currentScrollTop));
116
+ const scrollLeftDelta = Math.abs(currentScrollLeft - (prevScrollLeft || currentScrollLeft));
117
+ const scrollStabilized = scrollTopDelta < 10 && scrollLeftDelta < 10;
118
+ const aggressiveCull = !injectedFallback && ((!isViewTransition && sprites.size > Math.max(120, Math.ceil(inViewportIds.length * 1.5))) ||
119
+ (isViewTransition && !scrollStabilized));
85
120
  for (const [id, sprite] of sprites) {
86
121
  if (!visibleSet.has(id)) {
87
122
  if (isViewTransition && layout.positions.has(id)) {
@@ -163,22 +198,17 @@ function syncSpritesToViewport(params) {
163
198
  }
164
199
  const MAX_SPRITES_PER_FRAME = 50;
165
200
  let createdCount = 0;
166
- console.log('[syncSpritesToViewport] About to create sprites for inViewportIds:', inViewportIds.length);
167
- console.log('[syncSpritesToViewport] layout.positions IDs:', Array.from(layout.positions.keys()));
168
201
  for (const id of inViewportIds) {
169
202
  const position = layout.positions.get(id);
170
203
  if (!position) {
171
- console.log('[syncSpritesToViewport] No position for id:', id, 'in layout.positions');
172
204
  continue;
173
205
  }
174
206
  let sprite = sprites.get(id);
175
207
  if (!sprite) {
176
208
  if (createdCount >= MAX_SPRITES_PER_FRAME) {
177
- console.log('[syncSpritesToViewport] Max sprites per frame reached');
178
209
  continue;
179
210
  }
180
211
  createdCount++;
181
- console.log('[syncSpritesToViewport] Creating sprite for id:', id, 'at position:', position);
182
212
  let startX = position.x;
183
213
  let startY = position.y;
184
214
  let shouldAnimate = false;
@@ -214,10 +244,6 @@ function syncSpritesToViewport(params) {
214
244
  }
215
245
  }
216
246
  if (sprite.targetX !== position.x || sprite.targetY !== position.y) {
217
- console.log('[syncSpritesToViewport] Updating sprite target position for id:', id, 'from', {
218
- oldX: sprite.targetX,
219
- oldY: sprite.targetY
220
- }, 'to', position);
221
247
  if (isViewTransition) {
222
248
  sprite.startX = sprite.currentX;
223
249
  sprite.startY = sprite.currentY;
@@ -233,9 +259,6 @@ function syncSpritesToViewport(params) {
233
259
  delete sprite.animationDelay;
234
260
  }
235
261
  }
236
- else {
237
- console.log('[syncSpritesToViewport] Sprite position unchanged for id:', id, 'at', position);
238
- }
239
262
  const item = items[Number(id)];
240
263
  if (item) {
241
264
  updateCardContent(sprite, item);
@@ -1 +1 @@
1
- {"version":3,"file":"visibility.js","sources":["../../../../../PivotViewer/components/pivot/visibility.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 * as PIXI from 'pixi.js';\nimport type { CardSprite } from './constants';\nimport { CARD_GAP } from './constants';\nimport type { LayoutResult } from '../../engine/types';\nimport { destroySprite } from './sprites';\n\nexport interface SyncParams<TItem> {\n root: PIXI.Container | null;\n container: HTMLDivElement | null;\n sprites: Map<string | number, CardSprite>;\n layout: LayoutResult;\n visibleIds: Uint32Array;\n items: TItem[];\n cardWidth: number;\n cardHeight: number;\n panX: number;\n panY: number;\n panDeltaX?: number;\n panDeltaY?: number;\n viewportWidth: number;\n viewportHeight: number;\n zoomLevel: number;\n createCardSprite: (id: string | number, x: number, y: number) => CardSprite;\n updateCardContent: (sprite: CardSprite, item: TItem) => void;\n isViewTransition?: boolean;\n prevLayout?: LayoutResult | null;\n}\n\nexport function syncSpritesToViewport<TItem>(params: SyncParams<TItem>) {\n const { root, container, sprites, layout, visibleIds, items, cardWidth, cardHeight, panX, panY, panDeltaX, panDeltaY, viewportWidth, viewportHeight, createCardSprite, updateCardContent, zoomLevel, isViewTransition, prevLayout } = params;\n if (!root || !container) return;\n\n console.log('[syncSpritesToViewport] Called with', {\n layoutPositionsSize: layout.positions.size,\n visibleIdsSize: visibleIds.length,\n spritesSize: sprites.size,\n itemsLength: items.length,\n isViewTransition,\n zoomLevel\n });\n\n // `visibleIds` comes from callers but this module iterates `layout.positions`.\n // Keep a reference to avoid unused variable lint errors when callers include it.\n void visibleIds;\n\n // Apply pan delta to animating sprites to keep them visually stable during camera jumps\n if (isViewTransition && (panDeltaX || panDeltaY)) {\n const dx = (panDeltaX || 0) / (zoomLevel || 1);\n const dy = (panDeltaY || 0) / (zoomLevel || 1);\n\n for (const sprite of sprites.values()) {\n if (sprite.animationStartTime !== undefined) {\n if (sprite.startX !== undefined) sprite.startX += dx;\n if (sprite.startY !== undefined) sprite.startY += dy;\n sprite.currentX += dx;\n sprite.currentY += dy;\n sprite.container?.position?.set(sprite.currentX, sprite.currentY);\n }\n }\n }\n\n const visibleSet = new Set<string | number>();\n\n // Increase buffer (in world units) to reduce edge cases where rapid\n // scrolling skips sprite creation. Keep buffer in world units and convert\n // DOM pixel measurements into world coordinates below to avoid mixing\n // coordinate spaces which can cause precision drift at browser zooms.\n const baseBufferWorld = Math.max(cardWidth, cardHeight) * 4;\n // Ensure buffer scales with viewport size (in world units) so that when\n // zoomed out we still pre-create enough sprites ahead of the viewport.\n const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;\n // The layout positions are in world units; when the root container is scaled\n // (zoomed) the rendered pixel position = position * zoomLevel. The DOM\n // scroll positions (`container.scrollLeft/Top`) are the authoritative pixel\n // camera offsets; prefer them over the passed `panX/panY` to avoid stale\n // values or race conditions between React state and direct DOM updates.\n const effectivePanX = typeof container.scrollLeft === 'number' ? container.scrollLeft : (panX || 0);\n const effectivePanY = typeof container.scrollTop === 'number' ? container.scrollTop : (panY || 0);\n\n // Convert pixel-based DOM measurements into world units so we compare like\n // with like. root.position is set using -pixels, so the mapping\n // from DOM scroll (pixels) to world units is: world = pixels / zoomLevel.\n const panWorldX = effectivePanX * invScale;\n const panWorldY = effectivePanY * invScale;\n\n // Use the container's measured client size for the viewport dimensions\n // (in pixels). The passed `viewportWidth`/`viewportHeight` can be stale\n // when the browser/device zoom changes; `clientWidth/clientHeight` are\n // authoritative for the actual visible pixel area.\n const viewportPxWidth = container.clientWidth || viewportWidth;\n const viewportPxHeight = container.clientHeight || viewportHeight;\n\n const viewportWorldWidth = viewportPxWidth * invScale;\n const viewportWorldHeight = viewportPxHeight * invScale;\n\n // Ensure bufferWorld is calculated from the actual measured viewport\n // in world units (after converting client pixel dims using invScale).\n // Make buffer adaptive to zoom: when zoomed out (invScale > 1) a small\n // pixel scroll maps to a larger world delta, so increase the buffer.\n // Use the larger of width/height to ensure we buffer enough in both directions.\n const bufferWorld = Math.max(baseBufferWorld * invScale, Math.max(viewportWorldWidth, viewportWorldHeight) * 2.0, baseBufferWorld);\n\n // Do not clamp viewport edges to 0 — allow negative top/left values so the\n // visible window correctly follows the scroll even when the buffer is\n // larger than the current scroll offset.\n const viewportLeftWorld = panWorldX - bufferWorld;\n const viewportRightWorld = panWorldX + viewportWorldWidth + bufferWorld;\n const viewportTopWorld = panWorldY - bufferWorld;\n const viewportBottomWorld = panWorldY + viewportWorldHeight + bufferWorld;\n\n const inViewportIds: (string | number)[] = [];\n // Small tolerance in world units to avoid floating-point edge cases when\n // browser/device zoom or high scroll values produce tiny rounding errors.\n // Scale epsilon with invScale so tolerance grows when zoomed out.\n const worldEpsilon = Math.max(0.5, 0.5 * invScale);\n\n // Iterate layout positions directly to avoid depending on `visibleIds`\n // which may be calculated in a different coordinate space or with\n // different assumptions about zoom. Looping the positions map is\n // deterministic and uses world coordinates directly.\n for (const [id, position] of layout.positions) {\n if (!position) continue;\n const worldX = position.x;\n const worldY = position.y;\n const worldCardW = cardWidth;\n const worldCardH = cardHeight;\n\n if (\n worldX + worldCardW >= viewportLeftWorld - worldEpsilon &&\n worldX <= viewportRightWorld + worldEpsilon &&\n worldY + worldCardH >= viewportTopWorld - worldEpsilon &&\n worldY <= viewportBottomWorld + worldEpsilon\n ) {\n inViewportIds.push(id);\n visibleSet.add(id);\n }\n }\n\n // Ensure last rows are present when the user scrolls near the bottom.\n // Compute slot/row information and force-insert IDs from the last few\n // rows to avoid missing tiles due to rounding/precision at zoom levels.\n try {\n const slotHeight = cardHeight + (CARD_GAP || 8);\n const totalRows = Math.ceil((layout.totalHeight || 0) / slotHeight) || 0;\n // Determine how many rows are visible in the viewport (world units),\n // then prefetch a fraction of that adjusted by zoom (invScale).\n const rowsVisible = Math.max(1, Math.ceil(viewportWorldHeight / slotHeight));\n const prefetchMultiplier = 0.75; // fraction of viewport to prefetch\n const prefetchRows = Math.max(2, Math.ceil(rowsVisible * prefetchMultiplier * Math.max(1, invScale)));\n const lastRowThresholdY = Math.max(0, (totalRows - prefetchRows) * slotHeight);\n for (const [id, position] of layout.positions) {\n if (position.y >= lastRowThresholdY) {\n if (!visibleSet.has(id)) {\n inViewportIds.push(id);\n visibleSet.add(id);\n }\n }\n }\n } catch (e) {\n void e;\n }\n\n // If we detect a very large discrepancy between created sprites and the\n // computed in-viewport count, that's a signal our culling math may be\n // unstable (especially at non-100% zoom). In that case, skip hiding this\n // frame as a conservative safeguard to avoid mass disappearing tiles.\n // However, disable this safeguard during view transitions to ensure old sprites are cleaned up.\n // EXCEPT: During view transitions, if scroll position hasn't stabilized yet (e.g., switching to grouped\n // mode triggers a scroll-to-bottom), keep all sprites visible to prevent flickering\n const scrollStabilized = Math.abs(panWorldY - (container.scrollTop * invScale)) < 10;\n const aggressiveCull = (!isViewTransition && sprites.size > Math.max(120, Math.ceil(inViewportIds.length * 1.5))) || \n (isViewTransition && !scrollStabilized);\n\n for (const [id, sprite] of sprites) {\n if (!visibleSet.has(id)) {\n // If view transition is active, check if this sprite has a valid target in the new layout\n // If so, keep it visible and animate it to the new position (even if off-screen)\n if (isViewTransition && layout.positions.has(id)) {\n const newPos = layout.positions.get(id);\n if (newPos) {\n sprite.targetX = newPos.x;\n sprite.targetY = newPos.y;\n\n // Trigger animation if not already animating\n if (sprite.animationStartTime === undefined) {\n sprite.startX = sprite.currentX;\n sprite.startY = sprite.currentY;\n sprite.animationStartTime = Date.now();\n sprite.animationDelay = Math.random() * 300;\n }\n\n try { if (sprite.container) sprite.container.visible = true; } catch (e) { void e; }\n // Don't mark as hidden, so it won't be swept\n if ((sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt) delete (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n continue;\n }\n }\n\n if (aggressiveCull) {\n // Keep sprite visible this frame to avoid visual holes\n try { if (sprite.container) sprite.container.visible = true; } catch (e) { void e; }\n continue;\n }\n\n try {\n if (sprite.container) {\n sprite.container.visible = false;\n }\n (sprite as unknown as { __lastHiddenAt: number }).__lastHiddenAt = Date.now();\n } catch (e) {\n void e;\n }\n } else {\n try {\n if (sprite.container) {\n sprite.container.visible = true;\n }\n if ((sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt) delete (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n } catch (e) { void e; }\n }\n }\n\n // Sweep: actually destroy sprites that have been hidden longer than threshold\n try {\n const SWEEP_MS = 100; // keep hidden sprites for 100ms before destruction (reduced from 500ms for faster mode transitions)\n const now = Date.now();\n for (const [id, sprite] of sprites) {\n const lastHidden = (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n if (lastHidden && now - lastHidden > SWEEP_MS) {\n try {\n // remove from parent if present\n if (sprite.container && sprite.container.parent) sprite.container.parent.removeChild(sprite.container);\n } catch (e) {\n void e;\n }\n try {\n destroySprite(sprite);\n } catch (e) {\n void e;\n }\n sprites.delete(id);\n }\n }\n } catch (e) {\n void e;\n }\n\n // Limit the number of sprites created per frame to avoid choking the GPU/CPU\n // when scrolling rapidly or zooming out significantly.\n const MAX_SPRITES_PER_FRAME = 50;\n let createdCount = 0;\n\n console.log('[syncSpritesToViewport] About to create sprites for inViewportIds:', inViewportIds.length);\n console.log('[syncSpritesToViewport] layout.positions IDs:', Array.from(layout.positions.keys()));\n\n for (const id of inViewportIds) {\n const position = layout.positions.get(id);\n if (!position) {\n console.log('[syncSpritesToViewport] No position for id:', id, 'in layout.positions');\n continue;\n }\n\n let sprite = sprites.get(id);\n if (!sprite) {\n if (createdCount >= MAX_SPRITES_PER_FRAME) {\n console.log('[syncSpritesToViewport] Max sprites per frame reached');\n continue;\n }\n createdCount++;\n\n console.log('[syncSpritesToViewport] Creating sprite for id:', id, 'at position:', position);\n\n let startX = position.x;\n let startY = position.y;\n let shouldAnimate = false;\n\n // If view transition, try to find old position to fly in from\n if (isViewTransition && prevLayout && prevLayout.positions.has(id)) {\n const oldPos = prevLayout.positions.get(id);\n if (oldPos) {\n startX = oldPos.x;\n startY = oldPos.y;\n\n // If we have a pan delta (camera jump), we need to adjust the start position\n // so that the sprite appears at the same visual location relative to the NEW camera.\n // StartWorld = OldWorld + PanDelta\n if (panDeltaX || panDeltaY) {\n const dx = (panDeltaX || 0) / (zoomLevel || 1);\n const dy = (panDeltaY || 0) / (zoomLevel || 1);\n startX += dx;\n startY += dy;\n }\n\n shouldAnimate = true;\n }\n }\n\n sprite = createCardSprite(id, startX, startY);\n sprites.set(id, sprite);\n if (sprite.container) {\n root.addChild(sprite.container);\n sprite.currentX = startX;\n sprite.currentY = startY;\n // Keep sprite.container positioned in world units; animation/update\n // loop will apply root.scale/position to convert to pixels.\n sprite.container.position.set(startX, startY);\n }\n\n if (shouldAnimate) {\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n sprite.startX = startX;\n sprite.startY = startY;\n sprite.animationStartTime = Date.now();\n sprite.animationDelay = Math.random() * 300;\n }\n }\n\n // Check if target changed to trigger animation\n if (sprite.targetX !== position.x || sprite.targetY !== position.y) {\n console.log('[syncSpritesToViewport] Updating sprite target position for id:', id, 'from', {\n oldX: sprite.targetX,\n oldY: sprite.targetY\n }, 'to', position);\n if (isViewTransition) {\n sprite.startX = sprite.currentX;\n sprite.startY = sprite.currentY;\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n sprite.animationStartTime = Date.now();\n // Add random delay for \"organic\" fly effect\n sprite.animationDelay = Math.random() * 300;\n } else {\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n delete sprite.animationStartTime;\n delete sprite.animationDelay;\n }\n } else {\n console.log('[syncSpritesToViewport] Sprite position unchanged for id:', id, 'at', position);\n }\n\n const item = items[Number(id)];\n if (item) {\n updateCardContent(sprite, item);\n }\n }\n}\n"],"names":[],"mappings":";;;AA+BM,SAAU,qBAAqB,CAAQ,MAAyB,EAAA;AAClE,IAAA,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,MAAM;AAC5O,IAAA,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS;QAAE;AAEzB,IAAA,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE;AAC/C,QAAA,mBAAmB,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI;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QAC9B,IAAI,IAAI,EAAE;AACN,YAAA,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC;QACnC;IACJ;AACJ;;;;"}
1
+ {"version":3,"file":"visibility.js","sources":["../../../../../PivotViewer/components/pivot/visibility.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 * as PIXI from 'pixi.js';\nimport type { CardSprite } from './constants';\nimport { CARD_GAP } from './constants';\nimport type { LayoutResult } from '../../engine/types';\nimport { destroySprite } from './sprites';\n\nexport interface SyncParams<TItem> {\n root: PIXI.Container | null;\n groupsContainer?: PIXI.Container | null;\n container: HTMLDivElement | null;\n sprites: Map<string | number, CardSprite>;\n layout: LayoutResult;\n visibleIds: Uint32Array;\n items: TItem[];\n cardWidth: number;\n cardHeight: number;\n panX: number;\n panY: number;\n panDeltaX?: number;\n panDeltaY?: number;\n viewportWidth: number;\n viewportHeight: number;\n zoomLevel: number;\n createCardSprite: (id: string | number, x: number, y: number) => CardSprite;\n updateCardContent: (sprite: CardSprite, item: TItem) => void;\n isViewTransition?: boolean;\n viewMode: string;\n prevLayout?: LayoutResult | null;\n prevScrollTop?: number;\n prevScrollLeft?: number;\n}\n\nexport function syncSpritesToViewport<TItem>(params: SyncParams<TItem>) {\n const { root, groupsContainer, container, sprites, layout, visibleIds: _visibleIds, items, cardWidth, cardHeight, panX, panY, panDeltaX, panDeltaY, viewportWidth, viewportHeight, createCardSprite, updateCardContent, zoomLevel, isViewTransition, viewMode, prevLayout, prevScrollTop, prevScrollLeft } = params;\n if (!root || !container) return;\n\n void _visibleIds;\n\n // Use the container's measured client size for the viewport dimensions\n // (in pixels). The passed `viewportWidth`/`viewportHeight` can be stale\n // when the browser/device zoom changes; `clientWidth/clientHeight` are\n // authoritative for the actual visible pixel area.\n const viewportPxWidth = container.clientWidth || viewportWidth;\n const viewportPxHeight = container.clientHeight || viewportHeight;\n\n const contentHeightPx = (layout.totalHeight || 0) * zoomLevel;\n let offsetY = 0;\n\n // If content fits vertically within the viewport, align relative to bottom.\n // The spacer ensures container isn't scrollable in this case (scrollTop=0).\n // The items are at large Y coordinates relative to layout.totalHeight.\n // We want the bottom of the layout (totalHeight) to align with viewport bottom.\n if (viewMode === 'grouped' && contentHeightPx < viewportPxHeight) {\n // Calculate offset in pixels to shift the content down\n offsetY = viewportPxHeight - contentHeightPx;\n }\n\n // Use the container's actual scroll position for positioning, not the passed panX/panY\n // which may be stale (from React state) compared to live DOM scroll values.\n const actualScrollX = typeof container.scrollLeft === 'number' ? container.scrollLeft : (panX || 0);\n const actualScrollY = typeof container.scrollTop === 'number' ? container.scrollTop : (panY || 0);\n\n // Apply scaling and position to root container\n if (root) {\n root.scale.set(zoomLevel);\n // Standard position: -scrollX, -scrollY\n // Plus vertical alignment offset if zoomed out\n root.position.set(-actualScrollX, offsetY - actualScrollY);\n }\n \n // Apply synchronization to groups container if present\n if (groupsContainer) {\n groupsContainer.scale.set(zoomLevel);\n groupsContainer.position.set(-actualScrollX, offsetY - actualScrollY);\n }\n\n // `visibleIds` comes from callers but this module iterates `layout.positions`\n\n // Apply pan delta to animating sprites to keep them visually stable during camera jumps\n if (isViewTransition && (panDeltaX || panDeltaY)) {\n const dx = (panDeltaX || 0) / (zoomLevel || 1);\n const dy = (panDeltaY || 0) / (zoomLevel || 1);\n\n for (const sprite of sprites.values()) {\n if (sprite.animationStartTime !== undefined) {\n if (sprite.startX !== undefined) sprite.startX += dx;\n if (sprite.startY !== undefined) sprite.startY += dy;\n sprite.currentX += dx;\n sprite.currentY += dy;\n sprite.container?.position?.set(sprite.currentX, sprite.currentY);\n }\n }\n }\n\n const visibleSet = new Set<string | number>();\n\n // Increase buffer (in world units) to reduce edge cases where rapid\n // scrolling skips sprite creation. Keep buffer in world units and convert\n // DOM pixel measurements into world coordinates below to avoid mixing\n // coordinate spaces which can cause precision drift at browser zooms.\n const baseBufferWorld = Math.max(cardWidth, cardHeight) * 4;\n // Ensure buffer scales with viewport size (in world units) so that when\n // zoomed out we still pre-create enough sprites ahead of the viewport.\n const invScale = zoomLevel && zoomLevel !== 0 ? 1 / zoomLevel : 1;\n // The layout positions are in world units; when the root container is scaled\n // (zoomed) the rendered pixel position = position * zoomLevel. The DOM\n // scroll positions (`container.scrollLeft/Top`) are the authoritative pixel\n // camera offsets; prefer them over the passed `panX/panY` to avoid stale\n // values or race conditions between React state and direct DOM updates.\n const effectivePanX = typeof container.scrollLeft === 'number' ? container.scrollLeft : (panX || 0);\n const effectivePanY = typeof container.scrollTop === 'number' ? container.scrollTop : (panY || 0);\n\n // Convert pixel-based DOM measurements into world units so we compare like\n // with like. root.position is set using -pixels, so the mapping\n // from DOM scroll (pixels) to world units is: world = pixels / zoomLevel.\n // OffsetY is already in pixels and doesn't need scaling in panWorldY calc\n // because panWorldY is used for viewport buffering/culling, which is relative\n // to the \"camera\" position in world space.\n // The camera world Y = (scrollTop - offsetY) / zoomLevel.\n const effectivePanYWithOffset = effectivePanY - offsetY;\n const panWorldX = effectivePanX * invScale;\n const panWorldY = effectivePanYWithOffset * invScale;\n\n const viewportWorldWidth = viewportPxWidth * invScale;\n const viewportWorldHeight = viewportPxHeight * invScale;\n\n // Ensure bufferWorld is calculated from the actual measured viewport\n // in world units (after converting client pixel dims using invScale).\n // Make buffer adaptive to zoom: when zoomed out (invScale > 1) a small\n // pixel scroll maps to a larger world delta, so increase the buffer.\n // Use the larger of width/height to ensure we buffer enough in both directions.\n const bufferWorld = Math.max(baseBufferWorld * invScale, Math.max(viewportWorldWidth, viewportWorldHeight) * 2.0, baseBufferWorld);\n\n // Do not clamp viewport edges to 0 — allow negative top/left values so the\n // visible window correctly follows the scroll even when the buffer is\n // larger than the current scroll offset.\n const viewportLeftWorld = panWorldX - bufferWorld;\n const viewportRightWorld = panWorldX + viewportWorldWidth + bufferWorld;\n const viewportTopWorld = panWorldY - bufferWorld;\n const viewportBottomWorld = panWorldY + viewportWorldHeight + bufferWorld;\n\n const inViewportIds: (string | number)[] = [];\n // Small tolerance in world units to avoid floating-point edge cases when\n // browser/device zoom or high scroll values produce tiny rounding errors.\n // Scale epsilon with invScale so tolerance grows when zoomed out.\n const worldEpsilon = Math.max(0.5, 0.5 * invScale);\n\n // Iterate layout positions directly to avoid depending on `visibleIds`\n // which may be calculated in a different coordinate space or with\n // different assumptions about zoom. Looping the positions map is\n // deterministic and uses world coordinates directly.\n for (const [id, position] of layout.positions) {\n if (!position) continue;\n const worldX = position.x;\n const worldY = position.y;\n const worldCardW = cardWidth;\n const worldCardH = cardHeight;\n\n if (\n worldX + worldCardW >= viewportLeftWorld - worldEpsilon &&\n worldX <= viewportRightWorld + worldEpsilon &&\n worldY + worldCardH >= viewportTopWorld - worldEpsilon &&\n worldY <= viewportBottomWorld + worldEpsilon\n ) {\n inViewportIds.push(id);\n visibleSet.add(id);\n }\n }\n\n // During view transitions, if no cards are visible and we're not animating yet,\n // force-add the first few cards from the layout to ensure content appears.\n // This prevents a blank screen when switching modes, especially in packaged builds\n // where scroll stabilization might be delayed.\n if (isViewTransition && inViewportIds.length === 0 && layout.positions.size > 0) {\n let count = 0;\n for (const [id, position] of layout.positions) {\n if (count < 5 && position) { // Add up to 5 cards\n inViewportIds.push(id);\n visibleSet.add(id);\n count++;\n }\n }\n }\n\n // Ensure last rows are present when the user scrolls near the bottom.\n // Compute slot/row information and force-insert IDs from the last few\n // rows to avoid missing tiles due to rounding/precision at zoom levels.\n try {\n const slotHeight = cardHeight + (CARD_GAP || 8);\n const totalRows = Math.ceil((layout.totalHeight || 0) / slotHeight) || 0;\n // Determine how many rows are visible in the viewport (world units),\n // then prefetch a fraction of that adjusted by zoom (invScale).\n const rowsVisible = Math.max(1, Math.ceil(viewportWorldHeight / slotHeight));\n const prefetchMultiplier = 0.75; // fraction of viewport to prefetch\n const prefetchRows = Math.max(2, Math.ceil(rowsVisible * prefetchMultiplier * Math.max(1, invScale)));\n const lastRowThresholdY = Math.max(0, (totalRows - prefetchRows) * slotHeight);\n for (const [id, position] of layout.positions) {\n if (position.y >= lastRowThresholdY) {\n if (!visibleSet.has(id)) {\n inViewportIds.push(id);\n visibleSet.add(id);\n }\n }\n }\n } catch (e) {\n void e;\n }\n\n // Fallback: if no sprites are calculated as visible (e.g., due to rounding\n // or scroll/zoom race conditions), force a handful of cards into view so\n // the canvas never renders empty at certain zoom levels.\n // When transitioning views, be more aggressive to ensure content appears during the transition\n let injectedFallback = false;\n const fallbackCount = isViewTransition ? 30 : 12;\n if (inViewportIds.length === 0 && layout.positions.size > 0) {\n injectedFallback = true;\n let count = 0;\n for (const [id] of layout.positions) {\n inViewportIds.push(id);\n visibleSet.add(id);\n count++;\n if (count >= fallbackCount) break;\n }\n }\n\n // If we detect a very large discrepancy between created sprites and the\n // computed in-viewport count, that's a signal our culling math may be\n // unstable (especially at non-100% zoom). In that case, skip hiding this\n // frame as a conservative safeguard to avoid mass disappearing tiles.\n // However, disable this safeguard during view transitions to ensure old sprites are cleaned up.\n // EXCEPT: During view transitions, if scroll position hasn't stabilized yet (e.g., switching to grouped\n // mode triggers a scroll-to-bottom), keep all sprites visible to prevent flickering.\n // Check scroll stabilization by comparing current scroll to previous scroll position.\n const currentScrollTop = container.scrollTop || 0;\n const currentScrollLeft = container.scrollLeft || 0;\n const scrollTopDelta = Math.abs(currentScrollTop - (prevScrollTop || currentScrollTop));\n const scrollLeftDelta = Math.abs(currentScrollLeft - (prevScrollLeft || currentScrollLeft));\n const scrollStabilized = scrollTopDelta < 10 && scrollLeftDelta < 10;\n const aggressiveCull = !injectedFallback && (\n (!isViewTransition && sprites.size > Math.max(120, Math.ceil(inViewportIds.length * 1.5))) ||\n (isViewTransition && !scrollStabilized)\n );\n\n for (const [id, sprite] of sprites) {\n if (!visibleSet.has(id)) {\n // If view transition is active, check if this sprite has a valid target in the new layout\n // If so, keep it visible and animate it to the new position (even if off-screen)\n if (isViewTransition && layout.positions.has(id)) {\n const newPos = layout.positions.get(id);\n if (newPos) {\n sprite.targetX = newPos.x;\n sprite.targetY = newPos.y;\n\n // Trigger animation if not already animating\n if (sprite.animationStartTime === undefined) {\n sprite.startX = sprite.currentX;\n sprite.startY = sprite.currentY;\n sprite.animationStartTime = Date.now();\n sprite.animationDelay = Math.random() * 300;\n }\n\n try { if (sprite.container) sprite.container.visible = true; } catch (e) { void e; }\n // Don't mark as hidden, so it won't be swept\n if ((sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt) delete (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n continue;\n }\n }\n\n if (aggressiveCull) {\n // Keep sprite visible this frame to avoid visual holes\n try { if (sprite.container) sprite.container.visible = true; } catch (e) { void e; }\n continue;\n }\n\n try {\n if (sprite.container) {\n sprite.container.visible = false;\n }\n (sprite as unknown as { __lastHiddenAt: number }).__lastHiddenAt = Date.now();\n } catch (e) {\n void e;\n }\n } else {\n try {\n if (sprite.container) {\n sprite.container.visible = true;\n }\n if ((sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt) delete (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n } catch (e) { void e; }\n }\n }\n\n // Sweep: actually destroy sprites that have been hidden longer than threshold\n try {\n const SWEEP_MS = 100; // keep hidden sprites for 100ms before destruction (reduced from 500ms for faster mode transitions)\n const now = Date.now();\n for (const [id, sprite] of sprites) {\n const lastHidden = (sprite as unknown as { __lastHiddenAt?: number }).__lastHiddenAt;\n if (lastHidden && now - lastHidden > SWEEP_MS) {\n try {\n // remove from parent if present\n if (sprite.container && sprite.container.parent) sprite.container.parent.removeChild(sprite.container);\n } catch (e) {\n void e;\n }\n try {\n destroySprite(sprite);\n } catch (e) {\n void e;\n }\n sprites.delete(id);\n }\n }\n } catch (e) {\n void e;\n }\n\n // Limit the number of sprites created per frame to avoid choking the GPU/CPU\n // when scrolling rapidly or zooming out significantly.\n const MAX_SPRITES_PER_FRAME = 50;\n let createdCount = 0;\n\n\n for (const id of inViewportIds) {\n const position = layout.positions.get(id);\n if (!position) {\n continue;\n }\n\n let sprite = sprites.get(id);\n if (!sprite) {\n if (createdCount >= MAX_SPRITES_PER_FRAME) {\n continue;\n }\n createdCount++;\n\n let startX = position.x;\n let startY = position.y;\n let shouldAnimate = false;\n\n // If view transition, try to find old position to fly in from\n if (isViewTransition && prevLayout && prevLayout.positions.has(id)) {\n const oldPos = prevLayout.positions.get(id);\n if (oldPos) {\n startX = oldPos.x;\n startY = oldPos.y;\n\n // If we have a pan delta (camera jump), we need to adjust the start position\n // so that the sprite appears at the same visual location relative to the NEW camera.\n // StartWorld = OldWorld + PanDelta\n if (panDeltaX || panDeltaY) {\n const dx = (panDeltaX || 0) / (zoomLevel || 1);\n const dy = (panDeltaY || 0) / (zoomLevel || 1);\n startX += dx;\n startY += dy;\n }\n\n shouldAnimate = true;\n }\n }\n\n sprite = createCardSprite(id, startX, startY);\n sprites.set(id, sprite);\n if (sprite.container) {\n root.addChild(sprite.container);\n sprite.currentX = startX;\n sprite.currentY = startY;\n // Keep sprite.container positioned in world units; animation/update\n // loop will apply root.scale/position to convert to pixels.\n sprite.container.position.set(startX, startY);\n }\n\n if (shouldAnimate) {\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n sprite.startX = startX;\n sprite.startY = startY;\n sprite.animationStartTime = Date.now();\n sprite.animationDelay = Math.random() * 300;\n }\n }\n\n // Check if target changed to trigger animation\n if (sprite.targetX !== position.x || sprite.targetY !== position.y) {\n if (isViewTransition) {\n sprite.startX = sprite.currentX;\n sprite.startY = sprite.currentY;\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n sprite.animationStartTime = Date.now();\n // Add random delay for \"organic\" fly effect\n sprite.animationDelay = Math.random() * 300;\n } else {\n sprite.targetX = position.x;\n sprite.targetY = position.y;\n delete sprite.animationStartTime;\n delete sprite.animationDelay;\n }\n }\n\n const item = items[Number(id)];\n if (item) {\n updateCardContent(sprite, item);\n }\n }\n}\n"],"names":[],"mappings":";;;AAmCM,SAAU,qBAAqB,CAAQ,MAAyB,EAAA;IAClE,MAAM,EAAE,IAAI,EA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CAAC,kBAAkB,GAAG,IAAI,CAAC,GAAG,EAAE;gBAEtC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG;YAC/C;iBAAO;AACH,gBAAA,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC;AAC3B,gBAAA,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC;gBAC3B,OAAO,MAAM,CAAC,kBAAkB;gBAChC,OAAO,MAAM,CAAC,cAAc;YAChC;QACJ;QAEA,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,IAAI,EAAE;AACN,YAAA,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC;QACnC;IACJ;AACJ;;;;"}
@@ -45,31 +45,34 @@ function computeCollectionLayout(grouping, spec, positions) {
45
45
  };
46
46
  }
47
47
  function computeGroupedLayout(grouping, spec, positions) {
48
- const { cardWidth, cardHeight, cardsPerColumn, groupSpacing } = spec;
48
+ const { cardWidth, cardHeight, cardsPerColumn } = spec;
49
+ const effectiveGroupSpacing = 0;
49
50
  const slotWidth = cardWidth + CARD_GAP;
50
51
  const slotHeight = cardHeight + CARD_GAP;
52
+ const BOTTOM_MARGIN = 0;
51
53
  const COLUMNS_PER_BUCKET = 2;
52
54
  const bucketWidth = COLUMNS_PER_BUCKET * slotWidth;
53
- let groupX = CANVAS_PADDING;
55
+ let groupX = 0;
54
56
  const layoutHeight = spec.containerHeight || (cardsPerColumn * slotHeight);
55
57
  const bucketWidths = [];
58
+ const groupXs = [];
56
59
  let maxRows = 0;
57
60
  for (const group of grouping.groups) {
58
61
  const itemsInGroup = group.ids.length;
59
62
  const rowsInGroup = Math.ceil(itemsInGroup / COLUMNS_PER_BUCKET);
60
63
  maxRows = Math.max(maxRows, rowsInGroup);
61
64
  }
62
- const contentHeight = Math.max(layoutHeight, maxRows * slotHeight);
65
+ const contentHeight = Math.max(layoutHeight, (maxRows * slotHeight) + BOTTOM_MARGIN);
63
66
  for (let groupIndex = 0; groupIndex < grouping.groups.length; groupIndex++) {
64
67
  const group = grouping.groups[groupIndex];
68
+ groupXs.push(groupX);
65
69
  const itemsInGroup = group.ids.length;
66
70
  for (let i = 0; i < itemsInGroup; i++) {
67
71
  const id = group.ids[i];
68
72
  const col = i % COLUMNS_PER_BUCKET;
69
73
  const row = Math.floor(i / COLUMNS_PER_BUCKET);
70
- const x = groupX + col * slotWidth;
71
- const rowsInGroup = Math.ceil(itemsInGroup / COLUMNS_PER_BUCKET);
72
- const y = CANVAS_PADDING + contentHeight - (rowsInGroup - row) * slotHeight;
74
+ const x = groupX + (col * slotWidth) + (CARD_GAP / 2);
75
+ const y = CANVAS_PADDING + contentHeight - BOTTOM_MARGIN - ((row + 1) * slotHeight);
73
76
  positions.set(id, {
74
77
  x,
75
78
  y,
@@ -79,7 +82,7 @@ function computeGroupedLayout(grouping, spec, positions) {
79
82
  bucketWidths.push(bucketWidth);
80
83
  groupX += bucketWidth;
81
84
  if (groupIndex < grouping.groups.length - 1) {
82
- groupX += groupSpacing;
85
+ groupX += effectiveGroupSpacing;
83
86
  }
84
87
  }
85
88
  return {
@@ -87,6 +90,7 @@ function computeGroupedLayout(grouping, spec, positions) {
87
90
  totalWidth: groupX + CANVAS_PADDING,
88
91
  totalHeight: contentHeight + (CANVAS_PADDING * 2),
89
92
  bucketWidths,
93
+ groupXs,
90
94
  };
91
95
  }
92
96
 
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sources":["../../../../PivotViewer/engine/layout.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 type {\n LayoutSpec,\n LayoutResult,\n ItemPosition,\n GroupingResult,\n ItemId,\n} from './types';\nimport { CARD_GAP, CANVAS_PADDING } from '../constants';\n\nexport function computeLayout(\n grouping: GroupingResult,\n spec: LayoutSpec\n): LayoutResult {\n const positions = new Map<ItemId, ItemPosition>();\n\n if (spec.viewMode === 'collection') {\n return computeCollectionLayout(grouping, spec, positions);\n } else {\n return computeGroupedLayout(grouping, spec, positions);\n }\n}\n\nfunction computeCollectionLayout(\n grouping: GroupingResult,\n spec: LayoutSpec,\n positions: Map<ItemId, ItemPosition>\n): LayoutResult {\n const { cardWidth, cardHeight, containerWidth } = spec;\n const slotWidth = cardWidth + CARD_GAP;\n const slotHeight = cardHeight + CARD_GAP;\n\n // Calculate how many cards fit per row based on container width (include gap)\n const cardsPerRow = Math.max(1, Math.floor((containerWidth + CARD_GAP - (CANVAS_PADDING * 2)) / slotWidth));\n\n let x = CANVAS_PADDING;\n let y = CANVAS_PADDING;\n let column = 0;\n let itemCount = 0;\n\n for (const group of grouping.groups) {\n for (let i = 0; i < group.ids.length; i++) {\n const id = group.ids[i];\n\n positions.set(id, {\n x,\n y,\n groupIndex: 0,\n });\n\n // Move to next position horizontally (left to right)\n column++;\n x += slotWidth;\n\n // Wrap to next row when we've filled the width\n if (column >= cardsPerRow) {\n column = 0;\n x = CANVAS_PADDING;\n y += slotHeight;\n }\n\n itemCount++;\n }\n }\n\n const rows = Math.ceil(itemCount / cardsPerRow);\n const contentWidth = Math.min(itemCount, cardsPerRow) * slotWidth;\n\n return {\n positions,\n totalWidth: Math.max(containerWidth, contentWidth + (CANVAS_PADDING * 2)),\n totalHeight: (rows * slotHeight) + (CANVAS_PADDING * 2),\n };\n}\n\nfunction computeGroupedLayout(\n grouping: GroupingResult,\n spec: LayoutSpec,\n positions: Map<ItemId, ItemPosition>\n): LayoutResult {\n const { cardWidth, cardHeight, cardsPerColumn, groupSpacing } = spec;\n const slotWidth = cardWidth + CARD_GAP;\n const slotHeight = cardHeight + CARD_GAP;\n\n // Fixed bucket width: 2 columns of cards per bucket (always)\n const COLUMNS_PER_BUCKET = 2;\n const bucketWidth = COLUMNS_PER_BUCKET * slotWidth;\n\n let groupX = CANVAS_PADDING;\n // Use container height for layout, or fallback to cardsPerColumn height\n const layoutHeight = spec.containerHeight || (cardsPerColumn * slotHeight);\n const bucketWidths: number[] = [];\n let maxRows = 0;\n\n // First pass: calculate max rows to determine total height\n for (const group of grouping.groups) {\n const itemsInGroup = group.ids.length;\n const rowsInGroup = Math.ceil(itemsInGroup / COLUMNS_PER_BUCKET);\n maxRows = Math.max(maxRows, rowsInGroup);\n }\n\n // Calculate actual content height needed (ensure it's at least as tall as the container)\n const contentHeight = Math.max(layoutHeight, maxRows * slotHeight);\n\n for (let groupIndex = 0; groupIndex < grouping.groups.length; groupIndex++) {\n const group = grouping.groups[groupIndex];\n\n const itemsInGroup = group.ids.length;\n\n for (let i = 0; i < itemsInGroup; i++) {\n const id = group.ids[i];\n\n // Cards fill from left to right, bottom to top\n // For a 2-column bucket: i=0,1 in row 0; i=2,3 in row 1; etc.\n const col = i % COLUMNS_PER_BUCKET;\n const row = Math.floor(i / COLUMNS_PER_BUCKET);\n\n const x = groupX + col * slotWidth;\n // Position cards from bottom of container, stacking upwards\n // Start from contentHeight and subtract row positions\n const rowsInGroup = Math.ceil(itemsInGroup / COLUMNS_PER_BUCKET);\n const y = CANVAS_PADDING + contentHeight - (rowsInGroup - row) * slotHeight;\n\n positions.set(id, {\n x,\n y,\n groupIndex,\n });\n }\n\n // Always use fixed bucket width\n bucketWidths.push(bucketWidth);\n\n // Advance position by fixed bucket width + spacing\n groupX += bucketWidth;\n if (groupIndex < grouping.groups.length - 1) {\n groupX += groupSpacing;\n }\n }\n\n return {\n positions,\n totalWidth: groupX + CANVAS_PADDING,\n totalHeight: contentHeight + (CANVAS_PADDING * 2),\n bucketWidths,\n };\n}\n"],"names":[],"mappings":";;AAYM,SAAU,aAAa,CAC3B,QAAwB,EACxB,IAAgB,EAAA;AAEhB,IAAA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAwB;AAEjD,IAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,YAAY,EAAE;QAClC,OAAO,uBAAuB,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC;IAC3D;SAAO;QACL,OA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,EAAE,UAAU,EAAE,EAAE;QAC1E,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC;AAEzC,QAAA,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM;AAErC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAIvB,YAAA,MAAM,GAAG,GAAG,CAAC,GAAG,kBAAkB;YAClC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,kBAAkB,CAAC;AAE9C,YAAA,MAAM,CAAC,GAAG,MAAM,GAAG,GAAG,GAAG,SAAS;YAGlC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,kBAAkB,CAAC;AAChE,YAAA,MAAM,CAAC,GAAG,cAAc,GAAG,aAAa,GAAG,CAAC,WAAW,GAAG,GAAG,IAAI,UAAU;AAE3E,YAAA,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE;gBAChB,CAAC;gBACD,CAAC;gBACD,UAAU;AACX,aAAA,CAAC;QACJ;AAGA,QAAA,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC;QAG9B,MAAM,IAAI,WAAW;QACrB,IAAI,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3C,MAAM,IAAI,YAAY;QACxB;IACF;IAEA,OAAO;QACL,SAAS;QACT,UAAU,EAAE,MAAM,GAAG,cAAc;AACnC,QAAA,WAAW,EAAE,aAAa,IAAI,cAAc,GAAG,CAAC,CAAC;QACjD,YAAY;KACb;AACH;;;;"}
1
+ {"version":3,"file":"layout.js","sources":["../../../../PivotViewer/engine/layout.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 type {\n LayoutSpec,\n LayoutResult,\n ItemPosition,\n GroupingResult,\n ItemId,\n} from './types';\nimport { CARD_GAP, CANVAS_PADDING } from '../constants';\n\nexport function computeLayout(\n grouping: GroupingResult,\n spec: LayoutSpec\n): LayoutResult {\n const positions = new Map<ItemId, ItemPosition>();\n\n if (spec.viewMode === 'collection') {\n return computeCollectionLayout(grouping, spec, positions);\n } else {\n return computeGroupedLayout(grouping, spec, positions);\n }\n}\n\nfunction computeCollectionLayout(\n grouping: GroupingResult,\n spec: LayoutSpec,\n positions: Map<ItemId, ItemPosition>\n): LayoutResult {\n const { cardWidth, cardHeight, containerWidth } = spec;\n const slotWidth = cardWidth + CARD_GAP;\n const slotHeight = cardHeight + CARD_GAP;\n\n // Calculate how many cards fit per row based on container width (include gap)\n const cardsPerRow = Math.max(1, Math.floor((containerWidth + CARD_GAP - (CANVAS_PADDING * 2)) / slotWidth));\n\n let x = CANVAS_PADDING;\n let y = CANVAS_PADDING;\n let column = 0;\n let itemCount = 0;\n\n for (const group of grouping.groups) {\n for (let i = 0; i < group.ids.length; i++) {\n const id = group.ids[i];\n\n positions.set(id, {\n x,\n y,\n groupIndex: 0,\n });\n\n // Move to next position horizontally (left to right)\n column++;\n x += slotWidth;\n\n // Wrap to next row when we've filled the width\n if (column >= cardsPerRow) {\n column = 0;\n x = CANVAS_PADDING;\n y += slotHeight;\n }\n\n itemCount++;\n }\n }\n\n const rows = Math.ceil(itemCount / cardsPerRow);\n const contentWidth = Math.min(itemCount, cardsPerRow) * slotWidth;\n\n return {\n positions,\n totalWidth: Math.max(containerWidth, contentWidth + (CANVAS_PADDING * 2)),\n totalHeight: (rows * slotHeight) + (CANVAS_PADDING * 2),\n };\n}\n\nfunction computeGroupedLayout(\n grouping: GroupingResult,\n spec: LayoutSpec,\n positions: Map<ItemId, ItemPosition>\n): LayoutResult {\n const { cardWidth, cardHeight, cardsPerColumn } = spec;\n // Override group spacing to ensure consistent card spacing across groups\n // We want visual gap between groups to match gap between cards (CARD_GAP)\n const effectiveGroupSpacing = 0;\n\n const slotWidth = cardWidth + CARD_GAP;\n const slotHeight = cardHeight + CARD_GAP;\n // Bottom margin of 0 - the CARD_GAP in slotHeight provides sufficient spacing\n // between the bottom card and the footer label\n const BOTTOM_MARGIN = 0;\n\n // Fixed bucket width: 2 columns of cards per bucket (always)\n const COLUMNS_PER_BUCKET = 2;\n const bucketWidth = COLUMNS_PER_BUCKET * slotWidth;\n\n let groupX = 0;\n // Use container height for layout, or fallback to cardsPerColumn height\n const layoutHeight = spec.containerHeight || (cardsPerColumn * slotHeight);\n const bucketWidths: number[] = [];\n const groupXs: number[] = [];\n let maxRows = 0;\n\n // First pass: calculate max rows to determine total height\n for (const group of grouping.groups) {\n const itemsInGroup = group.ids.length;\n const rowsInGroup = Math.ceil(itemsInGroup / COLUMNS_PER_BUCKET);\n maxRows = Math.max(maxRows, rowsInGroup);\n }\n\n // Calculate actual content height needed (ensure it's at least as tall as the container)\n // We need to fit the tallest column plus the bottom margin\n const contentHeight = Math.max(layoutHeight, (maxRows * slotHeight) + BOTTOM_MARGIN);\n\n for (let groupIndex = 0; groupIndex < grouping.groups.length; groupIndex++) {\n const group = grouping.groups[groupIndex];\n groupXs.push(groupX);\n\n const itemsInGroup = group.ids.length;\n\n for (let i = 0; i < itemsInGroup; i++) {\n const id = group.ids[i];\n\n // Cards fill from left to right, bottom to top\n // For a 2-column bucket: i=0,1 in row 0; i=2,3 in row 1; etc.\n const col = i % COLUMNS_PER_BUCKET;\n const row = Math.floor(i / COLUMNS_PER_BUCKET);\n\n // Center the cards within the bucket\n // The bucket width fits 2 slots (2W + 2G). Cards take 2W + G.\n // So we have G/2 padding on each side to center them.\n const x = groupX + (col * slotWidth) + (CARD_GAP / 2);\n\n // Position cards from bottom of container, stacking upwards, starting at row 0 (bottom)\n const y = CANVAS_PADDING + contentHeight - BOTTOM_MARGIN - ((row + 1) * slotHeight);\n\n positions.set(id, {\n x,\n y,\n groupIndex,\n });\n }\n\n // Always use fixed bucket width\n bucketWidths.push(bucketWidth);\n\n // Advance position by fixed bucket width + spacing\n groupX += bucketWidth;\n if (groupIndex < grouping.groups.length - 1) {\n groupX += effectiveGroupSpacing;\n }\n }\n\n return {\n positions,\n totalWidth: groupX + CANVAS_PADDING,\n totalHeight: contentHeight + (CANVAS_PADDING * 2),\n bucketWidths,\n groupXs,\n };\n}\n"],"names":[],"mappings":";;AAYM,SAAU,aAAa,CAC3B,QAAwB,EACxB,IAAgB,EAAA;AAEhB,IAAA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAwB;AAEjD,IAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,YAAY,EAAE;QAClC,OAAO,uBAAuB,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC;IAC3D;SAAO;QACL,OAAO,oBAAoB,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC;IACxD;AACF;AAEA,SAAS,uBAAuB,CAC9B,QAAwB,EACxB,IAAgB,EAChB,SAAoC,EAAA;IAEpC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,IAAI;AACtD,IAAA,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ;AACtC,IAAA,MAAM,UAAU,GAAG,UAAU,GAAG,QAAQ;IAGxC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,GAAG,QAAQ,IAAI,cAAc,GAAG,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC;IAE3G,IAAI,CAAC,GAAG,cAAc;IACtB,IAAI,CAAC,GAAG,cAAc;IACtB,IAAI,MAAM,GAAG,CAAC;IACd,IAAI,SAAS,GAAG,CAAC;AAEjB,IAAA,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,MAAM,EAAE;AACnC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAA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G,GAAG,CAAC,IAAI,UAAU,CAAC;AAEnF,YAAA,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE;gBAChB,CAAC;gBACD,CAAC;gBACD,UAAU;AACX,aAAA,CAAC;QACJ;AAGA,QAAA,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC;QAG9B,MAAM,IAAI,WAAW;QACrB,IAAI,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3C,MAAM,IAAI,qBAAqB;QACjC;IACF;IAEA,OAAO;QACL,SAAS;QACT,UAAU,EAAE,MAAM,GAAG,cAAc;AACnC,QAAA,WAAW,EAAE,aAAa,IAAI,cAAc,GAAG,CAAC,CAAC;QACjD,YAAY;QACZ,OAAO;KACR;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"pivot.worker.d.ts","sourceRoot":"","sources":["../../../../PivotViewer/engine/pivot.worker.ts"],"names":[],"mappings":"AAyGA,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"pivot.worker.d.ts","sourceRoot":"","sources":["../../../../PivotViewer/engine/pivot.worker.ts"],"names":[],"mappings":"AA+FA,OAAO,EAAE,CAAC"}