@abtnode/webapp 1.8.63 → 1.8.64-beta-0b5ede51

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 +0,0 @@
1
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[7327],{77327:function(e,t,n){n.r(t),n.d(t,{BlockletList:function(){return ce},default:function(){return se}});var l,a,o=n(71171),i=n(33028),r=n(32723),s=n(34795),c=n(96234),u=n(5057),d=n(33518),m=n(85493),f=n(15849),p=n(67654),x=n(11750),h=n(37565),b=n(21769),k=n(74490),g=n(39948),v=n(72904),j=n(37298),y=n(78146),Z=n(34519),C=n(42873),w=n(19561),A=n(31290),B=n(13714),L=n(52118),S=n(32356),_=n(30746),D=n(80514),I=n(98867),N=n(56048),R=n(82594),P=n(54474),T=n(38242),F=n(60411),z=n(52926),M=n(74094),U=n(17265),W=n(59740),O=n(49603),E=n(24138),J=n(96266),q=["blocklet","skipAccessibilityCheck"];function G(e){var t=e.blocklet,n=e.skipAccessibilityCheck,l=void 0!==n&&n,a=(0,W.Z)(e,q),o=(0,u.useContext)(L.LocaleContext).t,r=(0,E.BZ)(t),s=r.urls,c=r.loading,d=r.recommendedUrl;if(c&&!l)return(0,J.jsx)(Z.default,(0,i.Z)({size:12},a));var m=l?s[0]:d;return m?(0,J.jsx)(K,(0,i.Z)((0,i.Z)({},a),{},{children:(0,J.jsx)(H,{children:(0,J.jsx)(O.Z,{href:m,target:"_blank",className:"blocklet-interface",underline:"hover",children:o("common.open")})})})):o("blocklet.router.noAccessibleUrl")}var H=d.default.div(l||(l=(0,o.Z)(["\n display: flex;\n margin: 4px 0;\n"]))),K=d.default.div(a||(a=(0,o.Z)(["\n .blocklet-interface {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n white-space: nowrap;\n\n img {\n margin-right: 4px;\n }\n }\n"])));G.defaultProps={skipAccessibilityCheck:!1};var Q=n(44919),V=n(75e3),X=n(29316),Y=n(50438),$=n(99593),ee=n(50453),te=n(47020);function ne(e){var t=e.onCancel,n=e.onSuccess,l=(0,F.h6)().api,a=(0,u.useState)(!1),o=(0,c.Z)(a,2),i=o[0],d=o[1],m=(0,u.useState)(""),f=(0,c.Z)(m,2),p=f[0],h=f[1],b=(0,L.useLocaleContext)().t,k=(0,u.useState)(),g=(0,c.Z)(k,2),v=g[0],j=g[1],y=(0,u.useState)(),C=(0,c.Z)(y,2),w=C[0],S=C[1],_=function(){var e=(0,s.Z)((0,r.Z)().mark((function e(){var t,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d(!0),e.prev=1,e.next=4,l.installBlocklet({input:{title:v,description:w}});case 4:t=e.sent,n(t.blocklet),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),a="Blocklet Install failed: ".concat((0,M.Z)(e.t0)),h(a);case 12:return e.prev=12,d(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,8,12,15]])})));return function(){return e.apply(this,arguments)}}();return(0,J.jsxs)($.default,{title:b("blocklet.installFromCreate"),fullWidth:!0,maxWidth:"sm",onClose:function(){return t()},showCloseButton:!0,open:!0,actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(B.default,{onClick:function(e){e.stopPropagation(),t()},color:"inherit",children:b("common.cancel")}),(0,J.jsxs)(B.default,{onClick:function(e){e.stopPropagation(),_()},color:"primary","data-cy":"install-blocklet-next-step",variant:"contained",disabled:i||p||!v||!w,style:{marginLeft:8},children:[i&&(0,J.jsx)(Z.default,{size:[16,10]}),b("common.create")]})]}),children:[(0,J.jsx)(ee.Z,{component:"div",children:(0,J.jsxs)(x.Z,{component:"div",children:[(0,J.jsx)(te.Z,{style:{marginBottom:24},label:"Blocklet ".concat(b("common.title")),autoComplete:"off",variant:"outlined",fullWidth:!0,autoFocus:!0,value:v,onChange:function(e){h(null),j(e.target.value)},disabled:i}),(0,J.jsx)(te.Z,{label:"Blocklet ".concat(b("common.description")),autoComplete:"off",variant:"outlined",fullWidth:!0,value:w,onChange:function(e){h(null),S(e.target.value)},disabled:i})]})}),!!p&&(0,J.jsx)(A.default,{type:"error",style:{width:"100%",marginTop:8},children:p})]})}function le(e){var t=e.onCreate,n=(0,m.s0)(),l=(0,L.useLocaleContext)().t,a=(0,u.useState)(""),o=(0,c.Z)(a,2),i=o[0],r=o[1],s=(0,u.useState)(""),d=(0,c.Z)(s,2),f=d[0],p=d[1],x=(0,u.useState)(null),h=(0,c.Z)(x,2),b=h[0],k=h[1],g=(0,u.useState)(null),v=(0,c.Z)(g,2),j=v[0],y=v[1],Z=function(){k(null)};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(X.default,{onClick:function(){return n("/store")},menuButtonProps:{"data-cy":"open-install-menu"},menu:[(0,J.jsx)(X.default.Item,{"data-cy":"open-install-form",onClick:function(){k({onCancel:function(){Z(),k(null)},onSuccess:function(){Z()}})},children:l("blocklet.installFromUrl")},"1"),(0,J.jsx)(X.default.Item,{"data-cy":"open-create-form",onClick:function(){y({onCancel:function(){y(null)},onSuccess:function(){y(null),t.apply(void 0,arguments)}})},children:l("blocklet.installFromCreate")},"2")],children:[(0,J.jsx)(Q.default,{}),l("blocklet.installFromMarket")]}),!!i&&(0,J.jsx)(V.default,{variant:"error",message:i,onClose:function(){return r("")}}),!!f&&(0,J.jsx)(V.default,{variant:"success",duration:3e3,message:f,onClose:function(){return p("")}}),b&&(0,J.jsx)(Y.default,{onCancel:b.onCancel,onSuccess:b.onSuccess}),j&&(0,J.jsx)(ne,{onCancel:j.onCancel,onSuccess:j.onSuccess})]})}ne.defaultProps={},le.defaultProps={onCreate:function(){}};var ae,oe,ie=n(7199),re="internal";function se(){return(0,J.jsx)(D.DeletingBlockletProvider,{children:(0,J.jsx)(ce,{})})}function ce(){var e=(0,m.s0)(),t=(0,F.h6)(),n=(0,z.RJ)(),l=n.data,a=n.externalData,o=n.error,d=n.refresh,W=n.loading,O=(0,D.useDeletingBlockletContext)(),E=O.deletingBlocklets,q=O.addDeletingDid,H=O.removeDeletingDid,K=O.matchDeletingDid,Q=(0,L.useLocaleContext)(),V=Q.t,X=Q.locale,Y=(0,u.useState)(""),$=(0,c.Z)(Y,2),ee=$[0],te=$[1],ne=(0,p.default)("show-external-blocklet-actions",!1),ae=(0,c.Z)(ne,1)[0],oe=[{id:re,name:V("blocklet.internal")},{id:"external",name:V("blocklet.external")}],se=(0,u.useState)(re),ce=(0,c.Z)(se,2),me=ce[0],fe=ce[1],pe=me===re?l:a;K(pe.map((function(e){return e.meta.did})));var xe=function(e){var t=e.action,n=e.blocklet;"remove"===t&&q(n.meta.did)},he=function(){var e=(0,s.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.error){e.next=4;break}return S.default.error(n.error.message),"remove"===n.action&&H(n.blocklet.meta.did),e.abrupt("return");case 4:"remove"===n.action&&t.refresh({silent:!0});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),be=(0,v.Z)((function(e){return e.breakpoints.up("md")})),ke=null,ge=pe||[];if(o)ke=(0,J.jsx)(A.default,{type:"error",variant:"icon",children:(0,J.jsxs)("div",{children:[(0,M.Z)(o),(0,J.jsx)(B.default,{onClick:function(){return d({silent:!1})},children:(0,J.jsx)("span",{style:{color:"#44cdc6",textDecoration:"underline"},children:V("common.retry")})})]})});else if(ge.length>0||W){var ve=["installedAt","startedAt","stoppedAt","createdAt"],je=function(e){if("starting"===e.status)return new Date("2199").getTime();if("running"===e.status){if(e.appRuntimeInfo)return e.appRuntimeInfo.startAt;if(e.startedAt)return e.startedAt.getTime()}return 0},ye=ge.map((function(e){return ve.forEach((function(t){if(e[t]){var n=new Date(e[t]);e[t]=n}})),e})).sort((function(e,t){var n=je(e);return je(t)-n}));ee&&(ye=ye.filter((function(e){var t,n=(0,T.getDisplayName)(e,!0)||"",l=(null===(t=e.site)||void 0===t?void 0:t.domainAliases)||[],a=ee.trim().toLocaleLowerCase();return n.toLocaleLowerCase().includes(a)||l.some((function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.toLocaleLowerCase().includes(a)}))})));var Ze=(0,j.getDurableData)("blocklets-list");Ze.searchText&&!ee&&te(Ze.searchText);var Ce=[{label:V("common.name"),name:"meta.title",options:{customBodyRenderLite:function(e){var t=ye[e],n=(0,T.getAppMissingConfigs)(t).length>0?"components":"overview";return(0,J.jsx)(f.Link,{to:"/blocklets/".concat(t.meta.did,"/").concat(n),className:"blocklet-name-wrapper",children:(0,J.jsxs)(x.Z,{component:"strong",variant:"body1",className:"blocklet-name",children:[(0,J.jsx)(P.Z,{blocklet:t,style:{marginRight:8}}),(0,J.jsxs)(g.Z,{children:[(0,J.jsx)(g.Z,{children:(0,T.getDisplayName)(t)}),(0,J.jsxs)(g.Z,{children:[(0,J.jsx)(R.default,{mode:t.mode||""}),t.controller&&(0,J.jsx)(N.default,{type:"primary",children:V("blocklet.external")})]})]})]})},t.meta.did)}}},me===re?{label:V("common.visit"),name:"runtimeInfo.pid",align:"left",options:{sort:!1,customBodyRenderLite:function(e){var t=ye[e];return(0,J.jsx)(G,{blocklet:t},t.meta.did)}}}:null,{label:V("common.version"),name:"meta.version",options:{customBodyRenderLite:function(e){var t=ye[e];return(0,J.jsx)(I.default,{blocklet:t,checkUpgrade:!1},t.meta.did)}}},{label:V("common.installedAt"),name:"installedAt",options:{customBodyRenderLite:function(e){var t=ye[e];return t.installedAt?(0,J.jsx)(y.default,{value:t.installedAt.getTime(),locale:X},t.meta.did):t.createdAt?(0,J.jsx)(y.default,{value:t.createdAt.getTime(),locale:X},t.meta.did):""}}},{label:V("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite:function(e){var t=ye[e];return"running"===t.status&&t.appRuntimeInfo?(0,J.jsx)(y.default,{value:t.appRuntimeInfo.startAt,locale:X},t.meta.did):""}}},{label:V("common.status"),name:"status",width:120,align:"center",options:{customBodyRenderLite:function(e){var t=ye[e];return(0,J.jsx)(_.default,{"data-cy":"blocklet-status","status-blocklet-did":t.meta.did,status:E.includes(t.meta.did)?"deleting":t.status,source:t.source},t.meta.did)}}},me===re||ae?{label:V("common.actions"),name:"",width:90,options:{sort:!1,customBodyRenderLite:function(e){var t=ye[e];return(0,J.jsx)(U.Z,{blocklet:t,variant:"menu",onStart:xe,onComplete:he},t.meta.did)}}}:null].filter(Boolean),we={};be||(we.TableBody=function(e){if(W)return(0,J.jsx)(C.default,{relative:"parent",children:(0,J.jsx)(Z.default,{})});var t=e.page,n=e.rowsPerPage,l=ye.slice(t*n,(t+1)*n);return l.length?(0,J.jsx)("div",{children:l.map((function(e){var t=(0,T.getAppMissingConfigs)(e).length>0?"components":"overview";return(0,J.jsxs)(g.Z,{className:"blocklet-item--mobile",display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,J.jsx)(P.Z,{className:"blocklet__avatar",blocklet:e,size:be?40:60}),(0,J.jsxs)(f.Link,{className:"blocklet__content",to:"/blocklets/".concat(e.meta.did,"/").concat(t),children:[(0,J.jsxs)(g.Z,{display:"flex",justifyContent:"space-between",alignItems:"flex-start",children:[(0,J.jsx)(x.Z,{component:"strong",variant:"body1",className:"blocklet__name",children:(0,T.getDisplayName)(e,!0)}),(0,J.jsx)(U.Z,{blocklet:e,variant:"menu",onStart:xe,onComplete:he},e.meta.did)]}),(0,J.jsxs)(x.Z,{component:"small",className:"blocklet__addons",children:[(0,J.jsxs)(g.Z,{display:"flex",alignItems:"center",children:[(0,J.jsx)(I.default,{blocklet:e}),(0,J.jsx)(G,{blocklet:e,style:{marginLeft:16,fontSize:14}})]}),(0,J.jsx)(_.default,{"status-blocklet-did":e.meta.did,status:e.status,source:e.source},e.meta.did)]})]})]})}))}):(0,J.jsx)(w.default,{children:V("common.empty")})}),ke=(0,J.jsx)(ue,{children:(0,J.jsx)(j.default,{loading:W,className:"blocklet-list",title:(0,J.jsx)(g.Z,{display:"flex",alignItems:"center",children:V("blocklet.index.tableTitle")}),locale:X,data:ye,columns:Ce,durable:"blocklets-list",options:(0,i.Z)({download:!1,filter:!1,print:!1,searchPlaceholder:V("common.search"),searchAlwaysOpen:!0,sortOrder:{name:"uptime",direction:"desc"},searchDebounceTime:300,onSearchChange:function(e){return te(e)},customSearch:function(){return!0}},Ze),components:we})})}else 0===ge.length&&(ke=(0,J.jsx)(A.default,{type:"warning",variant:"icon",children:V("blocklet.index.noBlocklet")}));return(0,J.jsxs)(de,{children:[(0,J.jsxs)(x.Z,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[(0,J.jsxs)(g.Z,{display:"flex",alignItems:"center",children:[V("common.blocklets"),!(!a||!a.length)&&(0,J.jsx)(h.Z,{sx:{ml:1},children:(0,J.jsx)(b.Z,{value:me,onChange:function(e){return fe(e.target.value)},size:"small",children:oe.map((function(e){return(0,J.jsx)(k.Z,{value:e.id,children:V(e.name)},e.id)}))})})]}),(0,J.jsx)(ie.Z,{permission:"mutate_blocklets",children:(0,J.jsx)(le,{onCreate:function(t){e("/blocklets/".concat(t.meta.did,"/components"))}})})]}),ke]})}var ue=d.default.div(ae||(ae=(0,o.Z)(["\n .blocklet-item--mobile {\n padding: 16px 0;\n }\n"]))),de=d.default.main(oe||(oe=(0,o.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .blocklet-list {\n .blocklet-item--mobile {\n .blocklet__avatar {\n margin-right: -60px;\n }\n .blocklet__content {\n padding-left: 68px;\n flex: 1;\n display: flex;\n flex-direction: column;\n z-index: 1;\n }\n .blocklet__name {\n font-weight: bold;\n text-decoration: none;\n white-space: normal;\n word-break: break-all;\n }\n .blocklet__addons {\n display: flex;\n justify-content: space-between;\n margin-top: 5px;\n margin-bottom: -10px;\n }\n }\n .blocklet-name-wrapper {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n }\n .blocklet-name {\n font-weight: bold;\n text-decoration: underline;\n display: flex;\n align-items: center;\n white-space: normal;\n word-break: break-all;\n }\n\n .blocklet-interface {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n img {\n margin-right: 4px;\n }\n }\n\n .MuiToolbar-root {\n display: flex;\n }\n }\n"])))}}]);