@studiometa/js-toolkit 2.0.0 → 2.0.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.
@@ -2,6 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
6
  var __export = (target, all) => {
6
7
  for (var name in all)
7
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -15,6 +16,10 @@ var __copyProps = (to, from, except, desc) => {
15
16
  return to;
16
17
  };
17
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var __publicField = (obj, key, value) => {
20
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+ return value;
22
+ };
18
23
 
19
24
  // packages/js-toolkit/decorators/withFreezedOptions.js
20
25
  var withFreezedOptions_exports = {};
@@ -24,13 +29,17 @@ __export(withFreezedOptions_exports, {
24
29
  module.exports = __toCommonJS(withFreezedOptions_exports);
25
30
  function withFreezedOptions(BaseClass) {
26
31
  return class extends BaseClass {
32
+ constructor() {
33
+ super(...arguments);
34
+ __publicField(this, "__freezedOptions");
35
+ }
27
36
  get $options() {
28
- Object.defineProperty(this, "$options", {
37
+ Object.defineProperty(this, "__freezedOptions", {
29
38
  value: Object.freeze({ ...super.$options }),
30
- enumerable: true,
39
+ enumerable: false,
31
40
  configurable: true
32
41
  });
33
- return this.$options;
42
+ return this.__freezedOptions;
34
43
  }
35
44
  };
36
45
  }
@@ -1,12 +1,22 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
1
7
  function withFreezedOptions(BaseClass) {
2
8
  return class extends BaseClass {
9
+ constructor() {
10
+ super(...arguments);
11
+ __publicField(this, "__freezedOptions");
12
+ }
3
13
  get $options() {
4
- Object.defineProperty(this, "$options", {
14
+ Object.defineProperty(this, "__freezedOptions", {
5
15
  value: Object.freeze({ ...super.$options }),
6
- enumerable: true,
16
+ enumerable: false,
7
17
  configurable: true
8
18
  });
9
- return this.$options;
19
+ return this.__freezedOptions;
10
20
  }
11
21
  };
12
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiometa/js-toolkit",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "A set of useful little bits of JavaScript to boost your project! 🚀",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -123,7 +123,9 @@ function useScroll() {
123
123
  add: instance.add.bind(instance),
124
124
  remove: instance.remove.bind(instance),
125
125
  has: instance.has.bind(instance),
126
- props: instance.updateProps.bind(instance)
126
+ props() {
127
+ return instance.props;
128
+ }
127
129
  };
128
130
  }
129
131
  return scroll;
@@ -97,7 +97,9 @@ function useScroll() {
97
97
  add: instance.add.bind(instance),
98
98
  remove: instance.remove.bind(instance),
99
99
  has: instance.has.bind(instance),
100
- props: instance.updateProps.bind(instance)
100
+ props() {
101
+ return instance.props;
102
+ }
101
103
  };
102
104
  }
103
105
  return scroll;
@@ -68,8 +68,10 @@ async function start(element, classesOrStyles) {
68
68
  trs.isTransitioning = true;
69
69
  setClassesOrStyles(element, classesOrStyles.from);
70
70
  await (0, import_nextFrame.default)();
71
+ await (0, import_nextFrame.default)();
71
72
  setClassesOrStyles(element, classesOrStyles.active);
72
73
  await (0, import_nextFrame.default)();
74
+ await (0, import_nextFrame.default)();
73
75
  }
74
76
  async function next(element, classesOrStyles) {
75
77
  const hasTransition = testTransition(element);
@@ -41,8 +41,10 @@ async function start(element, classesOrStyles) {
41
41
  trs.isTransitioning = true;
42
42
  setClassesOrStyles(element, classesOrStyles.from);
43
43
  await nextFrame();
44
+ await nextFrame();
44
45
  setClassesOrStyles(element, classesOrStyles.active);
45
46
  await nextFrame();
47
+ await nextFrame();
46
48
  }
47
49
  async function next(element, classesOrStyles) {
48
50
  const hasTransition = testTransition(element);