akutil-common
Advanced tools
Comparing version 0.0.3 to 0.1.0
@@ -1,10 +0,5 @@ | ||
<a name="0.0.2"></a> | ||
## [0.0.2](https://aui-team-bot/https://bitbucket.org/atlassian/atlaskit-spike/compare/0.0.2-semver-tag-for-akutil-common...v0.0.2) (2016-06-29) | ||
<a name="0.0.3"></a> | ||
## 0.0.3 (2016-07-04) | ||
<a name="0.0.2-semver-tag-for-akutil-common"></a> | ||
## 0.0.2-semver-tag-for-akutil-common (2016-06-27) | ||
!function(root, factory) { | ||
"object" == typeof exports && "object" == typeof module ? module.exports = factory(require("object-assign")) : "function" == typeof define && define.amd ? define([ "object-assign" ], factory) : "object" == typeof exports ? exports.akutilCommon = factory(require("object-assign")) : root.akutilCommon = factory(root["object-assign"]); | ||
}(this, function(__WEBPACK_EXTERNAL_MODULE_2__) { | ||
"object" == typeof exports && "object" == typeof module ? module.exports = factory(require("tether")) : "function" == typeof define && define.amd ? define([ "tether" ], factory) : "object" == typeof exports ? exports.akutilCommon = factory(require("tether")) : root.akutilCommon = factory(root.tether); | ||
}(this, function(__WEBPACK_EXTERNAL_MODULE_5__) { | ||
/******/ | ||
@@ -79,5 +79,6 @@ return function(modules) { | ||
value: !0 | ||
}), exports.Alignment = exports.enumeration = void 0; | ||
}), exports.getPositionFromClasses = exports.attachmentMap = exports.Alignment = exports.enumeration = void 0; | ||
var _properties = __webpack_require__(1), _Alignment = __webpack_require__(4), _Alignment2 = _interopRequireDefault(_Alignment); | ||
exports.enumeration = _properties.enumeration, exports.Alignment = _Alignment2["default"]; | ||
exports.enumeration = _properties.enumeration, exports.Alignment = _Alignment2["default"], | ||
exports.attachmentMap = _Alignment.attachmentMap, exports.getPositionFromClasses = _Alignment.getPositionFromClasses; | ||
}, /* 1 */ | ||
@@ -136,3 +137,43 @@ /***/ | ||
function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_2__; | ||
"use strict"; | ||
function toObject(val) { | ||
if (null === val || void 0 === val) throw new TypeError("Object.assign cannot be called with null or undefined"); | ||
return Object(val); | ||
} | ||
function shouldUseNative() { | ||
try { | ||
if (!Object.assign) return !1; | ||
// Detect buggy property enumeration order in older V8 versions. | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=4118 | ||
var test1 = new String("abc"); | ||
if (// eslint-disable-line | ||
test1[5] = "de", "5" === Object.getOwnPropertyNames(test1)[0]) return !1; | ||
for (var test2 = {}, i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i; | ||
var order2 = Object.getOwnPropertyNames(test2).map(function(n) { | ||
return test2[n]; | ||
}); | ||
if ("0123456789" !== order2.join("")) return !1; | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
var test3 = {}; | ||
return "abcdefghijklmnopqrst".split("").forEach(function(letter) { | ||
test3[letter] = letter; | ||
}), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, test3)).join(""); | ||
} catch (e) { | ||
// We don't expect any of the above to throw, but better to be safe. | ||
return !1; | ||
} | ||
} | ||
/* eslint-disable no-unused-vars */ | ||
var hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
module.exports = shouldUseNative() ? Object.assign : function(target, source) { | ||
for (var from, symbols, to = toObject(target), s = 1; s < arguments.length; s++) { | ||
from = Object(arguments[s]); | ||
for (var key in from) hasOwnProperty.call(from, key) && (to[key] = from[key]); | ||
if (Object.getOwnPropertySymbols) { | ||
symbols = Object.getOwnPropertySymbols(from); | ||
for (var i = 0; i < symbols.length; i++) propIsEnumerable.call(from, symbols[i]) && (to[symbols[i]] = from[symbols[i]]); | ||
} | ||
} | ||
return to; | ||
}; | ||
}, /* 3 */ | ||
@@ -175,44 +216,123 @@ /***/ | ||
/***/ | ||
function(module, exports) { | ||
function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
function getReverseDirection(pos) { | ||
// eslint-disable-line consistent-return | ||
switch (pos) { | ||
// eslint-disable-line default-case | ||
case "left": | ||
return "right"; | ||
case "right": | ||
return "left"; | ||
case "top": | ||
return "bottom"; | ||
case "bottom": | ||
return "top"; | ||
} | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
"default": obj | ||
}; | ||
} | ||
function getTargetsFromPosition(position, isReverse) { | ||
var pos = position.split(" "), vertical = void 0, horizontal = void 0; | ||
return "left" === pos[0] || "right" === pos[0] ? (vertical = pos[1], horizontal = isReverse ? getReverseDirection(pos[0]) : pos[0]) : (vertical = isReverse ? getReverseDirection(pos[0]) : pos[0], | ||
horizontal = pos[1]), vertical + " " + horizontal; | ||
function getPositionFromClasses(classes) { | ||
var cl = classes.split(" "), position = "", targetClasses = void 0, elementClasses = void 0; | ||
return targetClasses = cl.filter(function(val) { | ||
return 0 === val.search("tether-target-attached"); | ||
}), targetClasses = targetClasses.map(function(val) { | ||
return val.replace("tether-target-attached-", ""); | ||
}), elementClasses = cl.filter(function(val) { | ||
return 0 === val.search("tether-element-attached"); | ||
}), elementClasses = elementClasses.map(function(val) { | ||
return val.replace("tether-element-attached-", ""); | ||
}), Object.keys(attachmentMap).forEach(function(i) { | ||
var el = attachmentMap[i].el, target = attachmentMap[i].target; | ||
el !== elementClasses.join(" ") && el !== elementClasses.reverse().join(" ") || target !== targetClasses.join(" ") && target !== targetClasses.reverse().join(" ") || (position = i); | ||
}), position; | ||
} | ||
function getAlignmentSnap(target, container) { | ||
var snapHorizontal = "right"; | ||
if (container && container !== window && container !== document || (container = document.documentElement), | ||
container && container.nodeType && container.nodeType === Node.ELEMENT_NODE) { | ||
var containerBounds = container.getBoundingClientRect(), targetBounds = target.getBoundingClientRect(); | ||
targetBounds.left > containerBounds.right / 2 && (snapHorizontal = "left"); | ||
} | ||
return { | ||
horizontal: snapHorizontal | ||
}; | ||
function Alignment(elem) { | ||
return this.disabled = !1, this.update(elem), this; | ||
} | ||
Object.defineProperty(exports, "__esModule", { | ||
value: !0 | ||
}), exports["default"] = { | ||
getTarget: getTargetsFromPosition, | ||
getAlignmentSnap: getAlignmentSnap | ||
}), exports.getPositionFromClasses = exports.attachmentMap = void 0; | ||
var _tether = __webpack_require__(5), _tether2 = _interopRequireDefault(_tether), attachmentMap = { | ||
"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" | ||
} | ||
}; | ||
Alignment.prototype = { | ||
disable: function() { | ||
return this.tether && (this.disabled = !0, this.tether.disable()), this; | ||
}, | ||
enable: function() { | ||
return this.tether && (this.disabled = !1, this.tether.enable()), this; | ||
}, | ||
update: function(elem) { | ||
if (this.disabled || !elem.position || !elem.target) return this; | ||
var opts = { | ||
element: elem.movable ? elem.movable : elem, | ||
target: document.querySelector(elem.target), | ||
attachment: attachmentMap[elem.position].el, | ||
targetAttachment: attachmentMap[elem.position].target, | ||
constraints: [ { | ||
to: elem.attachment || "window", | ||
attachment: "together" | ||
} ] | ||
}; | ||
return this.tether ? this.tether.setOptions(opts) : this.tether = new _tether2["default"](opts), | ||
this.tether.position(), this; | ||
}, | ||
reposition: function() { | ||
return this.tether && this.tether.position(), this; | ||
} | ||
}, exports["default"] = Alignment, exports.attachmentMap = attachmentMap, exports.getPositionFromClasses = getPositionFromClasses; | ||
}, /* 5 */ | ||
/***/ | ||
function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_5__; | ||
} ]); | ||
}); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("object-assign")):"function"==typeof define&&define.amd?define(["object-assign"],t):"object"==typeof exports?exports.akutilCommon=t(require("object-assign")):e.akutilCommon=t(e["object-assign"])}(this,function(e){return function(e){function t(u){if(n[u])return n[u].exports;var r=n[u]={exports:{},id:u,loaded:!1};return e[u].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Alignment=t.enumeration=void 0;var r=n(1),i=n(4),o=u(i);t.enumeration=r.enumeration,t.Alignment=o["default"]},function(e,t,n){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}function r(e){return function(){for(var t=arguments.length,n=Array(t),u=0;u<t;u++)n[u]=arguments[u];return n.unshift({},e),l["default"].apply(null,n)}}function i(e){return r({coerce:function(t){return(0,a.computeEnumValue)(e,t)},"default":e.missingDefault,initial:e.attribute?e.missingDefault:void 0,deserialize:function(e){return null===e?void 0:e},serialize:function(e){return"undefined"==typeof e?e:String(e)}})}Object.defineProperty(t,"__esModule",{value:!0}),t.enumeration=void 0;var o=n(2),l=u(o),a=n(3);t.enumeration=i},function(t,n){t.exports=e},function(e,t){"use strict";function n(e){return null!==e}function u(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function r(e,t){var n=function(e){return e.toLowerCase()===t.toLowerCase()},u=null===t||void 0===t,r=!u&&!e.values.filter(n).length;return u?e.hasOwnProperty("missingDefault")?e.missingDefault:null:r?e.hasOwnProperty("invalidDefault")?e.invalidDefault:e.hasOwnProperty("missingDefault")?e.missingDefault:null:e.values.length?e.values.filter(n)[0]:null}function i(e,t,n){e.setAttribute(t.attribute,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.computeBooleanValue=n,t.setBooleanAttribute=u,t.computeEnumValue=r,t.setEnumAttribute=i},function(e,t){"use strict";function n(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top"}}function u(e,t){var u=e.split(" "),r=void 0,i=void 0;return"left"===u[0]||"right"===u[0]?(r=u[1],i=t?n(u[0]):u[0]):(r=t?n(u[0]):u[0],i=u[1]),r+" "+i}function r(e,t){var n="right";if(t&&t!==window&&t!==document||(t=document.documentElement),t&&t.nodeType&&t.nodeType===Node.ELEMENT_NODE){var u=t.getBoundingClientRect(),r=e.getBoundingClientRect();r.left>u.right/2&&(n="left")}return{horizontal:n}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={getTarget:u,getAlignmentSnap:r}}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("tether")):"function"==typeof define&&define.amd?define(["tether"],e):"object"==typeof exports?exports.akutilCommon=e(require("tether")):t.akutilCommon=e(t.tether)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.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.getPositionFromClasses=e.attachmentMap=e.Alignment=e.enumeration=void 0;var o=n(1),i=n(4),a=r(i);e.enumeration=o.enumeration,e.Alignment=a["default"],e.attachmentMap=i.attachmentMap,e.getPositionFromClasses=i.getPositionFromClasses},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(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 i(t){return o({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=i},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 o={};return"abcdefghijklmnopqrst".split("").forEach(function(t){o[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(i){return!1}}var o=Object.prototype.hasOwnProperty,i=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)o.call(r,s)&&(u[s]=r[s]);if(Object.getOwnPropertySymbols){a=Object.getOwnPropertySymbols(r);for(var c=0;c<a.length;c++)i.call(r,a[c])&&(u[a[c]]=r[a[c]])}}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 o(t,e){var n=function(t){return t.toLowerCase()===e.toLowerCase()},r=null===e||void 0===e,o=!r&&!t.values.filter(n).length;return r?t.hasOwnProperty("missingDefault")?t.missingDefault:null:o?t.hasOwnProperty("invalidDefault")?t.invalidDefault:t.hasOwnProperty("missingDefault")?t.missingDefault:null:t.values.length?t.values.filter(n)[0]:null}function i(t,e,n){t.setAttribute(e.attribute,n)}Object.defineProperty(e,"__esModule",{value:!0}),e.computeBooleanValue=n,e.setBooleanAttribute=r,e.computeEnumValue=o,e.setEnumAttribute=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){var e=t.split(" "),n="",r=void 0,o=void 0;return r=e.filter(function(t){return 0===t.search("tether-target-attached")}),r=r.map(function(t){return t.replace("tether-target-attached-","")}),o=e.filter(function(t){return 0===t.search("tether-element-attached")}),o=o.map(function(t){return t.replace("tether-element-attached-","")}),Object.keys(l).forEach(function(t){var e=l[t].el,i=l[t].target;e!==o.join(" ")&&e!==o.reverse().join(" ")||i!==r.join(" ")&&i!==r.reverse().join(" ")||(n=t)}),n}function i(t){return this.disabled=!1,this.update(t),this}Object.defineProperty(e,"__esModule",{value:!0}),e.getPositionFromClasses=e.attachmentMap=void 0;var a=n(5),u=r(a),l={"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"}};i.prototype={disable:function(){return this.tether&&(this.disabled=!0,this.tether.disable()),this},enable:function(){return this.tether&&(this.disabled=!1,this.tether.enable()),this},update:function(t){if(this.disabled||!t.position||!t.target)return this;var e={element:t.movable?t.movable:t,target:document.querySelector(t.target),attachment:l[t.position].el,targetAttachment:l[t.position].target,constraints:[{to:t.attachment||"window",attachment:"together"}]};return this.tether?this.tether.setOptions(e):this.tether=new u["default"](e),this.tether.position(),this},reposition:function(){return this.tether&&this.tether.position(),this}},e["default"]=i,e.attachmentMap=l,e.getPositionFromClasses=o},function(e,n){e.exports=t}])}); |
{ | ||
"name": "akutil-common", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"description": "", | ||
@@ -16,5 +16,5 @@ "main": "dist/bundle.js", | ||
"dependencies": { | ||
"skatejs": "1.0.0-beta.2", | ||
"skatejs-named-slots": "^0.2.0" | ||
"skatejs": "v1.0.0-beta.6", | ||
"tether": "nadiam84/tether#0a1aecb" | ||
} | ||
} |
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
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
20275
335
1
1
- Removedskatejs-named-slots@^0.2.0
- Removeddebounce@1.2.1(transitive)
- Removedincremental-dom@0.4.0(transitive)
- Removedobject-assign@4.1.0(transitive)
- Removedskatejs@1.0.0-beta.2(transitive)
- Removedskatejs-named-slots@0.2.10(transitive)
Updatedskatejs@v1.0.0-beta.6