From b13483247db54827c82e9cfb20d5e4dcc2cbaacd Mon Sep 17 00:00:00 2001 From: Yokiijay Date: Thu, 5 Nov 2020 15:34:23 +0800 Subject: [PATCH] *update - Inspect UI --- dist/index.es.js | 3 ++- dist/index.es.js.map | 1 + dist/index.js | 3 ++- dist/index.js.map | 1 + src/components/Inspect.tsx | 24 ++++++++++++------------ todo.md | 7 ++++++- 6 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 dist/index.es.js.map create mode 100644 dist/index.js.map diff --git a/dist/index.es.js b/dist/index.es.js index 62aba06..a7743e6 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -1 +1,2 @@ -import t from"@emotion/styled";import{color as e,layout as n,colorStyle as r,space as o,flex as i,flexbox as s,fontSize as c,fontFamily as a,fontWeight as u,fontStyle as l,background as f,borderRadius as h,boxShadow as d,textShadow as p,textAlign as v,border as b}from"styled-system";import{jsx as y,css as m}from"@emotion/core";import g,{useRef as w,useState as _,useEffect as O,useLayoutEffect as x}from"react";function E(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function j(){return(j=Object.assign||function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function P(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function T(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var s,c=t[Symbol.iterator]();!(r=(s=c.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return B(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},t.prototype.connect_=function(){R&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),H?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){R&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;W.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),I=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),K="undefined"!=typeof WeakMap?new WeakMap:new D,Q=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=F.getInstance(),r=new J(e,n,this);K.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){Q.prototype[t]=function(){var e;return(e=K.get(this))[t].apply(e,arguments)}}));var Z=void 0!==k.ResizeObserver?k.ResizeObserver:Q;function tt(){var t=P(["\n &:hover {\n background: rgba(255, 105, 180, .6) !important;\n color: white !important;\n backdrop-filter: blur(4px);\n }\n "]);return tt=function(){return t},t}var et=function(){var t=w(null),e=T(_({width:0,height:0}),2),n=e[0],r=e[1];return O((function(){var e=new Z((function(e){r(M(M({},n),{},{width:t.current.offsetWidth,height:t.current.offsetHeight}))}));return t.current&&e.observe(t.current),function(){return e.disconnect()}}),[t]),y("div",{className:"inspect",style:{position:"absolute",width:"100%",height:"100%",boxShadow:"0 0 0 1px rgba(255, 0, 255, 0.6)",background:"rgba(255, 0, 255, 0.08)",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center",color:"transparent",textShadow:"0 2px 5px rgba(0,0,0,.4)",fontSize:12,transition:".4s",zIndex:9999},ref:t,css:m(tt())},n.width," x ",n.height)};function nt(){var t=P(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n"]);return nt=function(){return t},t}function rt(){var t=P(["\n ",";\n ",";\n position: relative;\n "]);return rt=function(){return t},t}function ot(){var t=P(["\n img,\n video,\n audio {\n width: 100%;\n height: 100%;\n object-fit: ",";\n }\n "]);return ot=function(){return t},t}var it=function(t){var e=t.style,n=t.color,r=t.row,o=t.center,i=t.left,s=t.right,c=t.top,a=t.bottom,u=t.rowBetween,l=t.rowAround,f=t.rowEvenly,h=t.colBetween,d=t.colAround,p=t.colEvenly,v=t.pointer,b=t.textTransform,g=t.objectFit,w=t.fit,_=t.cover,O=t.transition,x=t.position,E=t.width,A=t.fullWidth,P=t.inspect,T=t.alignX,B=t.alignY,D=t.stretch,R=t.boxSizing,k=t.borderBox,z=t.contentBox,W=t.userSelect,H=t.pointerEvents,F=S(t,["style","color","row","center","left","right","top","bottom","rowBetween","rowAround","rowEvenly","colBetween","colAround","colEvenly","pointer","textTransform","objectFit","fit","cover","transition","position","width","fullWidth","inspect","alignX","alignY","stretch","boxSizing","borderBox","contentBox","userSelect","pointerEvents"]),I={center:o,left:"boolean"==typeof i&&i?i:void 0,right:"boolean"==typeof s&&s?s:void 0,top:"boolean"==typeof c&&c?c:void 0,bottom:"boolean"==typeof a&&a?a:void 0,rowBetween:u,rowAround:l,rowEvenly:f,colBetween:h,colAround:d,colEvenly:p},C=r?"row":"column",L=function(t){var e=t.childrenPosition,n=t.flexDirection,r=t.alignX,o=t.alignY;t.stretch;return"row"===n?r||(e.left?"flex-start":e.right?"flex-end":e.rowBetween?"space-between":e.rowAround?"space-around":e.rowEvenly?"space-evenly":e.center?"center":"flex-start"):"column"===n?o||(e.top?"flex-start":e.bottom?"flex-end":e.colBetween?"space-between":e.colAround?"space-around":e.colEvenly?"space-evenly":e.center?"center":"flex-start"):"flex-start"}({childrenPosition:I,flexDirection:C,alignX:T,alignY:B,stretch:D}),q=function(t){var e=t.childrenPosition,n=t.flexDirection,r=t.alignX,o=t.alignY,i=t.stretch;return"column"===n?i?"stretch":r||(e.left?"flex-start":e.right?"flex-end":e.rowBetween?"space-between":e.rowAround?"space-around":e.rowEvenly?"space-evenly":e.center?"center":"flex-start"):"row"===n?i?"stretch":o||(e.top?"flex-start":e.bottom?"flex-end":e.colBetween?"space-between":e.colAround?"space-around":e.colEvenly?"space-evenly":e.center?"center":"flex-start"):"flex-start"}({childrenPosition:I,flexDirection:C,alignX:T,alignY:B,stretch:D}),X=v?"pointer":void 0,Y="boolean"==typeof O?".4s":"string"==typeof O?O:void 0,G=m(ot(),_?"cover":w||g);return y(st,j({color:n,flexDirection:C,alignItems:q,justifyContent:L,style:M({cursor:X,textTransform:b,transition:Y,position:x,left:"boolean"!=typeof i?i:void 0,right:"boolean"!=typeof s?s:void 0,top:"boolean"!=typeof c?c:void 0,bottom:"boolean"!=typeof a?a:void 0,width:A?"100%":E,boxSizing:(k?"border-box":z&&"content-box")||R,userSelect:W,pointerEvents:H},e),css:m(rt(),_||w||g?G:null,_||w||g&&F.borderRadius?"overflow: hidden":null)},F),P&&y(et,null),F.children)};it.defaultProps={display:"flex"};var st=t.div(nt(),e,n,r,o,i,s,c,a,u,l,f,h,d,p,v,b),ct=function(t){var e=t.src,n=t.alt,r=t.objectFit,o=t.fit,i=t.cover,s=t.height,c=t.width,a=t.minWidth,u=t.minHeight,l=t.maxWidth,f=t.maxHeight,h=t.display,d=t.borderRadius,p=S(t,["src","alt","objectFit","fit","cover","height","width","minWidth","minHeight","maxWidth","maxHeight","display","borderRadius"]),v=function(t,e){return Math.round(Math.random()*(e-t)+t)};return g.createElement("img",j({src:e?"random"===e?"https://picsum.photos/seed/".concat(v(0,3e3),"/300"):e:"https://picsum.photos/seed/".concat(v(0,3e3),"/300"),alt:n,style:{objectFit:i?"cover":o||r?o||r:void 0,width:c,height:s,minWidth:a,minHeight:u,maxWidth:l,maxHeight:f,display:h,borderRadius:d}},p))},at=function(t){var e=t.src,n=t.children,r=(t.random,S(t,["src","children","random"]));return g.createElement(it,j({},r,{center:!!n}),e?g.createElement(ct,{src:e}):n)};at.defaultProps={borderRadius:"50%",cover:!0,size:34,backgroundColor:"whitesmoke"};var ut=function(t){var e=t.title,n=t.favicon;return x((function(){document.title=e,document.querySelector("link[rel=icon]").setAttribute("href",n)}),[]),g.createElement(g.Fragment,null)};export{at as Avatar,it as Box,ct as Image,ut as Media}; +import t from"@emotion/styled";import{color as e,layout as n,colorStyle as r,space as o,flex as i,flexbox as s,fontSize as c,fontFamily as a,fontWeight as u,fontStyle as l,background as f,borderRadius as h,boxShadow as d,textShadow as p,textAlign as v,border as b}from"styled-system";import{jsx as y,css as m}from"@emotion/core";import g,{useRef as w,useState as _,useEffect as O,useLayoutEffect as x}from"react";function E(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function j(){return(j=Object.assign||function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function P(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function R(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var s,c=t[Symbol.iterator]();!(r=(s=c.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return T(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},t.prototype.connect_=function(){D&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),H?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){D&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;k.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),I=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),K="undefined"!=typeof WeakMap?new WeakMap:new B,Q=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=F.getInstance(),r=new J(e,n,this);K.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){Q.prototype[t]=function(){var e;return(e=K.get(this))[t].apply(e,arguments)}}));var Z=void 0!==z.ResizeObserver?z.ResizeObserver:Q,tt=function(){var t=w(null),e=R(_({width:0,height:0}),2),n=e[0],r=e[1];return O((function(){var e=new Z((function(e){r(M(M({},n),{},{width:t.current.offsetWidth,height:t.current.offsetHeight}))}));return t.current&&e.observe(t.current),function(){return e.disconnect()}}),[t]),y("div",{className:"inspect",style:{position:"absolute",width:"100%",height:"100%",boxShadow:"0 0 0 1px orangered",borderRadius:2,top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center",fontSize:12,transition:".4s",zIndex:9999},ref:t},y("div",{className:"inspect-info",style:{color:"white",background:"red",padding:8,borderRadius:4}},n.width," x ",n.height))};function et(){var t=P(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n"]);return et=function(){return t},t}function nt(){var t=P(["\n ",";\n ",";\n position: relative;\n "]);return nt=function(){return t},t}function rt(){var t=P(["\n img,\n video,\n audio {\n width: 100%;\n height: 100%;\n object-fit: ",";\n }\n "]);return rt=function(){return t},t}var ot=function(t){var e=t.style,n=t.color,r=t.row,o=t.center,i=t.left,s=t.right,c=t.top,a=t.bottom,u=t.rowBetween,l=t.rowAround,f=t.rowEvenly,h=t.colBetween,d=t.colAround,p=t.colEvenly,v=t.pointer,b=t.textTransform,g=t.objectFit,w=t.fit,_=t.cover,O=t.transition,x=t.position,E=t.width,A=t.fullWidth,P=t.inspect,R=t.alignX,T=t.alignY,B=t.stretch,D=t.boxSizing,z=t.borderBox,W=t.contentBox,k=t.userSelect,H=t.pointerEvents,F=S(t,["style","color","row","center","left","right","top","bottom","rowBetween","rowAround","rowEvenly","colBetween","colAround","colEvenly","pointer","textTransform","objectFit","fit","cover","transition","position","width","fullWidth","inspect","alignX","alignY","stretch","boxSizing","borderBox","contentBox","userSelect","pointerEvents"]),I={center:o,left:"boolean"==typeof i&&i?i:void 0,right:"boolean"==typeof s&&s?s:void 0,top:"boolean"==typeof c&&c?c:void 0,bottom:"boolean"==typeof a&&a?a:void 0,rowBetween:u,rowAround:l,rowEvenly:f,colBetween:h,colAround:d,colEvenly:p},C=r?"row":"column",L=function(t){var e=t.childrenPosition,n=t.flexDirection,r=t.alignX,o=t.alignY;t.stretch;return"row"===n?r||(e.left?"flex-start":e.right?"flex-end":e.rowBetween?"space-between":e.rowAround?"space-around":e.rowEvenly?"space-evenly":e.center?"center":"flex-start"):"column"===n?o||(e.top?"flex-start":e.bottom?"flex-end":e.colBetween?"space-between":e.colAround?"space-around":e.colEvenly?"space-evenly":e.center?"center":"flex-start"):"flex-start"}({childrenPosition:I,flexDirection:C,alignX:R,alignY:T,stretch:B}),q=function(t){var e=t.childrenPosition,n=t.flexDirection,r=t.alignX,o=t.alignY,i=t.stretch;return"column"===n?i?"stretch":r||(e.left?"flex-start":e.right?"flex-end":e.rowBetween?"space-between":e.rowAround?"space-around":e.rowEvenly?"space-evenly":e.center?"center":"flex-start"):"row"===n?i?"stretch":o||(e.top?"flex-start":e.bottom?"flex-end":e.colBetween?"space-between":e.colAround?"space-around":e.colEvenly?"space-evenly":e.center?"center":"flex-start"):"flex-start"}({childrenPosition:I,flexDirection:C,alignX:R,alignY:T,stretch:B}),X=v?"pointer":void 0,Y="boolean"==typeof O?".4s":"string"==typeof O?O:void 0,G=m(rt(),_?"cover":w||g);return y(it,j({color:n,flexDirection:C,alignItems:q,justifyContent:L,style:M({cursor:X,textTransform:b,transition:Y,position:x,left:"boolean"!=typeof i?i:void 0,right:"boolean"!=typeof s?s:void 0,top:"boolean"!=typeof c?c:void 0,bottom:"boolean"!=typeof a?a:void 0,width:A?"100%":E,boxSizing:(z?"border-box":W&&"content-box")||D,userSelect:k,pointerEvents:H},e),css:m(nt(),_||w||g?G:null,_||w||g&&F.borderRadius?"overflow: hidden":null)},F),P&&y(tt,null),F.children)};ot.defaultProps={display:"flex"};var it=t.div(et(),e,n,r,o,i,s,c,a,u,l,f,h,d,p,v,b),st=function(t){var e=t.src,n=t.alt,r=t.objectFit,o=t.fit,i=t.cover,s=t.height,c=t.width,a=t.minWidth,u=t.minHeight,l=t.maxWidth,f=t.maxHeight,h=t.display,d=t.borderRadius,p=S(t,["src","alt","objectFit","fit","cover","height","width","minWidth","minHeight","maxWidth","maxHeight","display","borderRadius"]),v=function(t,e){return Math.round(Math.random()*(e-t)+t)};return g.createElement("img",j({src:e?"random"===e?"https://picsum.photos/seed/".concat(v(0,3e3),"/300"):e:"https://picsum.photos/seed/".concat(v(0,3e3),"/300"),alt:n,style:{objectFit:i?"cover":o||r?o||r:void 0,width:c,height:s,minWidth:a,minHeight:u,maxWidth:l,maxHeight:f,display:h,borderRadius:d}},p))},ct=function(t){var e=t.src,n=t.children,r=(t.random,S(t,["src","children","random"]));return g.createElement(ot,j({},r,{center:!!n}),e?g.createElement(st,{src:e}):n)};ct.defaultProps={borderRadius:"50%",cover:!0,size:34,backgroundColor:"whitesmoke"};var at=function(t){var e=t.title,n=t.favicon;return x((function(){document.title=e,document.querySelector("link[rel=icon]").setAttribute("href",n)}),[]),g.createElement(g.Fragment,null)};export{ct as Avatar,ot as Box,st as Image,at as Media}; +//# sourceMappingURL=index.es.js.map diff --git a/dist/index.es.js.map b/dist/index.es.js.map new file mode 100644 index 0000000..e84023e --- /dev/null +++ b/dist/index.es.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.es.js","sources":["../src/utils/flex.ts","../node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js","../src/components/Inspect.tsx","../src/components/Box.tsx","../src/components/Image.tsx","../src/components/Avatar.tsx","../src/components/Media.tsx"],"sourcesContent":["import * as CSS from 'csstype'\n\ntype Position = {\n center?: boolean\n left?: boolean\n right?: boolean\n top?: boolean\n bottom?: boolean\n row?: boolean\n rowBetween?: boolean\n colBetween?: boolean\n rowAround?: boolean\n colAround?: boolean\n rowEvenly?: boolean\n colEvenly?: boolean\n}\n\ntype FlexDirection = CSS.FlexDirectionProperty\n\nexport type JustifyContentProps = CSS.JustifyContentProperty\nexport type AlignItemsProps = CSS.AlignItemsProperty\n\ninterface JustifyContentFN {\n (params: {\n childrenPosition: Position\n flexDirection: FlexDirection\n alignX?: JustifyContentProps | AlignItemsProps\n alignY?: JustifyContentProps | AlignItemsProps\n stretch?: boolean\n }): JustifyContentProps\n}\ninterface AlignItemsFN {\n (parmas: {\n childrenPosition: Position\n flexDirection: FlexDirection\n alignX?: JustifyContentProps | AlignItemsProps\n alignY?: JustifyContentProps | AlignItemsProps\n stretch?: boolean\n }): AlignItemsProps\n}\n\n// Get justifyContent property based on Position, Direction jsx props\nexport const getComputedJustifyContent: JustifyContentFN = ({\n childrenPosition,\n flexDirection: direction,\n alignX,\n alignY,\n stretch\n}) => {\n if (direction === 'row') {\n if(alignX) return alignX\n\n return childrenPosition.left\n ? 'flex-start'\n : childrenPosition.right\n ? 'flex-end'\n : childrenPosition.rowBetween\n ? 'space-between'\n : childrenPosition.rowAround\n ? 'space-around'\n : childrenPosition.rowEvenly\n ? 'space-evenly'\n : childrenPosition.center\n ? 'center'\n : 'flex-start'\n }\n if (direction === 'column') {\n if(alignY) return alignY\n\n return childrenPosition.top\n ? 'flex-start'\n : childrenPosition.bottom\n ? 'flex-end'\n : childrenPosition.colBetween\n ? 'space-between'\n : childrenPosition.colAround\n ? 'space-around'\n : childrenPosition.colEvenly\n ? 'space-evenly'\n : childrenPosition.center\n ? 'center'\n : 'flex-start'\n }\n return 'flex-start'\n}\n// Get alignItemsjustifyContent property based on Position, Direction jsx props\nexport const getComputedAlignItems: AlignItemsFN = ({\n childrenPosition,\n flexDirection: direction,\n alignX,\n alignY,\n stretch\n}) => {\n if (direction === 'column') {\n if(stretch) return 'stretch'\n if(alignX) return alignX\n\n return childrenPosition.left\n ? 'flex-start'\n : childrenPosition.right\n ? 'flex-end'\n : childrenPosition.rowBetween\n ? 'space-between'\n : childrenPosition.rowAround\n ? 'space-around'\n : childrenPosition.rowEvenly\n ? 'space-evenly'\n : childrenPosition.center\n ? 'center'\n : 'flex-start'\n }\n if (direction === 'row') {\n if(stretch) return 'stretch'\n if(alignY) return alignY\n\n return childrenPosition.top\n ? 'flex-start'\n : childrenPosition.bottom\n ? 'flex-end'\n : childrenPosition.colBetween\n ? 'space-between'\n : childrenPosition.colAround\n ? 'space-around'\n : childrenPosition.colEvenly\n ? 'space-evenly'\n : childrenPosition.center\n ? 'center'\n : 'flex-start'\n }\n return 'flex-start'\n}\n","/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n/* eslint-disable require-jsdoc, valid-jsdoc */\r\nvar MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return result;\r\n }\r\n return /** @class */ (function () {\r\n function class_1() {\r\n this.__entries__ = [];\r\n }\r\n Object.defineProperty(class_1.prototype, \"size\", {\r\n /**\r\n * @returns {boolean}\r\n */\r\n get: function () {\r\n return this.__entries__.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n class_1.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n return entry && entry[1];\r\n };\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n class_1.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n }\r\n else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n /**\r\n * @returns {void}\r\n */\r\n class_1.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n class_1.prototype.forEach = function (callback, ctx) {\r\n if (ctx === void 0) { ctx = null; }\r\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n return class_1;\r\n }());\r\n})();\n\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n// Returns global object of a current environment.\r\nvar global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n})();\n\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\nvar requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n})();\n\n// Defines minimum timeout before adding a trailing call.\r\nvar trailingTimeout = 2;\r\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\nfunction throttle (callback, delay) {\r\n var leadingCall = false, trailingCall = false, lastCallTime = 0;\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n callback();\r\n }\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n }\r\n else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n lastCallTime = timeStamp;\r\n }\r\n return proxy;\r\n}\n\n// Minimum delay before invoking the update of observers.\r\nvar REFRESH_DELAY = 20;\r\n// A list of substrings of CSS properties used to find transition events that\r\n// might affect dimensions of observed elements.\r\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n// Check if MutationObserver is available.\r\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\nvar ResizeObserverController = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\r\n function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }\r\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n };\r\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n };\r\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\n ResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n return activeObservers.length > 0;\r\n };\r\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n window.addEventListener('resize', this.refresh);\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n }\r\n else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n this.mutationEventsAdded_ = true;\r\n }\r\n this.connected_ = true;\r\n };\r\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n };\r\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\r\n var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\n ResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n return this.instance_;\r\n };\r\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n ResizeObserverController.instance_ = null;\r\n return ResizeObserverController;\r\n}());\n\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\nvar defineConfigurable = (function (target, props) {\r\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n return target;\r\n});\n\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\nvar getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n});\n\n// Placeholder of an empty content rectangle.\r\nvar emptyRect = createRectInit(0, 0, 0, 0);\r\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\nfunction toFloat(value) {\r\n return parseFloat(value) || 0;\r\n}\r\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\nfunction getBordersSize(styles) {\r\n var positions = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n positions[_i - 1] = arguments[_i];\r\n }\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n return size + toFloat(value);\r\n }, 0);\r\n}\r\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\nfunction getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n var value = styles['padding-' + position];\r\n paddings[position] = toFloat(value);\r\n }\r\n return paddings;\r\n}\r\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n}\r\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth, clientHeight = target.clientHeight;\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width), height = toFloat(styles.height);\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n}\r\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nvar isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return (target instanceof getWindowOf(target).SVGElement &&\r\n typeof target.getBBox === 'function'); };\r\n})();\r\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nfunction isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n}\r\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n return getHTMLElementContentRect(target);\r\n}\r\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\nfunction createReadOnlyRect(_a) {\r\n var x = _a.x, y = _a.y, width = _a.width, height = _a.height;\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n return rect;\r\n}\r\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n}\n\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\nvar ResizeObservation = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\r\n function ResizeObservation(target) {\r\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastWidth = 0;\r\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastHeight = 0;\r\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n this.target = target;\r\n }\r\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n this.contentRect_ = rect;\r\n return (rect.width !== this.broadcastWidth ||\r\n rect.height !== this.broadcastHeight);\r\n };\r\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\n ResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n return rect;\r\n };\r\n return ResizeObservation;\r\n}());\n\nvar ResizeObserverEntry = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\r\n function ResizeObserverEntry(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n }\r\n return ResizeObserverEntry;\r\n}());\n\nvar ResizeObserverSPI = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\r\n function ResizeObserverSPI(callback, controller, callbackCtx) {\r\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\r\n this.activeObservations_ = [];\r\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\r\n this.observations_ = new MapShim();\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n }\r\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n observations.set(target, new ResizeObservation(target));\r\n this.controller_.addObserver(this);\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n };\r\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n observations.delete(target);\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n };\r\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n };\r\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.gatherActive = function () {\r\n var _this = this;\r\n this.clearActive();\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n _this.activeObservations_.push(observation);\r\n }\r\n });\r\n };\r\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n var ctx = this.callbackCtx_;\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n };\r\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n };\r\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n };\r\n return ResizeObserverSPI;\r\n}());\n\n// Registry of internal observers. If WeakMap is not available use current shim\r\n// for the Map collection as it has all required methods and because WeakMap\r\n// can't be fully polyfilled anyway.\r\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\nvar ResizeObserver = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\r\n function ResizeObserver(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n observers.set(this, observer);\r\n }\r\n return ResizeObserver;\r\n}());\r\n// Expose public methods of ResizeObserver.\r\n[\r\n 'observe',\r\n 'unobserve',\r\n 'disconnect'\r\n].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n var _a;\r\n return (_a = observers.get(this))[method].apply(_a, arguments);\r\n };\r\n});\n\nvar index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n return ResizeObserver;\r\n})();\n\nexport default index;\n","import React, { useRef, useEffect, useState } from 'react'\n/** @jsx jsx */\nimport { jsx, css } from '@emotion/core'\nimport ResizeObserver from 'resize-observer-polyfill'\n\nconst Inspect: React.FC = () => {\n const ref = useRef(null)\n const [info, setInfo] = useState({\n width: 0,\n height: 0\n })\n\n const updateInfo = ()=>{\n setInfo({\n ...info,\n width: ref.current!.offsetWidth,\n height: ref.current!.offsetHeight\n })\n }\n\n useEffect(()=>{\n const ro = new ResizeObserver(entries=>updateInfo())\n ref.current && ro.observe(ref.current)\n return ()=>ro.disconnect()\n }, [ref])\n\n return(\n
\n
\n {info.width} x {info.height}\n
\n
\n )\n}\n\nexport default Inspect\n","import React, { HTMLAttributes, DetailedHTMLProps } from 'react'\nimport styled from '@emotion/styled'\nimport {\n colorStyle,\n space,\n layout,\n ColorProps,\n SpaceProps,\n LayoutProps,\n flex,\n FlexProps,\n flexbox,\n FlexboxProps,\n fontSize,\n FontSizeProps,\n fontFamily,\n fontWeight,\n fontStyle,\n FontFamilyProps,\n FontWeightProps,\n FontStyleProps,\n color,\n BackgroundProps,\n background,\n borderRadius,\n BorderRadiusProps,\n boxShadow,\n BoxShadowProps,\n textShadow,\n TextShadowProps,\n textAlign,\n TextAlignProps,\n border,\n BorderProps\n} from 'styled-system'\nimport { getComputedJustifyContent, getComputedAlignItems } from '../utils/flex'\nimport * as CSS from 'csstype'\n/** @jsx jsx */\nimport { jsx, css } from '@emotion/core'\nimport Inspect from './Inspect'\n\nexport interface BoxProps extends StyledBoxType, ColorProps {\n center?: boolean\n left?: boolean | string | number\n right?: boolean | string | number\n top?: boolean | string | number\n bottom?: boolean | string | number\n row?: boolean\n rowBetween?: boolean\n colBetween?: boolean\n rowAround?: boolean\n colAround?: boolean\n rowEvenly?: boolean\n colEvenly?: boolean\n color?: string\n pointer?: Boolean\n textTransform?: CSS.TextTransformProperty\n objectFit?: CSS.ObjectFitProperty\n fit?: CSS.ObjectFitProperty\n cover?: boolean\n transition?: boolean | CSS.TransitionProperty\n position?: CSS.PositionProperty\n width?: CSS.WidthProperty\n fullWidth?: boolean\n inspect?: boolean\n alignX?: CSS.JustifyContentProperty | CSS.AlignItemsProperty\n alignY?: CSS.JustifyContentProperty | CSS.AlignItemsProperty\n stretch?: boolean\n boxSizing?: CSS.BoxSizingProperty\n borderBox?: boolean\n contentBox?: boolean\n userSelect?: CSS.UserSelectProperty\n pointerEvents?: CSS.PointerEventsProperty\n}\n\nconst Box: React.FC<\n BoxProps & DetailedHTMLProps, HTMLDivElement>\n> = ({\n style,\n color,\n row,\n center,\n left,\n right,\n top,\n bottom,\n rowBetween,\n rowAround,\n rowEvenly,\n colBetween,\n colAround,\n colEvenly,\n pointer,\n textTransform,\n objectFit,\n fit,\n cover,\n transition,\n position,\n width,\n fullWidth,\n inspect,\n alignX,\n alignY,\n stretch,\n boxSizing,\n borderBox,\n contentBox,\n userSelect,\n pointerEvents,\n ...props\n}) => {\n const childrenPosition = {\n center,\n left: typeof left === 'boolean' && left ? left : undefined,\n right: typeof right === 'boolean' && right ? right : undefined,\n top: typeof top === 'boolean' && top ? top : undefined,\n bottom: typeof bottom === 'boolean' && bottom ? bottom : undefined,\n rowBetween,\n rowAround,\n rowEvenly,\n colBetween,\n colAround,\n colEvenly\n }\n const flexDirection = row ? 'row' : 'column'\n const justifyContent = getComputedJustifyContent({\n childrenPosition,\n flexDirection,\n alignX,\n alignY,\n stretch\n })\n const alignItems = getComputedAlignItems({\n childrenPosition,\n flexDirection,\n alignX,\n alignY,\n stretch\n })\n const cursor = pointer ? 'pointer' : undefined\n const transitionStyle =\n typeof transition === 'boolean'\n ? '.4s'\n : typeof transition === 'string'\n ? transition\n : undefined\n\n const objectFitCSS = css`\n img,\n video,\n audio {\n width: 100%;\n height: 100%;\n object-fit: ${cover ? 'cover' : fit || objectFit};\n }\n `\n\n return (\n \n {inspect && }\n {props.children}\n \n )\n}\n\nBox.defaultProps = {\n display: 'flex'\n}\n\n// Props definition for Box\ntype StyledBoxType = SpaceProps &\n LayoutProps &\n FlexProps &\n FlexboxProps &\n FontSizeProps &\n FontFamilyProps &\n FontWeightProps &\n FontStyleProps &\n BackgroundProps &\n BorderRadiusProps &\n BoxShadowProps &\n TextShadowProps &\n TextAlignProps &\n BorderProps\n\n// Use styled-theme to decorate Box\nconst StyledBox = styled.div`\n ${color}\n ${layout}\n ${colorStyle}\n ${space}\n ${flex}\n ${flexbox}\n ${fontSize}\n ${fontFamily}\n ${fontWeight}\n ${fontStyle}\n ${background}\n ${borderRadius}\n ${boxShadow}\n ${textShadow}\n ${textAlign}\n ${border}\n`\n\nexport default Box\n","import React, { ImgHTMLAttributes, DetailedHTMLProps } from 'react'\nimport * as CSS from 'csstype'\n\nexport interface ImageProps {\n src?: 'random' | string&{}\n objectFit?: CSS.ObjectFitProperty\n fit?: CSS.ObjectFitProperty,\n cover?: boolean,\n width?: CSS.WidthProperty\n height?: CSS.HeightProperty\n minWidth?: CSS.MinWidthProperty\n minHeight?: CSS.MinHeightProperty\n maxWidth?: CSS.MaxWidthProperty\n maxHeight?: CSS.MaxHeightProperty\n display?: 'inline' | 'block' | 'inline-block' | 'none' | 'unset' | 'initial'\n borderRadius?: CSS.BorderRadiusProperty\n}\n\nconst Image: React.FC, HTMLImageElement>> = ({\n src,\n alt,\n objectFit,\n fit,\n cover,\n height,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n display,\n borderRadius,\n ...props\n}) => {\n const objectFitStyle = ():any => {\n if(cover) return 'cover'\n if(fit || objectFit) return fit || objectFit\n }\n\n const randomSeed:(a:number,b:number)=>number = (a,b)=>{\n return Math.round(Math.random()*(b-a) + a)\n }\n\n return (\n \n )\n}\n\n// const StyledImage = styled.img`\n\n// `\n\nexport default Image\n","import React, { ImgHTMLAttributes } from 'react'\nimport Box, {BoxProps} from './Box'\nimport Image, {ImageProps} from './Image'\n\nexport interface AvatarProps extends BoxProps {\n src?: 'random' | string&{}\n /**Generate random pictures from https://picsum.photos/ for quick demonstration.*/\n random?: boolean\n}\n\nconst Avatar: React.FC = ({src, children, random, ...props}) => {\n\n\n return(\n \n {src ? : children}\n \n )\n}\n\nAvatar.defaultProps = {\n borderRadius: '50%',\n cover: true,\n size: 34,\n backgroundColor: 'whitesmoke'\n}\n\nexport default Avatar\n","import React, { useLayoutEffect } from 'react'\n\nexport interface MediaProps {\n title: string\n favicon: string\n}\n\nconst Media: React.FC = ({\n title,\n favicon\n}) => {\n useLayoutEffect(()=>{\n document.title = title\n document.querySelector('link[rel=icon]')!.setAttribute('href', favicon)\n }, [])\n\n return(<>)\n}\n\nexport default Media\n"],"names":["MapShim","Map","getIndex","arr","key","result","some","entry","index","class_1","__entries__","Object","defineProperty","prototype","get","this","length","enumerable","configurable","set","value","push","delete","entries","splice","has","clear","forEach","callback","ctx","_i","_a","call","isBrowser","window","document","global$1","global","Math","self","Function","requestAnimationFrame$1","requestAnimationFrame","bind","setTimeout","Date","now","transitionKeys","mutationObserverSupported","MutationObserver","ResizeObserverController","connected_","mutationEventsAdded_","mutationsObserver_","observers_","onTransitionEnd_","refresh","delay","leadingCall","trailingCall","lastCallTime","resolvePending","proxy","timeoutCallback","timeStamp","throttle","addObserver","observer","indexOf","connect_","removeObserver","observers","disconnect_","updateObservers_","activeObservers","filter","gatherActive","hasActive","broadcastActive","addEventListener","observe","attributes","childList","characterData","subtree","removeEventListener","disconnect","_b","propertyName","getInstance","instance_","defineConfigurable","target","props","keys","writable","getWindowOf","ownerDocument","defaultView","emptyRect","createRectInit","toFloat","parseFloat","getBordersSize","styles","positions","arguments","reduce","size","position","getHTMLElementContentRect","clientWidth","clientHeight","getComputedStyle","paddings","positions_1","getPaddings","horizPad","left","right","vertPad","top","bottom","width","height","boxSizing","round","documentElement","isDocumentElement","vertScrollbar","horizScrollbar","abs","isSVGGraphicsElement","SVGGraphicsElement","SVGElement","getBBox","getContentRect","bbox","getSVGContentRect","x","y","ResizeObservation","broadcastWidth","broadcastHeight","contentRect_","isActive","rect","broadcastRect","ResizeObserverEntry","rectInit","Constr","contentRect","DOMRectReadOnly","create","ResizeObserverSPI","controller","callbackCtx","activeObservations_","observations_","TypeError","callback_","controller_","callbackCtx_","Element","observations","unobserve","clearActive","_this","observation","map","WeakMap","ResizeObserver","method","apply","Inspect","ref","useRef","useState","info","setInfo","useEffect","ro","current","offsetWidth","offsetHeight","jsx","className","style","boxShadow","borderRadius","display","justifyContent","alignItems","fontSize","transition","zIndex","color","background","padding","Box","row","center","rowBetween","rowAround","rowEvenly","colBetween","colAround","colEvenly","pointer","textTransform","objectFit","fit","cover","fullWidth","inspect","alignX","alignY","stretch","borderBox","contentBox","userSelect","pointerEvents","childrenPosition","undefined","flexDirection","direction","getComputedJustifyContent","getComputedAlignItems","cursor","transitionStyle","objectFitCSS","css","StyledBox","children","defaultProps","styled","div","layout","colorStyle","space","flex","flexbox","fontFamily","fontWeight","fontStyle","textShadow","textAlign","border","Image","src","alt","minWidth","minHeight","maxWidth","maxHeight","randomSeed","a","b","random","React","Avatar","backgroundColor","Media","title","favicon","useLayoutEffect","querySelector","setAttribute"],"mappings":"gtFA0CO,ICnCHA,EAA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AAO1B,aAAe,CACpB7C,aAAc,MACduB,OAAO,EACPxG,KAAM,GACNyJ,gBAAiB,kBCjBbC,GAA8B,gBAClCC,IAAAA,MACAC,IAAAA,eAEAC,GAAgB,WACdtO,SAASoO,MAAQA,EACjBpO,SAASuO,cAAc,kBAAmBC,aAAa,OAAQH,KAC9D,IAEIL"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index c61be0f..5d90caa 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1 +1,2 @@ -"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("@emotion/styled")),n=require("styled-system"),r=require("@emotion/core"),o=require("react"),i=t(o);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(){return(c=Object.assign||function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function f(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var s,c=t[Symbol.iterator]();!(r=(s=c.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},t.prototype.connect_=function(){v&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),g?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){v&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;m.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),_=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),D="undefined"!=typeof WeakMap?new WeakMap:new p,k=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=w.getInstance(),r=new T(e,n,this);D.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){k.prototype[t]=function(){var e;return(e=D.get(this))[t].apply(e,arguments)}}));var z=void 0!==b.ResizeObserver?b.ResizeObserver:k;function W(){var t=f(["\n &:hover {\n background: rgba(255, 105, 180, .6) !important;\n color: white !important;\n backdrop-filter: blur(4px);\n }\n "]);return W=function(){return t},t}var F=function(){var t=o.useRef(null),e=h(o.useState({width:0,height:0}),2),n=e[0],i=e[1];return o.useEffect((function(){var e=new z((function(e){i(u(u({},n),{},{width:t.current.offsetWidth,height:t.current.offsetHeight}))}));return t.current&&e.observe(t.current),function(){return e.disconnect()}}),[t]),r.jsx("div",{className:"inspect",style:{position:"absolute",width:"100%",height:"100%",boxShadow:"0 0 0 1px rgba(255, 0, 255, 0.6)",background:"rgba(255, 0, 255, 0.08)",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center",color:"transparent",textShadow:"0 2px 5px rgba(0,0,0,.4)",fontSize:12,transition:".4s",zIndex:9999},ref:t,css:r.css(W())},n.width," x ",n.height)};function H(){var t=f(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n"]);return H=function(){return t},t}function q(){var t=f(["\n ",";\n ",";\n position: relative;\n "]);return q=function(){return t},t}function I(){var t=f(["\n img,\n video,\n audio {\n width: 100%;\n height: 100%;\n object-fit: ",";\n }\n "]);return I=function(){return t},t}var C=function(t){var e=t.style,n=t.color,o=t.row,i=t.center,s=t.left,a=t.right,f=t.top,h=t.bottom,d=t.rowBetween,p=t.rowAround,v=t.rowEvenly,b=t.colBetween,y=t.colAround,m=t.colEvenly,g=t.pointer,w=t.textTransform,_=t.objectFit,x=t.fit,O=t.cover,E=t.transition,j=t.position,A=t.width,S=t.fullWidth,M=t.inspect,P=t.alignX,B=t.alignY,R=t.stretch,T=t.boxSizing,D=t.borderBox,k=t.contentBox,z=t.userSelect,W=t.pointerEvents,H=l(t,["style","color","row","center","left","right","top","bottom","rowBetween","rowAround","rowEvenly","colBetween","colAround","colEvenly","pointer","textTransform","objectFit","fit","cover","transition","position","width","fullWidth","inspect","alignX","alignY","stretch","boxSizing","borderBox","contentBox","userSelect","pointerEvents"]),C={center:i,left:"boolean"==typeof s&&s?s:void 0,right:"boolean"==typeof a&&a?a:void 0,top:"boolean"==typeof f&&f?f:void 0,bottom:"boolean"==typeof h&&h?h:void 0,rowBetween:d,rowAround:p,rowEvenly:v,colBetween:b,colAround:y,colEvenly:m},X=o?"row":"column",Y=function(t){var e=t.childrenPosition,n=t.flexDirection,r=t.alignX,o=t.alignY;t.stretch;return"row"===n?r||(e.left?"flex-start":e.right?"flex-end":e.rowBetween?"space-between":e.rowAround?"space-around":e.rowEvenly?"space-evenly":e.center?"center":"flex-start"):"column"===n?o||(e.top?"flex-start":e.bottom?"flex-end":e.colBetween?"space-between":e.colAround?"space-around":e.colEvenly?"space-evenly":e.center?"center":"flex-start"):"flex-start"}({childrenPosition:C,flexDirection:X,alignX:P,alignY:B,stretch:R}),G=function(t){var e=t.childrenPosition,n=t.flexDirection,r=t.alignX,o=t.alignY,i=t.stretch;return"column"===n?i?"stretch":r||(e.left?"flex-start":e.right?"flex-end":e.rowBetween?"space-between":e.rowAround?"space-around":e.rowEvenly?"space-evenly":e.center?"center":"flex-start"):"row"===n?i?"stretch":o||(e.top?"flex-start":e.bottom?"flex-end":e.colBetween?"space-between":e.colAround?"space-around":e.colEvenly?"space-evenly":e.center?"center":"flex-start"):"flex-start"}({childrenPosition:C,flexDirection:X,alignX:P,alignY:B,stretch:R}),V=g?"pointer":void 0,N="boolean"==typeof E?".4s":"string"==typeof E?E:void 0,U=r.css(I(),O?"cover":x||_);return r.jsx(L,c({color:n,flexDirection:X,alignItems:G,justifyContent:Y,style:u({cursor:V,textTransform:w,transition:N,position:j,left:"boolean"!=typeof s?s:void 0,right:"boolean"!=typeof a?a:void 0,top:"boolean"!=typeof f?f:void 0,bottom:"boolean"!=typeof h?h:void 0,width:S?"100%":A,boxSizing:(D?"border-box":k&&"content-box")||T,userSelect:z,pointerEvents:W},e),css:r.css(q(),O||x||_?U:null,O||x||_&&H.borderRadius?"overflow: hidden":null)},H),M&&r.jsx(F,null),H.children)};C.defaultProps={display:"flex"};var L=e.div(H(),n.color,n.layout,n.colorStyle,n.space,n.flex,n.flexbox,n.fontSize,n.fontFamily,n.fontWeight,n.fontStyle,n.background,n.borderRadius,n.boxShadow,n.textShadow,n.textAlign,n.border),X=function(t){var e=t.src,n=t.alt,r=t.objectFit,o=t.fit,s=t.cover,a=t.height,u=t.width,f=t.minWidth,h=t.minHeight,d=t.maxWidth,p=t.maxHeight,v=t.display,b=t.borderRadius,y=l(t,["src","alt","objectFit","fit","cover","height","width","minWidth","minHeight","maxWidth","maxHeight","display","borderRadius"]),m=function(t,e){return Math.round(Math.random()*(e-t)+t)};return i.createElement("img",c({src:e?"random"===e?"https://picsum.photos/seed/".concat(m(0,3e3),"/300"):e:"https://picsum.photos/seed/".concat(m(0,3e3),"/300"),alt:n,style:{objectFit:s?"cover":o||r?o||r:void 0,width:u,height:a,minWidth:f,minHeight:h,maxWidth:d,maxHeight:p,display:v,borderRadius:b}},y))},Y=function(t){var e=t.src,n=t.children,r=(t.random,l(t,["src","children","random"]));return i.createElement(C,c({},r,{center:!!n}),e?i.createElement(X,{src:e}):n)};Y.defaultProps={borderRadius:"50%",cover:!0,size:34,backgroundColor:"whitesmoke"};exports.Avatar=Y,exports.Box=C,exports.Image=X,exports.Media=function(t){var e=t.title,n=t.favicon;return o.useLayoutEffect((function(){document.title=e,document.querySelector("link[rel=icon]").setAttribute("href",n)}),[]),i.createElement(i.Fragment,null)}; +"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("@emotion/styled")),n=require("styled-system"),r=require("@emotion/core"),o=require("react"),i=t(o);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(){return(c=Object.assign||function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function f(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var s,c=t[Symbol.iterator]();!(r=(s=c.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},t.prototype.connect_=function(){v&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),g?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){v&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;m.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),_=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),D="undefined"!=typeof WeakMap?new WeakMap:new p,z=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=w.getInstance(),r=new T(e,n,this);D.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){z.prototype[t]=function(){var e;return(e=D.get(this))[t].apply(e,arguments)}}));var W=void 0!==b.ResizeObserver?b.ResizeObserver:z,k=function(){var t=o.useRef(null),e=h(o.useState({width:0,height:0}),2),n=e[0],i=e[1];return o.useEffect((function(){var e=new W((function(e){i(u(u({},n),{},{width:t.current.offsetWidth,height:t.current.offsetHeight}))}));return t.current&&e.observe(t.current),function(){return e.disconnect()}}),[t]),r.jsx("div",{className:"inspect",style:{position:"absolute",width:"100%",height:"100%",boxShadow:"0 0 0 1px orangered",borderRadius:2,top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center",fontSize:12,transition:".4s",zIndex:9999},ref:t},r.jsx("div",{className:"inspect-info",style:{color:"white",background:"red",padding:8,borderRadius:4}},n.width," x ",n.height))};function F(){var t=f(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n"]);return F=function(){return t},t}function H(){var t=f(["\n ",";\n ",";\n position: relative;\n "]);return H=function(){return t},t}function q(){var t=f(["\n img,\n video,\n audio {\n width: 100%;\n height: 100%;\n object-fit: ",";\n }\n "]);return q=function(){return t},t}var I=function(t){var e=t.style,n=t.color,o=t.row,i=t.center,s=t.left,a=t.right,f=t.top,h=t.bottom,d=t.rowBetween,p=t.rowAround,v=t.rowEvenly,b=t.colBetween,y=t.colAround,m=t.colEvenly,g=t.pointer,w=t.textTransform,_=t.objectFit,x=t.fit,O=t.cover,E=t.transition,j=t.position,A=t.width,S=t.fullWidth,M=t.inspect,P=t.alignX,R=t.alignY,B=t.stretch,T=t.boxSizing,D=t.borderBox,z=t.contentBox,W=t.userSelect,F=t.pointerEvents,I=l(t,["style","color","row","center","left","right","top","bottom","rowBetween","rowAround","rowEvenly","colBetween","colAround","colEvenly","pointer","textTransform","objectFit","fit","cover","transition","position","width","fullWidth","inspect","alignX","alignY","stretch","boxSizing","borderBox","contentBox","userSelect","pointerEvents"]),L={center:i,left:"boolean"==typeof s&&s?s:void 0,right:"boolean"==typeof a&&a?a:void 0,top:"boolean"==typeof f&&f?f:void 0,bottom:"boolean"==typeof h&&h?h:void 0,rowBetween:d,rowAround:p,rowEvenly:v,colBetween:b,colAround:y,colEvenly:m},X=o?"row":"column",Y=function(t){var e=t.childrenPosition,n=t.flexDirection,r=t.alignX,o=t.alignY;t.stretch;return"row"===n?r||(e.left?"flex-start":e.right?"flex-end":e.rowBetween?"space-between":e.rowAround?"space-around":e.rowEvenly?"space-evenly":e.center?"center":"flex-start"):"column"===n?o||(e.top?"flex-start":e.bottom?"flex-end":e.colBetween?"space-between":e.colAround?"space-around":e.colEvenly?"space-evenly":e.center?"center":"flex-start"):"flex-start"}({childrenPosition:L,flexDirection:X,alignX:P,alignY:R,stretch:B}),G=function(t){var e=t.childrenPosition,n=t.flexDirection,r=t.alignX,o=t.alignY,i=t.stretch;return"column"===n?i?"stretch":r||(e.left?"flex-start":e.right?"flex-end":e.rowBetween?"space-between":e.rowAround?"space-around":e.rowEvenly?"space-evenly":e.center?"center":"flex-start"):"row"===n?i?"stretch":o||(e.top?"flex-start":e.bottom?"flex-end":e.colBetween?"space-between":e.colAround?"space-around":e.colEvenly?"space-evenly":e.center?"center":"flex-start"):"flex-start"}({childrenPosition:L,flexDirection:X,alignX:P,alignY:R,stretch:B}),V=g?"pointer":void 0,N="boolean"==typeof E?".4s":"string"==typeof E?E:void 0,U=r.css(q(),O?"cover":x||_);return r.jsx(C,c({color:n,flexDirection:X,alignItems:G,justifyContent:Y,style:u({cursor:V,textTransform:w,transition:N,position:j,left:"boolean"!=typeof s?s:void 0,right:"boolean"!=typeof a?a:void 0,top:"boolean"!=typeof f?f:void 0,bottom:"boolean"!=typeof h?h:void 0,width:S?"100%":A,boxSizing:(D?"border-box":z&&"content-box")||T,userSelect:W,pointerEvents:F},e),css:r.css(H(),O||x||_?U:null,O||x||_&&I.borderRadius?"overflow: hidden":null)},I),M&&r.jsx(k,null),I.children)};I.defaultProps={display:"flex"};var C=e.div(F(),n.color,n.layout,n.colorStyle,n.space,n.flex,n.flexbox,n.fontSize,n.fontFamily,n.fontWeight,n.fontStyle,n.background,n.borderRadius,n.boxShadow,n.textShadow,n.textAlign,n.border),L=function(t){var e=t.src,n=t.alt,r=t.objectFit,o=t.fit,s=t.cover,a=t.height,u=t.width,f=t.minWidth,h=t.minHeight,d=t.maxWidth,p=t.maxHeight,v=t.display,b=t.borderRadius,y=l(t,["src","alt","objectFit","fit","cover","height","width","minWidth","minHeight","maxWidth","maxHeight","display","borderRadius"]),m=function(t,e){return Math.round(Math.random()*(e-t)+t)};return i.createElement("img",c({src:e?"random"===e?"https://picsum.photos/seed/".concat(m(0,3e3),"/300"):e:"https://picsum.photos/seed/".concat(m(0,3e3),"/300"),alt:n,style:{objectFit:s?"cover":o||r?o||r:void 0,width:u,height:a,minWidth:f,minHeight:h,maxWidth:d,maxHeight:p,display:v,borderRadius:b}},y))},X=function(t){var e=t.src,n=t.children,r=(t.random,l(t,["src","children","random"]));return i.createElement(I,c({},r,{center:!!n}),e?i.createElement(L,{src:e}):n)};X.defaultProps={borderRadius:"50%",cover:!0,size:34,backgroundColor:"whitesmoke"};exports.Avatar=X,exports.Box=I,exports.Image=L,exports.Media=function(t){var e=t.title,n=t.favicon;return o.useLayoutEffect((function(){document.title=e,document.querySelector("link[rel=icon]").setAttribute("href",n)}),[]),i.createElement(i.Fragment,null)}; +//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..7ed0d64 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/utils/flex.ts","../node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js","../src/components/Inspect.tsx","../src/components/Box.tsx","../src/components/Image.tsx","../src/components/Avatar.tsx","../src/components/Media.tsx"],"sourcesContent":["import * as CSS from 'csstype'\n\ntype Position = {\n center?: boolean\n left?: boolean\n right?: boolean\n top?: boolean\n bottom?: boolean\n row?: boolean\n rowBetween?: boolean\n colBetween?: boolean\n rowAround?: boolean\n colAround?: boolean\n rowEvenly?: boolean\n colEvenly?: boolean\n}\n\ntype FlexDirection = CSS.FlexDirectionProperty\n\nexport type JustifyContentProps = CSS.JustifyContentProperty\nexport type AlignItemsProps = CSS.AlignItemsProperty\n\ninterface JustifyContentFN {\n (params: {\n childrenPosition: Position\n flexDirection: FlexDirection\n alignX?: JustifyContentProps | AlignItemsProps\n alignY?: JustifyContentProps | AlignItemsProps\n stretch?: boolean\n }): JustifyContentProps\n}\ninterface AlignItemsFN {\n (parmas: {\n childrenPosition: Position\n flexDirection: FlexDirection\n alignX?: JustifyContentProps | AlignItemsProps\n alignY?: JustifyContentProps | AlignItemsProps\n stretch?: boolean\n }): AlignItemsProps\n}\n\n// Get justifyContent property based on Position, Direction jsx props\nexport const getComputedJustifyContent: JustifyContentFN = ({\n childrenPosition,\n flexDirection: direction,\n alignX,\n alignY,\n stretch\n}) => {\n if (direction === 'row') {\n if(alignX) return alignX\n\n return childrenPosition.left\n ? 'flex-start'\n : childrenPosition.right\n ? 'flex-end'\n : childrenPosition.rowBetween\n ? 'space-between'\n : childrenPosition.rowAround\n ? 'space-around'\n : childrenPosition.rowEvenly\n ? 'space-evenly'\n : childrenPosition.center\n ? 'center'\n : 'flex-start'\n }\n if (direction === 'column') {\n if(alignY) return alignY\n\n return childrenPosition.top\n ? 'flex-start'\n : childrenPosition.bottom\n ? 'flex-end'\n : childrenPosition.colBetween\n ? 'space-between'\n : childrenPosition.colAround\n ? 'space-around'\n : childrenPosition.colEvenly\n ? 'space-evenly'\n : childrenPosition.center\n ? 'center'\n : 'flex-start'\n }\n return 'flex-start'\n}\n// Get alignItemsjustifyContent property based on Position, Direction jsx props\nexport const getComputedAlignItems: AlignItemsFN = ({\n childrenPosition,\n flexDirection: direction,\n alignX,\n alignY,\n stretch\n}) => {\n if (direction === 'column') {\n if(stretch) return 'stretch'\n if(alignX) return alignX\n\n return childrenPosition.left\n ? 'flex-start'\n : childrenPosition.right\n ? 'flex-end'\n : childrenPosition.rowBetween\n ? 'space-between'\n : childrenPosition.rowAround\n ? 'space-around'\n : childrenPosition.rowEvenly\n ? 'space-evenly'\n : childrenPosition.center\n ? 'center'\n : 'flex-start'\n }\n if (direction === 'row') {\n if(stretch) return 'stretch'\n if(alignY) return alignY\n\n return childrenPosition.top\n ? 'flex-start'\n : childrenPosition.bottom\n ? 'flex-end'\n : childrenPosition.colBetween\n ? 'space-between'\n : childrenPosition.colAround\n ? 'space-around'\n : childrenPosition.colEvenly\n ? 'space-evenly'\n : childrenPosition.center\n ? 'center'\n : 'flex-start'\n }\n return 'flex-start'\n}\n","/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n/* eslint-disable require-jsdoc, valid-jsdoc */\r\nvar MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return result;\r\n }\r\n return /** @class */ (function () {\r\n function class_1() {\r\n this.__entries__ = [];\r\n }\r\n Object.defineProperty(class_1.prototype, \"size\", {\r\n /**\r\n * @returns {boolean}\r\n */\r\n get: function () {\r\n return this.__entries__.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n class_1.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n return entry && entry[1];\r\n };\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n class_1.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n }\r\n else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n /**\r\n * @returns {void}\r\n */\r\n class_1.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n class_1.prototype.forEach = function (callback, ctx) {\r\n if (ctx === void 0) { ctx = null; }\r\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n return class_1;\r\n }());\r\n})();\n\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n// Returns global object of a current environment.\r\nvar global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n})();\n\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\nvar requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n})();\n\n// Defines minimum timeout before adding a trailing call.\r\nvar trailingTimeout = 2;\r\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\nfunction throttle (callback, delay) {\r\n var leadingCall = false, trailingCall = false, lastCallTime = 0;\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n callback();\r\n }\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n }\r\n else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n lastCallTime = timeStamp;\r\n }\r\n return proxy;\r\n}\n\n// Minimum delay before invoking the update of observers.\r\nvar REFRESH_DELAY = 20;\r\n// A list of substrings of CSS properties used to find transition events that\r\n// might affect dimensions of observed elements.\r\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n// Check if MutationObserver is available.\r\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\nvar ResizeObserverController = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\r\n function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }\r\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n };\r\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n };\r\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\n ResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n return activeObservers.length > 0;\r\n };\r\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n window.addEventListener('resize', this.refresh);\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n }\r\n else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n this.mutationEventsAdded_ = true;\r\n }\r\n this.connected_ = true;\r\n };\r\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n };\r\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\r\n var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\n ResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n return this.instance_;\r\n };\r\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n ResizeObserverController.instance_ = null;\r\n return ResizeObserverController;\r\n}());\n\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\nvar defineConfigurable = (function (target, props) {\r\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n return target;\r\n});\n\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\nvar getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n});\n\n// Placeholder of an empty content rectangle.\r\nvar emptyRect = createRectInit(0, 0, 0, 0);\r\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\nfunction toFloat(value) {\r\n return parseFloat(value) || 0;\r\n}\r\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\nfunction getBordersSize(styles) {\r\n var positions = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n positions[_i - 1] = arguments[_i];\r\n }\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n return size + toFloat(value);\r\n }, 0);\r\n}\r\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\nfunction getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n var value = styles['padding-' + position];\r\n paddings[position] = toFloat(value);\r\n }\r\n return paddings;\r\n}\r\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n}\r\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth, clientHeight = target.clientHeight;\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width), height = toFloat(styles.height);\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n}\r\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nvar isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return (target instanceof getWindowOf(target).SVGElement &&\r\n typeof target.getBBox === 'function'); };\r\n})();\r\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nfunction isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n}\r\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n return getHTMLElementContentRect(target);\r\n}\r\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\nfunction createReadOnlyRect(_a) {\r\n var x = _a.x, y = _a.y, width = _a.width, height = _a.height;\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n return rect;\r\n}\r\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n}\n\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\nvar ResizeObservation = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\r\n function ResizeObservation(target) {\r\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastWidth = 0;\r\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastHeight = 0;\r\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n this.target = target;\r\n }\r\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n this.contentRect_ = rect;\r\n return (rect.width !== this.broadcastWidth ||\r\n rect.height !== this.broadcastHeight);\r\n };\r\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\n ResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n return rect;\r\n };\r\n return ResizeObservation;\r\n}());\n\nvar ResizeObserverEntry = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\r\n function ResizeObserverEntry(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n }\r\n return ResizeObserverEntry;\r\n}());\n\nvar ResizeObserverSPI = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\r\n function ResizeObserverSPI(callback, controller, callbackCtx) {\r\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\r\n this.activeObservations_ = [];\r\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\r\n this.observations_ = new MapShim();\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n }\r\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n observations.set(target, new ResizeObservation(target));\r\n this.controller_.addObserver(this);\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n };\r\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n observations.delete(target);\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n };\r\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n };\r\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.gatherActive = function () {\r\n var _this = this;\r\n this.clearActive();\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n _this.activeObservations_.push(observation);\r\n }\r\n });\r\n };\r\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n var ctx = this.callbackCtx_;\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n };\r\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n };\r\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n };\r\n return ResizeObserverSPI;\r\n}());\n\n// Registry of internal observers. If WeakMap is not available use current shim\r\n// for the Map collection as it has all required methods and because WeakMap\r\n// can't be fully polyfilled anyway.\r\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\nvar ResizeObserver = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\r\n function ResizeObserver(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n observers.set(this, observer);\r\n }\r\n return ResizeObserver;\r\n}());\r\n// Expose public methods of ResizeObserver.\r\n[\r\n 'observe',\r\n 'unobserve',\r\n 'disconnect'\r\n].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n var _a;\r\n return (_a = observers.get(this))[method].apply(_a, arguments);\r\n };\r\n});\n\nvar index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n return ResizeObserver;\r\n})();\n\nexport default index;\n","import React, { useRef, useEffect, useState } from 'react'\n/** @jsx jsx */\nimport { jsx, css } from '@emotion/core'\nimport ResizeObserver from 'resize-observer-polyfill'\n\nconst Inspect: React.FC = () => {\n const ref = useRef(null)\n const [info, setInfo] = useState({\n width: 0,\n height: 0\n })\n\n const updateInfo = ()=>{\n setInfo({\n ...info,\n width: ref.current!.offsetWidth,\n height: ref.current!.offsetHeight\n })\n }\n\n useEffect(()=>{\n const ro = new ResizeObserver(entries=>updateInfo())\n ref.current && ro.observe(ref.current)\n return ()=>ro.disconnect()\n }, [ref])\n\n return(\n
\n
\n {info.width} x {info.height}\n
\n
\n )\n}\n\nexport default Inspect\n","import React, { HTMLAttributes, DetailedHTMLProps } from 'react'\nimport styled from '@emotion/styled'\nimport {\n colorStyle,\n space,\n layout,\n ColorProps,\n SpaceProps,\n LayoutProps,\n flex,\n FlexProps,\n flexbox,\n FlexboxProps,\n fontSize,\n FontSizeProps,\n fontFamily,\n fontWeight,\n fontStyle,\n FontFamilyProps,\n FontWeightProps,\n FontStyleProps,\n color,\n BackgroundProps,\n background,\n borderRadius,\n BorderRadiusProps,\n boxShadow,\n BoxShadowProps,\n textShadow,\n TextShadowProps,\n textAlign,\n TextAlignProps,\n border,\n BorderProps\n} from 'styled-system'\nimport { getComputedJustifyContent, getComputedAlignItems } from '../utils/flex'\nimport * as CSS from 'csstype'\n/** @jsx jsx */\nimport { jsx, css } from '@emotion/core'\nimport Inspect from './Inspect'\n\nexport interface BoxProps extends StyledBoxType, ColorProps {\n center?: boolean\n left?: boolean | string | number\n right?: boolean | string | number\n top?: boolean | string | number\n bottom?: boolean | string | number\n row?: boolean\n rowBetween?: boolean\n colBetween?: boolean\n rowAround?: boolean\n colAround?: boolean\n rowEvenly?: boolean\n colEvenly?: boolean\n color?: string\n pointer?: Boolean\n textTransform?: CSS.TextTransformProperty\n objectFit?: CSS.ObjectFitProperty\n fit?: CSS.ObjectFitProperty\n cover?: boolean\n transition?: boolean | CSS.TransitionProperty\n position?: CSS.PositionProperty\n width?: CSS.WidthProperty\n fullWidth?: boolean\n inspect?: boolean\n alignX?: CSS.JustifyContentProperty | CSS.AlignItemsProperty\n alignY?: CSS.JustifyContentProperty | CSS.AlignItemsProperty\n stretch?: boolean\n boxSizing?: CSS.BoxSizingProperty\n borderBox?: boolean\n contentBox?: boolean\n userSelect?: CSS.UserSelectProperty\n pointerEvents?: CSS.PointerEventsProperty\n}\n\nconst Box: React.FC<\n BoxProps & DetailedHTMLProps, HTMLDivElement>\n> = ({\n style,\n color,\n row,\n center,\n left,\n right,\n top,\n bottom,\n rowBetween,\n rowAround,\n rowEvenly,\n colBetween,\n colAround,\n colEvenly,\n pointer,\n textTransform,\n objectFit,\n fit,\n cover,\n transition,\n position,\n width,\n fullWidth,\n inspect,\n alignX,\n alignY,\n stretch,\n boxSizing,\n borderBox,\n contentBox,\n userSelect,\n pointerEvents,\n ...props\n}) => {\n const childrenPosition = {\n center,\n left: typeof left === 'boolean' && left ? left : undefined,\n right: typeof right === 'boolean' && right ? right : undefined,\n top: typeof top === 'boolean' && top ? top : undefined,\n bottom: typeof bottom === 'boolean' && bottom ? bottom : undefined,\n rowBetween,\n rowAround,\n rowEvenly,\n colBetween,\n colAround,\n colEvenly\n }\n const flexDirection = row ? 'row' : 'column'\n const justifyContent = getComputedJustifyContent({\n childrenPosition,\n flexDirection,\n alignX,\n alignY,\n stretch\n })\n const alignItems = getComputedAlignItems({\n childrenPosition,\n flexDirection,\n alignX,\n alignY,\n stretch\n })\n const cursor = pointer ? 'pointer' : undefined\n const transitionStyle =\n typeof transition === 'boolean'\n ? '.4s'\n : typeof transition === 'string'\n ? transition\n : undefined\n\n const objectFitCSS = css`\n img,\n video,\n audio {\n width: 100%;\n height: 100%;\n object-fit: ${cover ? 'cover' : fit || objectFit};\n }\n `\n\n return (\n \n {inspect && }\n {props.children}\n \n )\n}\n\nBox.defaultProps = {\n display: 'flex'\n}\n\n// Props definition for Box\ntype StyledBoxType = SpaceProps &\n LayoutProps &\n FlexProps &\n FlexboxProps &\n FontSizeProps &\n FontFamilyProps &\n FontWeightProps &\n FontStyleProps &\n BackgroundProps &\n BorderRadiusProps &\n BoxShadowProps &\n TextShadowProps &\n TextAlignProps &\n BorderProps\n\n// Use styled-theme to decorate Box\nconst StyledBox = styled.div`\n ${color}\n ${layout}\n ${colorStyle}\n ${space}\n ${flex}\n ${flexbox}\n ${fontSize}\n ${fontFamily}\n ${fontWeight}\n ${fontStyle}\n ${background}\n ${borderRadius}\n ${boxShadow}\n ${textShadow}\n ${textAlign}\n ${border}\n`\n\nexport default Box\n","import React, { ImgHTMLAttributes, DetailedHTMLProps } from 'react'\nimport * as CSS from 'csstype'\n\nexport interface ImageProps {\n src?: 'random' | string&{}\n objectFit?: CSS.ObjectFitProperty\n fit?: CSS.ObjectFitProperty,\n cover?: boolean,\n width?: CSS.WidthProperty\n height?: CSS.HeightProperty\n minWidth?: CSS.MinWidthProperty\n minHeight?: CSS.MinHeightProperty\n maxWidth?: CSS.MaxWidthProperty\n maxHeight?: CSS.MaxHeightProperty\n display?: 'inline' | 'block' | 'inline-block' | 'none' | 'unset' | 'initial'\n borderRadius?: CSS.BorderRadiusProperty\n}\n\nconst Image: React.FC, HTMLImageElement>> = ({\n src,\n alt,\n objectFit,\n fit,\n cover,\n height,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n display,\n borderRadius,\n ...props\n}) => {\n const objectFitStyle = ():any => {\n if(cover) return 'cover'\n if(fit || objectFit) return fit || objectFit\n }\n\n const randomSeed:(a:number,b:number)=>number = (a,b)=>{\n return Math.round(Math.random()*(b-a) + a)\n }\n\n return (\n \n )\n}\n\n// const StyledImage = styled.img`\n\n// `\n\nexport default Image\n","import React, { ImgHTMLAttributes } from 'react'\nimport Box, {BoxProps} from './Box'\nimport Image, {ImageProps} from './Image'\n\nexport interface AvatarProps extends BoxProps {\n src?: 'random' | string&{}\n /**Generate random pictures from https://picsum.photos/ for quick demonstration.*/\n random?: boolean\n}\n\nconst Avatar: React.FC = ({src, children, random, ...props}) => {\n\n\n return(\n \n {src ? : children}\n \n )\n}\n\nAvatar.defaultProps = {\n borderRadius: '50%',\n cover: true,\n size: 34,\n backgroundColor: 'whitesmoke'\n}\n\nexport default Avatar\n","import React, { useLayoutEffect } from 'react'\n\nexport interface MediaProps {\n title: string\n favicon: string\n}\n\nconst Media: React.FC = ({\n title,\n favicon\n}) => {\n useLayoutEffect(()=>{\n document.title = title\n document.querySelector('link[rel=icon]')!.setAttribute('href', favicon)\n }, [])\n\n return(<>)\n}\n\nexport default Media\n"],"names":["MapShim","Map","getIndex","arr","key","result","some","entry","index","class_1","__entries__","Object","defineProperty","prototype","get","this","length","enumerable","configurable","set","value","push","delete","entries","splice","has","clear","forEach","callback","ctx","_i","_a","call","isBrowser","window","document","global$1","global","Math","self","Function","requestAnimationFrame$1","requestAnimationFrame","bind","setTimeout","Date","now","transitionKeys","mutationObserverSupported","MutationObserver","ResizeObserverController","connected_","mutationEventsAdded_","mutationsObserver_","observers_","onTransitionEnd_","refresh","delay","leadingCall","trailingCall","lastCallTime","resolvePending","proxy","timeoutCallback","timeStamp","throttle","addObserver","observer","indexOf","connect_","removeObserver","observers","disconnect_","updateObservers_","activeObservers","filter","gatherActive","hasActive","broadcastActive","addEventListener","observe","attributes","childList","characterData","subtree","removeEventListener","disconnect","_b","propertyName","getInstance","instance_","defineConfigurable","target","props","keys","writable","getWindowOf","ownerDocument","defaultView","emptyRect","createRectInit","toFloat","parseFloat","getBordersSize","styles","positions","arguments","reduce","size","position","getHTMLElementContentRect","clientWidth","clientHeight","getComputedStyle","paddings","positions_1","getPaddings","horizPad","left","right","vertPad","top","bottom","width","height","boxSizing","round","documentElement","isDocumentElement","vertScrollbar","horizScrollbar","abs","isSVGGraphicsElement","SVGGraphicsElement","SVGElement","getBBox","getContentRect","bbox","getSVGContentRect","x","y","ResizeObservation","broadcastWidth","broadcastHeight","contentRect_","isActive","rect","broadcastRect","ResizeObserverEntry","rectInit","Constr","contentRect","DOMRectReadOnly","create","ResizeObserverSPI","controller","callbackCtx","activeObservations_","observations_","TypeError","callback_","controller_","callbackCtx_","Element","observations","unobserve","clearActive","_this","observation","map","WeakMap","ResizeObserver","method","apply","Inspect","ref","useRef","useState","info","setInfo","useEffect","ro","current","offsetWidth","offsetHeight","jsx","className","style","boxShadow","borderRadius","display","justifyContent","alignItems","fontSize","transition","zIndex","color","background","padding","Box","row","center","rowBetween","rowAround","rowEvenly","colBetween","colAround","colEvenly","pointer","textTransform","objectFit","fit","cover","fullWidth","inspect","alignX","alignY","stretch","borderBox","contentBox","userSelect","pointerEvents","childrenPosition","undefined","flexDirection","direction","getComputedJustifyContent","getComputedAlignItems","cursor","transitionStyle","objectFitCSS","css","StyledBox","children","defaultProps","styled","div","layout","colorStyle","space","flex","flexbox","fontFamily","fontWeight","fontStyle","textShadow","textAlign","border","Image","src","alt","minWidth","minHeight","maxWidth","maxHeight","randomSeed","a","b","random","React","Avatar","backgroundColor","title","favicon","useLayoutEffect","querySelector","setAttribute"],"mappings":"ijFA0CO,ICnCHA,EAAW,cACQ,oBAARC,WACAA,aASFC,EAASC,EAAKC,OACf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G,KAAM,GACNyJ,gBAAiB,2ECjBiB,gBAClCC,IAAAA,MACAC,IAAAA,eAEAC,mBAAgB,WACdrO,SAASmO,MAAQA,EACjBnO,SAASsO,cAAc,kBAAmBC,aAAa,OAAQH,KAC9D,IAEIJ"} \ No newline at end of file diff --git a/src/components/Inspect.tsx b/src/components/Inspect.tsx index 9aba65d..5f730a8 100644 --- a/src/components/Inspect.tsx +++ b/src/components/Inspect.tsx @@ -29,26 +29,26 @@ const Inspect: React.FC = () => { position: 'absolute', width: '100%', height: '100%', - boxShadow: '0 0 0 1px rgba(255, 0, 255, 0.6)', - background: 'rgba(255, 0, 255, 0.08)', + boxShadow: '0 0 0 1px orangered', + borderRadius: 2, top: 0, left: 0, display: 'flex', justifyContent: 'center', alignItems: 'center', - color: 'transparent', - textShadow: '0 2px 5px rgba(0,0,0,.4)', + // textShadow: '0 2px 5px rgba(0,0,0,.4)', fontSize: 12, transition: '.4s', zIndex: 9999 - }} ref={ref} css={css` - &:hover { - background: rgba(255, 105, 180, .6) !important; - color: white !important; - backdrop-filter: blur(4px); - } - `}> - {info.width} x {info.height} + }} ref={ref}> +
+ {info.width} x {info.height} +
) } diff --git a/todo.md b/todo.md index 3603235..2b093ed 100644 --- a/todo.md +++ b/todo.md @@ -17,4 +17,9 @@ 17. zIndex 18. fixbug - Box width={1} becomes width='100%' 19. fixbug - Avatar random not working -20. feature - 多行溢出 \ No newline at end of file +20. feature - 多行溢出 +21. feature - Box hide scroll bar +22. fixbug - Box size with minWidth +23. feature - Box zoom style prop +24. update - Inspect ui ✅ +25. fixbug - Name Media component to Meta \ No newline at end of file