@abtnode/blocklet-services 1.16.20-beta-28c66e0b → 1.16.20-beta-cf6dfce1

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.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.20-beta-28c66e0b",
6
+ "version": "1.16.20-beta-cf6dfce1",
7
7
  "description": "Provide unified services for every blocklet",
8
8
  "main": "api/index.js",
9
9
  "files": [
@@ -33,17 +33,17 @@
33
33
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
34
34
  "license": "Apache-2.0",
35
35
  "dependencies": {
36
- "@abtnode/analytics": "1.16.20-beta-28c66e0b",
37
- "@abtnode/auth": "1.16.20-beta-28c66e0b",
38
- "@abtnode/client": "1.16.20-beta-28c66e0b",
39
- "@abtnode/connect-storage": "1.16.20-beta-28c66e0b",
40
- "@abtnode/constant": "1.16.20-beta-28c66e0b",
41
- "@abtnode/core": "1.16.20-beta-28c66e0b",
42
- "@abtnode/cron": "1.16.20-beta-28c66e0b",
43
- "@abtnode/logger": "1.16.20-beta-28c66e0b",
44
- "@abtnode/models": "1.16.20-beta-28c66e0b",
45
- "@abtnode/router-templates": "1.16.20-beta-28c66e0b",
46
- "@abtnode/util": "1.16.20-beta-28c66e0b",
36
+ "@abtnode/analytics": "1.16.20-beta-cf6dfce1",
37
+ "@abtnode/auth": "1.16.20-beta-cf6dfce1",
38
+ "@abtnode/client": "1.16.20-beta-cf6dfce1",
39
+ "@abtnode/connect-storage": "1.16.20-beta-cf6dfce1",
40
+ "@abtnode/constant": "1.16.20-beta-cf6dfce1",
41
+ "@abtnode/core": "1.16.20-beta-cf6dfce1",
42
+ "@abtnode/cron": "1.16.20-beta-cf6dfce1",
43
+ "@abtnode/logger": "1.16.20-beta-cf6dfce1",
44
+ "@abtnode/models": "1.16.20-beta-cf6dfce1",
45
+ "@abtnode/router-templates": "1.16.20-beta-cf6dfce1",
46
+ "@abtnode/util": "1.16.20-beta-cf6dfce1",
47
47
  "@arcblock/did": "^1.18.103",
48
48
  "@arcblock/did-auth": "1.18.103",
49
49
  "@arcblock/did-ext": "^1.18.103",
@@ -52,11 +52,11 @@
52
52
  "@arcblock/jwt": "1.18.103",
53
53
  "@arcblock/validator": "^1.18.103",
54
54
  "@arcblock/ws": "1.18.103",
55
- "@blocklet/constant": "1.16.20-beta-28c66e0b",
55
+ "@blocklet/constant": "1.16.20-beta-cf6dfce1",
56
56
  "@blocklet/form-builder": "^0.1.11",
57
57
  "@blocklet/form-collector": "^0.1.6",
58
- "@blocklet/meta": "1.16.20-beta-28c66e0b",
59
- "@blocklet/sdk": "1.16.20-beta-28c66e0b",
58
+ "@blocklet/meta": "1.16.20-beta-cf6dfce1",
59
+ "@blocklet/sdk": "1.16.20-beta-cf6dfce1",
60
60
  "@did-connect/authenticator": "^2.2.1",
61
61
  "@did-connect/relay-adapter-express": "^2.2.1",
62
62
  "@ocap/client": "1.18.103",
@@ -96,12 +96,12 @@
96
96
  },
97
97
  "resolutions": {},
98
98
  "devDependencies": {
99
- "@abtnode/ux": "1.16.20-beta-28c66e0b",
99
+ "@abtnode/ux": "1.16.20-beta-cf6dfce1",
100
100
  "@arcblock/did-connect": "^2.8.20",
101
101
  "@arcblock/icons": "^2.8.20",
102
102
  "@arcblock/ux": "^2.8.20",
103
103
  "@blocklet/launcher-layout": "2.2.46",
104
- "@blocklet/tracker": "1.16.20-beta-28c66e0b",
104
+ "@blocklet/tracker": "1.16.20-beta-cf6dfce1",
105
105
  "@blocklet/ui-react": "^2.8.20",
106
106
  "@emotion/react": "^11.10.4",
107
107
  "@emotion/styled": "^11.10.4",
@@ -172,5 +172,5 @@
172
172
  "url": "https://github.com/ArcBlock/blocklet-server/issues",
173
173
  "email": "shijun@arcblock.io"
174
174
  },
175
- "gitHead": "c4c767c15f6f3c0972a466e262f00860878a90a3"
175
+ "gitHead": "bc2f0c9c5a39b124c7a7b64ec907527b3e8ccdf1"
176
176
  }
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[356],{70998:function(e,n,t){t.d(n,{Z:function(){return x}});var o=t(33028),l=t(59740),r=t(24974),i=t.n(r),c=t(59467),a=t(62399),s=t(19611),d=t.n(s),u=t(20244),p=t(41395),m=t(24891);var h=t(37574),f=["blocklet","style","size","ancestors"];function x(e){var n=e.blocklet,t=e.style,r=e.size,i=e.ancestors,s=(0,l.Z)(e,f),x=(0,p.h6)(),b=function(e){var n,t=e.blocklet,o=e.ancestors,l=void 0===o?[]:o,r=(0,p.h6)(),i=r.inService,c="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,m.XN)(null===t||void 0===t?void 0:t.status)?"~":""),a=i?d()(m.zn,u.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",c):d()(r.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)a=d()(t.deployedFrom,(0,m.lk)(t.meta.bundleDid,t.meta.logo),c);else{var s=window.env.apiPrefix||"/",h=l.concat(t),f=i?h.slice(1):h;a=d()(s,"/blocklet/logo-bundle".concat(f.map((function(e){return"/".concat(e.meta.did)})).join("")),c)}return{logoUrl:a,inService:i}}({blocklet:n,ancestors:i}),v=b.logoUrl,Z=b.inService,j=s.variant,g=Z?function(){}:function(e){e.target.src="".concat(x.imgPrefix,"/blocklet.png")},k=(0,h.jsx)("img",{src:v,onError:g,alt:n.meta.name,style:{width:r}});return n.meta.logo||(k=(0,h.jsx)(a.Z,{did:n.meta.did||"",responsive:!0})),(0,h.jsx)(c.Z,(0,o.Z)((0,o.Z)({variant:j||"square",style:Object.assign({backgroundColor:"transparent",width:r,height:r,borderRadius:10},t)},s),{},{children:k}))}x.propTypes={blocklet:i().object.isRequired,style:i().object,size:i().oneOfType([i().number,i().string]),ancestors:i().array},x.defaultProps={style:{},size:40,ancestors:[]}},60356:function(e,n,t){t.r(n),t.d(n,{default:function(){return Ye}});var o=t(71171),l=t(30969),r=t(24974),i=t.n(r),c=t(30734),a=t(16380),s=t(38361),d=t(45008),u=t(96234),p=t(86822),m=t(26022),h=t(94551),f=t(10814),x=t(2291),b=t(29996),v=t(1986),Z=t(9715),j=t(16438),g=t(41395),k=t(33028),y=t(59740),T=t(94308),I=t(37574),E=["size"];function P(e){var n=e.size,t=(0,y.Z)(e,E);return(0,I.jsx)(s.Z,(0,k.Z)((0,k.Z)({display:"flex",mt:4},t),{},{children:(0,I.jsx)(T.Z,{size:n})}))}P.propTypes={size:i().number},P.defaultProps={size:24};var S,R=t(36558),C=t(8479),N=t(70998);function w(){var e=(0,m.PE)(),n=e.t,t=e.locale,o=(0,g.h6)().api,r=(0,l.useState)(!0),i=(0,u.Z)(r,2),a=i[0],k=i[1],y=(0,d.y0)().blocklet,T=(0,l.useState)(null),E=(0,u.Z)(T,2),S=E[0],w=E[1],z=(0,c.useParams)().componentDid,B=void 0===z?"":z,A=(0,l.useState)(null),L=(0,u.Z)(A,2),O=L[0],D=L[1],V=function(){o.getProjects({input:{did:y.meta.did,componentDid:B}}).then((function(e){var n=(null===e||void 0===e?void 0:e.projects)||[];k(!1),D(n)})).catch((function(e){k(!1),v.Z.error(e.message)}))};if((0,l.useEffect)((function(){V()}),[]),!O&&a)return(0,I.jsx)(P,{});if(!O)return null;if(!O.length)return(0,I.jsxs)(s.Z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[(0,I.jsx)(s.Z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:n("blocklet.publish.blockletEmptyTip")}),(0,I.jsx)(s.Z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:n("blocklet.publish.createBlockletTip")}),(0,I.jsx)(p.rU,{to:"create",children:(0,I.jsx)(b.Z,{variant:"contained",children:n("blocklet.publish.createBlocklet")})})]});var W=[{label:"Blocklet",name:"blockletTitle",options:{customBodyRenderLite:function(e){var n=O[e];return(0,I.jsx)(p.rU,{to:"".concat(n.id),children:n.blockletTitle||"/"})}}},{label:"DID",name:"blockletDid",options:{customBodyRender:function(e){return(0,I.jsx)(R.Z,{size:14,responsive:!0,did:e})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:function(e){return e?(0,I.jsx)(Z.Z,{type:"success",children:e}):""}}},B?null:{label:n("common.scope"),name:"componentDid",options:{customBodyRender:function(e){var n=(y.children||[]).find((function(n){return n.meta.did===e}));return n?(0,I.jsxs)(s.Z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[(0,I.jsx)(N.Z,{size:14,blocklet:n,ancestors:[y]}),(0,I.jsx)(s.Z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:n.meta.title})]},e):""}}},{label:n("common.updatedAt"),name:"updatedAt",options:{customBodyRender:function(e){return(0,I.jsx)(j.Z,{value:Number(e),locale:t})}}},{label:n("common.actions"),name:"actions",options:{customBodyRenderLite:function(e){var n=O[e];return(0,I.jsx)(s.Z,{display:"flex",children:(0,I.jsx)(h.Z,{color:"error","aria-label":"delete",onClick:function(){return function(e){w(e)}(n)},children:(0,I.jsx)(f.default,{sx:{fontSize:18}})})})}}}].filter(Boolean);return(0,I.jsxs)(_,{children:[(0,I.jsx)(s.Z,{sx:{textAlign:"right"},children:(0,I.jsx)(p.rU,{to:"create",children:(0,I.jsx)(b.Z,{variant:"contained",children:n("blocklet.publish.createBlocklet")})})}),(0,I.jsx)(x.Z,{className:"main-table",locale:t,data:O,columns:W,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),S&&(0,I.jsx)(C.Z,{title:"".concat(n("common.delete")," ").concat(S.blockletTitle),description:n("blocklet.publish.deleteBlockletTip"),confirm:n("common.confirm"),onConfirm:function(){k(!1);var e=S.id;o.deleteProject({input:{did:y.meta.did,projectId:e}}).then((function(){k(!1),V(),v.Z.success(n("common.removeSuccess")),w(null)})).catch((function(e){k(!1),v.Z.error(e.message)}))},onCancel:function(){return w(null)}})]})}w.propTypes={};var z,_=(0,a.Z)(s.Z)(S||(S=(0,o.Z)(["\n .main-table > div:first-child {\n display: none;\n }\n"]))),B=t(33665),A=t(2689),L=t(87006),O=t(33359),D=t(15012),V=t(4953),W=t(26328),U=t(77370),M=[{label:{en:"Resource",zh:"\u8d44\u6e90"},value:"resource"},{label:{en:"Application",zh:"\u5e94\u7528"},value:"pack",disabled:!0}];function F(e){var n=Object.assign({},((0,B.Z)(e),e)),t=(0,c.useNavigate)(),o=(0,m.PE)(),r=o.t,i=o.locale,a=(0,d.y0)().blocklet,h=(0,l.useState)(""),f=(0,u.Z)(h,2),x=f[0],Z=f[1],j=(0,l.useState)(!1),y=(0,u.Z)(j,2),T=y[0],E=y[1],P=(0,l.useState)("resource"),S=(0,u.Z)(P,2),R=S[0],C=S[1],N=(0,U.T)().api,w=(0,g.h6)().api,z=(0,l.useState)(),_=(0,u.Z)(z,2),F=_[0],q=_[1],X=(0,l.useState)(!1),H=(0,u.Z)(X,2),K=H[0],G=H[1],Q=(0,c.useParams)().componentDid,Y=void 0===Q?"":Q;return(0,I.jsxs)(J,(0,k.Z)((0,k.Z)({},n),{},{children:[(0,I.jsxs)(D.Z,{className:"breadcrumbs","aria-label":"breadcrumb",children:[(0,I.jsx)(p.rU,{to:"..",children:r("common.publish")}),(0,I.jsxs)(O.Z,{color:"text.primary",children:[r("common.create")," Blocklet"]})]}),(0,I.jsxs)(s.Z,{style:{maxWidth:500},children:[(0,I.jsx)(L.Z,{required:!0,sx:{mb:4},label:"Blocklet DID",fullWidth:!0,readonly:!0,autoComplete:"off",variant:"outlined",onClick:function(){return!F&&G(!0)},InputProps:{"data-cy":"export-blocklet-did",endAdornment:(0,I.jsx)(V.Z,{position:"end",children:(0,I.jsx)(b.Z,{onClick:function(){return G(!0)},children:r(F?"common.update":"common.create")})})},helperText:"",value:F||""}),K&&(0,I.jsx)(W.Z,{open:!0,popup:!0,onClose:function(){return G(!1)},action:"gen-blocklet-key-pair",locale:i,checkFn:N.get,saveConnect:!1,forceConnected:!1,checkTimeout:3e5,onSuccess:function(e){var n,t=null===e||void 0===e||null===(n=e.blockletWallet)||void 0===n?void 0:n.address;t?q(t):v.Z.error("Empty Blocklet DID"),G(!1)},onError:function(e){v.Z.error(e.message),G(!1)},extraParams:{did:a.meta.did},messages:{title:r("blocklet.publish.connect.title"),scan:r("blocklet.publish.connect.scan"),confirm:r("blocklet.publish.connect.confirm"),success:r("blocklet.publish.connect.success")}}),(0,I.jsx)(L.Z,{required:!0,label:"Blocklet ".concat(r("common.title")),autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-title"},fullWidth:!0,helperText:"",value:x||"",onChange:function(e){Z(e.target.value)}}),(0,I.jsx)(L.Z,{sx:{my:4},id:"blocklet-type",select:!0,label:"Blocklet ".concat(r("common.type")),helperText:"",fullWidth:!0,value:R,onChange:function(e){return C(e.target.value)},children:M.map((function(e){return(0,I.jsx)(A.Z,{value:e.value,disabled:e.disabled,children:e.label[i]||e.label.en},e.value)}))})]}),(0,I.jsx)(b.Z,{variant:"contained",disabled:T,onClick:function(){F?x?(E(!0),w.createProject({input:{did:a.meta.did,blockletTitle:x||"",blockletDid:F,type:R,componentDid:Y}}).then((function(){E(!1),t("../",{replace:!0})})).catch((function(e){E(!1),v.Z.error(e.message)}))):v.Z.error(r("blocklet.publish.errorTip.noTitle")):v.Z.error(r("blocklet.publish.errorTip.noDid"))},children:r("common.create")})]}))}F.propTypes={},F.defaultProps={};var q,J=a.Z.div(z||(z=(0,o.Z)(["\n .breadcrumbs {\n margin-bottom: 24px;\n }\n"]))),X=t(19611),H=t.n(X),K=t(70093),G=t.n(K),Q=t(32677),Y=t(20244),$=t(59505);function ee(){var e=(0,m.PE)(),n=e.t,t=e.locale,o=(0,c.useParams)().projectId,r=(0,g.h6)().api,i=(0,l.useState)(!0),a=(0,u.Z)(i,2),k=a[0],y=a[1],T=(0,d.y0)().blocklet,E=(0,l.useState)(null),S=(0,u.Z)(E,2),R=S[0],N=S[1],w=(0,l.useState)(null),z=(0,u.Z)(w,2),_=z[0],B=z[1],A=(0,l.useState)(null),L=(0,u.Z)(A,2),V=L[0],W=L[1];(0,l.useEffect)((function(){r.doBatchQuery({getProject:{input:{did:T.meta.did,projectId:o}},getReleases:{input:{did:T.meta.did,projectId:o}}}).then((function(e){B(e.getProject.project||{}),N(e.getReleases.releases||[]),y(!1)})).catch((function(e){y(!1),v.Z.error(e.message)}))}),[]);if(!R&&k)return(0,I.jsx)(P,{});if(!R)return null;var U=(0,I.jsxs)(D.Z,{className:"breadcrumbs","aria-label":"breadcrumb",children:[(0,I.jsx)(p.rU,{to:"..",children:n("common.publish")}),(0,I.jsx)(O.Z,{color:"text.primary",children:_.blockletTitle})]});if(!R.length)return(0,I.jsxs)(I.Fragment,{children:[U,(0,I.jsxs)(s.Z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[(0,I.jsx)(s.Z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:n("blocklet.publish.releaseEmptyTip")}),(0,I.jsx)(s.Z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:n("blocklet.publish.createReleaseTip")}),(0,I.jsx)(p.rU,{to:"create",children:(0,I.jsx)(b.Z,{variant:"contained",children:n("blocklet.publish.createRelease")})})]})]});var M=[{label:n("common.version"),name:"blockletVersion",options:{customBodyRenderLite:function(e){var n=R[e];return(0,I.jsx)(p.rU,{to:"".concat(n.id),children:n.blockletVersion||"/"})}}},{label:n("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:function(e){var n=R[e];return(0,I.jsx)(O.Z,{className:"note",children:n.note||""})}}},{label:n("common.status"),name:"status",options:{customBodyRender:function(e){return(0,I.jsx)(Z.Z,{type:"published"===e?"success":"warning",children:G()(e)})}}},{label:n("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:function(e){var n=R[e];return n.status!==$.PROJECT.RELEASE_STATUS.published?"":(0,I.jsx)(j.Z,{value:Number(n.updatedAt),locale:t})}}},{label:n("common.actions"),name:"actions",options:{customBodyRenderLite:function(e){var n=R[e];return(0,I.jsxs)(s.Z,{display:"flex",alignItems:"center",children:[(0,I.jsx)(h.Z,{color:"primary","aria-label":"download",disabled:"published"!==n.status,children:"published"===n.status?(0,I.jsx)("a",{style:{display:"flex"},href:H()("".concat(Y.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project/").concat(T.meta.did,"/").concat(_.id,"/").concat(n.id,"/download/").concat((n.files||[])[0])),children:(0,I.jsx)(Q.Z,{sx:{fontSize:18}})}):(0,I.jsx)(Q.Z,{sx:{fontSize:18}})}),(0,I.jsx)(h.Z,{color:"error","aria-label":"delete",onClick:function(){return function(e){W(e)}(n)},children:(0,I.jsx)(f.default,{sx:{fontSize:18}})})]})}}}];return(0,I.jsxs)(te,{children:[(0,I.jsxs)(s.Z,{className:"header",children:[U,(0,I.jsx)(p.rU,{to:"create",children:(0,I.jsx)(b.Z,{variant:"contained",children:n("blocklet.publish.createRelease")})})]}),(0,I.jsx)(x.Z,{className:"main-table",verticalKeyWidth:100,locale:t,data:R,columns:M,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),V&&(0,I.jsx)(C.Z,{title:n("".concat(n("common.delete")," ").concat(V.blockletVersion)),description:n("blocklet.publish.deleteReleaseTip"),confirm:n("common.confirm"),onConfirm:function(){y(!1);var e=V.id;r.deleteRelease({input:{did:T.meta.did,projectId:o,releaseId:e}}).then((function(){y(!1),r.getReleases({input:{did:T.meta.did,projectId:o}}).then((function(e){var n=(null===e||void 0===e?void 0:e.releases)||[];y(!1),N(n)})).catch((function(e){y(!1),v.Z.error(e.message)})),v.Z.success(n("common.removeSuccess")),W(null)})).catch((function(e){y(!1),v.Z.error(e.message)}))},onCancel:function(){return W(null)}})]})}ee.propTypes={};var ne,te=(0,a.Z)(s.Z)(q||(q=(0,o.Z)(["\n .header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n .main-table > div:first-child {\n display: none;\n }\n .note {\n word-break: break-all;\n white-space: pre-line;\n }\n"]))),oe=t(68079),le=t(56666),re=t(43178),ie=t(49735),ce=t.n(ie),ae=t(60451),se=t.n(ae),de=t(59467),ue=t(30291),pe=t(78789),me=t(19865),he=t(24891),fe=t(32723),xe=t(34795),be=t(65667),ve=t.n(be),Ze=t(92522),je=t.n(Ze),ge=t(49884),ke=t(24837),ye=t(7418),Te=t(88876),Ie=t(23038),Ee=t(52838),Pe=t(16374),Se=t(96628),Re=["data"];function Ce(e){var n=e.data,t=(0,y.Z)(e,Re);return n&&n.length?(0,I.jsx)(we,(0,k.Z)((0,k.Z)({},t),{},{children:n.map((function(e){return(0,I.jsx)("a",{href:e.url,target:"_blank",rel:"noreferrer",children:(0,I.jsx)("img",{src:e.url,alt:e.alt||""})},e.url)}))})):null}Ce.propTypes={data:i().arrayOf(i().shape({url:i().string,alt:i().string}))},Ce.defaultProps={data:[]};var Ne,we=(0,a.Z)(s.Z)(ne||(ne=(0,o.Z)(["\n display: flex;\n justify-content: flex-start;\n flex-wrap: wrap;\n margin-bottom: -12px;\n a {\n display: flex;\n }\n img {\n height: 128px;\n cursor: pointer;\n margin-right: 12px;\n margin-bottom: 12px;\n }\n"]))),ze=function(e,n){for(var t=(0,oe.Z)(e);t.length>0;){var o=t.shift();if(o.id===n)return o;o.children&&t.push.apply(t,(0,oe.Z)(o.children))}return[]};function _e(e){var n=e.icon;return n?je()(n)?(0,I.jsx)("img",{className:"resource-icon",src:n,alt:"icon"}):(0,I.jsx)(Se.JO,{className:"resource-icon",icon:n}):null}function Be(e){var n=e.disabled,t=e.data,o=e.onChange,l=e.value;function r(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.push(e.id),e.children&&e.children.forEach((function(e){return r(e,n)})),n}var i=function(e){return r(ze(t,e))},c=function e(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=ze(t,n);return l.parent?(o.push(l.parent),e(l.parent,o)):o};function a(e,n){var t=i(e.id),o=t.indexOf(e.id);return t.splice(o,1),t.every((function(e){return l.concat(n).includes(e)}))}var d=function(e,n){e.stopPropagation();var r=i(n),s=c(n);if(l.includes(n)){var d=l.filter((function(e){return!r.concat(s).includes(e)}));o(d)}else{for(var u=r,p=0;p<s.length;++p)a(ze(t,s[p]),u)&&u.push(s[p]);o((0,oe.Z)(l).concat(u))}},u=function(e){e.stopPropagation()},p=t.some((function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)>0})),m=function e(t){var o;return(0,I.jsx)(ye.Z,{nodeId:t.id,label:(0,I.jsx)(ge.Z,{onClick:u,control:(0,I.jsx)(Te.Z,{size:"small",checked:-1!==l.indexOf(t.id),tabIndex:-1,disableRipple:!0,onClick:function(e){return d(e,t.id)},disabled:n}),label:(0,I.jsxs)(s.Z,{className:"content",children:[(0,I.jsxs)(s.Z,{display:"flex",alignItems:"center",children:[t.icon&&(0,I.jsx)(_e,{icon:t.icon}),(0,I.jsx)(s.Z,{className:"name",children:t.name}),t.url&&(0,I.jsx)("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"link",children:(0,I.jsx)(Pe.Z,{className:"link-icon"})})]}),!!t.description&&(0,I.jsx)(s.Z,{className:"description",children:t.description}),!(null===(o=t.images)||void 0===o||!o.length)&&(0,I.jsx)(Ce,{className:"images",data:t.images})]})}),children:Array.isArray(t.children)?t.children.map(e):null},t.id)};return(0,I.jsx)(Le,{className:ve()(!p&&"no-children"),multiSelect:!0,defaultCollapseIcon:(0,I.jsx)(Ie.Z,{}),defaultExpandIcon:(0,I.jsx)(Ee.default,{}),selected:l,children:t.map((function(e){return m(e)}))})}_e.propTypes={icon:i().string},_e.defaultProps={icon:""},Be.propTypes={data:i().array,value:i().array,onChange:i().func,disabled:i().bool},Be.defaultProps={data:[],value:[],onChange:function(){},disabled:!1};var Ae,Le=(0,a.Z)(ke.Z)(Ne||(Ne=(0,o.Z)(["\n &.no-children {\n .MuiTreeItem-content {\n padding: 0;\n .MuiTreeItem-iconContainer {\n display: none;\n }\n .MuiTreeItem-label {\n padding-left: 0;\n }\n }\n }\n .MuiTreeItem-content {\n align-items: flex-start;\n .MuiTreeItem-iconContainer {\n transform: translateY(10px);\n }\n &.Mui-selected {\n background-color: transparent;\n }\n }\n .MuiTreeItem-label {\n cursor: default;\n }\n .MuiFormControlLabel-root {\n align-items: flex-start;\n }\n .content {\n padding-top: 6px;\n }\n .name {\n font-size: 16px;\n font-weight: 700;\n }\n .resource-icon {\n margin-right: 2px;\n font-size: 16px;\n }\n img.resource-icon {\n width: 1rem;\n height: 1rem;\n }\n .link {\n margin-left: 8px;\n font-size: 16px;\n color: ",";\n display: flex;\n }\n .link-icon {\n font-size: inherit;\n }\n .description {\n font-size: 14px;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main}),(function(e){return e.theme.palette.text.secondary})),Oe=t(54559),De=function e(n,t){return n.forEach((function(n){t&&(n.parent=t),(n.children||[]).forEach((function(t){t.parent=n.id,e(t.children||[],t.id)}))})),n};function Ve(e){var n=e.app,t=e.component,o=e.projectId,r=e.release,i=(0,m.PE)(),c=i.t,a=i.locale,d=(0,g.h6)().api,p=(0,l.useState)([]),h=(0,u.Z)(p,2),f=h[0],x=h[1],Z=(0,l.useState)([]),j=(0,u.Z)(Z,2),k=j[0],y=j[1],T=(0,l.useState)(!1),E=(0,u.Z)(T,2),P=E[0],S=E[1],R=r.id,C="published"===r.status,N=((null===t||void 0===t?void 0:t.meta.capabilities)||{}).resourceExportApi,w=void 0===N?"/":N,z=new URL(H()("http://127.0.0.1",t.mountPoint,w||"/").replace(/\/+/g,"/"));z.searchParams.set("projectId",o),z.searchParams.set("releaseId",R),z.searchParams.set("local",a);var _="".concat(z.pathname).concat(z.search),B=function(){var e=(0,xe.Z)((0,fe.Z)().mark((function e(l){return(0,fe.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.updateSelectedResources({input:{did:n.meta.did,projectId:o,releaseId:R,componentDid:t.meta.did,resources:l}});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),v.Z.error(e.t0.message);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(n){return e.apply(this,arguments)}}(),A=function(){var e=(0,xe.Z)((0,fe.Z)().mark((function e(){var n;return(0,fe.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=k,e.prev=1,S(!0),e.next=5,Oe.od.post(_,{resources:n,projectId:o,releaseId:R,locale:a});case 5:v.Z.success(c("common.saveSuccess")),S(!1),B(k),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(1),S(!1),v.Z.error(e.t0.message);case 14:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(){return e.apply(this,arguments)}}();return(0,l.useEffect)((function(){Oe.od.get(_).then((function(e){var n,t=De((null===(n=e.data)||void 0===n?void 0:n.resources)||[]);x(t)})).catch((function(e){v.Z.error(e.message)})),d.getSelectedResources({input:{did:n.meta.did,projectId:o,releaseId:R,componentDid:t.meta.did}}).then((function(e){var n=(null===e||void 0===e?void 0:e.resources)||[];y(n)})).catch((function(e){v.Z.error(e.message)}))}),[_]),"running"!==t.status?(0,I.jsx)(Ue,{children:(0,I.jsx)(s.Z,{pt:6,children:c("blocklet.publish.componentNotRunning",{name:t.meta.title})})}):(0,I.jsx)(Ue,{children:(0,I.jsxs)(s.Z,{children:[(0,I.jsx)(Be,{data:f,value:k,onChange:function(e){y(e)},disabled:P||C}),!C&&(0,I.jsx)(s.Z,{className:"footer",children:(0,I.jsx)(b.Z,{variant:"contained",disabled:P,onClick:function(){return A()},children:c("common.save")})})]})})}Ve.propTypes={component:i().object.isRequired,app:i().object.isRequired,projectId:i().string.isRequired,release:i().shape({id:i().string.isRequired,status:i().string})},Ve.defaultProps={release:{id:""}};var We,Ue=(0,a.Z)(s.Z)(Ae||(Ae=(0,o.Z)(["\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 16px;\n padding-bottom: 0px;\n max-height: 600px;\n overflow-y: auto;\n .footer {\n border-top: 1px solid #ddd;\n display: flex;\n padding: 12px 0;\n margin-top: 12px;\n position: sticky;\n bottom: 0;\n background: #fff;\n }\n"]))),Me=["image/*",".jpg",".jpeg",".png",".gif",".svg"],Fe=10485760,qe=(0,l.lazy)((function(){return Promise.all([t.e(4917),t.e(5547)]).then(t.bind(t,25547)).then((function(e){return{default:e.Uploader}}))})),Je=function(e,n,t){var o=[];return e.blockletTitle||o.push({param:"blockletTitle",message:t("blocklet.publish.errorTip.noTitle")}),e.blockletVersion?se().valid(e.blockletVersion)||o.push({param:"blockletVersion",message:"Invalid Blocklet Version"}):o.push({param:"blockletVersion",message:t("blocklet.publish.errorTip.noVersion")}),n===$.PROJECT.RELEASE_STATUS.published&&(e.blockletDescription||o.push({param:"blockletDescription",message:t("blocklet.publish.errorTip.noDescription")}),e.note||o.push({param:"note",message:t("blocklet.publish.errorTip.noNote")})),o.length?o:null},Xe=function(e){var n=e.tabs,t=e.blocklet,o=e.ancestors,l=void 0===o?[]:o,r=t.meta.did;n.push({label:(0,I.jsxs)(s.Z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[(0,I.jsx)(N.Z,{size:24,blocklet:t,ancestors:l}),(0,I.jsx)(s.Z,{ml:"4px",className:"text",children:(0,I.jsx)(s.Z,{children:t.meta.title})})]},r),value:r})},He=function(e){var n=ce()(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","note"]);return n.blockletScreenshots||(n.blockletScreenshots=[]),n};function Ke(e){var n,t,o,r=Object.assign({},((0,B.Z)(e),e)),i=(0,c.useNavigate)(),a=(0,c.useParams)(),f=a.projectId,x=a.releaseId,Z=a.componentDid,j=(0,m.PE)().t,y=(0,d.y0)().blocklet,E=(0,re.Z)(null),S=(0,u.Z)(E,2),R=S[0],C=S[1],N=(0,l.useState)({}),w=(0,u.Z)(N,2),z=w[0],_=w[1],A=(0,l.useState)(!1),W=(0,u.Z)(A,2),U=W[0],M=W[1],F=(0,l.useState)(!1),q=(0,u.Z)(F,2),J=q[0],X=q[1],K=(0,l.useState)(null),G=(0,u.Z)(K,2),Q=G[0],ee=G[1],ne=(0,g.h6)().api,te=(0,l.useRef)(null),ie=(0,l.useRef)(null),ce="create"===x?"":x,ae="create"===x?"create":"edit",fe=[],xe=((null===y||void 0===y?void 0:y.children)||[]).filter((function(e){return e.meta.capabilities.resourceExportApi})).filter((function(e){return!Z||e.meta.did===Z}));xe.forEach((function(e){Xe({tabs:fe,blocklet:e,t:j,ancestors:[y]})}));var be=(0,l.useState)(null===(n=fe[0])||void 0===n?void 0:n.value),ve=(0,u.Z)(be,2),Ze=ve[0],je=ve[1],ge="published"===(null===Q||void 0===Q?void 0:Q.status),ke=ge,ye=function(){ne.getRelease({input:{did:y.meta.did,projectId:f,releaseId:ce}}).then((function(e){M(!1),C(He(null===e||void 0===e?void 0:e.release)),ee(null===e||void 0===e?void 0:e.release)})).catch((function(e){M(!1),v.Z.error((0,he.Z)(e))}))},Te=(0,l.useCallback)((function(){if("edit"===ae){if(!ce)return void v.Z.error("Empty release id");ye()}"create"===ae&&ne.getProject({input:{did:y.meta.did,projectId:f}}).then((function(e){M(!1);var n=e.project||{};n.blockletVersion?se().valid(n.blockletVersion)&&(n.blockletVersion=se().inc(n.blockletVersion,"patch")):n.blockletVersion="1.0.0",C(He(n))})).catch((function(e){M(!1),v.Z.error((0,he.Z)(e))}))}),[ae,ce]);(0,l.useEffect)((function(){Te()}),[Te]);var Ie=function(e){var n=Je(R,e,j);if(n)return v.Z.error(n.map((function(e){return e.message})).join("; ")),void _(n.reduce((function(e,n){return(0,k.Z)((0,k.Z)({},e),{},(0,le.Z)({},n.param,n.message))}),{}));var t=(0,k.Z)({},R);if(t.blockletVersion=se().valid(t.blockletVersion),!t.blockletVersion)return v.Z.error("Invalid Blocklet Version"),void _({blockletVersion:"Invalid Blocklet Version"});t.blockletTitle=(t.blockletTitle||"").trim(),t.blockletDescription=(t.blockletDescription||"").trim(),t.blockletIntroduction=(t.blockletIntroduction||"").trim(),t.note=(t.note||"").trim(),X(e),M(!0),ne.createRelease({input:(0,k.Z)((0,k.Z)({},t),{},{did:y.meta.did,projectId:f,releaseId:ce,status:e})}).then((function(n){if(X(!1),M(!1),"draft"===e?v.Z.success(j("blocklet.publish.saveDraftSuccess")):v.Z.success(j("blocklet.publish.createReleaseSuccess")),"create"===ae){var t,o=null===n||void 0===n||null===(t=n.release)||void 0===t?void 0:t.id;i("../".concat(f,"/").concat(o),{replace:!0})}else ye()})).catch((function(e){X(!1),M(!1),v.Z.error((0,he.Z)(e))}))};if(!R&&U)return(0,I.jsx)(P,{});if(!R)return null;var Ee="".concat(Y.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project/").concat(y.meta.did,"/").concat(f,"/logo/upload"),Pe="".concat(Y.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project/").concat(y.meta.did,"/").concat(f,"/screenshot/upload"),Se=null!==R&&void 0!==R&&R.blockletLogo?"".concat(Ee,"/").concat(R.blockletLogo):"".concat(Y.WELLKNOWN_SERVICE_PATH_PREFIX,"/static/images/logo.png"),Re=((null===R||void 0===R?void 0:R.blockletScreenshots)||[]).filter(Boolean).map((function(e){return"".concat(Pe,"/").concat(e)})),Ce=xe.find((function(e){return e.meta.did===Ze})),Ne=Ce?(0,I.jsx)(s.Z,{children:(0,I.jsx)(Ve,{app:y,component:Ce,projectId:f,release:(0,k.Z)((0,k.Z)({},Q),{},{id:ce})})}):(0,I.jsx)(s.Z,{display:"flex",mt:-3,children:(0,I.jsx)(pe.Z,{children:j("common.empty")})});return(0,I.jsxs)(Qe,(0,k.Z)((0,k.Z)({},r),{},{children:[(0,I.jsxs)(s.Z,{className:"sticky-header",children:[(0,I.jsxs)(D.Z,{className:"breadcrumbs","aria-label":"breadcrumb",children:[(0,I.jsx)(p.rU,{to:"../",children:j("common.publish")}),(0,I.jsx)(p.rU,{to:"../".concat(f),children:(null===R||void 0===R?void 0:R.blockletTitle)||"Blocklet"}),(0,I.jsx)(O.Z,{color:"text.primary",children:"create"===ae?j("common.create"):(null===R||void 0===R?void 0:R.blockletVersion)||j("common.edit")})]}),(0,I.jsxs)(s.Z,{display:"flex",children:[!ge&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(b.Z,{variant:"outlined",disabled:U||J,onClick:function(){return Ie($.PROJECT.RELEASE_STATUS.draft)},style:{marginRight:12},children:[J===$.PROJECT.RELEASE_STATUS.draft&&(0,I.jsx)(T.Z,{size:14,sx:{mr:.5}}),j("blocklet.publish.saveDraft")]}),(0,I.jsxs)(b.Z,{variant:"contained",disabled:U||J,onClick:function(){return Ie($.PROJECT.RELEASE_STATUS.published)},children:[J===$.PROJECT.RELEASE_STATUS.published&&(0,I.jsx)(T.Z,{size:14,sx:{mr:.5},color:"inherit"}),j("common.release")]})]}),ge&&(0,I.jsx)(b.Z,{variant:"contained",children:(0,I.jsx)("a",{href:H()("".concat(Y.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project/").concat(y.meta.did,"/").concat(f,"/").concat(ce,"/download/").concat((Q.files||[])[0])),children:j("common.download")})})]})]}),(0,I.jsxs)(s.Z,{pt:3,children:[(0,I.jsxs)(s.Z,{display:"flex",className:"section",children:[(0,I.jsx)(O.Z,{variant:"h3",className:"left",children:j("blocklet.publish.productTitle")}),(0,I.jsxs)(s.Z,{sx:{flex:1},children:[(0,I.jsx)(L.Z,{label:"Blocklet ".concat(j("common.title")),placeholder:"Blocklet ".concat(j("common.title")),InputProps:{"data-cy":"blocklet-title",readOnly:ke},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:R.blockletTitle||"",onChange:function(e){_({blockletTitle:""}),C({blockletTitle:e.target.value})},error:!!z.blockletTitle,helperText:z.blockletTitle||""}),(0,I.jsx)(L.Z,{label:"Blocklet ".concat(j("common.description")),placeholder:"Blocklet ".concat(j("common.description")),InputProps:{"data-cy":"blocklet-description",readOnly:ke},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:R.blockletDescription||"",onChange:function(e){_({blockletDescription:""}),C({blockletDescription:e.target.value})},error:!!z.blockletDescription,helperText:z.blockletDescription||"",sx:{mt:3}}),(0,I.jsx)(L.Z,{label:"Blocklet ".concat(j("common.introduction")),placeholder:"Blocklet ".concat(j("common.introduction")),InputProps:{"data-cy":"export-blocklet-introduction",readOnly:ke,endAdornment:(0,I.jsxs)(V.Z,{position:"end",children:[(null===R||void 0===R||null===(t=R.blockletIntroduction)||void 0===t?void 0:t.length)||0," / ",$.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:R.blockletIntroduction||"",onChange:function(e){_({blockletIntroduction:""}),C({blockletIntroduction:e.target.value.slice(0,$.PROJECT.MAX_INTRO_LENGTH)})},error:!!z.blockletIntroduction,helperText:z.blockletIntroduction||"",sx:{mt:3}})]})]}),(0,I.jsxs)(s.Z,{display:"flex",mt:3,className:"section",children:[(0,I.jsx)(O.Z,{variant:"h3",className:"left",children:j("blocklet.publish.versionTitle")}),(0,I.jsxs)(s.Z,{sx:{flex:1},children:[(0,I.jsx)(L.Z,{required:!0,label:"Blocklet ".concat(j("common.version")),placeholder:"Blocklet ".concat(j("common.version")),InputProps:{"data-cy":"blocklet-version",readOnly:ke},autoComplete:"off",variant:"outlined",fullWidth:!0,value:R.blockletVersion,onChange:function(e){_({blockletVersion:""}),C({blockletVersion:e.target.value})},error:!!z.blockletVersion,helperText:z.blockletVersion||""}),(0,I.jsx)(L.Z,{label:j("blocklet.publish.releaseNote"),autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:ke,endAdornment:(0,I.jsxs)(V.Z,{position:"end",children:[(null===R||void 0===R||null===(o=R.note)||void 0===o?void 0:o.length)||0," / ",$.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:R.note,onChange:function(e){_({note:""}),C({note:e.target.value.slice(0,$.PROJECT.MAX_NOTE_LENGTH)})},error:!!z.note,helperText:z.note||"",sx:{mt:3}})]})]}),(0,I.jsxs)(s.Z,{display:"flex",mt:3,className:"section full-width",children:[(0,I.jsx)(O.Z,{variant:"h3",className:"left",children:j("blocklet.publish.imgTitle")}),(0,I.jsxs)(s.Z,{sx:{flex:1},children:[(0,I.jsxs)(s.Z,{display:"flex",children:[(0,I.jsx)(O.Z,{variant:"subtitle1",sx:{mr:2},children:j("common.logo")}),(0,I.jsx)(s.Z,{sx:{flex:1,cursor:ke?"default":"pointer"},children:(0,I.jsx)(de.Z,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:Se,onClick:function(){return!ke&&te.current.open()}})})]}),(0,I.jsxs)(s.Z,{display:"flex",mt:3,children:[(0,I.jsx)(O.Z,{variant:"subtitle1",sx:{mr:2},children:j("common.screenshot")}),(0,I.jsxs)(s.Z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[Re.map((function(e,n){return(0,I.jsxs)(s.Z,{className:"screenshot",children:[(0,I.jsx)("img",{alt:"screenshot",src:e}),!ke&&(0,I.jsx)(h.Z,{className:"action",onClick:function(){var e=(0,oe.Z)(R.blockletScreenshots);e.splice(n,1),C({blockletScreenshots:e})},children:(0,I.jsx)(ue.default,{})})]})})),Re.length<5&&(0,I.jsx)(s.Z,{sx:{width:200,height:140,background:"#eee",cursor:ke?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:function(){return!ke&&ie.current.open()},children:"+"})]})]})]}),(0,I.jsx)(qe,{id:"\u200buploader-logo",ref:te,popup:!0,onUploadFinish:function(e){C({blockletLogo:e.data.filename}),te.current.close()},plugins:["ImageEditor"],apiPathProps:{uploader:Ee,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:Me,maxFileSize:Fe,maxNumberOfFiles:1}}},"uploader-logo"),(0,I.jsx)(qe,{id:"\u200buploader-screenshot",ref:ie,popup:!0,onUploadFinish:function(e){var n,t=R.blockletScreenshots||[];t.push(null===(n=e.data)||void 0===n?void 0:n.filename),C({blockletScreenshots:t}),ie.current.close()},plugins:["ImageEditor"],apiPathProps:{uploader:Pe,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:Me,maxFileSize:Fe,maxNumberOfFiles:5-Re.length}}},"uploader-screenshot")]}),(0,I.jsxs)(s.Z,{display:"flex",mt:3,className:"section full-width",children:[(0,I.jsx)(s.Z,{className:"left",children:(0,I.jsx)(O.Z,{variant:"h3",children:j("blocklet.publish.resourceTitle")})}),(0,I.jsxs)(s.Z,{sx:{flex:1},children:[(0,I.jsx)(me.Z,{tabs:fe,current:Ze,onChange:function(e){je(e)},sx:{ml:-2,mt:-1.5}}),(0,I.jsx)(s.Z,{children:Ne})]})]})]})]}))}Ke.propTypes={},Ke.defaultProps={};var Ge,Qe=a.Z.div(We||(We=(0,o.Z)(["\n .sticky-header {\n margin-top: -12px;\n padding: 12px 0;\n position: sticky;\n top: 0;\n z-index: 99;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background-color: #fff;\n padding-bottom: 12px;\n border-bottom: ",";\n }\n .screenshot {\n margin-bottom: 16px;\n max-width: 200px;\n max-height: 140px;\n width: 200px;\n height: 140px;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #eee;\n margin-right: 16px;\n position: relative;\n .action {\n visibility: hidden;\n position: absolute;\n top: 0px;\n right: 0px;\n background-color: rgba(0, 0, 0, 0.2);\n color: rgba(255, 255, 255, 0.8);\n }\n &:hover .action {\n visibility: visible;\n }\n }\n .screenshot img {\n width: 100%; /* \u56fe\u50cf\u5bbd\u5ea6\u586b\u5145\u5bb9\u5668 */\n height: auto; /* \u56fe\u50cf\u9ad8\u5ea6\u81ea\u9002\u5e94 */\n }\n .section {\n max-width: 800px;\n &.full-width {\n max-width: 100%;\n }\n .MuiTypography-h3 {\n font-size: 1.1rem;\n font-weight: 700;\n }\n .left {\n flex-shrink: 0;\n width: 140px;\n }\n .MuiTabs-indicator {\n display: none;\n }\n .MuiTypography-subtitle1 {\n width: 120px;\n font-weight: 700;\n font-size: 1rem;\n "," {\n width: 80px;\n }\n }\n }\n .MuiButtonBase-root {\n a {\n color: inherit;\n }\n }\n .MuiInputBase-multiline .MuiInputAdornment-positionEnd {\n align-self: flex-end;\n .MuiTypography-root {\n font-size: 0.8rem;\n }\n font-size: 0.8rem;\n }\n"])),(function(e){var n=e.theme;return"1px solid ".concat(n.palette.divider)}),(function(e){return e.theme.breakpoints.down("sm")}));function Ye(e){var n=e.padding,t=(0,d.y0)().blocklet,o=(0,c.useLocation)(),r=(0,c.useParams)().componentDid;if((0,l.useEffect)((function(){if(r&&window.parent){var e="".concat(o.pathname).concat(o.search);window.parent.postMessage({event:"popstate",page:"publish",componentDid:r,path:e},"*")}}),[r,o]),!t)return null;var i={};return n&&(i.padding=n),(0,I.jsx)($e,{style:i,children:(0,I.jsxs)(c.Routes,{children:[(0,I.jsx)(c.Route,{path:"/",element:(0,I.jsx)(w,{})}),(0,I.jsx)(c.Route,{path:"/create",element:(0,I.jsx)(F,{})}),(0,I.jsx)(c.Route,{path:"/:projectId",element:(0,I.jsx)(ee,{})}),(0,I.jsx)(c.Route,{path:"/:projectId/:releaseId",element:(0,I.jsx)(Ke,{})})]})})}Ye.propTypes={padding:i().oneOfType([i().string,i().number])},Ye.defaultProps={padding:""};var $e=(0,a.Z)(s.Z)(Ge||(Ge=(0,o.Z)(["\n a {\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main}))},36558:function(e,n,t){var o=t(33028),l=t(59740),r=t(24974),i=t.n(r),c=t(86822),a=t(19638),s=t(23586),d=t(37574),u=["did","href","external","avatarProps"];function p(e){var n=e.did,t=e.href,r=e.external,i=(e.avatarProps,(0,l.Z)(e,u)),p=(0,d.jsx)(s.Z,(0,o.Z)({did:n},i));return t?r?(0,d.jsx)(a.Z,{target:"_blank",href:t,underline:"hover",children:p}):(0,d.jsx)(c.rU,{to:t,children:p}):p}p.propTypes={did:i().string.isRequired,to:i().string,href:i().string,avatarProps:i().object,external:i().bool},p.defaultProps={to:"",href:"",avatarProps:{},external:!1},n.Z=p}}]);
2
- //# sourceMappingURL=356.df75c406.chunk.js.map
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[5047],{96709:function(n,e,r){r.r(e),r.d(e,{default:function(){return p}});r(30969);var o=r(30734),t=r(26022),a=r(75255),i=r(38361),s=r(50496),c=r(60356),l=r(37574),u=new URL(window.location.href),d="dialog"===u.searchParams.get("mode"),f=d?"":u.searchParams.get("padding")||"";function p(){var n=(0,t.PE)().t,e=(0,o.useParams)().componentDid,r=(0,a.Z)((function(n){return n.breakpoints.down("md")})),u=(0,l.jsx)(c.default,{padding:f});return d?(0,l.jsx)(s.ZP,{className:"resource-dialog",title:n("blocklet.publish.createResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:r?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:function(){window.parent.postMessage({event:"resourceDialog.close",componentDid:e},"*")},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:(0,l.jsx)(i.Z,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:u})}):u}},8479:function(n,e,r){r.d(e,{Z:function(){return S}});var o=r(71171),t=r(33028),a=r(32723),i=r(34795),s=r(96234),c=r(59740),l=r(30969),u=r(24974),d=r.n(u),f=r(16380),p=r(84636),m=r(94308),v=r(91862),Z=r(87130),h=r(43207),g=r(38357),w=r(18877),b=r(94702),x=r(75255),y=r(26022),C=r(29996),k=r(24891),j=r(45555);var R,M=function(){var n=(0,j.Z)();return{minWidth:(0,x.Z)(n.breakpoints.down("md"))?300:n.breakpoints.values.sm}},P=r(37574),N=["title","description","showCancel","cancel","confirm","color","params","onCancel","onConfirm","loading"];function S(n){var e=n.title,r=n.description,o=n.showCancel,u=n.cancel,d=n.confirm,f=n.color,p=n.params,j=n.onCancel,R=n.onConfirm,S=n.loading,T=(0,c.Z)(n,N),_=(0,l.useState)(p),z=(0,s.Z)(_,2),W=z[0],F=z[1],D=(0,l.useState)(!0),O=(0,s.Z)(D,2),q=O[0],B=O[1],E=(0,l.useState)(!1),H=(0,s.Z)(E,2),L=H[0],V=H[1],I=(0,l.useState)(""),K=(0,s.Z)(I,2),U=K[0],A=K[1],J=(0,y.PE)().t,Q=(0,b.Z)(),X=function(){var n=(0,i.Z)((0,a.Z)().mark((function n(e){return(0,a.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("function"!==typeof e){n.next=17;break}return V(!0),n.prev=2,n.next=5,e(W);case 5:B(!1),n.next=12;break;case 8:n.prev=8,n.t0=n.catch(2),A((0,k.Z)(n.t0)),console.error(n.t0);case 12:return n.prev=12,V(!1),n.finish(12);case 15:n.next=18;break;case 17:B(!1);case 18:case"end":return n.stop()}}),n,null,[[2,8,12,15]])})));return function(e){return n.apply(this,arguments)}}(),Y="function"===typeof e?e():e,$="function"===typeof r?r(W,F,A):r,nn=(0,x.Z)(Q.breakpoints.down("md")),en=M().minWidth;return(0,P.jsxs)(G,(0,t.Z)((0,t.Z)({onClick:function(n){n.stopPropagation()},fullScreen:nn,open:q,style:{minWidth:en}},T),{},{children:[(0,P.jsx)(g.Z,{children:Y}),(0,P.jsxs)(Z.Z,{style:{minWidth:en},children:[(0,P.jsx)(h.Z,{component:"div",children:$}),!!U&&(0,P.jsx)(w.Z,{severity:"error",style:{width:"100%",marginTop:8},children:U})]}),(0,P.jsxs)(v.Z,{className:"delete-actions",style:{padding:"8px 24px 24px"},children:[o&&(0,P.jsx)(C.Z,{onClick:function(n){n.stopPropagation(),X(j)},color:"inherit","data-cy":"cancel-confirm-dialog",children:u||J("common.cancel")}),(0,P.jsxs)(C.Z,{onClick:function(n){n.stopPropagation(),X(R)},color:f,disabled:W.__disableConfirm||L||S,variant:"contained","data-cy":"submit-confirm-dialog",autoFocus:!0,children:[(L||S)&&(0,P.jsx)(m.Z,{size:16,sx:{mr:1}}),d]})]})]}))}S.propTypes={title:d().any.isRequired,description:d().any.isRequired,showCancel:d().bool,cancel:d().string,color:d().string,confirm:d().string,params:d().object,onCancel:d().func,onConfirm:d().func.isRequired,loading:d().bool},S.defaultProps={onCancel:function(){},showCancel:!0,cancel:"",confirm:"Confirm",color:"error",params:{},loading:!1};var G=(0,f.Z)(p.Z)(R||(R=(0,o.Z)(["\n .delete-actions .Mui-disabled {\n color: rgba(0, 0, 0, 0.26) !important;\n box-shadow: none;\n background-color: rgba(0, 0, 0, 0.12) !important;\n }\n"])))},77370:function(n,e,r){r.d(e,{B:function(){return t.B3},T:function(){return a}});var o=r(30969),t=r(41333);function a(){return(0,o.useContext)(t.B3)}},54559:function(n,e,r){r.d(e,{hi:function(){return a},od:function(){return t.a}});var o=r(95803),t=r.n(o);t().defaults.timeout=1e4;var a=t().create()},9715:function(n,e,r){var o,t=r(71171),a=r(33028),i=r(59740),s=r(30969),c=r(24974),l=r.n(c),u=r(33359),d=r(79216),f=r(6200),p=r(55581),m=r(37574),v=["type","content","children","style","className","forwardedRef"],Z={error:{color:f.Z.common.white,backgroundColor:f.Z.error.main},warning:{color:f.Z.common.white,backgroundColor:f.Z.warning.main},success:{color:f.Z.common.white,backgroundColor:f.Z.success.main},primary:{color:f.Z.common.white,backgroundColor:f.Z.primary.main},reverse:{color:"#fff",backgroundColor:"#222"}};function h(n){var e=(0,d.dG)(n,h,["style"]),r=e.type,o=e.content,t=e.children,s=e.style,c=e.className,l=e.forwardedRef,u=(0,i.Z)(e,v),g=(0,p.Fg)().palette,b=Object.assign({},Z[r]||Z.primary,s);return g[r]&&Object.assign(b,{color:g[r].contrastText||f.Z.common.white,backgroundColor:g[r].main}),(0,m.jsx)(w,(0,a.Z)((0,a.Z)({ref:l,component:"span",className:c,style:b},u),{},{children:o||t}))}h.propTypes={children:l().any.isRequired,type:l().oneOf(Object.keys(Z)),content:l().string,className:l().string,style:l().oneOfType([l().object,l().string])},h.defaultProps={type:"primary",content:"",className:"",style:{}};var g=(0,s.forwardRef)((function(n,e){return(0,m.jsx)(h,(0,a.Z)((0,a.Z)({},n),{},{forwardedRef:e}))}));e.Z=g;var w=(0,p.zo)(u.Z)(o||(o=(0,t.Z)(["\n && {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 10px;\n height: 20px;\n line-height: 20px;\n font-size: 12px;\n font-weight: 500;\n border-radius: 4px;\n }\n"])))},10814:function(n,e,r){var o=r(71600);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=o(r(48035)),a=r(37574),i=(0,t.default)((0,a.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");e.default=i},23038:function(n,e,r){var o=r(71600);e.Z=void 0;var t=o(r(48035)),a=r(37574),i=(0,t.default)((0,a.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");e.Z=i},37973:function(n,e,r){var o=r(71600);e.Z=void 0;var t=o(r(48035)),a=r(37574),i=(0,t.default)((0,a.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");e.Z=i},21098:function(n,e,r){var o=r(31461),t=r(7896),a=r(30969),i=r(87023),s=r(26540),c=r(45971),l=r(17363),u=r(54126),d=r(86171),f=r(42641),p=r(37574),m=["className","row"],v=(0,c.ZP)("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:function(n,e){var r=n.ownerState;return[e.root,r.row&&e.row]}})((function(n){var e=n.ownerState;return(0,t.Z)({display:"flex",flexDirection:"column",flexWrap:"wrap"},e.row&&{flexDirection:"row"})})),Z=a.forwardRef((function(n,e){var r=(0,l.Z)({props:n,name:"MuiFormGroup"}),a=r.className,c=r.row,Z=void 0!==c&&c,h=(0,o.Z)(r,m),g=(0,d.Z)(),w=(0,f.Z)({props:r,muiFormControl:g,states:["error"]}),b=(0,t.Z)({},r,{row:Z,error:w.error}),x=function(n){var e=n.classes,r={root:["root",n.row&&"row",n.error&&"error"]};return(0,s.Z)(r,u.y,e)}(b);return(0,p.jsx)(v,(0,t.Z)({className:(0,i.Z)(x.root,a),ownerState:b,ref:e},h))}));e.Z=Z},54126:function(n,e,r){r.d(e,{y:function(){return a}});var o=r(62746),t=r(2975);function a(n){return(0,t.Z)("MuiFormGroup",n)}var i=(0,o.Z)("MuiFormGroup",["root","row","error"]);e.Z=i},56277:function(n,e,r){var o=r(56666),t=r(31461),a=r(7896),i=r(30969),s=r(87023),c=r(26540),l=r(17363),u=r(45971),d=r(6856),f=r(37574),p=["className","component","disableGutters","variant"],m=(0,u.ZP)("div",{name:"MuiToolbar",slot:"Root",overridesResolver:function(n,e){var r=n.ownerState;return[e.root,!r.disableGutters&&e.gutters,e[r.variant]]}})((function(n){var e=n.theme,r=n.ownerState;return(0,a.Z)({position:"relative",display:"flex",alignItems:"center"},!r.disableGutters&&(0,o.Z)({paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),"dense"===r.variant&&{minHeight:48})}),(function(n){var e=n.theme;return"regular"===n.ownerState.variant&&e.mixins.toolbar})),v=i.forwardRef((function(n,e){var r=(0,l.Z)({props:n,name:"MuiToolbar"}),o=r.className,i=r.component,u=void 0===i?"div":i,v=r.disableGutters,Z=void 0!==v&&v,h=r.variant,g=void 0===h?"regular":h,w=(0,t.Z)(r,p),b=(0,a.Z)({},r,{component:u,disableGutters:Z,variant:g}),x=function(n){var e=n.classes,r={root:["root",!n.disableGutters&&"gutters",n.variant]};return(0,c.Z)(r,d.N,e)}(b);return(0,f.jsx)(m,(0,a.Z)({as:u,className:(0,s.Z)(x.root,o),ref:e,ownerState:b},w))}));e.Z=v},6856:function(n,e,r){r.d(e,{N:function(){return a}});var o=r(62746),t=r(2975);function a(n){return(0,t.Z)("MuiToolbar",n)}var i=(0,o.Z)("MuiToolbar",["root","gutters","regular","dense"]);e.Z=i},43178:function(n,e,r){var o=r(30969);e.Z=function(n){void 0===n&&(n={});var e=o.useState(n),r=e[0],t=e[1];return[r,o.useCallback((function(n){t((function(e){return Object.assign({},e,n instanceof Function?n(e):n)}))}),[])]}}}]);
2
- //# sourceMappingURL=5047.2f665ae5.chunk.js.map