@abtnode/blocklet-services 1.16.37-beta-20250108-030909-4ccec32e → 1.16.37

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,4 +1,4 @@
1
- import{t as $,j as t,a2 as W,bs as D,a3 as l,E as m,aQ as M,br as O,aa as j,v as F}from"./vendor-mui-core-COxJgW9_.js";import{r as h,L as T}from"./vendor-react-D-afvo_7.js";import{I as H}from"./vendor-hooks-DzETutIU.js";import{j as q}from"./vendor-utils-CV7RLr7b.js";import{d as K}from"./PlayArrow-IJdeSlbo.js";import{d as V}from"./Error-CL8m4Xu6.js";import{g as U,z as u,C as Q,d as b,ag as k,Q as X,ai as G}from"./vendor-arcblock-Dn16DH88.js";import{W as J}from"./did-address-B-umhomj.js";import{d as L,e as R,g as Y,f as g,S as Z,h as ee,j as te,k as oe,l as ie,m as I,n as ne}from"./index-tDqjC_e2.js";import{d as re}from"./ServerLogo-DsurTeGQ.js";import{H as ae}from"./addon-DUnQ9eC0.js";import{g as S}from"./get-safe-url-ByH0hntp.js";import"./QuestionMarkCircle-2fDrHopp.js";function z({appInfo:e,...r}){const[o,i]=h.useState(!1),s=$(d=>d.breakpoints.down("md"))?32:48;return o?t.jsx(X,{did:e.publisher,size:s}):t.jsx(G,{src:e.icon,alt:e.title,width:s,height:s,...r,onError:()=>i(!0)})}z.propTypes={appInfo:m.object.isRequired};const C=(e,r)=>g.findComponentByIdV2(e,r)||e;function _e(){var v,_,E,N;const{t:e,locale:r}=U(),[o,i]=H({blocklet:null,component:null,launcherSession:null,loading:!1,starting:!1,manageSubscriptionURL:""}),p=$(a=>a.breakpoints.down("md")),s=new URL(window.location.href),d=s.searchParams.get("componentId"),w=()=>{const a=s.searchParams.get("redirect")||"/";window.location.href=S(decodeURIComponent(a))},y=()=>{const a=setInterval(()=>{L.get("/blocklet/detail?nocache=1").then(({data:n})=>{const c=C(n,d);if(c.status==="running"){w();return}c.status!=="starting"&&(i({blocklet:n,starting:!1}),n!==c&&i({component:c}),clearInterval(a))}).catch(n=>{i({loading:!1}),u.error(n.message)})},3e3)};h.useEffect(()=>{i({loading:!0}),L.get("/blocklet/detail?nocache=1").then(({data:a})=>{const n=C(a,d);if(i({loading:!1}),n.status==="running"){w();return}i({blocklet:a}),a!==n&&i({component:n}),n.status==="starting"&&(i({starting:!0}),y())}).catch(a=>{i({loading:!1}),u.error(a.message)})},[]);const B=h.useCallback(()=>{var n;i({loading:!0,starting:!0});const a={did:(n=o.blocklet)==null?void 0:n.meta.did};o.component&&(a.componentDids=[o.component.meta.did]),R.startBlocklet({input:a}).then(()=>{y()}).catch(c=>{u.error(c.message),i({loading:!1,starting:!1})})},[o.component,o.blocklet]);if(h.useEffect(()=>{var a;(a=o.blocklet)!=null&&a.controller&&(Y({launcherUrl:o.blocklet.controller.launcherUrl,launcherSessionId:o.blocklet.controller.launcherSessionId,locale:r}).then(n=>{i({manageSubscriptionURL:n})}).catch(n=>{console.error("get manage subscription url error",n)}),R.getLauncherSession({input:{launcherSessionId:o.blocklet.controller.launcherSessionId,launcherUrl:o.blocklet.controller.launcherUrl}}).then(n=>{i({launcherSession:n.launcherSession}).catch(c=>{console.error("get launcher session error",c)})}))},[(v=o.blocklet)==null?void 0:v.controller]),!o.blocklet)return t.jsx(Q,{children:t.jsx(W,{})});const x={icon:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo`,title:g.getDisplayName(o.blocklet),publisher:o.blocklet.appDid},f=localStorage.getItem("blocklet-server-url"),P=()=>{f&&window.open(S(f,{allowDomains:null}))};return t.jsxs(le,{children:[t.jsx(D,{styles:se}),t.jsxs("header",{className:"root-header",children:[!p&&t.jsx("div",{className:"left",children:t.jsx(re,{width:"128",height:"48",onClick:P,style:{cursor:f?"pointer":""}})}),t.jsx("div",{className:"right",children:t.jsx(ae,{SessionContext:Z})})]}),t.jsxs(de,{elevation:0,children:[t.jsxs(ce,{children:[t.jsx(z,{appInfo:x}),t.jsxs("div",{className:"app-info_content",children:[t.jsx(l,{className:"app-info_name",children:x.title}),t.jsx(J,{size:14,className:"app-info_did",did:x.publisher})]})]}),((N=(E=(_=o.blocklet)==null?void 0:_.controller)==null?void 0:E.status)==null?void 0:N.value)!==ee.BLOCKLET_CONTROLLER_STATUS.suspended&&t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(l,{className:"icon",children:t.jsx(K,{})}),t.jsx(l,{className:"title",children:e("blocklet.startApplication")})]}),t.jsx(l,{className:"sub-title",children:e("blocklet.startDescription",{name:o.component?g.getDisplayName(o.component,!0):g.getDisplayName(o.blocklet)})}),t.jsx(l,{mt:8,children:t.jsx(k,{style:{minWidth:200},disabled:o.loading||o.starting,variant:"contained",color:"primary",size:"large",loading:o.starting,onClick:()=>B(),children:o.starting?e("blocklet.starting"):e("blocklet.start")})})]}),te(o.blocklet)&&t.jsx(A,{blocklet:o.blocklet,launcherSession:o.launcherSession,manageSubscriptionURL:o.manageSubscriptionURL}),t.jsx(l,{mt:5,children:t.jsx(T,{className:"footer-link",to:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/overview`,children:e("blocklet.dashboard")})})]})]})}function A({blocklet:e,launcherSession:r,manageSubscriptionURL:o}){const{t:i,locale:p}=U();if(!e||!r)return"";const s=oe(e,r),d=ie(e,r);return!s&&!d?"":t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(V,{className:"icon-error"}),t.jsxs(l,{className:"title error",children:[s&&i("blocklet.suspended"),d&&i("blocklet.terminated")]})]}),t.jsxs(l,{className:"sub-title",children:[s&&i("blocklet.suspendedCausedByExpired",{deadline:I(r==null?void 0:r.reservedUntil,p)}),d&&i("blocklet.suspendedCausedByTerminated",{canceledAt:I(r==null?void 0:r.terminatedAt,p),deadline:ne(r==null?void 0:r.terminatedAt,p)})]}),t.jsxs(l,{mt:8,children:[s&&t.jsx(k,{component:M,style:{minWidth:200},variant:"contained",color:"primary",size:"large",target:"_blank",href:o||"#",children:i("blocklet.manageSubscription")}),d&&t.jsx(k,{component:T,to:q(b.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/did-spaces"),style:{minWidth:200},variant:"contained",color:"primary",size:"large",children:i("common.backup")})]})]})}A.propTypes={blocklet:m.object.isRequired,launcherSession:m.object.isRequired,manageSubscriptionURL:m.string.isRequired};const se=O`
1
+ import{t as $,j as t,a2 as W,bs as D,a3 as l,E as m,aQ as M,br as O,aa as j,v as F}from"./vendor-mui-core-COxJgW9_.js";import{r as h,L as T}from"./vendor-react-D-afvo_7.js";import{I as H}from"./vendor-hooks-DzETutIU.js";import{j as q}from"./vendor-utils-CV7RLr7b.js";import{d as K}from"./PlayArrow-IJdeSlbo.js";import{d as V}from"./Error-CL8m4Xu6.js";import{g as U,z as u,C as Q,d as b,ag as k,Q as X,ai as G}from"./vendor-arcblock-Dn16DH88.js";import{W as J}from"./did-address-B-umhomj.js";import{d as L,e as R,g as Y,f as g,S as Z,h as ee,j as te,k as oe,l as ie,m as I,n as ne}from"./index-tDqjC_e2.js";import{d as re}from"./ServerLogo-DsurTeGQ.js";import{H as ae}from"./addon-DUnQ9eC0.js";import{g as S}from"./get-safe-url-yHkHYeNB.js";import"./QuestionMarkCircle-2fDrHopp.js";function z({appInfo:e,...r}){const[o,i]=h.useState(!1),s=$(d=>d.breakpoints.down("md"))?32:48;return o?t.jsx(X,{did:e.publisher,size:s}):t.jsx(G,{src:e.icon,alt:e.title,width:s,height:s,...r,onError:()=>i(!0)})}z.propTypes={appInfo:m.object.isRequired};const C=(e,r)=>g.findComponentByIdV2(e,r)||e;function _e(){var v,_,E,N;const{t:e,locale:r}=U(),[o,i]=H({blocklet:null,component:null,launcherSession:null,loading:!1,starting:!1,manageSubscriptionURL:""}),p=$(a=>a.breakpoints.down("md")),s=new URL(window.location.href),d=s.searchParams.get("componentId"),w=()=>{const a=s.searchParams.get("redirect")||"/";window.location.href=S(decodeURIComponent(a))},y=()=>{const a=setInterval(()=>{L.get("/blocklet/detail?nocache=1").then(({data:n})=>{const c=C(n,d);if(c.status==="running"){w();return}c.status!=="starting"&&(i({blocklet:n,starting:!1}),n!==c&&i({component:c}),clearInterval(a))}).catch(n=>{i({loading:!1}),u.error(n.message)})},3e3)};h.useEffect(()=>{i({loading:!0}),L.get("/blocklet/detail?nocache=1").then(({data:a})=>{const n=C(a,d);if(i({loading:!1}),n.status==="running"){w();return}i({blocklet:a}),a!==n&&i({component:n}),n.status==="starting"&&(i({starting:!0}),y())}).catch(a=>{i({loading:!1}),u.error(a.message)})},[]);const B=h.useCallback(()=>{var n;i({loading:!0,starting:!0});const a={did:(n=o.blocklet)==null?void 0:n.meta.did};o.component&&(a.componentDids=[o.component.meta.did]),R.startBlocklet({input:a}).then(()=>{y()}).catch(c=>{u.error(c.message),i({loading:!1,starting:!1})})},[o.component,o.blocklet]);if(h.useEffect(()=>{var a;(a=o.blocklet)!=null&&a.controller&&(Y({launcherUrl:o.blocklet.controller.launcherUrl,launcherSessionId:o.blocklet.controller.launcherSessionId,locale:r}).then(n=>{i({manageSubscriptionURL:n})}).catch(n=>{console.error("get manage subscription url error",n)}),R.getLauncherSession({input:{launcherSessionId:o.blocklet.controller.launcherSessionId,launcherUrl:o.blocklet.controller.launcherUrl}}).then(n=>{i({launcherSession:n.launcherSession}).catch(c=>{console.error("get launcher session error",c)})}))},[(v=o.blocklet)==null?void 0:v.controller]),!o.blocklet)return t.jsx(Q,{children:t.jsx(W,{})});const x={icon:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo`,title:g.getDisplayName(o.blocklet),publisher:o.blocklet.appDid},f=localStorage.getItem("blocklet-server-url"),P=()=>{f&&window.open(S(f,{allowDomains:null}))};return t.jsxs(le,{children:[t.jsx(D,{styles:se}),t.jsxs("header",{className:"root-header",children:[!p&&t.jsx("div",{className:"left",children:t.jsx(re,{width:"128",height:"48",onClick:P,style:{cursor:f?"pointer":""}})}),t.jsx("div",{className:"right",children:t.jsx(ae,{SessionContext:Z})})]}),t.jsxs(de,{elevation:0,children:[t.jsxs(ce,{children:[t.jsx(z,{appInfo:x}),t.jsxs("div",{className:"app-info_content",children:[t.jsx(l,{className:"app-info_name",children:x.title}),t.jsx(J,{size:14,className:"app-info_did",did:x.publisher})]})]}),((N=(E=(_=o.blocklet)==null?void 0:_.controller)==null?void 0:E.status)==null?void 0:N.value)!==ee.BLOCKLET_CONTROLLER_STATUS.suspended&&t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(l,{className:"icon",children:t.jsx(K,{})}),t.jsx(l,{className:"title",children:e("blocklet.startApplication")})]}),t.jsx(l,{className:"sub-title",children:e("blocklet.startDescription",{name:o.component?g.getDisplayName(o.component,!0):g.getDisplayName(o.blocklet)})}),t.jsx(l,{mt:8,children:t.jsx(k,{style:{minWidth:200},disabled:o.loading||o.starting,variant:"contained",color:"primary",size:"large",loading:o.starting,onClick:()=>B(),children:o.starting?e("blocklet.starting"):e("blocklet.start")})})]}),te(o.blocklet)&&t.jsx(A,{blocklet:o.blocklet,launcherSession:o.launcherSession,manageSubscriptionURL:o.manageSubscriptionURL}),t.jsx(l,{mt:5,children:t.jsx(T,{className:"footer-link",to:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/overview`,children:e("blocklet.dashboard")})})]})]})}function A({blocklet:e,launcherSession:r,manageSubscriptionURL:o}){const{t:i,locale:p}=U();if(!e||!r)return"";const s=oe(e,r),d=ie(e,r);return!s&&!d?"":t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(V,{className:"icon-error"}),t.jsxs(l,{className:"title error",children:[s&&i("blocklet.suspended"),d&&i("blocklet.terminated")]})]}),t.jsxs(l,{className:"sub-title",children:[s&&i("blocklet.suspendedCausedByExpired",{deadline:I(r==null?void 0:r.reservedUntil,p)}),d&&i("blocklet.suspendedCausedByTerminated",{canceledAt:I(r==null?void 0:r.terminatedAt,p),deadline:ne(r==null?void 0:r.terminatedAt,p)})]}),t.jsxs(l,{mt:8,children:[s&&t.jsx(k,{component:M,style:{minWidth:200},variant:"contained",color:"primary",size:"large",target:"_blank",href:o||"#",children:i("blocklet.manageSubscription")}),d&&t.jsx(k,{component:T,to:q(b.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/did-spaces"),style:{minWidth:200},variant:"contained",color:"primary",size:"large",children:i("common.backup")})]})]})}A.propTypes={blocklet:m.object.isRequired,launcherSession:m.object.isRequired,manageSubscriptionURL:m.string.isRequired};const se=O`
2
2
  html,
3
3
  body,
4
4
  #app,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.37-beta-20250108-030909-4ccec32e",
6
+ "version": "1.16.37",
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.37-beta-20250108-030909-4ccec32e",
37
- "@abtnode/auth": "1.16.37-beta-20250108-030909-4ccec32e",
38
- "@abtnode/client": "1.16.37-beta-20250108-030909-4ccec32e",
39
- "@abtnode/connect-storage": "1.16.37-beta-20250108-030909-4ccec32e",
40
- "@abtnode/constant": "1.16.37-beta-20250108-030909-4ccec32e",
41
- "@abtnode/core": "1.16.37-beta-20250108-030909-4ccec32e",
42
- "@abtnode/cron": "1.16.37-beta-20250108-030909-4ccec32e",
43
- "@abtnode/logger": "1.16.37-beta-20250108-030909-4ccec32e",
44
- "@abtnode/models": "1.16.37-beta-20250108-030909-4ccec32e",
45
- "@abtnode/router-templates": "1.16.37-beta-20250108-030909-4ccec32e",
46
- "@abtnode/util": "1.16.37-beta-20250108-030909-4ccec32e",
36
+ "@abtnode/analytics": "1.16.37",
37
+ "@abtnode/auth": "1.16.37",
38
+ "@abtnode/client": "1.16.37",
39
+ "@abtnode/connect-storage": "1.16.37",
40
+ "@abtnode/constant": "1.16.37",
41
+ "@abtnode/core": "1.16.37",
42
+ "@abtnode/cron": "1.16.37",
43
+ "@abtnode/logger": "1.16.37",
44
+ "@abtnode/models": "1.16.37",
45
+ "@abtnode/router-templates": "1.16.37",
46
+ "@abtnode/util": "1.16.37",
47
47
  "@arcblock/did": "^1.19.2",
48
48
  "@arcblock/did-auth": "1.19.2",
49
49
  "@arcblock/did-ext": "^1.19.2",
@@ -52,15 +52,15 @@
52
52
  "@arcblock/jwt": "1.19.2",
53
53
  "@arcblock/validator": "^1.19.2",
54
54
  "@arcblock/ws": "1.19.2",
55
- "@blocklet/constant": "1.16.37-beta-20250108-030909-4ccec32e",
55
+ "@blocklet/constant": "1.16.37",
56
56
  "@blocklet/did-space-js": "^1.0.1",
57
- "@blocklet/env": "1.16.37-beta-20250108-030909-4ccec32e",
57
+ "@blocklet/env": "1.16.37",
58
58
  "@blocklet/form-builder": "^0.1.11",
59
59
  "@blocklet/form-collector": "^0.1.8",
60
- "@blocklet/images": "1.16.37-beta-20250108-030909-4ccec32e",
61
- "@blocklet/js-sdk": "1.16.37-beta-20250108-030909-4ccec32e",
62
- "@blocklet/meta": "1.16.37-beta-20250108-030909-4ccec32e",
63
- "@blocklet/sdk": "1.16.37-beta-20250108-030909-4ccec32e",
60
+ "@blocklet/images": "1.16.37",
61
+ "@blocklet/js-sdk": "1.16.37",
62
+ "@blocklet/meta": "1.16.37",
63
+ "@blocklet/sdk": "1.16.37",
64
64
  "@blocklet/uploader-server": "^0.1.66",
65
65
  "@did-connect/authenticator": "^2.2.4",
66
66
  "@did-connect/relay-adapter-express": "^2.2.4",
@@ -108,14 +108,14 @@
108
108
  "whatwg-url": "14.0.0"
109
109
  },
110
110
  "devDependencies": {
111
- "@abtnode/ux": "1.16.37-beta-20250108-030909-4ccec32e",
111
+ "@abtnode/ux": "1.16.37",
112
112
  "@arcblock/bridge": "^2.11.22",
113
113
  "@arcblock/did-connect": "^2.11.22",
114
114
  "@arcblock/icons": "^2.11.22",
115
115
  "@arcblock/react-hooks": "^2.11.22",
116
116
  "@arcblock/ux": "^2.11.22",
117
117
  "@blocklet/launcher-layout": "^2.11.22",
118
- "@blocklet/tracker": "1.16.37-beta-20250108-030909-4ccec32e",
118
+ "@blocklet/tracker": "1.16.37",
119
119
  "@blocklet/ui-react": "^2.11.22",
120
120
  "@blocklet/uploader": "^0.1.62",
121
121
  "@emotion/react": "^11.11.4",
@@ -192,5 +192,5 @@
192
192
  "url": "https://github.com/ArcBlock/blocklet-server/issues",
193
193
  "email": "shijun@arcblock.io"
194
194
  },
195
- "gitHead": "552f8a6280aa2331170253e6e76bbd0d3d975f0f"
195
+ "gitHead": "3e06fd31ca113b7555c3eec22c9087e256b92f44"
196
196
  }