akutil-common
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -1,6 +0,21 @@ | ||
<a name="0.3.0"></a> | ||
# 0.3.0 (2016-08-17) | ||
<a name="1.0.0"></a> | ||
# 1.0.0 (2016-08-22) | ||
<a name="akutil-common@1.0.0"></a> | ||
# akutil-common@1.0.0 (2016-08-18) | ||
### Bug Fixes | ||
* utils should be 1.x ([117ff3c](https://bitbucket.org/atlassian/atlaskit/commits/117ff3c)) | ||
### BREAKING CHANGES | ||
* does not actually break anything, but we need to go post 1.x | ||
<a name="akutil-common@0.3.0"></a> | ||
@@ -7,0 +22,0 @@ # akutil-common@0.3.0 (2016-08-12) |
!function(root, factory) { | ||
"object" == typeof exports && "object" == typeof module ? module.exports = factory(require("atlassian-tether"), require("keycode")) : "function" == typeof define && define.amd ? define([ "atlassian-tether", "keycode" ], factory) : "object" == typeof exports ? exports.akutilCommon = factory(require("atlassian-tether"), require("keycode")) : root.akutilCommon = factory(root["atlassian-tether"], root.keycode); | ||
}(this, function(__WEBPACK_EXTERNAL_MODULE_5__, __WEBPACK_EXTERNAL_MODULE_7__) { | ||
}(this, function(__WEBPACK_EXTERNAL_MODULE_5__, __WEBPACK_EXTERNAL_MODULE_6__) { | ||
/******/ | ||
@@ -79,7 +79,6 @@ return function(modules) { | ||
value: !0 | ||
}), exports.KeyPressHandler = exports.keyCode = exports.afterMutations = exports.Alignment = exports.enumeration = void 0; | ||
var _properties = __webpack_require__(1), _Alignment = __webpack_require__(4), _Alignment2 = _interopRequireDefault(_Alignment), _testHelpers = __webpack_require__(6), _keycode = __webpack_require__(7), _keycode2 = _interopRequireDefault(_keycode), _KeyPressHandler = __webpack_require__(8), _KeyPressHandler2 = _interopRequireDefault(_KeyPressHandler); | ||
}), exports.KeyPressHandler = exports.keyCode = exports.Alignment = exports.enumeration = void 0; | ||
var _properties = __webpack_require__(1), _Alignment = __webpack_require__(4), _Alignment2 = _interopRequireDefault(_Alignment), _keycode = __webpack_require__(6), _keycode2 = _interopRequireDefault(_keycode), _KeyPressHandler = __webpack_require__(7), _KeyPressHandler2 = _interopRequireDefault(_KeyPressHandler); | ||
exports.enumeration = _properties.enumeration, exports.Alignment = _Alignment2["default"], | ||
exports.afterMutations = _testHelpers.afterMutations, exports.keyCode = _keycode2["default"], | ||
exports.KeyPressHandler = _KeyPressHandler2["default"]; | ||
exports.keyCode = _keycode2["default"], exports.KeyPressHandler = _KeyPressHandler2["default"]; | ||
}, /* 1 */ | ||
@@ -408,39 +407,5 @@ /***/ | ||
function(module, exports) { | ||
"use strict"; | ||
/* | ||
Runs a list of functions, pausing between each one to ensure the component | ||
has had time to re-render. | ||
Ensure that you pass `done` into the test and that you call it at the end | ||
as this will make your tests asyncronous. | ||
USAGE | ||
``` | ||
it('should respond to prop changes', (done) => { | ||
afterMutations( | ||
() => expect(component).to.be.in.some.state, | ||
() => props(component, {propName, propValue}), | ||
() => expect(component).to.be.in.another.state, | ||
() -> props(component, {propName, anotherValue}), | ||
() => expect(component).to.be.in.another.another.state, | ||
done | ||
); | ||
}); | ||
``` | ||
*/ | ||
function afterMutations() { | ||
for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) fns[_key] = arguments[_key]; | ||
setTimeout(function() { | ||
var fn = fns.shift(); | ||
"function" == typeof fn && fn(), fns.length && afterMutations.apply(null, fns); | ||
}, 1); | ||
} | ||
Object.defineProperty(exports, "__esModule", { | ||
value: !0 | ||
}), exports.afterMutations = afterMutations; | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_6__; | ||
}, /* 7 */ | ||
/***/ | ||
function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_7__; | ||
}, /* 8 */ | ||
/***/ | ||
function(module, exports, __webpack_require__) { | ||
@@ -471,3 +436,3 @@ "use strict"; | ||
}; | ||
}(), _keycode = __webpack_require__(7), _keycode2 = _interopRequireDefault(_keycode), KeyPressHandler = function() { | ||
}(), _keycode = __webpack_require__(6), _keycode2 = _interopRequireDefault(_keycode), KeyPressHandler = function() { | ||
function KeyPressHandler(key, callback) { | ||
@@ -474,0 +439,0 @@ var _this = this; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("atlassian-tether"),require("keycode")):"function"==typeof define&&define.amd?define(["atlassian-tether","keycode"],e):"object"==typeof exports?exports.akutilCommon=e(require("atlassian-tether"),require("keycode")):t.akutilCommon=e(t["atlassian-tether"],t.keycode)}(this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.KeyPressHandler=e.keyCode=e.afterMutations=e.Alignment=e.enumeration=void 0;var i=n(1),o=n(4),a=r(o),u=n(6),l=n(7),s=r(l),f=n(8),c=r(f);e.enumeration=i.enumeration,e.Alignment=a["default"],e.afterMutations=u.afterMutations,e.keyCode=s["default"],e.KeyPressHandler=c["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.unshift({},t),u["default"].apply(null,n)}}function o(t){return i({coerce:function(e){return(0,l.computeEnumValue)(t,e)},"default":t.missingDefault,initial:t.attribute?t.missingDefault:void 0,deserialize:function(t){return null===t?void 0:t},serialize:function(t){return"undefined"==typeof t?t:String(t)}})}Object.defineProperty(e,"__esModule",{value:!0}),e.enumeration=void 0;var a=n(2),u=r(a),l=n(3);e.enumeration=o},function(t,e){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function r(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(o){return!1}}var i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=r()?Object.assign:function(t,e){for(var r,a,u=n(t),l=1;l<arguments.length;l++){r=Object(arguments[l]);for(var s in r)i.call(r,s)&&(u[s]=r[s]);if(Object.getOwnPropertySymbols){a=Object.getOwnPropertySymbols(r);for(var f=0;f<a.length;f++)o.call(r,a[f])&&(u[a[f]]=r[a[f]])}}return u}},function(t,e){"use strict";function n(t){return null!==t}function r(t,e,n){n?t.setAttribute(e,""):t.removeAttribute(e)}function i(t,e){var n=function(t){return t.toLowerCase()===e.toLowerCase()},r=null===e||void 0===e,i=!r&&!t.values.filter(n).length;return r?t.hasOwnProperty("missingDefault")?t.missingDefault:null:i?t.hasOwnProperty("invalidDefault")?t.invalidDefault:t.hasOwnProperty("missingDefault")?t.missingDefault:null:t.values.length?t.values.filter(n)[0]:null}function o(t,e,n){t.setAttribute(e.attribute,n)}Object.defineProperty(e,"__esModule",{value:!0}),e.computeBooleanValue=n,e.setBooleanAttribute=r,e.computeEnumValue=i,e.setEnumAttribute=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(5),u=r(a),l=function(){function t(e){i(this,t),this.disabled=!1,this.update(e)}return o(t,[{key:"disable",value:function(){return this.tether&&(this.disabled=!0,this.tether.disable()),this}},{key:"destroy",value:function(){return this.tether&&(this.disabled=!0,this.tether.destroy()),this}},{key:"enable",value:function(){return this.tether&&(this.disabled=!1,this.tether.enable()),this}},{key:"update",value:function(t){var e=this.constructor,n=e.defaultPosition,r=e.defaultConstraint,i=e.getElement,o=e.attachmentMap;if(this.disabled||!t.target||!i(t.target))return this;var a=o[t.position]||o[n],l={element:t,target:i(t.target),attachment:a.el,targetAttachment:a.target,constraints:[{to:t.attachment||r,attachment:"together"}]};return l.optimizations={doNotMoveInDOM:!0},this.tether?this.tether.setOptions(l):this.tether=new u["default"](l),this.tether.position(),this}},{key:"reposition",value:function(){return this.tether&&this.tether.position(),this}},{key:"getPositionFromClasses",value:function(t){if(!t)return"";var e=this.constructor.attachmentMap,n=t.split(/\s+/g),r="",i=void 0,o=void 0;i=n.filter(function(t){return 0===t.search("tether-target-attached")}),i=i.map(function(t){return t.replace("tether-target-attached-","")}),o=n.filter(function(t){return 0===t.search("tether-element-attached")}),o=o.map(function(t){return t.replace("tether-element-attached-","")});var a=o.join(" "),u=o.reverse().join(" "),l=i.join(" "),s=i.reverse().join(" ");return Object.keys(e).forEach(function(t){var n=e[t].el,i=e[t].target;n!==a&&n!==u||i!==l&&i!==s||(r=t)}),r}}],[{key:"getElement",value:function(t){if("string"==typeof t){var e=document.querySelectorAll(t);return e[0]}return t||document.body}},{key:"defaultPosition",get:function(){return"right middle"}},{key:"defaultConstraint",get:function(){return"window"}},{key:"attachmentMap",get:function(){return{"top left":{el:"bottom left",target:"top left",animation:"top"},"top center":{el:"bottom center",target:"top center",animation:"top"},"top right":{el:"bottom right",target:"top right",animation:"top"},"right top":{el:"top left",target:"top right",animation:"right"},"right middle":{el:"middle left",target:"middle right",animation:"right"},"right bottom":{el:"bottom left",target:"bottom right",animation:"right"},"bottom left":{el:"top left",target:"bottom left",animation:"bottom"},"bottom center":{el:"top center",target:"bottom center",animation:"bottom"},"bottom right":{el:"top right",target:"bottom right",animation:"bottom"},"left top":{el:"top right",target:"top left",animation:"left"},"left middle":{el:"middle right",target:"middle left",animation:"left"},"left bottom":{el:"bottom right",target:"bottom left",animation:"left"}}}}]),t}();e["default"]=l},function(e,n){e.exports=t},function(t,e){"use strict";function n(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];setTimeout(function(){var t=e.shift();"function"==typeof t&&t(),e.length&&n.apply(null,e)},1)}Object.defineProperty(e,"__esModule",{value:!0}),e.afterMutations=n},function(t,n){t.exports=e},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(7),u=r(a),l=function(){function t(e,n){var r=this;i(this,t),this.keyListeners={},this.keyListeners[(0,u["default"])(e)]=n,this.listener=function(t){r.keyListeners[t.keyCode]&&r.keyListeners[t.keyCode]()},document.addEventListener("keydown",this.listener)}return o(t,[{key:"add",value:function(t,e){this.keyListeners[(0,u["default"])(t)]=e}},{key:"destroy",value:function(t){t?delete this.keyListeners[(0,u["default"])(t)]:(this.keyListeners=void 0,document.removeEventListener("keydown",this.listener))}}]),t}();e["default"]=l}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("atlassian-tether"),require("keycode")):"function"==typeof define&&define.amd?define(["atlassian-tether","keycode"],e):"object"==typeof exports?exports.akutilCommon=e(require("atlassian-tether"),require("keycode")):t.akutilCommon=e(t["atlassian-tether"],t.keycode)}(this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.KeyPressHandler=e.keyCode=e.Alignment=e.enumeration=void 0;var i=n(1),o=n(4),a=r(o),u=n(6),l=r(u),s=n(7),f=r(s);e.enumeration=i.enumeration,e.Alignment=a["default"],e.keyCode=l["default"],e.KeyPressHandler=f["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.unshift({},t),u["default"].apply(null,n)}}function o(t){return i({coerce:function(e){return(0,l.computeEnumValue)(t,e)},"default":t.missingDefault,initial:t.attribute?t.missingDefault:void 0,deserialize:function(t){return null===t?void 0:t},serialize:function(t){return"undefined"==typeof t?t:String(t)}})}Object.defineProperty(e,"__esModule",{value:!0}),e.enumeration=void 0;var a=n(2),u=r(a),l=n(3);e.enumeration=o},function(t,e){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function r(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(o){return!1}}var i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=r()?Object.assign:function(t,e){for(var r,a,u=n(t),l=1;l<arguments.length;l++){r=Object(arguments[l]);for(var s in r)i.call(r,s)&&(u[s]=r[s]);if(Object.getOwnPropertySymbols){a=Object.getOwnPropertySymbols(r);for(var f=0;f<a.length;f++)o.call(r,a[f])&&(u[a[f]]=r[a[f]])}}return u}},function(t,e){"use strict";function n(t){return null!==t}function r(t,e,n){n?t.setAttribute(e,""):t.removeAttribute(e)}function i(t,e){var n=function(t){return t.toLowerCase()===e.toLowerCase()},r=null===e||void 0===e,i=!r&&!t.values.filter(n).length;return r?t.hasOwnProperty("missingDefault")?t.missingDefault:null:i?t.hasOwnProperty("invalidDefault")?t.invalidDefault:t.hasOwnProperty("missingDefault")?t.missingDefault:null:t.values.length?t.values.filter(n)[0]:null}function o(t,e,n){t.setAttribute(e.attribute,n)}Object.defineProperty(e,"__esModule",{value:!0}),e.computeBooleanValue=n,e.setBooleanAttribute=r,e.computeEnumValue=i,e.setEnumAttribute=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(5),u=r(a),l=function(){function t(e){i(this,t),this.disabled=!1,this.update(e)}return o(t,[{key:"disable",value:function(){return this.tether&&(this.disabled=!0,this.tether.disable()),this}},{key:"destroy",value:function(){return this.tether&&(this.disabled=!0,this.tether.destroy()),this}},{key:"enable",value:function(){return this.tether&&(this.disabled=!1,this.tether.enable()),this}},{key:"update",value:function(t){var e=this.constructor,n=e.defaultPosition,r=e.defaultConstraint,i=e.getElement,o=e.attachmentMap;if(this.disabled||!t.target||!i(t.target))return this;var a=o[t.position]||o[n],l={element:t,target:i(t.target),attachment:a.el,targetAttachment:a.target,constraints:[{to:t.attachment||r,attachment:"together"}]};return l.optimizations={doNotMoveInDOM:!0},this.tether?this.tether.setOptions(l):this.tether=new u["default"](l),this.tether.position(),this}},{key:"reposition",value:function(){return this.tether&&this.tether.position(),this}},{key:"getPositionFromClasses",value:function(t){if(!t)return"";var e=this.constructor.attachmentMap,n=t.split(/\s+/g),r="",i=void 0,o=void 0;i=n.filter(function(t){return 0===t.search("tether-target-attached")}),i=i.map(function(t){return t.replace("tether-target-attached-","")}),o=n.filter(function(t){return 0===t.search("tether-element-attached")}),o=o.map(function(t){return t.replace("tether-element-attached-","")});var a=o.join(" "),u=o.reverse().join(" "),l=i.join(" "),s=i.reverse().join(" ");return Object.keys(e).forEach(function(t){var n=e[t].el,i=e[t].target;n!==a&&n!==u||i!==l&&i!==s||(r=t)}),r}}],[{key:"getElement",value:function(t){if("string"==typeof t){var e=document.querySelectorAll(t);return e[0]}return t||document.body}},{key:"defaultPosition",get:function(){return"right middle"}},{key:"defaultConstraint",get:function(){return"window"}},{key:"attachmentMap",get:function(){return{"top left":{el:"bottom left",target:"top left",animation:"top"},"top center":{el:"bottom center",target:"top center",animation:"top"},"top right":{el:"bottom right",target:"top right",animation:"top"},"right top":{el:"top left",target:"top right",animation:"right"},"right middle":{el:"middle left",target:"middle right",animation:"right"},"right bottom":{el:"bottom left",target:"bottom right",animation:"right"},"bottom left":{el:"top left",target:"bottom left",animation:"bottom"},"bottom center":{el:"top center",target:"bottom center",animation:"bottom"},"bottom right":{el:"top right",target:"bottom right",animation:"bottom"},"left top":{el:"top right",target:"top left",animation:"left"},"left middle":{el:"middle right",target:"middle left",animation:"left"},"left bottom":{el:"bottom right",target:"bottom left",animation:"left"}}}}]),t}();e["default"]=l},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(6),u=r(a),l=function(){function t(e,n){var r=this;i(this,t),this.keyListeners={},this.keyListeners[(0,u["default"])(e)]=n,this.listener=function(t){r.keyListeners[t.keyCode]&&r.keyListeners[t.keyCode]()},document.addEventListener("keydown",this.listener)}return o(t,[{key:"add",value:function(t,e){this.keyListeners[(0,u["default"])(t)]=e}},{key:"destroy",value:function(t){t?delete this.keyListeners[(0,u["default"])(t)]:(this.keyListeners=void 0,document.removeEventListener("keydown",this.listener))}}]),t}();e["default"]=l}])}); |
{ | ||
"name": "akutil-common", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/bundle.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
6
1
2
33594
458