@zonos/amino 4.4.0 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var e=require("../../_tslib-fe391a2e.js"),i=require("react/jsx-runtime"),n=require("react");function t(e){return e&&e.__esModule?e:{default:e}}var r,o=t(require("styled-components")).default.div(r||(r=e.__makeTemplateObject(["\n position: relative;\n transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n overflow: ",";\n visibility: ",";\n height: ",";\n"],["\n position: relative;\n transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n overflow: ",";\n visibility: ",";\n height: ",";\n"])),(function(e){return e.hideOverflow?"hidden":void 0}),(function(e){return e.completelyCollapsed?"hidden":void 0}),(function(e){return e.currentlyCollapsed?"".concat(e.collapseSize,"px"):"".concat(e.$height,"px")}));exports.Collapse=function(t){var r=t.className,l=t.children,s=t.collapsed,c=void 0!==s&&s,a=t.collapseSize,u=void 0===a?0:a,d=e.__read(n.useState(c),2),v=d[0],f=d[1],h=e.__read(n.useState(c),2),p=h[0],_=h[1],b=e.__read(n.useState(void 0),2),m=b[0],g=b[1],y=n.useRef(null);n.useEffect((function(){var e=new ResizeObserver((function(e){var i,n;g(null===(n=null===(i=e[0])||void 0===i?void 0:i.borderBoxSize[0])||void 0===n?void 0:n.blockSize)}));return y.current&&e.observe(y.current),function(){e.disconnect()}}),[]),n.useEffect((function(){_(!0),c||f(!1)}),[c]);return i.jsx(o,e.__assign({className:r,currentlyCollapsed:c,completelyCollapsed:v,hideOverflow:p,onTransitionEnd:function(){c?(_(!0),f(!0)):(_(!1),f(!1))},$height:m,collapseSize:u},{children:i.jsx("div",e.__assign({style:{position:"relative"},ref:y},{children:l}))}))};
1
+ "use strict";var e=require("../../_tslib-fe391a2e.js"),t=require("react/jsx-runtime"),i=require("react");function n(e){return e&&e.__esModule?e:{default:e}}var r,o=n(require("styled-components")).default.div(r||(r=e.__makeTemplateObject(["\n position: relative;\n transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n overflow: ",";\n visibility: ",";\n height: ",";\n"],["\n position: relative;\n transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n overflow: ",";\n visibility: ",";\n height: ",";\n"])),(function(e){return e.hideOverflow?"hidden":void 0}),(function(e){return e.completelyCollapsed?"hidden":void 0}),(function(e){return e.currentlyCollapsed?"".concat(e.collapseSize,"px"):"".concat(e.$height,"px")}));exports.Collapse=function(n){var r=n.className,l=n.children,s=n.collapsed,a=void 0!==s&&s,c=n.collapseSize,u=void 0===c?0:c,d=e.__read(i.useState(a),2),p=d[0],h=d[1],f=e.__read(i.useState(a),2),v=f[0],m=f[1],_=e.__read(i.useState(),2),g=_[0],b=_[1],y=i.useRef(null),S=function(){if(null!==y.current){var e=window.getComputedStyle(y.current);return parseFloat(e.height)+parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth)+parseFloat(e.marginTop)+parseFloat(e.marginBottom)}};i.useEffect((function(){b(S())}),[]),i.useEffect((function(){m(!0),a||h(!1)}),[a]);return t.jsx(o,e.__assign({className:r,currentlyCollapsed:a,completelyCollapsed:p,hideOverflow:v,onTransitionEnd:function(){a?(m(!0),h(!0)):(m(!1),h(!1),b(S()))},$height:g,collapseSize:u},{children:t.jsx("div",e.__assign({style:{position:"relative"},ref:y},{children:l}))}))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",
@@ -11,6 +11,7 @@
11
11
  "not ie <= 11",
12
12
  "not op_mini all"
13
13
  ],
14
+ "scripts": {},
14
15
  "devDependencies": {},
15
16
  "dependencies": {
16
17
  "@dnd-kit/core": "^5.0.3",
@@ -53,6 +54,5 @@
53
54
  "styled-components": "^5.x",
54
55
  "swr": "2.x"
55
56
  },
56
- "scripts": {},
57
57
  "types": "all.d.ts"
58
58
  }
@@ -1 +1 @@
1
- "use strict";var r=require("../_tslib-fe391a2e.js"),e=function(e){var n=e.response,t=e.shouldLog,s=void 0===t||t,o=e.shouldThrow,i=void 0!==o&&o;return r.__awaiter(void 0,void 0,void 0,(function(){var e;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,n.json()];case 1:return[2,r.sent()];case 2:if(e=r.sent(),i)throw e;return s&&console.error(e),[2,null];case 3:return[2]}}))}))},n=function(n,t){return r.__awaiter(void 0,void 0,void 0,(function(){var s,o,i,u;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,fetch(n,t)];case 1:return(s=r.sent()).ok?[4,e({response:s})]:[3,3];case 2:return[2,{errors:[],json:i=r.sent(),response:s}];case 3:o=s.status.toString(),r.label=4;case 4:return r.trys.push([4,6,,7]),[4,e({response:s,shouldThrow:!0})];case 5:return i=r.sent(),u=JSON.stringify(i),[2,{errors:[{message:"".concat(o,": ").concat(u),type:o}],json:null,response:s}];case 6:return r.sent(),u="Unknown error",[2,{json:null,errors:[{message:"".concat(o,": ").concat(u),type:o}],response:null}];case 7:return[2]}}))}))},t=function(e,t){return r.__awaiter(void 0,void 0,void 0,(function(){var s,o,i,u;return r.__generator(this,(function(a){return(s=t||{}).logRequestIfError,o=r.__rest(s,["logRequestIfError"]),i=o.body&&JSON.stringify(o.body),u=r.__assign(r.__assign({},o),{body:i}),[2,n(e,u)]}))}))};exports.fetcher=function(e,n){return r.__awaiter(void 0,void 0,void 0,(function(){var s,o,i,u,a;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,t(e,n)];case 1:if(s=r.sent(),o=s.errors,i=s.json,u=s.response,a=o.find(Boolean),!(null==u?void 0:u.ok)||["pollUntil","failedData"].includes((null==a?void 0:a.type)||""))throw{errors:o,status:null==u?void 0:u.status};return[2,{json:i,response:u}]}}))}))},exports.handleFetch=t,exports.handleRequest=n;
1
+ "use strict";var e=require("../_tslib-fe391a2e.js"),r=function(r){var n=r.response,s=r.shouldLog,t=void 0===s||s,o=r.shouldThrow,u=void 0!==o&&o;return e.__awaiter(void 0,void 0,void 0,(function(){var r;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,n.json()];case 1:return[2,e.sent()];case 2:if(r=e.sent(),u)throw r;return t&&console.error(r),[2,null];case 3:return[2]}}))}))},n=function(n,s){return e.__awaiter(void 0,void 0,void 0,(function(){var t,o,u,a,i;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,fetch(n,s)];case 1:return t=e.sent(),[3,3];case 2:return(o=e.sent())instanceof Error?[2,{errors:[{message:o.message,type:"unknown"}],json:null,response:null}]:[2,{errors:[{message:i="Fail to fetch",type:"unknown"}],json:null,response:null}];case 3:return t.ok?[4,r({response:t})]:[3,5];case 4:return[2,{errors:[],json:a=e.sent(),response:t}];case 5:u=t.status.toString(),e.label=6;case 6:return e.trys.push([6,8,,9]),[4,r({response:t,shouldThrow:!0})];case 7:return a=e.sent(),i=JSON.stringify(a),[2,{errors:[{message:"".concat(u,": ").concat(i),type:u}],json:null,response:t}];case 8:return e.sent(),i="Unknown error",[2,{json:null,errors:[{message:"".concat(u,": ").concat(i),type:u}],response:null}];case 9:return[2]}}))}))},s=function(r,s){return e.__awaiter(void 0,void 0,void 0,(function(){var t,o,u,a;return e.__generator(this,(function(i){return(t=s||{}).logRequestIfError,o=e.__rest(t,["logRequestIfError"]),u=o.body&&JSON.stringify(o.body),a=e.__assign(e.__assign({},o),{body:u}),[2,n(r,a)]}))}))};exports.fetcher=function(r,n){return e.__awaiter(void 0,void 0,void 0,(function(){var t,o,u,a,i;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,s(r,n)];case 1:if(t=e.sent(),o=t.errors,u=t.json,a=t.response,i=o.find(Boolean),!(null==a?void 0:a.ok)||["pollUntil","failedData"].includes((null==i?void 0:i.type)||""))throw{errors:o,status:null==a?void 0:a.status};return[2,{json:u,response:a}]}}))}))},exports.handleFetch=s,exports.handleRequest=n;