@studiometa/js-toolkit 2.4.4-alpha.4 → 2.4.4-alpha.5

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.
@@ -16,6 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  }
17
17
  return to;
18
18
  };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
22
  mod
@@ -33,7 +34,6 @@ __export(decorators_exports, {
33
34
  withIntersectionObserver: () => import_withIntersectionObserver.default,
34
35
  withMountWhenInView: () => import_withMountWhenInView.default,
35
36
  withResponsiveOptions: () => import_withResponsiveOptions.default,
36
- withScrolledInView: () => import_withScrolledInView.default,
37
37
  withType: () => import_withType.default,
38
38
  withVue2: () => import_withVue2.default
39
39
  });
@@ -46,7 +46,7 @@ var import_withFreezedOptions = __toESM(require("./withFreezedOptions.cjs"), 1);
46
46
  var import_withIntersectionObserver = __toESM(require("./withIntersectionObserver.cjs"), 1);
47
47
  var import_withMountWhenInView = __toESM(require("./withMountWhenInView.cjs"), 1);
48
48
  var import_withResponsiveOptions = __toESM(require("./withResponsiveOptions.cjs"), 1);
49
- var import_withScrolledInView = __toESM(require("./withScrolledInView.cjs"), 1);
49
+ __reExport(decorators_exports, require("./withScrolledInView.cjs"), module.exports);
50
50
  var import_withType = __toESM(require("./withType.cjs"), 1);
51
51
  var import_withVue2 = __toESM(require("./withVue2.cjs"), 1);
52
52
  if (module.exports.default) module.exports = module.exports.default;
@@ -6,6 +6,6 @@ export { default as withFreezedOptions } from './withFreezedOptions.js';
6
6
  export { default as withIntersectionObserver } from './withIntersectionObserver.js';
7
7
  export { default as withMountWhenInView } from './withMountWhenInView.js';
8
8
  export { default as withResponsiveOptions } from './withResponsiveOptions.js';
9
- export { default as withScrolledInView } from './withScrolledInView.js';
9
+ export * from './withScrolledInView.js';
10
10
  export { default as withType } from './withType.js';
11
11
  export { default as withVue2 } from './withVue2.js';
@@ -6,9 +6,9 @@ import { default as default6 } from "./withFreezedOptions.js";
6
6
  import { default as default7 } from "./withIntersectionObserver.js";
7
7
  import { default as default8 } from "./withMountWhenInView.js";
8
8
  import { default as default9 } from "./withResponsiveOptions.js";
9
- import { default as default10 } from "./withScrolledInView.js";
10
- import { default as default11 } from "./withType.js";
11
- import { default as default12 } from "./withVue2.js";
9
+ export * from "./withScrolledInView.js";
10
+ import { default as default10 } from "./withType.js";
11
+ import { default as default11 } from "./withVue2.js";
12
12
  export {
13
13
  default2 as withBreakpointManager,
14
14
  default3 as withBreakpointObserver,
@@ -18,7 +18,6 @@ export {
18
18
  default7 as withIntersectionObserver,
19
19
  default8 as withMountWhenInView,
20
20
  default9 as withResponsiveOptions,
21
- default10 as withScrolledInView,
22
- default11 as withType,
23
- default12 as withVue2
21
+ default10 as withType,
22
+ default11 as withVue2
24
23
  };
@@ -30,7 +30,7 @@ var __publicField = (obj, key, value) => {
30
30
  // packages/js-toolkit/decorators/withScrolledInView.ts
31
31
  var withScrolledInView_exports = {};
32
32
  __export(withScrolledInView_exports, {
33
- default: () => withScrolledInView
33
+ withScrolledInView: () => withScrolledInView
34
34
  });
35
35
  module.exports = __toCommonJS(withScrolledInView_exports);
36
36
  var import_withMountWhenInView = __toESM(require("./withMountWhenInView.cjs"), 1);
@@ -86,8 +86,6 @@ function withScrolledInView(BaseClass, options = {}) {
86
86
  y: 0
87
87
  }
88
88
  });
89
- __publicField(this, "dampFactor", 0.1);
90
- __publicField(this, "dampPrecision", 1e-3);
91
89
  const render = () => {
92
90
  scheduler.update(() => {
93
91
  const renderFn = this.__callMethod("scrolledInView", this.__props);
@@ -138,6 +136,12 @@ function withScrolledInView(BaseClass, options = {}) {
138
136
  render();
139
137
  });
140
138
  }
139
+ get dampFactor() {
140
+ return 0.1;
141
+ }
142
+ get dampPrecision() {
143
+ return 1e-3;
144
+ }
141
145
  mounted() {
142
146
  if ((0, import_utils.isFunction)(super.mounted)) {
143
147
  super.mounted();
@@ -1,6 +1,6 @@
1
1
  import type { Base, BaseTypeParameter, BaseConstructor, BaseConfig } from '../Base/index.js';
2
2
  import type { RafServiceProps, ScrollServiceProps, ResizeServiceProps } from '../services/index.js';
3
- declare type ScrollInViewProps = {
3
+ export declare type ScrollInViewProps = {
4
4
  start: {
5
5
  x: number;
6
6
  y: number;
@@ -32,17 +32,17 @@ declare type withScrolledInViewOptions = IntersectionObserverInit & {
32
32
  /**
33
33
  * Add scrolled in view capabilities to a component.
34
34
  */
35
- export default function withScrolledInView<S extends BaseConstructor<Base>, T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: S, options?: withScrolledInViewOptions): {
35
+ export declare function withScrolledInView<S extends BaseConstructor<Base>, T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: S, options?: withScrolledInViewOptions): {
36
36
  new (...args: any[]): {
37
37
  __props: ScrollInViewProps;
38
38
  /**
39
39
  * Factor used for the `dampedProgress` props.
40
40
  */
41
- dampFactor: number;
41
+ readonly dampFactor: number;
42
42
  /**
43
43
  * Precision for the `dampedProgress` props.
44
44
  */
45
- dampPrecision: number;
45
+ readonly dampPrecision: number;
46
46
  /**
47
47
  * Mounted hook.
48
48
  */
@@ -141,11 +141,11 @@ export default function withScrolledInView<S extends BaseConstructor<Base>, T ex
141
141
  /**
142
142
  * Factor used for the `dampedProgress` props.
143
143
  */
144
- dampFactor: number;
144
+ readonly dampFactor: number;
145
145
  /**
146
146
  * Precision for the `dampedProgress` props.
147
147
  */
148
- dampPrecision: number;
148
+ readonly dampPrecision: number;
149
149
  /**
150
150
  * Mounted hook.
151
151
  */
@@ -57,8 +57,6 @@ function withScrolledInView(BaseClass, options = {}) {
57
57
  y: 0
58
58
  }
59
59
  });
60
- __publicField(this, "dampFactor", 0.1);
61
- __publicField(this, "dampPrecision", 1e-3);
62
60
  const render = () => {
63
61
  scheduler.update(() => {
64
62
  const renderFn = this.__callMethod("scrolledInView", this.__props);
@@ -109,6 +107,12 @@ function withScrolledInView(BaseClass, options = {}) {
109
107
  render();
110
108
  });
111
109
  }
110
+ get dampFactor() {
111
+ return 0.1;
112
+ }
113
+ get dampPrecision() {
114
+ return 1e-3;
115
+ }
112
116
  mounted() {
113
117
  if (isFunction(super.mounted)) {
114
118
  super.mounted();
@@ -179,5 +183,5 @@ function withScrolledInView(BaseClass, options = {}) {
179
183
  return WithScrolledInView;
180
184
  }
181
185
  export {
182
- withScrolledInView as default
186
+ withScrolledInView
183
187
  };
@@ -15,4 +15,4 @@ import type { Base, BaseConstructor } from '../Base/index.js';
15
15
  */
16
16
  export default function importOnInteraction<T extends BaseConstructor = BaseConstructor>(fn: () => Promise<T | {
17
17
  default: T;
18
- }>, nameOrSelectorOrElement: string | HTMLElement | HTMLElement[], events: string | string[], parent: Base): Promise<T>;
18
+ }>, nameOrSelectorOrElement: string | HTMLElement | HTMLElement[], events: string | string[], parent?: Base): Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiometa/js-toolkit",
3
- "version": "2.4.4-alpha.4",
3
+ "version": "2.4.4-alpha.5",
4
4
  "description": "A set of useful little bits of JavaScript to boost your project! 🚀",
5
5
  "publishConfig": {
6
6
  "access": "public"