Attempt to address #109

Please test latest master

Co-Authored-By: Thamjith Thaha <jithuthaha8@gmail.com>
Co-Authored-By: Frederic R. <frederic.rousseau@storyful.com>
This commit is contained in:
thednp 2021-11-10 17:05:07 +02:00
parent ebd86bf9e3
commit b36f26195c
15 changed files with 87 additions and 54 deletions

View file

@ -1,11 +1,11 @@
{
"extends": [
// Extend the airbnb eslint config
"airbnb-base",
"airbnb-base"
// Vue
"plugin:vue/vue3-recommended"
// "plugin:vue/vue3-recommended"
],
"parser": "vue-eslint-parser",
// "parser": "vue-eslint-parser",
"parserOptions": {
"sourceType": "module"
},
@ -19,6 +19,8 @@
},
// Rule overrides
"rules": {
// Disable no-restricted-globals for global objects
"no-restricted-globals": 0,
// Disable no-params-reassign for properties
"no-param-reassign": ["error", { "props": false }],
// Allow strict mode (we are not dealing with modules)

View file

@ -1,5 +1,5 @@
/*!
* KUTE.js Base v2.1.2 (http://thednp.github.io/kute.js)
* KUTE.js Base v2.1.3 (http://thednp.github.io/kute.js)
* Copyright 2015-2021 © thednp
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
*/
@ -7,7 +7,7 @@
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.KUTE = factory());
}(this, (function () { 'use strict';
})(this, (function () { 'use strict';
var KUTE = {};
@ -15,9 +15,8 @@
var globalObject;
if (typeof (global) !== 'undefined') { globalObject = global; }
else if (typeof (window.self) !== 'undefined') { globalObject = window.self; }
else if (typeof (window) !== 'undefined') { globalObject = window; }
if (typeof global !== 'undefined') { globalObject = global; }
else if (typeof window !== 'undefined') { globalObject = window.self; }
else { globalObject = {}; }
var globalObject$1 = globalObject;
@ -30,7 +29,10 @@
// link property update function to KUTE.js execution context
var onStart = {};
// import now from '../objects/now.js';
var Time = {};
// Time.now = now;
var that = window.self || window || {};
Time.now = that.performance.now.bind(that.performance);
@ -634,7 +636,7 @@
functions: { onStart: onStartOpacity },
};
var version = "2.1.2";
var version = "2.1.3";
// import {baseCrossBrowserMove} from './components/crossBrowserMove.js'
@ -667,4 +669,4 @@
return indexBase;
})));
}));

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/*!
* KUTE.js Extra v2.1.2 (http://thednp.github.io/kute.js)
* KUTE.js Extra v2.1.3 (http://thednp.github.io/kute.js)
* Copyright 2015-2021 © thednp
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
*/
@ -7,7 +7,7 @@
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.KUTE = factory());
}(this, (function () { 'use strict';
})(this, (function () { 'use strict';
var CubicBezier = function CubicBezier(p1x, p1y, p2x, p2y, functionName) {
var this$1$1 = this;
@ -88,9 +88,8 @@
var globalObject;
if (typeof (global) !== 'undefined') { globalObject = global; }
else if (typeof (window.self) !== 'undefined') { globalObject = window.self; }
else if (typeof (window) !== 'undefined') { globalObject = window; }
if (typeof global !== 'undefined') { globalObject = global; }
else if (typeof window !== 'undefined') { globalObject = window.self; }
else { globalObject = {}; }
var globalObject$1 = globalObject;
@ -103,7 +102,10 @@
// link property update function to KUTE.js execution context
var onStart = {};
// import now from '../objects/now.js';
var Time = {};
// Time.now = now;
var that = window.self || window || {};
Time.now = that.performance.now.bind(that.performance);
@ -185,8 +187,6 @@
// link properties to interpolate functions
var linkProperty = {};
// import connect from './connect.js'
var Objects = {
supportedProperties: supportedProperties,
defaultValues: defaultValues,
@ -4473,7 +4473,7 @@
},
};
var version = "2.1.2";
var version = "2.1.3";
var Components = {
BackgroundPosition: BackgroundPosition,
@ -4528,4 +4528,4 @@
return indexExtra;
})));
}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

16
dist/kute.esm.js vendored
View file

@ -1,5 +1,5 @@
/*!
* KUTE.js Standard v2.1.2 (http://thednp.github.io/kute.js)
* KUTE.js Standard v2.1.3 (http://thednp.github.io/kute.js)
* Copyright 2015-2021 © thednp
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
*/
@ -82,9 +82,8 @@ var Tweens = [];
let globalObject;
if (typeof (global) !== 'undefined') globalObject = global;
else if (typeof (window.self) !== 'undefined') globalObject = window.self;
else if (typeof (window) !== 'undefined') globalObject = window;
if (typeof global !== 'undefined') globalObject = global;
else if (typeof window !== 'undefined') globalObject = window.self;
else globalObject = {};
var globalObject$1 = globalObject;
@ -97,7 +96,10 @@ var Interpolate = {};
// link property update function to KUTE.js execution context
var onStart = {};
// import now from '../objects/now.js';
const Time = {};
// Time.now = now;
const that = window.self || window || {};
Time.now = that.performance.now.bind(that.performance);
@ -179,8 +181,6 @@ var onComplete = {};
// link properties to interpolate functions
var linkProperty = {};
// import connect from './connect.js'
var Objects = {
supportedProperties,
defaultValues,
@ -3325,7 +3325,7 @@ const svgMorph = {
},
};
var version = "2.1.2";
var version = "2.1.3";
const Components = {
EssentialBoxModel: essentialBoxModel,
@ -3370,4 +3370,4 @@ var index = {
Version: version,
};
export default index;
export { index as default };

File diff suppressed because one or more lines are too long

18
dist/kute.js vendored
View file

@ -1,5 +1,5 @@
/*!
* KUTE.js Standard v2.1.2 (http://thednp.github.io/kute.js)
* KUTE.js Standard v2.1.3 (http://thednp.github.io/kute.js)
* Copyright 2015-2021 © thednp
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
*/
@ -7,7 +7,7 @@
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.KUTE = factory());
}(this, (function () { 'use strict';
})(this, (function () { 'use strict';
var CubicBezier = function CubicBezier(p1x, p1y, p2x, p2y, functionName) {
var this$1$1 = this;
@ -88,9 +88,8 @@
var globalObject;
if (typeof (global) !== 'undefined') { globalObject = global; }
else if (typeof (window.self) !== 'undefined') { globalObject = window.self; }
else if (typeof (window) !== 'undefined') { globalObject = window; }
if (typeof global !== 'undefined') { globalObject = global; }
else if (typeof window !== 'undefined') { globalObject = window.self; }
else { globalObject = {}; }
var globalObject$1 = globalObject;
@ -103,7 +102,10 @@
// link property update function to KUTE.js execution context
var onStart = {};
// import now from '../objects/now.js';
var Time = {};
// Time.now = now;
var that = window.self || window || {};
Time.now = that.performance.now.bind(that.performance);
@ -185,8 +187,6 @@
// link properties to interpolate functions
var linkProperty = {};
// import connect from './connect.js'
var Objects = {
supportedProperties: supportedProperties,
defaultValues: defaultValues,
@ -3382,7 +3382,7 @@
},
};
var version = "2.1.2";
var version = "2.1.3";
var Components = {
EssentialBoxModel: essentialBoxModel,
@ -3429,4 +3429,4 @@
return index;
})));
}));

4
dist/kute.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{
"name": "kute.js",
"version": "2.1.2",
"version": "2.1.3",
"description": "JavaScript animation engine",
"main": "dist/kute.min.js",
"module": "dist/kute.esm.js",
@ -59,8 +59,8 @@
"dependencies": {
"cubic-bezier-easing": "^1.0.4",
"minifill": "^0.0.16",
"shorter-js": "^0.2.0-alpha1",
"svg-path-commander": "0.1.4"
"shorter-js": "^0.2.1",
"svg-path-commander": "0.1.5"
},
"devDependencies": {
"@rollup/plugin-buble": "^0.21.3",
@ -71,7 +71,7 @@
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-vue": "^7.7.0",
"npm-run-all": "^4.1.5",
"rollup": "^2.36.1",
"rollup": "^2.38.4",
"rollup-plugin-terser": "^7.0.2"
}
}

View file

@ -3,8 +3,10 @@ import Tweens from '../objects/tweens.js';
import globalObject from '../objects/globalObject.js';
import Interpolate from '../objects/interpolate.js';
import onStart from '../objects/onStart.js';
// import now from '../objects/now.js';
const Time = {};
// Time.now = now;
const that = window.self || window || {};
Time.now = that.performance.now.bind(that.performance);

View file

@ -1,8 +1,7 @@
let globalObject;
if (typeof (global) !== 'undefined') globalObject = global;
else if (typeof (window.self) !== 'undefined') globalObject = window.self;
else if (typeof (window) !== 'undefined') globalObject = window;
if (typeof global !== 'undefined') globalObject = global;
else if (typeof window !== 'undefined') globalObject = window.self;
else globalObject = {};
export default globalObject;

29
src/objects/now.js Normal file
View file

@ -0,0 +1,29 @@
let now;
// Include a performance.now polyfill.
// In node.js, use process.hrtime.
// eslint-disable-next-line
// @ts-ignore
if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) {
now = () => {
// eslint-disable-next-line
// @ts-ignore
const time = process.hrtime();
// Convert [seconds, nanoseconds] to milliseconds.
return time[0] * 1000 + time[1] / 1000000;
};
} else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) {
// In a browser, use self.performance.now if it is available.
// This must be bound, because directly assigning this function
// leads to an invocation exception in Chrome.
now = self.performance.now.bind(self.performance);
} else if (typeof Date !== 'undefined' && Date.now) {
// Use Date.now if it is available.
now = Date.now;
} else {
// Otherwise, use 'new Date().getTime()'.
now = () => new Date().getTime();
}
export default now;

View file

@ -7,7 +7,6 @@ import crossCheck from './crossCheck.js';
import onStart from './onStart.js';
import onComplete from './onComplete.js';
import linkProperty from './linkProperty.js';
// import connect from './connect.js'
export default {
supportedProperties,