@ethlete/cdk 5.0.0-next.27 → 5.0.0-next.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ethlete/cdk
2
2
 
3
+ ## 5.0.0-next.28
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3048](https://github.com/ethlete-io/ethdk/pull/3048) [`ee3bd8c`](https://github.com/ethlete-io/ethdk/commit/ee3bd8cae84be832da2ead4543b5440dd69d4e82) Thanks [@github-actions](https://github.com/apps/github-actions)! - Overlay: the full-screen open and close animation now clones the origin at the size it renders at, so a percentage-sized or ancestor-squeezed element no longer jumps to its intrinsic size.
8
+
3
9
  ## 5.0.0-next.27
4
10
 
5
11
  ### Patch Changes
@@ -7105,6 +7105,14 @@ const cleanupFullscreenAnimationStyles = (containerEl, renderer, state) => {
7105
7105
  restoreOriginElement(renderer, state.originElement);
7106
7106
  }
7107
7107
  };
7108
+ const pinClonedContentToRect = (renderer, content, rect) => {
7109
+ renderer.setStyle(content, {
7110
+ inset: '0',
7111
+ boxSizing: 'border-box',
7112
+ width: `${rect.width}px`,
7113
+ height: `${rect.height}px`,
7114
+ });
7115
+ };
7108
7116
  const updateCloneLeaveAnimationStyles = (renderer, cloneEl, rect, transforms) => {
7109
7117
  renderer.setStyle(cloneEl, {
7110
7118
  top: `${rect.top}px`,
@@ -7112,6 +7120,10 @@ const updateCloneLeaveAnimationStyles = (renderer, cloneEl, rect, transforms) =>
7112
7120
  width: `${rect.width}px`,
7113
7121
  height: `${rect.height}px`,
7114
7122
  });
7123
+ const clonedContent = cloneEl.firstElementChild;
7124
+ if (clonedContent instanceof HTMLElement) {
7125
+ pinClonedContentToRect(renderer, clonedContent, rect);
7126
+ }
7115
7127
  renderer.setCssProperties(cloneEl, {
7116
7128
  '--leave-from-translate-x': `${transforms.cloneTranslateX}px`,
7117
7129
  '--leave-from-translate-y': `${transforms.cloneTranslateY}px`,
@@ -7123,7 +7135,7 @@ const updateCloneLeaveAnimationStyles = (renderer, cloneEl, rect, transforms) =>
7123
7135
  '--leave-to-scale-y': '1',
7124
7136
  });
7125
7137
  };
7126
- const createOriginClone = (originElement, deps) => {
7138
+ const createOriginClone = (originElement, rect, deps) => {
7127
7139
  const { injector, appRef, document, renderer } = deps;
7128
7140
  const cloneComponentRef = createComponent(OverlayOriginCloneComponent, {
7129
7141
  environmentInjector: injector,
@@ -7133,9 +7145,9 @@ const createOriginClone = (originElement, deps) => {
7133
7145
  renderer.setStyle(clonedContent, {
7134
7146
  margin: '0',
7135
7147
  position: 'relative',
7136
- boxSizing: computedStyle.boxSizing,
7137
7148
  display: computedStyle.display,
7138
7149
  });
7150
+ pinClonedContentToRect(renderer, clonedContent, rect);
7139
7151
  cloneComponentRef.location.nativeElement.appendChild(clonedContent);
7140
7152
  appRef.attachView(cloneComponentRef.hostView);
7141
7153
  document.body.appendChild(cloneComponentRef.location.nativeElement);
@@ -7215,7 +7227,7 @@ const startFullscreenEnterAnimation = (context, deps, applyTransformOrigin, skip
7215
7227
  }
7216
7228
  const originElement = state.originElement;
7217
7229
  const transforms = calculateViewportTransforms(originElement);
7218
- const cloneComponentRef = createOriginClone(originElement, deps);
7230
+ const cloneComponentRef = createOriginClone(originElement, transforms.rect, deps);
7219
7231
  const cloneEl = cloneComponentRef.location.nativeElement;
7220
7232
  applyCloneElementStyles(renderer, cloneEl, transforms.rect, transforms);
7221
7233
  applyContainerElementStyles(renderer, containerEl, transforms.rect, transforms);
@@ -7291,7 +7303,7 @@ const startFullscreenLeaveAnimation = (context, state, deps, applyTransformOrigi
7291
7303
  let { cloneComponentRef } = state;
7292
7304
  let isOriginHidden = state.isOriginHidden;
7293
7305
  if (!cloneComponentRef) {
7294
- cloneComponentRef = createOriginClone(state.originElement, deps);
7306
+ cloneComponentRef = createOriginClone(state.originElement, transforms.rect, deps);
7295
7307
  const cloneEl = cloneComponentRef.location.nativeElement;
7296
7308
  applyCloneElementStyles(renderer, cloneEl, transforms.rect, transforms);
7297
7309
  applyContainerElementStyles(renderer, containerEl, transforms.rect, transforms);