@spatial-elements/core 1.0.0-beta.13 → 1.0.0-beta.15

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 (69) hide show
  1. package/dist/catalog/CarouselSectionSurfaces.d.ts.map +1 -1
  2. package/dist/catalog/CarouselSectionSurfaces.js +8 -2
  3. package/dist/catalog/CarouselSectionSurfaces.js.map +1 -1
  4. package/dist/catalog/CatalogSpatialElementLayer.d.ts.map +1 -1
  5. package/dist/catalog/CatalogSpatialElementLayer.js +12 -4
  6. package/dist/catalog/CatalogSpatialElementLayer.js.map +1 -1
  7. package/dist/catalog/SourceDomMotion.d.ts.map +1 -1
  8. package/dist/catalog/SourceDomMotion.js +2 -3
  9. package/dist/catalog/SourceDomMotion.js.map +1 -1
  10. package/dist/catalog/carouselRenderClip.d.ts +4 -0
  11. package/dist/catalog/carouselRenderClip.d.ts.map +1 -0
  12. package/dist/catalog/carouselRenderClip.js +15 -0
  13. package/dist/catalog/carouselRenderClip.js.map +1 -0
  14. package/dist/spatial-element/SpatialElementDockController.d.ts +5 -3
  15. package/dist/spatial-element/SpatialElementDockController.d.ts.map +1 -1
  16. package/dist/spatial-element/SpatialElementDockController.js +41 -30
  17. package/dist/spatial-element/SpatialElementDockController.js.map +1 -1
  18. package/dist/spatial-element/SpatialElementPaneController.d.ts +4 -4
  19. package/dist/spatial-element/SpatialElementPaneController.d.ts.map +1 -1
  20. package/dist/spatial-element/SpatialElementPaneController.js +46 -20
  21. package/dist/spatial-element/SpatialElementPaneController.js.map +1 -1
  22. package/dist/spatial-element/responsiveLayout.d.ts.map +1 -1
  23. package/dist/spatial-element/responsiveLayout.js +4 -2
  24. package/dist/spatial-element/responsiveLayout.js.map +1 -1
  25. package/dist/spatial-element/spatialElementDock.d.ts +1 -1
  26. package/dist/spatial-element/spatialElementDock.d.ts.map +1 -1
  27. package/dist/spatial-element/spatialElementDock.js +2 -2
  28. package/dist/spatial-element/spatialElementDock.js.map +1 -1
  29. package/dist/stage/DetailWheelGesture.d.ts +17 -2
  30. package/dist/stage/DetailWheelGesture.d.ts.map +1 -1
  31. package/dist/stage/DetailWheelGesture.js +45 -7
  32. package/dist/stage/DetailWheelGesture.js.map +1 -1
  33. package/dist/stage/HeldSceneCapture.d.ts +15 -0
  34. package/dist/stage/HeldSceneCapture.d.ts.map +1 -0
  35. package/dist/stage/HeldSceneCapture.js +48 -0
  36. package/dist/stage/HeldSceneCapture.js.map +1 -0
  37. package/dist/stage/MinimapController.d.ts +2 -0
  38. package/dist/stage/MinimapController.d.ts.map +1 -1
  39. package/dist/stage/MinimapController.js +23 -3
  40. package/dist/stage/MinimapController.js.map +1 -1
  41. package/dist/stage/PanelPresentationController.d.ts +5 -0
  42. package/dist/stage/PanelPresentationController.d.ts.map +1 -1
  43. package/dist/stage/PanelPresentationController.js +74 -30
  44. package/dist/stage/PanelPresentationController.js.map +1 -1
  45. package/dist/stage/SpaceMouseAdapter.js +8 -6
  46. package/dist/stage/SpaceMouseAdapter.js.map +1 -1
  47. package/dist/stage/SpatialElementInteractionController.d.ts +27 -2
  48. package/dist/stage/SpatialElementInteractionController.d.ts.map +1 -1
  49. package/dist/stage/SpatialElementInteractionController.js +272 -56
  50. package/dist/stage/SpatialElementInteractionController.js.map +1 -1
  51. package/dist/stage/StageExperience.d.ts.map +1 -1
  52. package/dist/stage/StageExperience.js +17 -17
  53. package/dist/stage/StageExperience.js.map +1 -1
  54. package/dist/stage/StageRenderPipeline.d.ts +1 -0
  55. package/dist/stage/StageRenderPipeline.d.ts.map +1 -1
  56. package/dist/stage/StageRenderPipeline.js +15 -8
  57. package/dist/stage/StageRenderPipeline.js.map +1 -1
  58. package/dist/stage/TrackpadGesture.d.ts +17 -0
  59. package/dist/stage/TrackpadGesture.d.ts.map +1 -0
  60. package/dist/stage/TrackpadGesture.js +39 -0
  61. package/dist/stage/TrackpadGesture.js.map +1 -0
  62. package/dist/stage/cssProjection.d.ts +3 -1
  63. package/dist/stage/cssProjection.d.ts.map +1 -1
  64. package/dist/stage/cssProjection.js +8 -3
  65. package/dist/stage/cssProjection.js.map +1 -1
  66. package/dist/stage/rendererState.d.ts.map +1 -1
  67. package/dist/stage/rendererState.js +24 -9
  68. package/dist/stage/rendererState.js.map +1 -1
  69. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SourceDomMotion.d.ts","sourceRoot":"","sources":["../../src/catalog/SourceDomMotion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE7F,MAAM,WAAW,mBAAmB;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE;AAClG,MAAM,WAAW,eAAe;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;AAE9F,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAGzH;AAOD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAW7H;AAED,8EAA8E;AAC9E,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,eAAe,eAQ3E,MAAM,sCAMxB;AAOD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,eAAe;uBAwBrF,MAAM;;;cAqBhC"}
1
+ {"version":3,"file":"SourceDomMotion.d.ts","sourceRoot":"","sources":["../../src/catalog/SourceDomMotion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAkC,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnG,MAAM,WAAW,mBAAmB;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE;AAClG,MAAM,WAAW,eAAe;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;AAE9F,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAEzH;AAOD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAW7H;AAED,8EAA8E;AAC9E,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,eAAe,eAQ3E,MAAM,sCAMxB;AAOD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,eAAe;uBAwBrF,MAAM;;;cAqBhC"}
@@ -1,8 +1,7 @@
1
1
  import { Matrix4 } from 'three';
2
- import { getProjectiveCssMatrix3d } from '../stage/cssProjection.js';
2
+ import { getProjectiveCssMatrixElements } from '../stage/cssProjection.js';
3
3
  export function sourceDomProjectiveMatrix(corners, width, height) {
4
- const css = getProjectiveCssMatrix3d(corners, width, height);
5
- return css ? css.slice(9, -1).split(',').map(Number) : undefined;
4
+ return getProjectiveCssMatrixElements(corners, width, height) ?? undefined;
6
5
  }
7
6
  function projectiveMatrix(corners, width, height) {
8
7
  const values = sourceDomProjectiveMatrix(corners, width, height);
@@ -1 +1 @@
1
- {"version":3,"file":"SourceDomMotion.js","sourceRoot":"","sources":["../../src/catalog/SourceDomMotion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,wBAAwB,EAA0B,MAAM,2BAA2B,CAAC;AAK7F,MAAM,UAAU,yBAAyB,CAAC,OAA0B,EAAE,KAAa,EAAE,MAAc;IAClG,MAAM,GAAG,GAAG,wBAAwB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAC7D,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC;AAED,SAAS,gBAAgB,CAAC,OAA0B,EAAE,KAAa,EAAE,MAAc;IAClF,MAAM,MAAM,GAAG,yBAAyB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACjE,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,MAA2B,EAAE,MAAuB,EAAE,QAAgB;IACzG,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC5E,MAAM,GAAG,GAAG;QACX,EAAE,CAAC,EAAE,MAAM,C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AAG,KAAK,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC7C,KAAK,CAAC,WAAW,EAAE,YAAY,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/G,OAAO,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC,CAAC;IACF,MAAM,CAAC,CAAC,CAAC,CAAC;IACV,OAAO;QACN,MAAM;QACN,IAAI,KAAK,IAAI,CAAC,QAAQ;YAAE,KAAK,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxD,OAAO;YACN,IAAI,QAAQ;gBAAE,OAAO;YACrB,QAAQ,GAAG,IAAI,CAAC;YAChB,KAAK,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,KAAK,EAAE,CAAC;gBACnD,IAAI,KAAK;oBAAE,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;;oBAC3D,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YAC7C,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import { Matrix4 } from 'three';\nimport { getProjectiveCssMatrix3d, type CssProjectionQuad } from '../stage/cssProjection.js';\n\nexport interface SourceDomProjection { width: number; height: number; corners: CssProjectionQuad }\nexport interface SourceDomTarget { left: number; top: number; width: number; height?: number }\n\nexport function sourceDomProjectiveMatrix(corners: CssProjectionQuad, width: number, height: number): number[] | undefined {\n\tconst css = getProjectiveCssMatrix3d(corners, width, height);\n\treturn css ? css.slice(9, -1).split(',').map(Number) : undefined;\n}\n\nfunction projectiveMatrix(corners: CssProjectionQuad, width: number, height: number) {\n\tconst values = sourceDomProjectiveMatrix(corners, width, height);\n\treturn values ? new Matrix4().fromArray(values) : undefined;\n}\n\nexport function sourceDomMotionQuad(source: SourceDomProjection, target: SourceDomTarget, progress: number): CssProjectionQuad {\n\tconst t = Math.min(1, Math.max(0, progress));\n\tconst height = target.height ?? source.height * target.width / source.width;\n\tconst end = [\n\t\t{ x: target.left, y: target.top }, { x: target.left + target.width, y: target.top },\n\t\t{ x: target.left + target.width, y: target.top + height }, { x: target.left, y: target.top + height }\n\t];\n\treturn source.corners.map((point, index) => ({\n\t\tx: point.x + (end[index].x - point.x) * t,\n\t\ty: point.y + (end[index].y - point.y) * t\n\t})) as unknown as CssProjectionQuad;\n}\n\n/** A planar correction on the RIGHT of the original local CSS3D transform. */\nexport function createSourceDomProjection(source: SourceDomProjection, target: SourceDomTarget) {\n\tif (![source.width, source.height, target.width].every(value => Number.isFinite(value) && value > 0) ||\n\t\t![target.left, target.top].every(Number.isFinite)) return;\n\tconst height = target.height ?? source.height * target.width / source.width;\n\tif (!Number.isFinite(height) || height <= 0) return;\n\tconst start = projectiveMatrix(source.corners, source.width, source.height);\n\tif (!start || !Number.isFinite(start.determinant()) || Math.abs(start.determinant()) < 1e-12) return;\n\tconst inverse = start.invert();\n\treturn (progress: number) => {\n\t\tif (!Number.isFinite(progress)) return;\n\t\tconst corners = sourceDomMotionQuad(source, target, progress);\n\t\tconst current = projectiveMatrix(corners, source.width, source.height);\n\t\treturn current ? inverse.clone().multiply(current) : undefined;\n\t};\n}\n\nconst OWNED_PROPERTIES = [\n\t'transform', 'transform-origin', 'width', 'height', 'min-width', 'max-width',\n\t'min-height', 'max-height', 'box-sizing', 'transition', 'animation', 'will-change', 'visibility'\n] as const;\n\n/**\n * Moves the existing node in its existing parent. No node creation, removal,\n * reparenting, destination layout, or renderer work occurs during this motion.\n * Callers freeze competing transform writers and keep clipping ancestors stable.\n */\nexport function createSourceDomMotion(element: HTMLElement, source: SourceDomProjection, target: SourceDomTarget) {\n\tconst project = createSourceDomProjection(source, target);\n\tif (!project) return;\n\tconst computed = getComputedStyle(element);\n\t// Individual transform properties precede `transform`. Until captured as part\n\t// of the local matrix, authored use must keep the ordinary transition path.\n\tif ([computed.translate, computed.rotate, computed.scale].some(value => value && value !== 'none')) return;\n\tconst origin = computed.transformOrigin.split(' ').map(Number.parseFloat);\n\tif (!Number.isFinite(origin[0]) || !Number.isFinite(origin[1])) return;\n\tconst css = new DOMMatrix(computed.transform === 'none' ? undefined : computed.transform);\n\tconst local = new Matrix4().makeTranslation(origin[0], origin[1], origin[2] || 0)\n\t\t.multiply(new Matrix4().fromArray(css.toFloat64Array()))\n\t\t.multiply(new Matrix4().makeTranslation(-origin[0], -origin[1], -(origin[2] || 0)));\n\tconst saved = OWNED_PROPERTIES.map(property => ({ property,\n\t\tvalue: element.style.getPropertyValue(property), priority: element.style.getPropertyPriority(property) }));\n\tconst write = (property: string, value: string) => element.style.setProperty(property, value, 'important');\n\t// Freeze the captured border box, retaining the source's own query width and\n\t// line wrapping. Its later intrinsic destination height belongs to reveal.\n\twrite('box-sizing', 'border-box');\n\tfor (const property of ['width', 'min-width', 'max-width']) write(property, `${source.width}px`);\n\tfor (const property of ['height', 'min-height', 'max-height']) write(property, `${source.height}px`);\n\twrite('transition', 'none'); write('animation', 'none');\n\twrite('transform-origin', '0px 0px 0px'); write('will-change', 'transform');\n\tlet restored = false;\n\tconst update = (progress: number) => {\n\t\tif (restored) return;\n\t\tconst delta = project(progress);\n\t\tif (!delta) return;\n\t\tconst matrix = local.clone().multiply(delta);\n\t\twrite('transform', `matrix3d(${matrix.elements.map(value => Math.abs(value) < 1e-12 ? 0 : value).join(',')})`);\n\t\treturn sourceDomMotionQuad(source, target, progress);\n\t};\n\tupdate(0);\n\treturn {\n\t\tupdate,\n\t\thide() { if (!restored) write('visibility', 'hidden'); },\n\t\trestore() {\n\t\t\tif (restored) return;\n\t\t\trestored = true;\n\t\t\tfor (const { property, value, priority } of saved) {\n\t\t\t\tif (value) element.style.setProperty(property, value, priority);\n\t\t\t\telse element.style.removeProperty(property);\n\t\t\t}\n\t\t}\n\t};\n}\n"]}
1
+ {"version":3,"file":"SourceDomMotion.js","sourceRoot":"","sources":["../../src/catalog/SourceDomMotion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,8BAA8B,EAA0B,MAAM,2BAA2B,CAAC;AAKnG,MAAM,UAAU,yBAAyB,CAAC,OAA0B,EAAE,KAAa,EAAE,MAAc;IAClG,OAAO,8BAA8B,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,SAAS,CAAC;AAC5E,CAAC;AAED,SAAS,gBAAgB,CAAC,OAA0B,EAAE,KAAa,EAAE,MAAc;IAClF,MAAM,MAAM,GAAG,yBAAyB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACjE,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,MAA2B,EAAE,MAAuB,EAAE,QAAgB;IACzG,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC5E,MAAM,GAAG,GAAG;QACX,EAAE,CAAC,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,C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C,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/G,OAAO,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC,CAAC;IACF,MAAM,CAAC,CAAC,CAAC,CAAC;IACV,OAAO;QACN,MAAM;QACN,IAAI,KAAK,IAAI,CAAC,QAAQ;YAAE,KAAK,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxD,OAAO;YACN,IAAI,QAAQ;gBAAE,OAAO;YACrB,QAAQ,GAAG,IAAI,CAAC;YAChB,KAAK,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,KAAK,EAAE,CAAC;gBACnD,IAAI,KAAK;oBAAE,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;;oBAC3D,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YAC7C,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import { Matrix4 } from 'three';\nimport { getProjectiveCssMatrixElements, type CssProjectionQuad } from '../stage/cssProjection.js';\n\nexport interface SourceDomProjection { width: number; height: number; corners: CssProjectionQuad }\nexport interface SourceDomTarget { left: number; top: number; width: number; height?: number }\n\nexport function sourceDomProjectiveMatrix(corners: CssProjectionQuad, width: number, height: number): number[] | undefined {\n\treturn getProjectiveCssMatrixElements(corners, width, height) ?? undefined;\n}\n\nfunction projectiveMatrix(corners: CssProjectionQuad, width: number, height: number) {\n\tconst values = sourceDomProjectiveMatrix(corners, width, height);\n\treturn values ? new Matrix4().fromArray(values) : undefined;\n}\n\nexport function sourceDomMotionQuad(source: SourceDomProjection, target: SourceDomTarget, progress: number): CssProjectionQuad {\n\tconst t = Math.min(1, Math.max(0, progress));\n\tconst height = target.height ?? source.height * target.width / source.width;\n\tconst end = [\n\t\t{ x: target.left, y: target.top }, { x: target.left + target.width, y: target.top },\n\t\t{ x: target.left + target.width, y: target.top + height }, { x: target.left, y: target.top + height }\n\t];\n\treturn source.corners.map((point, index) => ({\n\t\tx: point.x + (end[index].x - point.x) * t,\n\t\ty: point.y + (end[index].y - point.y) * t\n\t})) as unknown as CssProjectionQuad;\n}\n\n/** A planar correction on the RIGHT of the original local CSS3D transform. */\nexport function createSourceDomProjection(source: SourceDomProjection, target: SourceDomTarget) {\n\tif (![source.width, source.height, target.width].every(value => Number.isFinite(value) && value > 0) ||\n\t\t![target.left, target.top].every(Number.isFinite)) return;\n\tconst height = target.height ?? source.height * target.width / source.width;\n\tif (!Number.isFinite(height) || height <= 0) return;\n\tconst start = projectiveMatrix(source.corners, source.width, source.height);\n\tif (!start || !Number.isFinite(start.determinant()) || Math.abs(start.determinant()) < 1e-12) return;\n\tconst inverse = start.invert();\n\treturn (progress: number) => {\n\t\tif (!Number.isFinite(progress)) return;\n\t\tconst corners = sourceDomMotionQuad(source, target, progress);\n\t\tconst current = projectiveMatrix(corners, source.width, source.height);\n\t\treturn current ? inverse.clone().multiply(current) : undefined;\n\t};\n}\n\nconst OWNED_PROPERTIES = [\n\t'transform', 'transform-origin', 'width', 'height', 'min-width', 'max-width',\n\t'min-height', 'max-height', 'box-sizing', 'transition', 'animation', 'will-change', 'visibility'\n] as const;\n\n/**\n * Moves the existing node in its existing parent. No node creation, removal,\n * reparenting, destination layout, or renderer work occurs during this motion.\n * Callers freeze competing transform writers and keep clipping ancestors stable.\n */\nexport function createSourceDomMotion(element: HTMLElement, source: SourceDomProjection, target: SourceDomTarget) {\n\tconst project = createSourceDomProjection(source, target);\n\tif (!project) return;\n\tconst computed = getComputedStyle(element);\n\t// Individual transform properties precede `transform`. Until captured as part\n\t// of the local matrix, authored use must keep the ordinary transition path.\n\tif ([computed.translate, computed.rotate, computed.scale].some(value => value && value !== 'none')) return;\n\tconst origin = computed.transformOrigin.split(' ').map(Number.parseFloat);\n\tif (!Number.isFinite(origin[0]) || !Number.isFinite(origin[1])) return;\n\tconst css = new DOMMatrix(computed.transform === 'none' ? undefined : computed.transform);\n\tconst local = new Matrix4().makeTranslation(origin[0], origin[1], origin[2] || 0)\n\t\t.multiply(new Matrix4().fromArray(css.toFloat64Array()))\n\t\t.multiply(new Matrix4().makeTranslation(-origin[0], -origin[1], -(origin[2] || 0)));\n\tconst saved = OWNED_PROPERTIES.map(property => ({ property,\n\t\tvalue: element.style.getPropertyValue(property), priority: element.style.getPropertyPriority(property) }));\n\tconst write = (property: string, value: string) => element.style.setProperty(property, value, 'important');\n\t// Freeze the captured border box, retaining the source's own query width and\n\t// line wrapping. Its later intrinsic destination height belongs to reveal.\n\twrite('box-sizing', 'border-box');\n\tfor (const property of ['width', 'min-width', 'max-width']) write(property, `${source.width}px`);\n\tfor (const property of ['height', 'min-height', 'max-height']) write(property, `${source.height}px`);\n\twrite('transition', 'none'); write('animation', 'none');\n\twrite('transform-origin', '0px 0px 0px'); write('will-change', 'transform');\n\tlet restored = false;\n\tconst update = (progress: number) => {\n\t\tif (restored) return;\n\t\tconst delta = project(progress);\n\t\tif (!delta) return;\n\t\tconst matrix = local.clone().multiply(delta);\n\t\twrite('transform', `matrix3d(${matrix.elements.map(value => Math.abs(value) < 1e-12 ? 0 : value).join(',')})`);\n\t\treturn sourceDomMotionQuad(source, target, progress);\n\t};\n\tupdate(0);\n\treturn {\n\t\tupdate,\n\t\thide() { if (!restored) write('visibility', 'hidden'); },\n\t\trestore() {\n\t\t\tif (restored) return;\n\t\t\trestored = true;\n\t\t\tfor (const { property, value, priority } of saved) {\n\t\t\t\tif (value) element.style.setProperty(property, value, priority);\n\t\t\t\telse element.style.removeProperty(property);\n\t\t\t}\n\t\t}\n\t};\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { BlurRect } from './CatalogDepthBlur.js';
2
+ /** Standard-width surfaces can be overflown; full-width backgrounds separate scenes. */
3
+ export declare function carouselRenderClip(surface: BlurRect, fullSurfaces: readonly BlurRect[], viewportWidth: number, documentTop: number, documentBottom: number, ownFull: boolean): BlurRect;
4
+ //# sourceMappingURL=carouselRenderClip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carouselRenderClip.d.ts","sourceRoot":"","sources":["../../src/catalog/carouselRenderClip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,QAAQ,EAAE,EACtF,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAS/F"}
@@ -0,0 +1,15 @@
1
+ /** Standard-width surfaces can be overflown; full-width backgrounds separate scenes. */
2
+ export function carouselRenderClip(surface, fullSurfaces, viewportWidth, documentTop, documentBottom, ownFull) {
3
+ if (ownFull)
4
+ return { ...surface };
5
+ let top = documentTop, bottom = documentBottom;
6
+ for (const other of fullSurfaces) {
7
+ const end = other.top + other.height;
8
+ if (end <= surface.top + 1)
9
+ top = Math.max(top, end);
10
+ if (other.top >= surface.top + surface.height - 1)
11
+ bottom = Math.min(bottom, other.top);
12
+ }
13
+ return { left: 0, top, width: viewportWidth, height: Math.max(0, bottom - top) };
14
+ }
15
+ //# sourceMappingURL=carouselRenderClip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carouselRenderClip.js","sourceRoot":"","sources":["../../src/catalog/carouselRenderClip.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,MAAM,UAAU,kBAAkB,CAAC,OAAiB,EAAE,YAAiC,EACtF,aAAqB,EAAE,WAAmB,EAAE,cAAsB,EAAE,OAAgB;IACpF,IAAI,OAAO;QAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;IACnC,IAAI,GAAG,GAAG,WAAW,EAAE,MAAM,GAAG,cAAc,CAAC;IAC/C,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;QACrC,IAAI,GAAG,IAAI,OAAO,CAAC,GAAG,GAAG,CAAC;YAAE,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACrD,IAAI,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC;AAClF,CAAC","sourcesContent":["import type { BlurRect } from './CatalogDepthBlur.js';\n\n/** Standard-width surfaces can be overflown; full-width backgrounds separate scenes. */\nexport function carouselRenderClip(surface: BlurRect, fullSurfaces: readonly BlurRect[],\n\tviewportWidth: number, documentTop: number, documentBottom: number, ownFull: boolean): BlurRect {\n\tif (ownFull) return { ...surface };\n\tlet top = documentTop, bottom = documentBottom;\n\tfor (const other of fullSurfaces) {\n\t\tconst end = other.top + other.height;\n\t\tif (end <= surface.top + 1) top = Math.max(top, end);\n\t\tif (other.top >= surface.top + surface.height - 1) bottom = Math.min(bottom, other.top);\n\t}\n\treturn { left: 0, top, width: viewportWidth, height: Math.max(0, bottom - top) };\n}\n"]}
@@ -34,6 +34,7 @@ export declare class SpatialElementDockController {
34
34
  private minimapOriginalModelTop;
35
35
  private minimapOriginalModelLeft;
36
36
  private minimapDock?;
37
+ private minimapSource?;
37
38
  private minimapViewportTop;
38
39
  private minimapViewportLeft;
39
40
  private tabsDock?;
@@ -54,6 +55,7 @@ export declare class SpatialElementDockController {
54
55
  private minimapModelScale;
55
56
  private scrollY;
56
57
  private minimapDockApplied;
58
+ private appliedMinimapProgress;
57
59
  private started;
58
60
  private docked;
59
61
  private presentationProgress;
@@ -104,9 +106,9 @@ export declare class SpatialElementDockController {
104
106
  private restoreStickyTabs;
105
107
  private measureDepartingContent;
106
108
  private contentViewportTop;
107
- private updateDepartingContentClipping;
108
- private restoreDepartingContentClipping;
109
- private restoreContentClipping;
109
+ private updateDepartingContentMask;
110
+ private restoreDepartingContentMasks;
111
+ private restoreContentMask;
110
112
  private restoreMinimap;
111
113
  }
112
114
  //# sourceMappingURL=SpatialElementDockController.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpatialElementDockController.d.ts","sourceRoot":"","sources":["../../src/spatial-element/SpatialElementDockController.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AA6CnE;;;GAGG;AACH,qBAAa,4BAA4B;IAuD5B,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAe,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IAClF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAvD/B,OAAO,CAAC,aAAa,CAAC,CAAc;IACpC,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,SAAS,CAAC,CAAc;IAChC,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,mBAAmB,CAAC,CAAc;IAC1C,OAAO,CAAC,0BAA0B,CAAC,CAAc;IACjD,OAAO,CAAC,+BAA+B,CAAC,CAAmB;IAC3D,OAAO,CAAC,yBAAyB,CAAuB;IACxD,OAAO,CAAC,UAAU,CAAC,CAAc;IACjC,OAAO,CAAC,SAAS,CAAC,CAAc;IAChC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AC,aAAa;IAYrB,OAAO,CAAC,iBAAiB;IAyBzB,OAAO,CAAC,2BAA2B;IAanC,OAAO,CAAC,wBAAwB;IAYhC,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,uBAAuB;IAqB/B,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,8BAA8B;IAYtC,OAAO,CAAC,+BAA+B;IAIvC,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,cAAc;CAMtB"}
1
+ {"version":3,"file":"SpatialElementDockController.d.ts","sourceRoot":"","sources":["../../src/spatial-element/SpatialElementDockController.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AA4CnE;;;GAGG;AACH,qBAAa,4BAA4B;IAyD5B,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAe,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IAClF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAzD/B,OAAO,CAAC,aAAa,CAAC,CAAc;IACpC,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,SAAS,CAAC,CAAc;IAChC,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,mBAAmB,CAAC,CAAc;IAC1C,OAAO,CAAC,0BAA0B,CAAC,CAAc;IACjD,OAAO,CAAC,+BAA+B,CAAC,CAAmB;IAC3D,OAAO,CAAC,yBAAyB,CAAuB;IACxD,OAAO,CAAC,UAAU,CAAC,CAAc;IACjC,OAAO,CAAC,SAAS,CAAC,CAAc;IAChC,OAAO,CAAC,cAAc,CAAC,CAAc;IACrC,OAAO,CAAC,UAAU,CAAC,CAAc;IACjC,OAAO,CAAC,QAAQ,CAAC,CAAc;IAC/B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,sBAAsB,CAAC,CAAc;IAC7C,OAA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BAAsB;IAY9B,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,uBAAuB;IAqB/B,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,0BAA0B;IAgBlC,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,cAAc;CAMtB"}
@@ -49,6 +49,7 @@ export class SpatialElementDockController {
49
49
  minimapOriginalModelTop = null;
50
50
  minimapOriginalModelLeft = null;
51
51
  minimapDock;
52
+ minimapSource;
52
53
  minimapViewportTop = 0;
53
54
  minimapViewportLeft = 0;
54
55
  tabsDock;
@@ -69,6 +70,7 @@ export class SpatialElementDockController {
69
70
  minimapModelScale = 1;
70
71
  scrollY = 0;
71
72
  minimapDockApplied = false;
73
+ appliedMinimapProgress = -1;
72
74
  started = false;
73
75
  docked = false;
74
76
  presentationProgress = 0;
@@ -114,8 +116,7 @@ export class SpatialElementDockController {
114
116
  this.departingContent = Array.from(this.root.querySelectorAll(DEPARTING_CONTENT)).map((element) => ({
115
117
  element,
116
118
  frame: element.closest(PANEL_FRAME) ?? undefined,
117
- clipPath: element.style.clipPath,
118
- webkitClipPath: element.style.getPropertyValue('-webkit-clip-path'),
119
+ maskImage: element.style.maskImage,
119
120
  documentTop: 0,
120
121
  height: 0
121
122
  }));
@@ -182,7 +183,7 @@ export class SpatialElementDockController {
182
183
  this.setTabsActive(false);
183
184
  this.restoreStickyTabs();
184
185
  this.restoreStickyHeader();
185
- this.restoreDepartingContentClipping();
186
+ this.restoreDepartingContentMasks();
186
187
  this.root.removeAttribute('data-spatial-element-dock-active');
187
188
  this.root.removeAttribute('data-spatial-element-tabs-dock-active');
188
189
  this.root.style.removeProperty('--spatial-element-section-scroll-offset');
@@ -206,7 +207,9 @@ export class SpatialElementDockController {
206
207
  };
207
208
  handleResize = () => {
208
209
  this.scrollY = getStageVisualScrollPosition().scrollY;
209
- this.measure();
210
+ // Restore, measure and reapply the dock in one frame. Never expose the
211
+ // offscreen source frame to rendering between ResizeObserver and RAF.
212
+ this.layoutDirty = true;
210
213
  this.schedule();
211
214
  };
212
215
  handlePanelLayout = (event) => {
@@ -227,6 +230,7 @@ export class SpatialElementDockController {
227
230
  // Thumbnail scrolling must not move the page's docking threshold. Measure
228
231
  // the first thumbnail in its unscrolled rail while preserving outer/page scroll.
229
232
  const minimapPageTop = minimapRect.top + (this.mediaRail?.scrollTop ?? 0) + this.scrollY;
233
+ this.minimapSource = { ...minimapRect, top: minimapPageTop };
230
234
  const tabsWidth = this.sourceTabsList?.querySelector(TABS_LINKS)?.scrollWidth ?? 0;
231
235
  const metrics = this.readLayoutMetrics?.() ?? {
232
236
  width: window.innerWidth, height: window.innerHeight,
@@ -294,6 +298,7 @@ export class SpatialElementDockController {
294
298
  const minimapProgress = getSpatialElementDockPresentationProgress(this.scrollY, this.presentationEndScrollY, this.minimapAnimationStart);
295
299
  this.applyMinimapPresentation(minimapProgress, presentationProgress);
296
300
  this.applyHeaderPresentation(presentationProgress);
301
+ this.presentationProgress = presentationProgress;
297
302
  this.applyState(docked);
298
303
  this.applyTabsPresentation(tabsDocked);
299
304
  this.applyTabsState(tabsDocked);
@@ -304,13 +309,21 @@ export class SpatialElementDockController {
304
309
  if (!this.minimapFrame || !this.minimapDock)
305
310
  return;
306
311
  const changed = docked !== this.docked;
307
- const dockLayoutChanged = docked && !this.minimapDockApplied;
312
+ const dockLayoutChanged = docked && (!this.minimapDockApplied || this.appliedMinimapProgress !== this.presentationProgress);
313
+ this.appliedMinimapProgress = this.presentationProgress;
308
314
  this.docked = docked;
309
315
  if (docked) {
310
- if (!this.minimapDockApplied) {
311
- applyFixedRect(this.minimapFrame, this.minimapDock);
312
- this.minimapDockApplied = true;
313
- }
316
+ // The source and dock can have different sizes and horizontal positions.
317
+ // Interpolate them instead of replacing the fit square at the threshold.
318
+ const source = this.minimapSource ?? this.minimapDock;
319
+ const p = this.presentationProgress;
320
+ applyFixedRect(this.minimapFrame, {
321
+ left: source.left + (this.minimapDock.left - source.left) * p,
322
+ top: this.minimapDock.top,
323
+ width: source.width + (this.minimapDock.width - source.width) * p,
324
+ height: source.height + (this.minimapDock.height - source.height) * p
325
+ });
326
+ this.minimapDockApplied = true;
314
327
  // The virtual document is a transformed containing block. Counter only
315
328
  // this dock's scroll offset instead of invalidating inherited styles
316
329
  // across the complete page with a per-frame CSS custom property.
@@ -329,12 +342,12 @@ export class SpatialElementDockController {
329
342
  // The fit square can extend above the viewport for large layouts. The live
330
343
  // model follows this top edge through the same continuous dock morph,
331
344
  // including its hover and sensor pose, instead of being clipped by it.
332
- this.setMinimapModelTop(docked ? this.minimapViewportTop : undefined);
345
+ this.setMinimapModelTop(this.minimapDockProgress > 0 ? this.minimapViewportTop : undefined);
333
346
  this.minimapFrame.setAttribute('data-stage-minimap-model-left', this.minimapViewportLeft.toFixed(3));
334
347
  if (docked)
335
- this.updateDepartingContentClipping();
348
+ this.updateDepartingContentMask();
336
349
  else if (changed)
337
- this.restoreDepartingContentClipping();
350
+ this.restoreDepartingContentMasks();
338
351
  if (changed || dockLayoutChanged) {
339
352
  window.dispatchEvent(new CustomEvent(STAGE_PANEL_LAYOUT_EVENT, { detail: { source: 'spatial-element-dock' } }));
340
353
  }
@@ -670,31 +683,29 @@ export class SpatialElementDockController {
670
683
  ? getStickyPanelTop(sticky.documentTop, sticky.height, sticky.boundaryBottom, sticky.inset, this.scrollY) + sticky.contentInset
671
684
  : state.documentTop - this.scrollY;
672
685
  }
673
- updateDepartingContentClipping() {
686
+ updateDepartingContentMask() {
674
687
  for (const state of this.departingContent) {
675
688
  const viewportTop = this.contentViewportTop(state);
676
- const inset = Math.min(Math.max(this.stickyHeaderBottom - viewportTop, 0), state.height);
677
- const clipPath = `inset(${inset.toFixed(2)}px 0 0 0)`;
678
- if (state.appliedClipPath === clipPath)
689
+ // A translucent header cannot conceal a hard clip edge. Fade only the
690
+ // overlapping copy/media with the header, with a feather at its edge.
691
+ // The rest of the summary remains fully visible and interactive.
692
+ const edge = this.stickyHeaderBottom - viewportTop;
693
+ const alpha = (1 - this.presentationProgress).toFixed(6);
694
+ const mask = edge <= 0 || this.presentationProgress === 0 ? state.maskImage :
695
+ `linear-gradient(to bottom, rgb(0 0 0 / ${alpha}) ${Math.max(0, edge - 12).toFixed(2)}px, #000 ${Math.max(0, edge).toFixed(2)}px)`;
696
+ if (state.appliedMask === mask)
679
697
  continue;
680
- state.appliedClipPath = clipPath;
681
- state.element.style.clipPath = clipPath;
682
- state.element.style.setProperty('-webkit-clip-path', clipPath);
698
+ state.appliedMask = mask;
699
+ state.element.style.maskImage = mask;
683
700
  }
684
701
  }
685
- restoreDepartingContentClipping() {
702
+ restoreDepartingContentMasks() {
686
703
  for (const state of this.departingContent)
687
- this.restoreContentClipping(state);
704
+ this.restoreContentMask(state);
688
705
  }
689
- restoreContentClipping(state) {
690
- state.appliedClipPath = undefined;
691
- state.element.style.clipPath = state.clipPath;
692
- if (state.webkitClipPath) {
693
- state.element.style.setProperty('-webkit-clip-path', state.webkitClipPath);
694
- }
695
- else {
696
- state.element.style.removeProperty('-webkit-clip-path');
697
- }
706
+ restoreContentMask(state) {
707
+ state.appliedMask = undefined;
708
+ state.element.style.maskImage = state.maskImage;
698
709
  }
699
710
  restoreMinimap() {
700
711
  if (!this.minimapFrame)