@maas/vue-equipment 1.0.0-beta.63 → 1.0.0-beta.65

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment/nuxt",
3
3
  "configKey": "vueEquipment",
4
- "version": "1.0.0-beta.62",
4
+ "version": "1.0.0-beta.64",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div ref="el" class="magic-scroll-motion">
2
+ <div ref="el" class="magic-scroll-motion" :data-progress="mappedProgress">
3
3
  <slot />
4
4
  </div>
5
5
  </template>
@@ -33,7 +33,7 @@ const injectedProgress = inject(
33
33
  computed(() => 0)
34
34
  );
35
35
  const mappedProgress = computed(() => {
36
- return progress || injectedProgress.value || 0;
36
+ return progress ?? injectedProgress.value ?? 0;
37
37
  });
38
38
  const defaultSequenceOptions = {
39
39
  duration: 1,
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div ref="el" class="magic-scroll-scene">
2
+ <div ref="el" class="magic-scroll-scene" :data-progress="progress">
3
3
  <slot :progress="progress" />
4
4
  </div>
5
5
  </template>
@@ -1,4 +1,5 @@
1
1
  import {
2
+ computed,
2
3
  shallowRef,
3
4
  inject,
4
5
  toValue
@@ -22,7 +23,9 @@ export function useScrollApi(args) {
22
23
  };
23
24
  const childBoundingRect = useElementBounding(child);
24
25
  const parentBoundingRect = useElementBounding(parent);
25
- const mappedParentBoundingRect = toValue(parent) ? parentBoundingRect : windowBoundingRect;
26
+ const mappedParentBoundingRect = computed(
27
+ () => toValue(parent) ? parentBoundingRect : windowBoundingRect
28
+ );
26
29
  function splitLocation(location) {
27
30
  return {
28
31
  child: location.match(/^[a-z]+/)[0],
@@ -32,8 +35,8 @@ export function useScrollApi(args) {
32
35
  function getOffsetTop(points) {
33
36
  let y = 0;
34
37
  const scrollY = toValue(scrollReturn?.y) || 0;
35
- const parentTop = mappedParentBoundingRect.top.value;
36
- const parentHeight = mappedParentBoundingRect.height.value;
38
+ const parentTop = mappedParentBoundingRect.value.top.value;
39
+ const parentHeight = mappedParentBoundingRect.value.height.value;
37
40
  const childTop = childBoundingRect.top.value;
38
41
  const childHeight = childBoundingRect.height.value;
39
42
  if (!childHeight) {
@@ -50,7 +53,7 @@ export function useScrollApi(args) {
50
53
  y += childTop + childHeight + scrollY;
51
54
  break;
52
55
  }
53
- if (!mappedParentBoundingRect.height.value) {
56
+ if (!parentHeight) {
54
57
  return y;
55
58
  }
56
59
  switch (points.parent) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment",
3
3
  "description": "Our Frontend Toolkit, Free and Open Source",
4
- "version": "1.0.0-beta.63",
4
+ "version": "1.0.0-beta.65",
5
5
  "contributors": [
6
6
  {
7
7
  "name": "Robin Scholz",