From 9a7905d4ef180432d7fc5d6e7ab191deb6349275 Mon Sep 17 00:00:00 2001 From: Roman Schmid Date: Fri, 17 Aug 2018 16:29:02 +0200 Subject: [PATCH] Remove colons from drag-handle --- client/dist/js/main.js | 2 +- client/src/components/SortableUploadFieldItem.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/dist/js/main.js b/client/dist/js/main.js index bcad909..082b996 100644 --- a/client/dist/js/main.js +++ b/client/dist/js/main.js @@ -1 +1 @@ -!function(e){function t(n){if(o[n])return o[n].exports;var s=o[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var o={};t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/boot/index.js")}({"./client/src/boot/index.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var s=o(0),r=(n(s),o(2)),a=n(r),l=o("./client/src/components/SortableUploadField.jsx"),d=n(l),i=o("./client/src/components/SortableUploadFieldItem.jsx"),u=(n(i),o("./client/src/state/SortableUploadFieldReducerTransformer.js")),c=n(u);document.addEventListener("DOMContentLoaded",function(){a.default.transform("enhance-uploadfield",function(e){e.component("UploadField",d.default,"SortableUploadField"),e.reducer("assetAdmin",c.default)})})},"./client/src/components/SortableUploadField.jsx":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){return{actions:{uploadField:(0,_.bindActionCreators)(b,e)}}}Object.defineProperty(t,"__esModule",{value:!0});var d=Object.assign||function(e){for(var t=1;t0&&o(u)?t>1?n(u,t-1,o,a,l):s(l,u):a||(l[l.length]=u)}return l}var s=o("./node_modules/lodash/_arrayPush.js"),r=o("./node_modules/lodash/_isFlattenable.js");e.exports=n},"./node_modules/lodash/_baseFor.js":function(e,t,o){var n=o("./node_modules/lodash/_createBaseFor.js"),s=n();e.exports=s},"./node_modules/lodash/_baseForOwn.js":function(e,t,o){function n(e,t){return e&&s(e,t,r)}var s=o("./node_modules/lodash/_baseFor.js"),r=o("./node_modules/lodash/keys.js");e.exports=n},"./node_modules/lodash/_baseGet.js":function(e,t,o){function n(e,t){t=s(t,e);for(var o=0,n=t.length;null!=e&&ot||a&&l&&i&&!d&&!u||n&&l&&i||!o&&i||!r)return 1;if(!n&&!a&&!u&&e=d?i:i*("desc"==o[n]?-1:1)}return e.index-t.index}var s=o("./node_modules/lodash/_compareAscending.js");e.exports=n},"./node_modules/lodash/_coreJsData.js":function(e,t,o){var n=o("./node_modules/lodash/_root.js"),s=n["__core-js_shared__"];e.exports=s},"./node_modules/lodash/_createBaseEach.js":function(e,t,o){function n(e,t){return function(o,n){if(null==o)return o;if(!s(o))return e(o,n);for(var r=o.length,a=t?r:-1,l=Object(o);(t?a--:++a-1?l[d?t[i]:i]:void 0}}var s=o("./node_modules/lodash/_baseIteratee.js"),r=o("./node_modules/lodash/isArrayLike.js"),a=o("./node_modules/lodash/keys.js");e.exports=n},"./node_modules/lodash/_defineProperty.js":function(e,t,o){var n=o("./node_modules/lodash/_getNative.js"),s=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=s},"./node_modules/lodash/_equalArrays.js":function(e,t,o){function n(e,t,o,n,i,u){var c=o&l,f=e.length,h=t.length;if(f!=h&&!(c&&h>f))return!1;var p=u.get(e);if(p&&u.get(t))return p==t;var _=-1,m=!0,j=o&d?new s:void 0;for(u.set(e,t),u.set(t,e);++_-1&&e%1==0&&e-1}var s=o("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_listCacheSet.js":function(e,t,o){function n(e,t){var o=this.__data__,n=s(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}var s=o("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_mapCacheClear.js":function(e,t,o){function n(){this.size=0,this.__data__={hash:new s,map:new(a||r),string:new s}}var s=o("./node_modules/lodash/_Hash.js"),r=o("./node_modules/lodash/_ListCache.js"),a=o("./node_modules/lodash/_Map.js");e.exports=n},"./node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function n(e){var t=s(this,e).delete(e);return this.size-=t?1:0,t}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheGet.js":function(e,t,o){function n(e){return s(this,e).get(e)}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheHas.js":function(e,t,o){function n(e){return s(this,e).has(e)}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheSet.js":function(e,t,o){function n(e,t){var o=s(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapToArray.js":function(e,t){function o(e){var t=-1,o=Array(e.size);return e.forEach(function(e,n){o[++t]=[n,e]}),o}e.exports=o},"./node_modules/lodash/_matchesStrictComparable.js":function(e,t){function o(e,t){return function(o){return null!=o&&o[e]===t&&(void 0!==t||e in Object(o))}}e.exports=o},"./node_modules/lodash/_memoizeCapped.js":function(e,t,o){function n(e){var t=s(e,function(e){return o.size===r&&o.clear(),e}),o=t.cache;return t}var s=o("./node_modules/lodash/memoize.js"),r=500;e.exports=n},"./node_modules/lodash/_nativeCreate.js":function(e,t,o){var n=o("./node_modules/lodash/_getNative.js"),s=n(Object,"create");e.exports=s},"./node_modules/lodash/_nativeKeys.js":function(e,t,o){var n=o("./node_modules/lodash/_overArg.js"),s=n(Object.keys,Object);e.exports=s},"./node_modules/lodash/_nodeUtil.js":function(e,t,o){(function(e){var n=o("./node_modules/lodash/_freeGlobal.js"),s="object"==typeof t&&t&&!t.nodeType&&t,r=s&&"object"==typeof e&&e&&!e.nodeType&&e,a=r&&r.exports===s,l=a&&n.process,d=function(){try{return l&&l.binding&&l.binding("util")}catch(e){}}();e.exports=d}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/lodash/_objectToString.js":function(e,t){function o(e){return s.call(e)}var n=Object.prototype,s=n.toString;e.exports=o},"./node_modules/lodash/_overArg.js":function(e,t){function o(e,t){return function(o){return e(t(o))}}e.exports=o},"./node_modules/lodash/_overRest.js":function(e,t,o){function n(e,t,o){return t=r(void 0===t?e.length-1:t,0),function(){for(var n=arguments,a=-1,l=r(n.length-t,0),d=Array(l);++a0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var n=800,s=16,r=Date.now;e.exports=o},"./node_modules/lodash/_stackClear.js":function(e,t,o){function n(){this.__data__=new s,this.size=0}var s=o("./node_modules/lodash/_ListCache.js");e.exports=n},"./node_modules/lodash/_stackDelete.js":function(e,t){function o(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}e.exports=o},"./node_modules/lodash/_stackGet.js":function(e,t){function o(e){return this.__data__.get(e)}e.exports=o},"./node_modules/lodash/_stackHas.js":function(e,t){function o(e){return this.__data__.has(e)}e.exports=o},"./node_modules/lodash/_stackSet.js":function(e,t,o){function n(e,t){var o=this.__data__;if(o instanceof s){var n=o.__data__;if(!r||n.length-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=o},"./node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/lodash/isSymbol.js":function(e,t,o){function n(e){return"symbol"==typeof e||r(e)&&s(e)==a}var s=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isObjectLike.js"),a="[object Symbol]";e.exports=n},"./node_modules/lodash/isTypedArray.js":function(e,t,o){var n=o("./node_modules/lodash/_baseIsTypedArray.js"),s=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),a=r&&r.isTypedArray,l=a?s(a):n;e.exports=l},"./node_modules/lodash/keys.js":function(e,t,o){function n(e){return a(e)?s(e):r(e)}var s=o("./node_modules/lodash/_arrayLikeKeys.js"),r=o("./node_modules/lodash/_baseKeys.js"),a=o("./node_modules/lodash/isArrayLike.js");e.exports=n},"./node_modules/lodash/memoize.js":function(e,t,o){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(r);var o=function(){var n=arguments,s=t?t.apply(this,n):n[0],r=o.cache;if(r.has(s))return r.get(s);var a=e.apply(this,n);return o.cache=r.set(s,a)||r,a};return o.cache=new(n.Cache||s),o}var s=o("./node_modules/lodash/_MapCache.js"),r="Expected a function";n.Cache=s,e.exports=n},"./node_modules/lodash/property.js":function(e,t,o){function n(e){return a(e)?s(l(e)):r(e)}var s=o("./node_modules/lodash/_baseProperty.js"),r=o("./node_modules/lodash/_basePropertyDeep.js"),a=o("./node_modules/lodash/_isKey.js"),l=o("./node_modules/lodash/_toKey.js");e.exports=n},"./node_modules/lodash/sortBy.js":function(e,t,o){var n=o("./node_modules/lodash/_baseFlatten.js"),s=o("./node_modules/lodash/_baseOrderBy.js"),r=o("./node_modules/lodash/_baseRest.js"),a=o("./node_modules/lodash/_isIterateeCall.js"),l=r(function(e,t){if(null==e)return[];var o=t.length;return o>1&&a(e,t[0],t[1])?t=[]:o>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),s(e,n(t,1),[])});e.exports=l},"./node_modules/lodash/stubArray.js":function(e,t){function o(){return[]}e.exports=o},"./node_modules/lodash/stubFalse.js":function(e,t){function o(){return!1}e.exports=o},"./node_modules/lodash/toFinite.js":function(e,t,o){function n(e){return e?(e=s(e))===r||e===-r?(e<0?-1:1)*a:e===e?e:0:0===e?e:0}var s=o("./node_modules/lodash/toNumber.js"),r=1/0,a=1.7976931348623157e308;e.exports=n},"./node_modules/lodash/toInteger.js":function(e,t,o){function n(e){var t=s(e),o=t%1;return t===t?o?t-o:t:0}var s=o("./node_modules/lodash/toFinite.js");e.exports=n},"./node_modules/lodash/toNumber.js":function(e,t,o){function n(e){if("number"==typeof e)return e;if(r(e))return a;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var o=i.test(e);return o||u.test(e)?c(e.slice(2),o?2:8):d.test(e)?a:+e}var s=o("./node_modules/lodash/isObject.js"),r=o("./node_modules/lodash/isSymbol.js"),a=NaN,l=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=n},"./node_modules/lodash/toString.js":function(e,t,o){function n(e){return null==e?"":s(e)}var s=o("./node_modules/lodash/_baseToString.js");e.exports=n},"./node_modules/prop-types/factoryWithThrowingShims.js":function(e,t,o){"use strict";var n=o("./node_modules/fbjs/lib/emptyFunction.js"),s=o("./node_modules/fbjs/lib/invariant.js"),r=o("./node_modules/prop-types/lib/ReactPropTypesSecret.js");e.exports=function(){function e(e,t,o,n,a,l){l!==r&&s(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var o={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return o.checkPropTypes=n,o.PropTypes=o,o}},"./node_modules/prop-types/index.js":function(e,t,o){e.exports=o("./node_modules/prop-types/factoryWithThrowingShims.js")()},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":function(e,t,o){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},"./node_modules/react-sortable-hoc/dist/commonjs/Manager.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return(0,i.default)(this.refs[e],function(e){return e.node.sortableInfo.index})}}]),e}();t.default=u},"./node_modules/react-sortable-hoc/dist/commonjs/SortableContainer/index.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return o=t=function(t){function o(e){r(this,o);var t=a(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return t.handleStart=function(e){var o=t.props,n=o.distance,s=o.shouldCancelStart;if(2===e.button||s(e))return!1;t._touched=!0,t._pos={x:e.pageX,y:e.pageY};var r=(0,g.closest)(e.target,function(e){return null!=e.sortableInfo});if(r&&r.sortableInfo&&t.nodeIsChild(r)&&!t.state.sorting){var a=t.props.useDragHandle,l=r.sortableInfo,d=l.index,i=l.collection;if(a&&!(0,g.closest)(e.target,function(e){return null!=e.sortableHandle}))return;t.manager.active={index:d,collection:i},"a"===e.target.tagName.toLowerCase()&&e.preventDefault(),n||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout(function(){return t.handlePress(e)},t.props.pressDelay))}},t.nodeIsChild=function(e){return e.sortableInfo.manager===t.manager},t.handleMove=function(e){var o=t.props,n=o.distance,s=o.pressThreshold;if(!t.state.sorting&&t._touched){t._delta={x:t._pos.x-e.pageX,y:t._pos.y-e.pageY};var r=Math.abs(t._delta.x)+Math.abs(t._delta.y);n||s&&!(s&&r>=s)?n&&r>=n&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}},t.handleEnd=function(){var e=t.props.distance;t._touched=!1,e||t.cancel()},t.cancel=function(){t.state.sorting||(clearTimeout(t.pressTimer),t.manager.active=null)},t.handlePress=function(e){var o=t.manager.getActive();if(o){var n=t.props,r=n.axis,a=n.getHelperDimensions,l=n.helperClass,d=n.hideSortableGhost,i=n.onSortStart,u=n.useWindowAsScrollContainer,c=o.node,f=o.collection,h=c.sortableInfo.index,p=(0,g.getElementMargin)(c),_=t.container.getBoundingClientRect(),m=a({index:h,node:c,collection:f});t.node=c,t.margin=p,t.width=m.width,t.height=m.height,t.marginOffset={x:t.margin.left+t.margin.right,y:Math.max(t.margin.top,t.margin.bottom)},t.boundingClientRect=c.getBoundingClientRect(),t.containerBoundingRect=_,t.index=h,t.newIndex=h,t.axis={x:r.indexOf("x")>=0,y:r.indexOf("y")>=0},t.offsetEdge=t.getEdgeOffset(c),t.initialOffset=t.getOffset(e),t.initialScroll={top:t.scrollContainer.scrollTop,left:t.scrollContainer.scrollLeft},t.initialWindowScroll={top:window.pageYOffset,left:window.pageXOffset};var j=c.querySelectorAll("input, textarea, select"),y=c.cloneNode(!0);if([].concat(s(y.querySelectorAll("input, textarea, select"))).forEach(function(e,t){"file"!==e.type&&j[t]&&(e.value=j[t].value)}),t.helper=t.document.body.appendChild(y),t.helper.style.position="fixed",t.helper.style.top=t.boundingClientRect.top-p.top+"px",t.helper.style.left=t.boundingClientRect.left-p.left+"px",t.helper.style.width=t.width+"px",t.helper.style.height=t.height+"px",t.helper.style.boxSizing="border-box",t.helper.style.pointerEvents="none",d&&(t.sortableGhost=c,c.style.visibility="hidden",c.style.opacity=0),t.minTranslate={},t.maxTranslate={},t.axis.x&&(t.minTranslate.x=(u?0:_.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(u?t.contentWindow.innerWidth:_.left+_.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(u?0:_.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(u?t.contentWindow.innerHeight:_.top+_.height)-t.boundingClientRect.top-t.height/2),l){var v;(v=t.helper.classList).add.apply(v,s(l.split(" ")))}t.listenerNode=e.touches?c:t.contentWindow,g.events.move.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)}),g.events.end.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}),t.setState({sorting:!0,sortingIndex:h}),i&&i({node:c,index:h,collection:f},e)}},t.handleSortMove=function(e){var o=t.props.onSortMove;e.preventDefault(),t.updatePosition(e),t.animateNodes(),t.autoscroll(),o&&o(e)},t.handleSortEnd=function(e){var o=t.props,n=o.hideSortableGhost,s=o.onSortEnd,r=t.manager.active.collection;t.listenerNode&&(g.events.move.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)}),g.events.end.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})),t.helper.parentNode.removeChild(t.helper),n&&t.sortableGhost&&(t.sortableGhost.style.visibility="",t.sortableGhost.style.opacity="");for(var a=t.manager.refs[r],l=0,d=a.length;l=t.maxTranslate.y-t.height/2?(o.y=1,n.y=s.y*Math.abs((t.maxTranslate.y-t.height/2-e.y)/t.height)):e.x>=t.maxTranslate.x-t.width/2?(o.x=1,n.x=s.x*Math.abs((t.maxTranslate.x-t.width/2-e.x)/t.width)):e.y<=t.minTranslate.y+t.height/2?(o.y=-1,n.y=s.y*Math.abs((e.y-t.height/2-t.minTranslate.y)/t.height)):e.x<=t.minTranslate.x+t.width/2&&(o.x=-1,n.x=s.x*Math.abs((e.x-t.width/2-t.minTranslate.x)/t.width)),t.autoscrollInterval&&(clearInterval(t.autoscrollInterval),t.autoscrollInterval=null,t.isAutoScrolling=!1),0===o.x&&0===o.y||(t.autoscrollInterval=setInterval(function(){t.isAutoScrolling=!0;var e={left:1*n.x*o.x,top:1*n.y*o.y};t.scrollContainer.scrollTop+=e.top,t.scrollContainer.scrollLeft+=e.left,t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()},5))},t.manager=new b.default,t.events={start:t.handleStart,move:t.handleMove,end:t.handleEnd},(0,y.default)(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time."),t.state={},t}return l(o,t),c(o,[{key:"getChildContext",value:function(){return{manager:this.manager}}},{key:"componentDidMount",value:function(){var e=this,t=this.props,o=t.getContainer,n=t.useWindowAsScrollContainer,s=this.props.contentWindow||window;this.container="function"==typeof o?o(this.getWrappedInstance()):(0,m.findDOMNode)(this),this.document=this.container.ownerDocument||document,this.scrollContainer=n?this.document.body:this.container,this.contentWindow="function"==typeof s?s():s;for(var r in this.events)!function(t){e.events.hasOwnProperty(t)&&g.events[t].forEach(function(o){return e.container.addEventListener(o,e.events[t],!1)})}(r)}},{key:"componentWillUnmount",value:function(){var e=this;for(var t in this.events)!function(t){e.events.hasOwnProperty(t)&&g.events[t].forEach(function(o){return e.container.removeEventListener(o,e.events[t])})}(t)}},{key:"getEdgeOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{top:0,left:0};if(e){var o={top:t.top+e.offsetTop,left:t.left+e.offsetLeft};return e.parentNode!==this.container?this.getEdgeOffset(e.parentNode,o):o}}},{key:"getOffset",value:function(e){return{x:e.touches?e.touches[0].pageX:e.pageX,y:e.touches?e.touches[0].pageY:e.pageY}}},{key:"getLockPixelOffsets",value:function(){var e=this.props.lockOffset;Array.isArray(e)||(e=[e,e]),(0,y.default)(2===e.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",e);var t=e,o=u(t,2),n=o[0],s=o[1];return[this.getLockPixelOffset(n),this.getLockPixelOffset(s)]}},{key:"getLockPixelOffset",value:function(e){var t=e,o=e,n="px";if("string"==typeof e){var s=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(e);(0,y.default)(null!==s,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',e),t=o=parseFloat(e),n=s[1]}return(0,y.default)(isFinite(t)&&isFinite(o),"lockOffset value should be a finite. Given %s",e),"%"===n&&(t=t*this.width/100,o=o*this.height/100),{x:t,y:o}}},{key:"updatePosition",value:function(e){var t=this.props,o=t.lockAxis,n=t.lockToContainerEdges,s=this.getOffset(e),r={x:s.x-this.initialOffset.x,y:s.y-this.initialOffset.y};if(r.y-=window.pageYOffset-this.initialWindowScroll.top,r.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=r,n){var a=this.getLockPixelOffsets(),l=u(a,2),d=l[0],i=l[1],c={x:this.width/2-d.x,y:this.height/2-d.y},f={x:this.width/2-i.x,y:this.height/2-i.y};r.x=(0,g.limit)(this.minTranslate.x+c.x,this.maxTranslate.x-f.x,r.x),r.y=(0,g.limit)(this.minTranslate.y+c.y,this.maxTranslate.y-f.y,r.y)}"x"===o?r.y=0:"y"===o&&(r.x=0),this.helper.style[g.vendorPrefix+"Transform"]="translate3d("+r.x+"px,"+r.y+"px, 0)"}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,o=e.hideSortableGhost,n=this.manager.getOrderedRefs(),s={left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top},r={left:this.offsetEdge.left+this.translate.x+s.left,top:this.offsetEdge.top+this.translate.y+s.top},a={top:window.pageYOffset-this.initialWindowScroll.top,left:window.pageXOffset-this.initialWindowScroll.left};this.newIndex=null;for(var l=0,d=n.length;lc?c/2:this.width/2,height:this.height>f?f/2:this.height/2},p={x:0,y:0},_=n[l].edgeOffset;_||(n[l].edgeOffset=_=this.getEdgeOffset(i));var m=l0&&n[l-1];m&&!m.edgeOffset&&(m.edgeOffset=this.getEdgeOffset(m.node)),u!==this.index?(t&&(i.style[g.vendorPrefix+"TransitionDuration"]=t+"ms"),this.axis.x?this.axis.y?uthis.containerBoundingRect.width-h.width&&(p.x=m.edgeOffset.left-_.left,p.y=m.edgeOffset.top-_.top),null===this.newIndex&&(this.newIndex=u)):u>this.index&&(r.left+a.left+h.width>=_.left&&r.top+a.top+h.height>=_.top||r.top+a.top+h.height>=_.top+f)&&(p.x=-(this.width+this.marginOffset.x),_.left+p.xthis.index&&r.left+a.left+h.width>=_.left?(p.x=-(this.width+this.marginOffset.x),this.newIndex=u):uthis.index&&r.top+a.top+h.height>=_.top?(p.y=-(this.height+this.marginOffset.y),this.newIndex=u):u1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return o=t=function(t){function o(){return s(this,o),r(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return a(o,t),i(o,[{key:"componentDidMount",value:function(){var e=this.props,t=e.collection,o=e.disabled,n=e.index;o||this.setDraggable(t,n)}},{key:"componentWillReceiveProps",value:function(e){if(this.props.index!==e.index&&this.node&&(this.node.sortableInfo.index=e.index),this.props.disabled!==e.disabled){var t=e.collection,o=e.disabled,n=e.index;o?this.removeDraggable(t):this.setDraggable(t,n)}else this.props.collection!==e.collection&&(this.removeDraggable(this.props.collection),this.setDraggable(e.collection,e.index))}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.collection;e.disabled||this.removeDraggable(t)}},{key:"setDraggable",value:function(e,t){var o=this.node=(0,p.findDOMNode)(this);o.sortableInfo={index:t,collection:e,manager:this.context.manager},this.ref={node:o},this.context.manager.add(e,this.ref)}},{key:"removeDraggable",value:function(e){this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return(0,m.default)(n.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=n.withRef?"wrappedInstance":null;return c.default.createElement(e,d({ref:t},(0,j.omit)(this.props,"collection","disabled","index")))}}]),o}(u.Component),t.displayName=(0,j.provideDisplayName)("sortableElement",e),t.contextTypes={manager:h.default.object.isRequired},t.propTypes={index:h.default.number.isRequired,collection:h.default.oneOfType([h.default.number,h.default.string]),disabled:h.default.bool},t.defaultProps={collection:0},o}Object.defineProperty(t,"__esModule",{value:!0});var d=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return o=t=function(t){function o(){return s(this,o),r(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return a(o,t),i(o,[{key:"componentDidMount",value:function(){(0,f.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return(0,p.default)(n.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=n.withRef?"wrappedInstance":null;return c.default.createElement(e,d({ref:t},this.props))}}]),o}(u.Component),t.displayName=(0,_.provideDisplayName)("sortableHandle",e),o}Object.defineProperty(t,"__esModule",{value:!0});var d=Object.assign||function(e){for(var t=1;t=n.length)for(var s=o-n.length;1+s--;)n.push(void 0);return n.splice(o,0,n.splice(t,1)[0]),n}function s(e){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;nt?t:o}function l(e){return"px"===e.substr(-2)?parseFloat(e):0}function d(e){var t=window.getComputedStyle(e);return{top:l(t.marginTop),right:l(t.marginRight),bottom:l(t.marginBottom),left:l(t.marginLeft)}}function i(e,t){var o=t.displayName||t.name;return o?e+"("+o+")":e}Object.defineProperty(t,"__esModule",{value:!0}),t.arrayMove=n,t.omit=s,t.closest=r,t.limit=a,t.getElementMargin=d,t.provideDisplayName=i,t.events={start:["touchstart","mousedown"],move:["touchmove","mousemove"],end:["touchend","touchcancel","mouseup"]},t.vendorPrefix=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}()},"./node_modules/webpack/buildin/global.js":function(e,t){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(o=window)}e.exports=o},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},0:function(e,t){e.exports=React},1:function(e,t){e.exports=ReactDom},2:function(e,t){e.exports=Injector},3:function(e,t){e.exports=ReactRedux},4:function(e,t){e.exports=Redux},5:function(e,t){e.exports=reduxFieldReducer}}); \ No newline at end of file +!function(e){function t(n){if(o[n])return o[n].exports;var s=o[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var o={};t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/boot/index.js")}({"./client/src/boot/index.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var s=o(0),r=(n(s),o(2)),a=n(r),l=o("./client/src/components/SortableUploadField.jsx"),d=n(l),i=o("./client/src/components/SortableUploadFieldItem.jsx"),u=(n(i),o("./client/src/state/SortableUploadFieldReducerTransformer.js")),c=n(u);document.addEventListener("DOMContentLoaded",function(){a.default.transform("enhance-uploadfield",function(e){e.component("UploadField",d.default,"SortableUploadField"),e.reducer("assetAdmin",c.default)})})},"./client/src/components/SortableUploadField.jsx":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){return{actions:{uploadField:(0,_.bindActionCreators)(b,e)}}}Object.defineProperty(t,"__esModule",{value:!0});var d=Object.assign||function(e){for(var t=1;t0&&o(u)?t>1?n(u,t-1,o,a,l):s(l,u):a||(l[l.length]=u)}return l}var s=o("./node_modules/lodash/_arrayPush.js"),r=o("./node_modules/lodash/_isFlattenable.js");e.exports=n},"./node_modules/lodash/_baseFor.js":function(e,t,o){var n=o("./node_modules/lodash/_createBaseFor.js"),s=n();e.exports=s},"./node_modules/lodash/_baseForOwn.js":function(e,t,o){function n(e,t){return e&&s(e,t,r)}var s=o("./node_modules/lodash/_baseFor.js"),r=o("./node_modules/lodash/keys.js");e.exports=n},"./node_modules/lodash/_baseGet.js":function(e,t,o){function n(e,t){t=s(t,e);for(var o=0,n=t.length;null!=e&&ot||a&&l&&i&&!d&&!u||n&&l&&i||!o&&i||!r)return 1;if(!n&&!a&&!u&&e=d?i:i*("desc"==o[n]?-1:1)}return e.index-t.index}var s=o("./node_modules/lodash/_compareAscending.js");e.exports=n},"./node_modules/lodash/_coreJsData.js":function(e,t,o){var n=o("./node_modules/lodash/_root.js"),s=n["__core-js_shared__"];e.exports=s},"./node_modules/lodash/_createBaseEach.js":function(e,t,o){function n(e,t){return function(o,n){if(null==o)return o;if(!s(o))return e(o,n);for(var r=o.length,a=t?r:-1,l=Object(o);(t?a--:++a-1?l[d?t[i]:i]:void 0}}var s=o("./node_modules/lodash/_baseIteratee.js"),r=o("./node_modules/lodash/isArrayLike.js"),a=o("./node_modules/lodash/keys.js");e.exports=n},"./node_modules/lodash/_defineProperty.js":function(e,t,o){var n=o("./node_modules/lodash/_getNative.js"),s=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=s},"./node_modules/lodash/_equalArrays.js":function(e,t,o){function n(e,t,o,n,i,u){var c=o&l,f=e.length,h=t.length;if(f!=h&&!(c&&h>f))return!1;var p=u.get(e);if(p&&u.get(t))return p==t;var _=-1,m=!0,j=o&d?new s:void 0;for(u.set(e,t),u.set(t,e);++_-1&&e%1==0&&e-1}var s=o("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_listCacheSet.js":function(e,t,o){function n(e,t){var o=this.__data__,n=s(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}var s=o("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_mapCacheClear.js":function(e,t,o){function n(){this.size=0,this.__data__={hash:new s,map:new(a||r),string:new s}}var s=o("./node_modules/lodash/_Hash.js"),r=o("./node_modules/lodash/_ListCache.js"),a=o("./node_modules/lodash/_Map.js");e.exports=n},"./node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function n(e){var t=s(this,e).delete(e);return this.size-=t?1:0,t}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheGet.js":function(e,t,o){function n(e){return s(this,e).get(e)}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheHas.js":function(e,t,o){function n(e){return s(this,e).has(e)}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheSet.js":function(e,t,o){function n(e,t){var o=s(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapToArray.js":function(e,t){function o(e){var t=-1,o=Array(e.size);return e.forEach(function(e,n){o[++t]=[n,e]}),o}e.exports=o},"./node_modules/lodash/_matchesStrictComparable.js":function(e,t){function o(e,t){return function(o){return null!=o&&o[e]===t&&(void 0!==t||e in Object(o))}}e.exports=o},"./node_modules/lodash/_memoizeCapped.js":function(e,t,o){function n(e){var t=s(e,function(e){return o.size===r&&o.clear(),e}),o=t.cache;return t}var s=o("./node_modules/lodash/memoize.js"),r=500;e.exports=n},"./node_modules/lodash/_nativeCreate.js":function(e,t,o){var n=o("./node_modules/lodash/_getNative.js"),s=n(Object,"create");e.exports=s},"./node_modules/lodash/_nativeKeys.js":function(e,t,o){var n=o("./node_modules/lodash/_overArg.js"),s=n(Object.keys,Object);e.exports=s},"./node_modules/lodash/_nodeUtil.js":function(e,t,o){(function(e){var n=o("./node_modules/lodash/_freeGlobal.js"),s="object"==typeof t&&t&&!t.nodeType&&t,r=s&&"object"==typeof e&&e&&!e.nodeType&&e,a=r&&r.exports===s,l=a&&n.process,d=function(){try{return l&&l.binding&&l.binding("util")}catch(e){}}();e.exports=d}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/lodash/_objectToString.js":function(e,t){function o(e){return s.call(e)}var n=Object.prototype,s=n.toString;e.exports=o},"./node_modules/lodash/_overArg.js":function(e,t){function o(e,t){return function(o){return e(t(o))}}e.exports=o},"./node_modules/lodash/_overRest.js":function(e,t,o){function n(e,t,o){return t=r(void 0===t?e.length-1:t,0),function(){for(var n=arguments,a=-1,l=r(n.length-t,0),d=Array(l);++a0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var n=800,s=16,r=Date.now;e.exports=o},"./node_modules/lodash/_stackClear.js":function(e,t,o){function n(){this.__data__=new s,this.size=0}var s=o("./node_modules/lodash/_ListCache.js");e.exports=n},"./node_modules/lodash/_stackDelete.js":function(e,t){function o(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}e.exports=o},"./node_modules/lodash/_stackGet.js":function(e,t){function o(e){return this.__data__.get(e)}e.exports=o},"./node_modules/lodash/_stackHas.js":function(e,t){function o(e){return this.__data__.has(e)}e.exports=o},"./node_modules/lodash/_stackSet.js":function(e,t,o){function n(e,t){var o=this.__data__;if(o instanceof s){var n=o.__data__;if(!r||n.length-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=o},"./node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/lodash/isSymbol.js":function(e,t,o){function n(e){return"symbol"==typeof e||r(e)&&s(e)==a}var s=o("./node_modules/lodash/_baseGetTag.js"),r=o("./node_modules/lodash/isObjectLike.js"),a="[object Symbol]";e.exports=n},"./node_modules/lodash/isTypedArray.js":function(e,t,o){var n=o("./node_modules/lodash/_baseIsTypedArray.js"),s=o("./node_modules/lodash/_baseUnary.js"),r=o("./node_modules/lodash/_nodeUtil.js"),a=r&&r.isTypedArray,l=a?s(a):n;e.exports=l},"./node_modules/lodash/keys.js":function(e,t,o){function n(e){return a(e)?s(e):r(e)}var s=o("./node_modules/lodash/_arrayLikeKeys.js"),r=o("./node_modules/lodash/_baseKeys.js"),a=o("./node_modules/lodash/isArrayLike.js");e.exports=n},"./node_modules/lodash/memoize.js":function(e,t,o){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(r);var o=function(){var n=arguments,s=t?t.apply(this,n):n[0],r=o.cache;if(r.has(s))return r.get(s);var a=e.apply(this,n);return o.cache=r.set(s,a)||r,a};return o.cache=new(n.Cache||s),o}var s=o("./node_modules/lodash/_MapCache.js"),r="Expected a function";n.Cache=s,e.exports=n},"./node_modules/lodash/property.js":function(e,t,o){function n(e){return a(e)?s(l(e)):r(e)}var s=o("./node_modules/lodash/_baseProperty.js"),r=o("./node_modules/lodash/_basePropertyDeep.js"),a=o("./node_modules/lodash/_isKey.js"),l=o("./node_modules/lodash/_toKey.js");e.exports=n},"./node_modules/lodash/sortBy.js":function(e,t,o){var n=o("./node_modules/lodash/_baseFlatten.js"),s=o("./node_modules/lodash/_baseOrderBy.js"),r=o("./node_modules/lodash/_baseRest.js"),a=o("./node_modules/lodash/_isIterateeCall.js"),l=r(function(e,t){if(null==e)return[];var o=t.length;return o>1&&a(e,t[0],t[1])?t=[]:o>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),s(e,n(t,1),[])});e.exports=l},"./node_modules/lodash/stubArray.js":function(e,t){function o(){return[]}e.exports=o},"./node_modules/lodash/stubFalse.js":function(e,t){function o(){return!1}e.exports=o},"./node_modules/lodash/toFinite.js":function(e,t,o){function n(e){return e?(e=s(e))===r||e===-r?(e<0?-1:1)*a:e===e?e:0:0===e?e:0}var s=o("./node_modules/lodash/toNumber.js"),r=1/0,a=1.7976931348623157e308;e.exports=n},"./node_modules/lodash/toInteger.js":function(e,t,o){function n(e){var t=s(e),o=t%1;return t===t?o?t-o:t:0}var s=o("./node_modules/lodash/toFinite.js");e.exports=n},"./node_modules/lodash/toNumber.js":function(e,t,o){function n(e){if("number"==typeof e)return e;if(r(e))return a;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var o=i.test(e);return o||u.test(e)?c(e.slice(2),o?2:8):d.test(e)?a:+e}var s=o("./node_modules/lodash/isObject.js"),r=o("./node_modules/lodash/isSymbol.js"),a=NaN,l=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=n},"./node_modules/lodash/toString.js":function(e,t,o){function n(e){return null==e?"":s(e)}var s=o("./node_modules/lodash/_baseToString.js");e.exports=n},"./node_modules/prop-types/factoryWithThrowingShims.js":function(e,t,o){"use strict";var n=o("./node_modules/fbjs/lib/emptyFunction.js"),s=o("./node_modules/fbjs/lib/invariant.js"),r=o("./node_modules/prop-types/lib/ReactPropTypesSecret.js");e.exports=function(){function e(e,t,o,n,a,l){l!==r&&s(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var o={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return o.checkPropTypes=n,o.PropTypes=o,o}},"./node_modules/prop-types/index.js":function(e,t,o){e.exports=o("./node_modules/prop-types/factoryWithThrowingShims.js")()},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":function(e,t,o){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},"./node_modules/react-sortable-hoc/dist/commonjs/Manager.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return(0,i.default)(this.refs[e],function(e){return e.node.sortableInfo.index})}}]),e}();t.default=u},"./node_modules/react-sortable-hoc/dist/commonjs/SortableContainer/index.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return o=t=function(t){function o(e){r(this,o);var t=a(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return t.handleStart=function(e){var o=t.props,n=o.distance,s=o.shouldCancelStart;if(2===e.button||s(e))return!1;t._touched=!0,t._pos={x:e.pageX,y:e.pageY};var r=(0,g.closest)(e.target,function(e){return null!=e.sortableInfo});if(r&&r.sortableInfo&&t.nodeIsChild(r)&&!t.state.sorting){var a=t.props.useDragHandle,l=r.sortableInfo,d=l.index,i=l.collection;if(a&&!(0,g.closest)(e.target,function(e){return null!=e.sortableHandle}))return;t.manager.active={index:d,collection:i},"a"===e.target.tagName.toLowerCase()&&e.preventDefault(),n||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout(function(){return t.handlePress(e)},t.props.pressDelay))}},t.nodeIsChild=function(e){return e.sortableInfo.manager===t.manager},t.handleMove=function(e){var o=t.props,n=o.distance,s=o.pressThreshold;if(!t.state.sorting&&t._touched){t._delta={x:t._pos.x-e.pageX,y:t._pos.y-e.pageY};var r=Math.abs(t._delta.x)+Math.abs(t._delta.y);n||s&&!(s&&r>=s)?n&&r>=n&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}},t.handleEnd=function(){var e=t.props.distance;t._touched=!1,e||t.cancel()},t.cancel=function(){t.state.sorting||(clearTimeout(t.pressTimer),t.manager.active=null)},t.handlePress=function(e){var o=t.manager.getActive();if(o){var n=t.props,r=n.axis,a=n.getHelperDimensions,l=n.helperClass,d=n.hideSortableGhost,i=n.onSortStart,u=n.useWindowAsScrollContainer,c=o.node,f=o.collection,h=c.sortableInfo.index,p=(0,g.getElementMargin)(c),_=t.container.getBoundingClientRect(),m=a({index:h,node:c,collection:f});t.node=c,t.margin=p,t.width=m.width,t.height=m.height,t.marginOffset={x:t.margin.left+t.margin.right,y:Math.max(t.margin.top,t.margin.bottom)},t.boundingClientRect=c.getBoundingClientRect(),t.containerBoundingRect=_,t.index=h,t.newIndex=h,t.axis={x:r.indexOf("x")>=0,y:r.indexOf("y")>=0},t.offsetEdge=t.getEdgeOffset(c),t.initialOffset=t.getOffset(e),t.initialScroll={top:t.scrollContainer.scrollTop,left:t.scrollContainer.scrollLeft},t.initialWindowScroll={top:window.pageYOffset,left:window.pageXOffset};var j=c.querySelectorAll("input, textarea, select"),y=c.cloneNode(!0);if([].concat(s(y.querySelectorAll("input, textarea, select"))).forEach(function(e,t){"file"!==e.type&&j[t]&&(e.value=j[t].value)}),t.helper=t.document.body.appendChild(y),t.helper.style.position="fixed",t.helper.style.top=t.boundingClientRect.top-p.top+"px",t.helper.style.left=t.boundingClientRect.left-p.left+"px",t.helper.style.width=t.width+"px",t.helper.style.height=t.height+"px",t.helper.style.boxSizing="border-box",t.helper.style.pointerEvents="none",d&&(t.sortableGhost=c,c.style.visibility="hidden",c.style.opacity=0),t.minTranslate={},t.maxTranslate={},t.axis.x&&(t.minTranslate.x=(u?0:_.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(u?t.contentWindow.innerWidth:_.left+_.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(u?0:_.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(u?t.contentWindow.innerHeight:_.top+_.height)-t.boundingClientRect.top-t.height/2),l){var v;(v=t.helper.classList).add.apply(v,s(l.split(" ")))}t.listenerNode=e.touches?c:t.contentWindow,g.events.move.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)}),g.events.end.forEach(function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}),t.setState({sorting:!0,sortingIndex:h}),i&&i({node:c,index:h,collection:f},e)}},t.handleSortMove=function(e){var o=t.props.onSortMove;e.preventDefault(),t.updatePosition(e),t.animateNodes(),t.autoscroll(),o&&o(e)},t.handleSortEnd=function(e){var o=t.props,n=o.hideSortableGhost,s=o.onSortEnd,r=t.manager.active.collection;t.listenerNode&&(g.events.move.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)}),g.events.end.forEach(function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})),t.helper.parentNode.removeChild(t.helper),n&&t.sortableGhost&&(t.sortableGhost.style.visibility="",t.sortableGhost.style.opacity="");for(var a=t.manager.refs[r],l=0,d=a.length;l=t.maxTranslate.y-t.height/2?(o.y=1,n.y=s.y*Math.abs((t.maxTranslate.y-t.height/2-e.y)/t.height)):e.x>=t.maxTranslate.x-t.width/2?(o.x=1,n.x=s.x*Math.abs((t.maxTranslate.x-t.width/2-e.x)/t.width)):e.y<=t.minTranslate.y+t.height/2?(o.y=-1,n.y=s.y*Math.abs((e.y-t.height/2-t.minTranslate.y)/t.height)):e.x<=t.minTranslate.x+t.width/2&&(o.x=-1,n.x=s.x*Math.abs((e.x-t.width/2-t.minTranslate.x)/t.width)),t.autoscrollInterval&&(clearInterval(t.autoscrollInterval),t.autoscrollInterval=null,t.isAutoScrolling=!1),0===o.x&&0===o.y||(t.autoscrollInterval=setInterval(function(){t.isAutoScrolling=!0;var e={left:1*n.x*o.x,top:1*n.y*o.y};t.scrollContainer.scrollTop+=e.top,t.scrollContainer.scrollLeft+=e.left,t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()},5))},t.manager=new b.default,t.events={start:t.handleStart,move:t.handleMove,end:t.handleEnd},(0,y.default)(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time."),t.state={},t}return l(o,t),c(o,[{key:"getChildContext",value:function(){return{manager:this.manager}}},{key:"componentDidMount",value:function(){var e=this,t=this.props,o=t.getContainer,n=t.useWindowAsScrollContainer,s=this.props.contentWindow||window;this.container="function"==typeof o?o(this.getWrappedInstance()):(0,m.findDOMNode)(this),this.document=this.container.ownerDocument||document,this.scrollContainer=n?this.document.body:this.container,this.contentWindow="function"==typeof s?s():s;for(var r in this.events)!function(t){e.events.hasOwnProperty(t)&&g.events[t].forEach(function(o){return e.container.addEventListener(o,e.events[t],!1)})}(r)}},{key:"componentWillUnmount",value:function(){var e=this;for(var t in this.events)!function(t){e.events.hasOwnProperty(t)&&g.events[t].forEach(function(o){return e.container.removeEventListener(o,e.events[t])})}(t)}},{key:"getEdgeOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{top:0,left:0};if(e){var o={top:t.top+e.offsetTop,left:t.left+e.offsetLeft};return e.parentNode!==this.container?this.getEdgeOffset(e.parentNode,o):o}}},{key:"getOffset",value:function(e){return{x:e.touches?e.touches[0].pageX:e.pageX,y:e.touches?e.touches[0].pageY:e.pageY}}},{key:"getLockPixelOffsets",value:function(){var e=this.props.lockOffset;Array.isArray(e)||(e=[e,e]),(0,y.default)(2===e.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",e);var t=e,o=u(t,2),n=o[0],s=o[1];return[this.getLockPixelOffset(n),this.getLockPixelOffset(s)]}},{key:"getLockPixelOffset",value:function(e){var t=e,o=e,n="px";if("string"==typeof e){var s=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(e);(0,y.default)(null!==s,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',e),t=o=parseFloat(e),n=s[1]}return(0,y.default)(isFinite(t)&&isFinite(o),"lockOffset value should be a finite. Given %s",e),"%"===n&&(t=t*this.width/100,o=o*this.height/100),{x:t,y:o}}},{key:"updatePosition",value:function(e){var t=this.props,o=t.lockAxis,n=t.lockToContainerEdges,s=this.getOffset(e),r={x:s.x-this.initialOffset.x,y:s.y-this.initialOffset.y};if(r.y-=window.pageYOffset-this.initialWindowScroll.top,r.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=r,n){var a=this.getLockPixelOffsets(),l=u(a,2),d=l[0],i=l[1],c={x:this.width/2-d.x,y:this.height/2-d.y},f={x:this.width/2-i.x,y:this.height/2-i.y};r.x=(0,g.limit)(this.minTranslate.x+c.x,this.maxTranslate.x-f.x,r.x),r.y=(0,g.limit)(this.minTranslate.y+c.y,this.maxTranslate.y-f.y,r.y)}"x"===o?r.y=0:"y"===o&&(r.x=0),this.helper.style[g.vendorPrefix+"Transform"]="translate3d("+r.x+"px,"+r.y+"px, 0)"}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,o=e.hideSortableGhost,n=this.manager.getOrderedRefs(),s={left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top},r={left:this.offsetEdge.left+this.translate.x+s.left,top:this.offsetEdge.top+this.translate.y+s.top},a={top:window.pageYOffset-this.initialWindowScroll.top,left:window.pageXOffset-this.initialWindowScroll.left};this.newIndex=null;for(var l=0,d=n.length;lc?c/2:this.width/2,height:this.height>f?f/2:this.height/2},p={x:0,y:0},_=n[l].edgeOffset;_||(n[l].edgeOffset=_=this.getEdgeOffset(i));var m=l0&&n[l-1];m&&!m.edgeOffset&&(m.edgeOffset=this.getEdgeOffset(m.node)),u!==this.index?(t&&(i.style[g.vendorPrefix+"TransitionDuration"]=t+"ms"),this.axis.x?this.axis.y?uthis.containerBoundingRect.width-h.width&&(p.x=m.edgeOffset.left-_.left,p.y=m.edgeOffset.top-_.top),null===this.newIndex&&(this.newIndex=u)):u>this.index&&(r.left+a.left+h.width>=_.left&&r.top+a.top+h.height>=_.top||r.top+a.top+h.height>=_.top+f)&&(p.x=-(this.width+this.marginOffset.x),_.left+p.xthis.index&&r.left+a.left+h.width>=_.left?(p.x=-(this.width+this.marginOffset.x),this.newIndex=u):uthis.index&&r.top+a.top+h.height>=_.top?(p.y=-(this.height+this.marginOffset.y),this.newIndex=u):u1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return o=t=function(t){function o(){return s(this,o),r(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return a(o,t),i(o,[{key:"componentDidMount",value:function(){var e=this.props,t=e.collection,o=e.disabled,n=e.index;o||this.setDraggable(t,n)}},{key:"componentWillReceiveProps",value:function(e){if(this.props.index!==e.index&&this.node&&(this.node.sortableInfo.index=e.index),this.props.disabled!==e.disabled){var t=e.collection,o=e.disabled,n=e.index;o?this.removeDraggable(t):this.setDraggable(t,n)}else this.props.collection!==e.collection&&(this.removeDraggable(this.props.collection),this.setDraggable(e.collection,e.index))}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.collection;e.disabled||this.removeDraggable(t)}},{key:"setDraggable",value:function(e,t){var o=this.node=(0,p.findDOMNode)(this);o.sortableInfo={index:t,collection:e,manager:this.context.manager},this.ref={node:o},this.context.manager.add(e,this.ref)}},{key:"removeDraggable",value:function(e){this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return(0,m.default)(n.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=n.withRef?"wrappedInstance":null;return c.default.createElement(e,d({ref:t},(0,j.omit)(this.props,"collection","disabled","index")))}}]),o}(u.Component),t.displayName=(0,j.provideDisplayName)("sortableElement",e),t.contextTypes={manager:h.default.object.isRequired},t.propTypes={index:h.default.number.isRequired,collection:h.default.oneOfType([h.default.number,h.default.string]),disabled:h.default.bool},t.defaultProps={collection:0},o}Object.defineProperty(t,"__esModule",{value:!0});var d=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return o=t=function(t){function o(){return s(this,o),r(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return a(o,t),i(o,[{key:"componentDidMount",value:function(){(0,f.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return(0,p.default)(n.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=n.withRef?"wrappedInstance":null;return c.default.createElement(e,d({ref:t},this.props))}}]),o}(u.Component),t.displayName=(0,_.provideDisplayName)("sortableHandle",e),o}Object.defineProperty(t,"__esModule",{value:!0});var d=Object.assign||function(e){for(var t=1;t=n.length)for(var s=o-n.length;1+s--;)n.push(void 0);return n.splice(o,0,n.splice(t,1)[0]),n}function s(e){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;nt?t:o}function l(e){return"px"===e.substr(-2)?parseFloat(e):0}function d(e){var t=window.getComputedStyle(e);return{top:l(t.marginTop),right:l(t.marginRight),bottom:l(t.marginBottom),left:l(t.marginLeft)}}function i(e,t){var o=t.displayName||t.name;return o?e+"("+o+")":e}Object.defineProperty(t,"__esModule",{value:!0}),t.arrayMove=n,t.omit=s,t.closest=r,t.limit=a,t.getElementMargin=d,t.provideDisplayName=i,t.events={start:["touchstart","mousedown"],move:["touchmove","mousemove"],end:["touchend","touchcancel","mouseup"]},t.vendorPrefix=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}()},"./node_modules/webpack/buildin/global.js":function(e,t){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(o=window)}e.exports=o},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},0:function(e,t){e.exports=React},1:function(e,t){e.exports=ReactDom},2:function(e,t){e.exports=Injector},3:function(e,t){e.exports=ReactRedux},4:function(e,t){e.exports=Redux},5:function(e,t){e.exports=reduxFieldReducer}}); \ No newline at end of file diff --git a/client/src/components/SortableUploadFieldItem.jsx b/client/src/components/SortableUploadFieldItem.jsx index dc19284..bea88a7 100644 --- a/client/src/components/SortableUploadFieldItem.jsx +++ b/client/src/components/SortableUploadFieldItem.jsx @@ -3,7 +3,7 @@ import {SortableElement, SortableHandle} from 'react-sortable-hoc'; import {connect} from "react-redux"; const DragHandle = SortableHandle(() => - :: + ); const SortableItem = SortableElement((props) =>