Skip to content

Commit c8ee987

Browse files
committed
Merge branch 'release/2.2.3'
2 parents c2d5758 + b0ffa40 commit c8ee987

32 files changed

+771
-1299
lines changed

package-lock.json

Lines changed: 6 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@studiometa/js-toolkit-workspace",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"private": true,
55
"workspaces": [
66
"packages/*"

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@studiometa/js-toolkit-demo",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"private": true,
55
"type": "commonjs",
66
"scripts": {

packages/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@studiometa/js-toolkit-docs",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"type": "module",
55
"private": true,
66
"scripts": {

packages/docs/utils/math/ease.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,12 @@ Select an easing function below to see how it will transform the given progress
6969
const name = ref('linear');
7070
const linear = (progress) => progress;
7171
const fn = computed(() => (name.value === 'linear' ? linear : easingFunctions.value[name.value]));
72-
const count = 100;
72+
const count = 90;
7373

7474
onMounted(() => {
7575
import('@studiometa/js-toolkit/utils').then((mod) => {
76-
for (const [key, value] of Object.entries(mod)) {
77-
if (key.startsWith('ease')) {
78-
easingFunctions.value[key] = value;
79-
}
76+
for (const [key, value] of Object.entries(mod.ease)) {
77+
easingFunctions.value[key] = value;
8078
}
8179
});
8280
})
@@ -106,9 +104,10 @@ Select an easing function below to see how it will transform the given progress
106104
</div>
107105
<div
108106
v-for="i in count"
109-
:key="i"
110-
class="absolute top-full h-full -mt-1 -ml-1 transform transition"
111-
:style="{ left: (i / count) * 100 + '%', '--tw-translate-y': fn(i / count) * -100 + '%' }"
107+
:key="`${i}`"
108+
:data-key="i"
109+
class="absolute bottom-0 flex items-end h-full transition"
110+
:style="{ left: `${((i - 1) / count) * 100}%`, transform: `translateY(${fn((i - 1) / count) * -192}px` }"
112111
>
113112
<div class="w-0.5 h-0.5 bg-black rounded-full" />
114113
</div>

packages/js-toolkit/Base/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,13 @@ import RefsManager from './managers/RefsManager.js';
44
import ServicesManager from './managers/ServicesManager.js';
55
import EventsManager from './managers/EventsManager.js';
66
import OptionsManager from './managers/OptionsManager.js';
7+
import { noop } from '../utils/noop.js';
78

89
let id = 0;
910

1011
// eslint-disable-next-line no-undef
1112
const isDev = typeof __DEV__ !== 'undefined' && __DEV__;
1213

13-
/**
14-
* No operation function.
15-
* @returns {void}
16-
*/
17-
function noop() {}
18-
1914
/**
2015
* Test if the managers' instances implement the default manager.
2116
*

packages/js-toolkit/Base/managers/ServicesManager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import useScroll from '../../services/scroll.js';
55
import useKey from '../../services/key.js';
66
import useLoad from '../../services/load.js';
77
import AbstractManager from './AbstractManager.js';
8-
import { hasMethod } from '../utils.js';
8+
import { noop, isFunction } from '../../utils/index.js';
99

1010
/**
1111
* @typedef {import('../index').default} Base
@@ -59,7 +59,7 @@ export default class ServicesManager extends AbstractManager {
5959
has(service) {
6060
if (
6161
!(
62-
(hasMethod(this.__base, service) ||
62+
(isFunction(this.__base[service]) ||
6363
// @ts-ignore
6464
this.__base.__hasEvent(service)) &&
6565
this.__services[service]
@@ -94,10 +94,10 @@ export default class ServicesManager extends AbstractManager {
9494

9595
if (
9696
// @ts-ignore
97-
!(hasMethod(this.__base, service) || this.__base.__hasEvent(service)) ||
97+
!(isFunction(this.__base[service]) || this.__base.__hasEvent(service)) ||
9898
!this.__services[service]
9999
) {
100-
return function noop() {};
100+
return noop;
101101
}
102102
const { add } = this.__services[service]();
103103
const self = this;

packages/js-toolkit/Base/utils.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22
* @typedef {import('./index.js').default} Base
33
*/
44

5-
/**
6-
* Test if an object has a method.
7-
*
8-
* @param {Object} obj The object to test
9-
* @param {string} name The method's name
10-
* @returns {boolean}
11-
*/
12-
export function hasMethod(obj, name) {
13-
return typeof obj[name] === 'function';
14-
}
15-
165
/**
176
* Get a list of elements based on the name of a component.
187
*

packages/js-toolkit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@studiometa/js-toolkit",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"description": "A set of useful little bits of JavaScript to boost your project! 🚀",
55
"publishConfig": {
66
"access": "public"

packages/js-toolkit/services/Service.js

Lines changed: 0 additions & 124 deletions
This file was deleted.

0 commit comments

Comments
 (0)