motion-plus-vue 1.4.0 → 1.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cjs/index.js +2 -2
  2. package/dist/components/Carousel/Carousel.d.ts +28 -0
  3. package/dist/components/Carousel/CarouselView.d.ts +32 -0
  4. package/dist/components/Carousel/const.d.ts +3 -0
  5. package/dist/components/Carousel/context.d.ts +15 -0
  6. package/dist/components/Carousel/index.d.ts +3 -0
  7. package/dist/components/Carousel/utils/calc-current-page.d.ts +1 -0
  8. package/dist/components/Carousel/utils/calc-page-insets.d.ts +5 -0
  9. package/dist/components/Carousel/utils/find-current-index.d.ts +2 -0
  10. package/dist/components/Carousel/utils/find-next-page.d.ts +3 -0
  11. package/dist/components/Carousel/utils/find-prev-page.d.ts +3 -0
  12. package/dist/components/Cursor/Cursor.d.ts +2 -2
  13. package/dist/components/Ticker/DefaultTickerItem.d.ts +14 -0
  14. package/dist/components/Ticker/Ticker.d.ts +60 -5
  15. package/dist/components/Ticker/TickerItem.d.ts +59 -13
  16. package/dist/components/Ticker/const.d.ts +3 -0
  17. package/dist/components/Ticker/context.d.ts +4259 -2
  18. package/dist/components/Ticker/index.d.ts +1 -1
  19. package/dist/components/Ticker/types.d.ts +16 -1
  20. package/dist/components/Ticker/utils/layout-strategy.d.ts +2 -0
  21. package/dist/components/Typewriter/Typewriter.d.ts +1 -1
  22. package/dist/es/components/Carousel/Carousel.vue.mjs +79 -0
  23. package/dist/es/components/Carousel/Carousel.vue2.mjs +4 -0
  24. package/dist/es/components/Carousel/CarouselView.vue.mjs +115 -0
  25. package/dist/es/components/Carousel/CarouselView.vue2.mjs +4 -0
  26. package/dist/es/components/Carousel/const.mjs +13 -0
  27. package/dist/es/components/Carousel/context.mjs +6 -0
  28. package/dist/es/components/Carousel/utils/calc-current-page.mjs +13 -0
  29. package/dist/es/components/Carousel/utils/calc-page-insets.mjs +42 -0
  30. package/dist/es/components/Carousel/utils/find-current-index.mjs +13 -0
  31. package/dist/es/components/Carousel/utils/find-next-page.mjs +26 -0
  32. package/dist/es/components/Carousel/utils/find-prev-page.mjs +31 -0
  33. package/dist/es/components/Ticker/Ticker.vue.mjs +270 -111
  34. package/dist/es/components/Ticker/TickerItem.vue.mjs +68 -36
  35. package/dist/es/components/Ticker/const.mjs +12 -3
  36. package/dist/es/components/Ticker/context.mjs +5 -3
  37. package/dist/es/components/Ticker/utils/layout-strategy.mjs +57 -0
  38. package/dist/es/index.mjs +21 -16
  39. package/dist/es/utils/flatten-slots.mjs +22 -16
  40. package/dist/index.d.ts +1 -0
  41. package/package.json +3 -3
  42. package/dist/es/components/Ticker/use-item-offset.mjs +0 -12
  43. package/dist/es/components/Ticker/utils/get-cumulative-offset.mjs +0 -9
package/dist/es/index.mjs CHANGED
@@ -1,22 +1,27 @@
1
1
  import { AnimateNumber as o } from "./components/AnimateNumber/index.mjs";
2
- import { Ticker as f } from "./components/Ticker/index.mjs";
3
- import { default as s } from "./components/Cursor/Cursor.vue.mjs";
4
- import { default as p } from "./components/Ticker/TickerItem.vue.mjs";
5
- import { default as a } from "./components/Typewriter/Typewriter.vue.mjs";
6
- import { useCursorState as l } from "./components/Cursor/hooks/use-cursor-state/index.mjs";
7
- import { useCursorIsInView as I } from "./components/Cursor/hooks/use-cursor-in-view.mjs";
8
- import { usePointerPosition as d } from "./components/Cursor/hooks/use-pointer-position.mjs";
2
+ import { Ticker as s } from "./components/Ticker/index.mjs";
3
+ import { default as f } from "./components/Cursor/Cursor.vue.mjs";
4
+ import { default as a } from "./components/Ticker/TickerItem.vue.mjs";
5
+ import { default as x } from "./components/Typewriter/Typewriter.vue.mjs";
6
+ import { default as l } from "./components/Carousel/Carousel.vue.mjs";
7
+ import { useCursorState as n } from "./components/Cursor/hooks/use-cursor-state/index.mjs";
8
+ import { useCursorIsInView as T } from "./components/Cursor/hooks/use-cursor-in-view.mjs";
9
+ import { usePointerPosition as k } from "./components/Cursor/hooks/use-pointer-position.mjs";
9
10
  import { useMagneticPull as P } from "./components/Cursor/magnetic/use-magnetic-pull.mjs";
10
- import { useItemOffset as k } from "./components/Ticker/use-item-offset.mjs";
11
+ import { useTicker as b, useTickerItem as g } from "./components/Ticker/context.mjs";
12
+ import { useCarousel as A } from "./components/Carousel/context.mjs";
11
13
  export {
12
14
  o as AnimateNumber,
13
- s as Cursor,
14
- f as Ticker,
15
- p as TickerItem,
16
- a as Typewriter,
17
- I as useCursorIsInView,
18
- l as useCursorState,
19
- k as useItemOffset,
15
+ l as Carousel,
16
+ f as Cursor,
17
+ s as Ticker,
18
+ a as TickerItem,
19
+ x as Typewriter,
20
+ A as useCarousel,
21
+ T as useCursorIsInView,
22
+ n as useCursorState,
20
23
  P as useMagneticPull,
21
- d as usePointerPosition
24
+ k as usePointerPosition,
25
+ b as useTicker,
26
+ g as useTickerItem
22
27
  };
@@ -1,22 +1,28 @@
1
- import { Comment as s, Fragment as c } from "vue";
2
- function u(t = []) {
3
- const e = [];
4
- for (const n of t)
5
- n.type !== s && e.push(n);
6
- return e;
1
+ import { Comment as i, Fragment as c } from "vue";
2
+ function s(t = []) {
3
+ var n;
4
+ const r = [];
5
+ for (const e of t)
6
+ if (e.type !== i)
7
+ if (e.type === c) {
8
+ const o = Array.isArray(e.children) ? e.children : (n = e.children) == null ? void 0 : n.default();
9
+ r.push(...s(o));
10
+ } else
11
+ r.push(e);
12
+ return r;
7
13
  }
8
- function f(t) {
14
+ function l(t) {
9
15
  var n;
10
- const e = [];
11
- for (const r of t)
12
- if (r.type === c) {
13
- const o = Array.isArray(r.children) ? r.children : (n = r.children) == null ? void 0 : n.default();
14
- e.push(...f(o));
16
+ const r = [];
17
+ for (const e of t)
18
+ if (e.type === c) {
19
+ const o = Array.isArray(e.children) ? e.children : (n = e.children) == null ? void 0 : n.default();
20
+ r.push(...l(o));
15
21
  } else
16
- e.push(r);
17
- return e;
22
+ r.push(e);
23
+ return r;
18
24
  }
19
25
  export {
20
- u as flattenSlots,
21
- f as renderVNode
26
+ s as flattenSlots,
27
+ l as renderVNode
22
28
  };
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './components/AnimateNumber';
2
2
  export * from './components/Cursor';
3
3
  export * from './components/Ticker';
4
4
  export * from './components/Typewriter';
5
+ export * from './components/Carousel';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion-plus-vue",
3
- "version": "1.4.0",
3
+ "version": "1.5.0-beta.1",
4
4
  "description": "Motion Plus Vue",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -25,11 +25,11 @@
25
25
  ],
26
26
  "typings": "./dist/index.d.ts",
27
27
  "peerDependencies": {
28
- "motion-v": "^1.6.0",
28
+ "motion-v": "^1.7.4",
29
29
  "vue": ">=3.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "motion-plus-dom": "^1.5.0"
32
+ "motion-plus-dom": "^2.0.2"
33
33
  },
34
34
  "size-limit": [
35
35
  {
@@ -1,12 +0,0 @@
1
- import { invariant as t } from "motion-v";
2
- import { useTickerItemContext as o } from "./context.mjs";
3
- function n() {
4
- const e = o(null);
5
- return t(
6
- !!e,
7
- "useItemOffset must be used within a TickerItem"
8
- ), e == null ? void 0 : e.offset;
9
- }
10
- export {
11
- n as useItemOffset
12
- };
@@ -1,9 +0,0 @@
1
- function l(f, o) {
2
- let t = 0, e = f;
3
- for (; e; )
4
- t += o === "x" ? e.offsetLeft : e.offsetTop, e = e.offsetParent;
5
- return t;
6
- }
7
- export {
8
- l as getCumulativeOffset
9
- };