@tachybase/module-message 1.3.16 → 1.3.18

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
- (function(d,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@tachybase/client"),require("@tachybase/utils/client"),require("react/jsx-runtime"),require("react"),require("@tachybase/schema"),require("antd"),require("@tachybase/components"),require("@tachybase/module-workflow/client"),require("lodash"),require("@ant-design/icons"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/utils/client","react/jsx-runtime","react","@tachybase/schema","antd","@tachybase/components","@tachybase/module-workflow/client","lodash","@ant-design/icons","react-router-dom"],e):(d=typeof globalThis!="undefined"?globalThis:d||self,e(d["@tachybase/module-message"]={},d["@tachybase/client"],d["@tachybase/utils"],d.jsxRuntime,d.react,d["@tachybase/schema"],d.antd,d["@tachybase/components"],d["@tachybase/module-workflow"],d.lodash,d["@ant-design/icons"],d["react-router-dom"]))})(this,function(d,e,x,r,h,A,I,P,g,M,W,ee){"use strict";var xt=Object.defineProperty,gt=Object.defineProperties;var ht=Object.getOwnPropertyDescriptors;var Z=Object.getOwnPropertySymbols;var yt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable;var Q=(d,e,x)=>e in d?xt(d,e,{enumerable:!0,configurable:!0,writable:!0,value:x}):d[e]=x,f=(d,e)=>{for(var x in e||(e={}))yt.call(e,x)&&Q(d,x,e[x]);if(Z)for(var x of Z(e))Ct.call(e,x)&&Q(d,x,e[x]);return d},v=(d,e)=>gt(d,ht(e));var u=(d,e,x)=>new Promise((r,h)=>{var A=g=>{try{P(x.next(g))}catch(M){h(M)}},I=g=>{try{P(x.throw(g))}catch(M){h(M)}},P=g=>g.done?r(g.value):Promise.resolve(g.value).then(A,I);P((x=x.apply(d,e)).next())});const L="message-instruction",y="message",te="messages",oe="messages-update-badge-count",ne="site-message",se="sms",re=({children:t})=>{const o=e.useApp(),n=e.useCompile(),s=e.usePlugin(D),a=h.useMemo(()=>Array.from(s.channels.getValues()),[s]).map(i=>{var p,l;return i.send||((l=(p=i.useAction)==null?void 0:p.call(i))==null?void 0:l.send)}).filter(Boolean);return h.useEffect(()=>{A.autorun(()=>{if(o.ws.connected){const i={type:"signIn",payload:{token:o.apiClient.auth.getToken()}};o.ws.send(JSON.stringify(i))}})},[]),h.useEffect(()=>{o.ws.on("message",i=>{const p=JSON.parse(i.data);if((p==null?void 0:p.type)===te){const l=p.payload.message,m=n(l.title),b=n(l.content),w={title:m,content:b};a.forEach(S=>S==null?void 0:S(w))}})},[]),r.jsx(r.Fragment,{children:t})};class B{}const E=()=>{const{i18n:t}=e.useApp();return{t:(n,s={})=>t.t(n,f({ns:[y,"core"]},s))}},C=t=>e.tval(t,{ns:[y,"core"]});function N(t){return e.i18n.t(t,{ns:[y,"core"]})}const z=ne;class ae extends B{constructor(){super(...arguments),this.name=z,this.title=N("In-App Notifications")}useAction(){const o=e.useApp();return{send:s=>{const{title:c,content:a}=s;o.notification.info({key:c,message:`${c}${a?":"+a:""}`,duration:10})}}}}class ie extends e.Plugin{load(){return u(this,null,function*(){this.app.pm.get(D).registerChannel(z,ae)})}}const K=se;class ce extends B{constructor(){super(...arguments),this.name=K,this.title=N("Text Message Alerts")}}class pe extends e.Plugin{load(){return u(this,null,function*(){this.app.pm.get(D).registerChannel(K,ce)})}}class le extends e.Plugin{afterAdd(){return u(this,null,function*(){yield this.app.pm.add(ie),yield this.app.pm.add(pe)})}load(){return u(this,null,function*(){this.app.use(re)})}}const _="messages_providers",V={dumpRules:{group:"third-party"},name:_,shared:!0,fields:[{type:"string",name:"id",primaryKey:!0,interface:"input",uiSchema:{title:'{{t("ID")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Title")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"type",interface:"select",uiSchema:{title:`{{t("Provider type", { ns: "${y}" })}}`,type:"string","x-component":"Select",required:!0,enum:[{label:`{{t("Aliyun SMS", { ns: "${y}" })}}`,value:"sms-aliyun"},{label:`{{t("Tencent SMS", { ns: "${y}" })}}`,value:"sms-tencent"}]}},{type:"jsonb",name:"options"},{type:"radio",name:"default",interface:"checkbox",uiSchema:{title:'{{t("Default")}}',type:"boolean","x-component":"Checkbox"}}]},de={type:"void",title:'{{ t("Edit") }}',"x-action":"update","x-component":"Action.Link","x-component-props":{openMode:"drawer",icon:"EditOutlined"},"x-decorator":"ACLActionProvider",properties:{drawer:{type:"void",title:'{{ t("Edit record") }}',"x-component":"Action.Container","x-component-props":{className:"tb-action-popup"},properties:{card:{type:"void","x-acl-action-props":{skipScopeCheck:!1},"x-acl-action":`${_}:update`,"x-decorator":"FormBlockProvider","x-use-decorator-props":"useEditFormBlockDecoratorProps","x-decorator-props":{action:"get",dataSource:"main",collection:V},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useEditFormBlockProps",properties:{actionBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-use-component-props":"useUpdateActionProps","x-component-props":{type:"primary"}}}},id:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":!0},title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":!0},options:{type:"object","x-component":"ProviderOptions"},default:{"x-component":"CollectionField","x-decorator":"FormItem"}}}}}}}}},me={type:"void",name:"NotificationProviders","x-component":I.Card,"x-component-props":{bordered:!1},properties:{tableCard:{type:"void",name:"tableCard","x-decorator":"TableBlockProvider","x-decorator-props":{collection:V,action:"list",params:{pageSize:50,sort:["-default","id"],appends:[]}},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-designer":"Filter.Action.Designer","x-component":"Filter.Action","x-use-component-props":"useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-action":"refresh","x-component":"Action","x-use-component-props":"useRefreshActionProps","x-designer":"Action.Designer","x-component-props":{icon:"ReloadOutlined"},"x-align":"right"},delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action","x-use-component-props":"useBulkDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(t){const o=e.useActionContext();return e.useRequest(()=>Promise.resolve({data:{name:`s_${A.uid()}`}}),v(f({},t),{refreshDeps:[o.visible]}))}},title:'{{t("Add new")}}',properties:{actionBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},create:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useCreateDatabaseConnectionAction","x-component-props":{type:"primary"}}}},id:{"x-component":"CollectionField","x-decorator":"FormItem",description:'{{t("Identifier for program usage. Support letters, numbers and underscores, must start with an letter.")}}'},title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"ProviderOptions"},default:{"x-component":"CollectionField","x-decorator":"FormItem"}}}}}}},table:{type:"array","x-uid":"input","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-use-decorator-props":"useTableBlockDecoratorProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{id:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{id:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},title:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},type:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{type:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},default:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{default:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"TableV2.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:de,delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}}}}}}}}}}}},ue={type:"object",properties:{accessKeyId:{title:`{{t("Access Key ID", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},accessKeySecret:{title:`{{t("Access Key Secret", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password"},endpoint:{title:`{{t("Endpoint", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},sign:{title:`{{t("Sign", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},template:{title:`{{t("Template code", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"}}},xe={type:"object",properties:{secretId:{title:`{{t("Secret Id", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},secretKey:{title:`{{t("Secret Key", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password"},region:{title:`{{t("Region", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},endpoint:{title:`{{t("Endpoint", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",default:"sms.tencentcloudapi.com"},SignName:{title:`{{t("Sign name", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},SmsSdkAppId:{title:`{{t("Sms sdk app id", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},TemplateId:{title:`{{t("Template Id", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"}}},O=new x.Registry,$="sms-aliyun",ge="sms-tencent";O.register($,ue),O.register(ge,xe);const he=$,ye=A.observer(t=>{const o=A.useForm(),n=A.useField(),[s,c]=h.useState(new A.Schema({}));return h.useEffect(()=>{o.clearFormGraph("options.*"),c(new A.Schema(O.get(o.values.type)||{}))},[o.values.type]),r.jsx(P.FormLayout,{layout:"vertical",children:r.jsx(A.RecursionField,{basePath:n.address,onlyRenderProperties:!0,schema:s},o.values.type||he)})},{displayName:"ProviderOptions"}),Ce=()=>r.jsx(e.ExtendCollectionsProvider,{collections:[V],children:r.jsx(e.SchemaComponent,{schema:me,components:{ProviderOptions:ye}})}),Se="notification-providers";class fe extends e.Plugin{load(){return u(this,null,function*(){this.app.systemSettingsManager.add(`system-services.${Se}`,{icon:"CheckCircleOutlined",title:`{{t("Notification providers", { ns: "${y}" })}}`,aclSnippet:"pm.message.providers",Component:Ce})})}}const be=()=>{const t=e.usePlugin(D),o=Array.from(t.channels.getValues());return r.jsx(I.Card,{children:o.map(n=>r.jsx(we,{channel:n},n.name))})},we=t=>{var w,S;const{channel:o}=t,{name:n,title:s}=o,c=e.useAPIClient(),{t:a}=E(),{message:i}=I.App.useApp(),p=e.useCurrentUserContext(),l=((S=(w=p==null?void 0:p.data)==null?void 0:w.data)==null?void 0:S.subPrefs)||{},m=l[n]||{},b=T=>u(this,null,function*(){var X;const R=yield c.resource("users").updateProfile({values:{subPrefs:v(f({},l),{[n]:{enable:T}})}});R.status===200&&i.success(a("Edited successfully")),p.mutate({data:f(f({},(X=p==null?void 0:p.data)==null?void 0:X.data),R.data.data[0])})});return r.jsxs("p",{children:[s,r.jsx(I.Switch,{checked:m.enable,onChange:b})]})};class ve extends e.Plugin{load(){return u(this,null,function*(){this.userSettingsManager.add("sub-manager",{title:N("Subscription management"),icon:"BellOutlined",Component:be})})}}class Ae extends e.Plugin{afterAdd(){return u(this,null,function*(){yield this.app.pm.add(le),yield this.app.pm.add(fe),yield this.app.pm.add(ve)})}}const Ie=()=>{var l;const{workflow:t}=g.useFlowContext(),[o,n]=e.parseCollectionName((l=t.config)==null?void 0:l.collection),s=e.useSchemaInitializerItem(),{insert:c}=e.useSchemaInitializer(),{getTemplateSchemaByMode:a}=e.useSchemaTemplateManager(),i=e.useRecordCollectionDataSourceItems("FormItem"),p=b=>u(this,[b],function*({item:m}){const w=m.template?yield a(m):null,S=e.createReadPrettyFormBlockSchema({actionInitializers:null,resource:n,collection:n,dataSource:o,template:w,settings:"blockSettings:details"});M.unset(S,["x-acl-action","x-acl-action-props"]);const[T]=Object.keys(S.properties);M.set(S.properties[T],"x-use-component-props","usePropsShowDetail"),c(S)});return r.jsx(e.SchemaInitializerItem,v(f({},s),{onClick:p,items:i}))};function Me(){var p;const t=e.usePlugin(g),{workflow:o}=g.useFlowContext(),n=g.useTrigger(),s=g.useContextNode(),c=g.useAvailableUpstreams(s),a=[(p=n.useInitializers)==null?void 0:p.call(n,o.config)].filter(Boolean),i=c.map(l=>{var b;const m=t.instructions.get(l.type);return(b=m==null?void 0:m.useInitializers)==null?void 0:b.call(m,l)}).filter(Boolean);return[...a,...i.length?[{name:"nodes",type:"subMenu",title:'{{t("Node result", { ns: "workflow" })}}',children:i}]:[]].filter(Boolean)}const ke=({app:t})=>{const n=t.schemaInitializerManager.get("page:addBlock").items;return new e.SchemaInitializer({name:"InitializerBlockMessage",title:"{{t('Add block')}}",wrap:e.gridRowColWrap,items:[{name:"messageCard",type:"itemGroup",title:C("Trigger data"),children:[{name:"detail",type:"item",title:'{{t("Details")}}',Component:Ie}]},{name:"dataBlocks",type:"itemGroup",title:C("Workflow Data blocks"),checkChildrenLength:!0,useChildren:Me},...n]})};class Pe extends e.Plugin{load(){return u(this,null,function*(){const o=ke({app:this.app});this.app.schemaInitializerManager.add(o)})}}function Te(t){const{value:o,onChange:n}=t,s=e.useAPIClient(),c=h.useCallback(p=>{},[]),{data:a,loading:i}=e.useRequest(()=>u(this,null,function*(){return yield De({srcId:o,onChange:n,apiClient:s})}));return{schemaData:a,loading:i,handleSchemaChange:c}}function De(s){return u(this,arguments,function*({srcId:t,onChange:o,apiClient:n}){const c=t!=null?t:x.uid(),a=Ne(c);if(t){const i=yield Fe({apiClient:n,srcId:t});if(i["x-uid"]===t)return i}else yield Be({apiClient:n,schema:a}),o(c);return a})}function Ne(t){return{type:"void",name:t,"x-uid":t,"x-component":"Grid","x-initializer":"InitializerBlockMessage",properties:{}}}function Fe(n){return u(this,arguments,function*({apiClient:t,srcId:o}){var a;const{data:s}=yield t.request({url:`uiSchemas:getJsonSchema/${o}`});return(a=s.data)!=null?a:{}})}function Be(n){return u(this,arguments,function*({apiClient:t,schema:o}){yield t.resource("uiSchemas").insert({values:o})})}const Ee=t=>{const{schemaData:o,loading:n,handleSchemaChange:s}=Te(t);return n?r.jsx(I.Spin,{}):r.jsx(e.SchemaComponent,{schema:o,scope:{usePropsShowDetail:()=>({})},memoized:!0,onChange:s})},Ve={actionStyle:e.css`
1
+ (function(d,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@tachybase/client"),require("@tachybase/utils/client"),require("react/jsx-runtime"),require("react"),require("@tachybase/schema"),require("antd"),require("@tachybase/components"),require("@tachybase/module-workflow/client"),require("lodash"),require("@ant-design/icons"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/utils/client","react/jsx-runtime","react","@tachybase/schema","antd","@tachybase/components","@tachybase/module-workflow/client","lodash","@ant-design/icons","react-router-dom"],e):(d=typeof globalThis!="undefined"?globalThis:d||self,e(d["@tachybase/module-message"]={},d["@tachybase/client"],d["@tachybase/utils"],d.jsxRuntime,d.react,d["@tachybase/schema"],d.antd,d["@tachybase/components"],d["@tachybase/module-workflow"],d.lodash,d["@ant-design/icons"],d["react-router-dom"]))})(this,function(d,e,x,r,h,A,I,P,g,M,Q,ee){"use strict";var xt=Object.defineProperty,gt=Object.defineProperties;var ht=Object.getOwnPropertyDescriptors;var X=Object.getOwnPropertySymbols;var yt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable;var Z=(d,e,x)=>e in d?xt(d,e,{enumerable:!0,configurable:!0,writable:!0,value:x}):d[e]=x,f=(d,e)=>{for(var x in e||(e={}))yt.call(e,x)&&Z(d,x,e[x]);if(X)for(var x of X(e))Ct.call(e,x)&&Z(d,x,e[x]);return d},v=(d,e)=>gt(d,ht(e));var u=(d,e,x)=>new Promise((r,h)=>{var A=g=>{try{P(x.next(g))}catch(M){h(M)}},I=g=>{try{P(x.throw(g))}catch(M){h(M)}},P=g=>g.done?r(g.value):Promise.resolve(g.value).then(A,I);P((x=x.apply(d,e)).next())});const L="message-instruction",y="message",te="messages",oe="messages-update-badge-count",ne="site-message",se="sms",re=({children:t})=>{const o=e.useApp(),n=e.useCompile(),s=e.usePlugin(D),a=h.useMemo(()=>Array.from(s.channels.getValues()),[s]).map(i=>{var p,l;return i.send||((l=(p=i.useAction)==null?void 0:p.call(i))==null?void 0:l.send)}).filter(Boolean);return h.useEffect(()=>{A.autorun(()=>{if(o.ws.connected){const i={type:"signIn",payload:{token:o.apiClient.auth.getToken()}};o.ws.send(JSON.stringify(i))}})},[]),h.useEffect(()=>{o.ws.on("message",i=>{const p=JSON.parse(i.data);if((p==null?void 0:p.type)===te){const l=p.payload.message,m=n(l.title),b=n(l.content),w={title:m,content:b};a.forEach(S=>S==null?void 0:S(w))}})},[]),r.jsx(r.Fragment,{children:t})};class B{}const E=()=>{const{i18n:t}=e.useApp();return{t:(n,s={})=>t.t(n,f({ns:[y,"core"]},s))}},C=t=>e.tval(t,{ns:[y,"core"]});function N(t){return e.i18n.t(t,{ns:[y,"core"]})}const z=ne;class ae extends B{constructor(){super(...arguments),this.name=z,this.title=N("In-App Notifications")}useAction(){const o=e.useApp();return{send:s=>{const{title:c,content:a}=s;o.notification.info({key:c,message:`${c}${a?":"+a:""}`,duration:10})}}}}class ie extends e.Plugin{load(){return u(this,null,function*(){this.app.pm.get(D).registerChannel(z,ae)})}}const K=se;class ce extends B{constructor(){super(...arguments),this.name=K,this.title=N("Text Message Alerts")}}class pe extends e.Plugin{load(){return u(this,null,function*(){this.app.pm.get(D).registerChannel(K,ce)})}}class le extends e.Plugin{afterAdd(){return u(this,null,function*(){yield this.app.pm.add(ie),yield this.app.pm.add(pe)})}load(){return u(this,null,function*(){this.app.use(re)})}}const _="messages_providers",V={dumpRules:{group:"third-party"},name:_,shared:!0,fields:[{type:"string",name:"id",primaryKey:!0,interface:"input",uiSchema:{title:'{{t("ID")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Title")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"type",interface:"select",uiSchema:{title:`{{t("Provider type", { ns: "${y}" })}}`,type:"string","x-component":"Select",required:!0,enum:[{label:`{{t("Aliyun SMS", { ns: "${y}" })}}`,value:"sms-aliyun"},{label:`{{t("Tencent SMS", { ns: "${y}" })}}`,value:"sms-tencent"}]}},{type:"jsonb",name:"options"},{type:"radio",name:"default",interface:"checkbox",uiSchema:{title:'{{t("Default")}}',type:"boolean","x-component":"Checkbox"}}]},de={type:"void",title:'{{ t("Edit") }}',"x-action":"update","x-component":"Action.Link","x-component-props":{openMode:e.OpenMode.DRAWER_MODE,icon:"EditOutlined"},"x-decorator":"ACLActionProvider",properties:{drawer:{type:"void",title:'{{ t("Edit record") }}',"x-component":"Action.Container","x-component-props":{className:"tb-action-popup"},properties:{card:{type:"void","x-acl-action-props":{skipScopeCheck:!1},"x-acl-action":`${_}:update`,"x-decorator":"FormBlockProvider","x-use-decorator-props":"useEditFormBlockDecoratorProps","x-decorator-props":{action:"get",dataSource:"main",collection:V},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useEditFormBlockProps",properties:{actionBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-use-component-props":"useUpdateActionProps","x-component-props":{type:"primary"}}}},id:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":!0},title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":!0},options:{type:"object","x-component":"ProviderOptions"},default:{"x-component":"CollectionField","x-decorator":"FormItem"}}}}}}}}},me={type:"void",name:"NotificationProviders","x-component":I.Card,"x-component-props":{bordered:!1},properties:{tableCard:{type:"void",name:"tableCard","x-decorator":"TableBlockProvider","x-decorator-props":{collection:V,action:"list",params:{pageSize:50,sort:["-default","id"],appends:[]}},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-designer":"Filter.Action.Designer","x-component":"Filter.Action","x-use-component-props":"useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-action":"refresh","x-component":"Action","x-use-component-props":"useRefreshActionProps","x-designer":"Action.Designer","x-component-props":{icon:"ReloadOutlined"},"x-align":"right"},delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action","x-use-component-props":"useBulkDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(t){const o=e.useActionContext();return e.useRequest(()=>Promise.resolve({data:{name:`s_${A.uid()}`}}),v(f({},t),{refreshDeps:[o.visible]}))}},title:'{{t("Add new")}}',properties:{actionBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},create:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useCreateDatabaseConnectionAction","x-component-props":{type:"primary"}}}},id:{"x-component":"CollectionField","x-decorator":"FormItem",description:'{{t("Identifier for program usage. Support letters, numbers and underscores, must start with an letter.")}}'},title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"ProviderOptions"},default:{"x-component":"CollectionField","x-decorator":"FormItem"}}}}}}},table:{type:"array","x-uid":"input","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-use-decorator-props":"useTableBlockDecoratorProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{id:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{id:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},title:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},type:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{type:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},default:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{default:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"TableV2.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:de,delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}}}}}}}}}}}},ue={type:"object",properties:{accessKeyId:{title:`{{t("Access Key ID", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},accessKeySecret:{title:`{{t("Access Key Secret", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password"},endpoint:{title:`{{t("Endpoint", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},sign:{title:`{{t("Sign", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},template:{title:`{{t("Template code", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"}}},xe={type:"object",properties:{secretId:{title:`{{t("Secret Id", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},secretKey:{title:`{{t("Secret Key", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password"},region:{title:`{{t("Region", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},endpoint:{title:`{{t("Endpoint", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",default:"sms.tencentcloudapi.com"},SignName:{title:`{{t("Sign name", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},SmsSdkAppId:{title:`{{t("Sms sdk app id", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"},TemplateId:{title:`{{t("Template Id", { ns: "${y}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"}}},O=new x.Registry,$="sms-aliyun",ge="sms-tencent";O.register($,ue),O.register(ge,xe);const he=$,ye=A.observer(t=>{const o=A.useForm(),n=A.useField(),[s,c]=h.useState(new A.Schema({}));return h.useEffect(()=>{o.clearFormGraph("options.*"),c(new A.Schema(O.get(o.values.type)||{}))},[o.values.type]),r.jsx(P.FormLayout,{layout:"vertical",children:r.jsx(A.RecursionField,{basePath:n.address,onlyRenderProperties:!0,schema:s},o.values.type||he)})},{displayName:"ProviderOptions"}),Ce=()=>r.jsx(e.ExtendCollectionsProvider,{collections:[V],children:r.jsx(e.SchemaComponent,{schema:me,components:{ProviderOptions:ye}})}),Se="notification-providers";class fe extends e.Plugin{load(){return u(this,null,function*(){this.app.systemSettingsManager.add(`system-services.${Se}`,{icon:"CheckCircleOutlined",title:`{{t("Notification providers", { ns: "${y}" })}}`,aclSnippet:"pm.message.providers",Component:Ce})})}}const be=()=>{const t=e.usePlugin(D),o=Array.from(t.channels.getValues());return r.jsx(I.Card,{children:o.map(n=>r.jsx(we,{channel:n},n.name))})},we=t=>{var w,S;const{channel:o}=t,{name:n,title:s}=o,c=e.useAPIClient(),{t:a}=E(),{message:i}=I.App.useApp(),p=e.useCurrentUserContext(),l=((S=(w=p==null?void 0:p.data)==null?void 0:w.data)==null?void 0:S.subPrefs)||{},m=l[n]||{},b=T=>u(null,null,function*(){var W;const Y=yield c.resource("users").updateProfile({values:{subPrefs:v(f({},l),{[n]:{enable:T}})}});Y.status===200&&i.success(a("Edited successfully")),p.mutate({data:f(f({},(W=p==null?void 0:p.data)==null?void 0:W.data),Y.data.data[0])})});return r.jsxs("p",{children:[s,r.jsx(I.Switch,{checked:m.enable,onChange:b})]})};class ve extends e.Plugin{load(){return u(this,null,function*(){this.userSettingsManager.add("sub-manager",{title:N("Subscription management"),icon:"BellOutlined",Component:be})})}}class Ae extends e.Plugin{afterAdd(){return u(this,null,function*(){yield this.app.pm.add(le),yield this.app.pm.add(fe),yield this.app.pm.add(ve)})}}const Ie=()=>{var l;const{workflow:t}=g.useFlowContext(),[o,n]=e.parseCollectionName((l=t.config)==null?void 0:l.collection),s=e.useSchemaInitializerItem(),{insert:c}=e.useSchemaInitializer(),{getTemplateSchemaByMode:a}=e.useSchemaTemplateManager(),i=e.useRecordCollectionDataSourceItems("FormItem"),p=b=>u(null,[b],function*({item:m}){const w=m.template?yield a(m):null,S=e.createReadPrettyFormBlockSchema({actionInitializers:null,resource:n,collection:n,dataSource:o,template:w,settings:"blockSettings:details"});M.unset(S,["x-acl-action","x-acl-action-props"]);const[T]=Object.keys(S.properties);M.set(S.properties[T],"x-use-component-props","usePropsShowDetail"),c(S)});return r.jsx(e.SchemaInitializerItem,v(f({},s),{onClick:p,items:i}))};function Me(){var p;const t=e.usePlugin(g),{workflow:o}=g.useFlowContext(),n=g.useTrigger(),s=g.useContextNode(),c=g.useAvailableUpstreams(s),a=[(p=n.useInitializers)==null?void 0:p.call(n,o.config)].filter(Boolean),i=c.map(l=>{var b;const m=t.instructions.get(l.type);return(b=m==null?void 0:m.useInitializers)==null?void 0:b.call(m,l)}).filter(Boolean);return[...a,...i.length?[{name:"nodes",type:"subMenu",title:'{{t("Node result", { ns: "workflow" })}}',children:i}]:[]].filter(Boolean)}const ke=({app:t})=>{const n=t.schemaInitializerManager.get("page:addBlock").items;return new e.SchemaInitializer({name:"InitializerBlockMessage",title:"{{t('Add block')}}",wrap:e.gridRowColWrap,items:[{name:"messageCard",type:"itemGroup",title:C("Trigger data"),children:[{name:"detail",type:"item",title:'{{t("Details")}}',Component:Ie}]},{name:"dataBlocks",type:"itemGroup",title:C("Workflow Data blocks"),checkChildrenLength:!0,useChildren:Me},...n]})};class Pe extends e.Plugin{load(){return u(this,null,function*(){const o=ke({app:this.app});this.app.schemaInitializerManager.add(o)})}}function Te(t){const{value:o,onChange:n}=t,s=e.useAPIClient(),c=h.useCallback(p=>{},[]),{data:a,loading:i}=e.useRequest(()=>u(null,null,function*(){return yield De({srcId:o,onChange:n,apiClient:s})}));return{schemaData:a,loading:i,handleSchemaChange:c}}function De(s){return u(this,arguments,function*({srcId:t,onChange:o,apiClient:n}){const c=t!=null?t:x.uid(),a=Ne(c);if(t){const i=yield Fe({apiClient:n,srcId:t});if(i["x-uid"]===t)return i}else yield Be({apiClient:n,schema:a}),o(c);return a})}function Ne(t){return{type:"void",name:t,"x-uid":t,"x-component":"Grid","x-initializer":"InitializerBlockMessage",properties:{}}}function Fe(n){return u(this,arguments,function*({apiClient:t,srcId:o}){var a;const{data:s}=yield t.request({url:`uiSchemas:getJsonSchema/${o}`});return(a=s.data)!=null?a:{}})}function Be(n){return u(this,arguments,function*({apiClient:t,schema:o}){yield t.resource("uiSchemas").insert({values:o})})}const Ee=t=>{const{schemaData:o,loading:n,handleSchemaChange:s}=Te(t);return n?r.jsx(I.Spin,{}):r.jsx(e.SchemaComponent,{schema:o,scope:{usePropsShowDetail:()=>({})},memoized:!0,onChange:s})},Ve={actionStyle:e.css`
2
2
  .ant-drawer-body {
3
3
  background: var(--tb-box-bg);
4
4
  }
@@ -19,7 +19,7 @@
19
19
  > .ant-space-item:nth-child(2) {
20
20
  flex-grow: 1;
21
21
  }
22
- `};class Le extends g.Instruction{constructor(){super(...arguments),this.title=C("Site Messages"),this.type=L,this.group=g.BuiltinGroupType.EXTENDED,this.icon="SiteMessage",this.color="#1eca0a",this.description=C("In the workflow, notification messages can be viewed by the notified person in the notification center."),this.components={ArrayItems:P.ArrayItems,SelectNotifiedPerson:g.SelectNotifiedPerson,AdditionNotifiedPerson:g.AdditionNotifiedPerson,ConfigButtonMessage:g.ConfigButtonMessage,WorkflowVariableCodeMirror:g.WorkflowVariableCodeMirror,MessageDetail:q,ViewShowMessage:q},this.fieldset={notifiedPerson:{type:"array",title:C("The Notified Person"),required:!0,"x-decorator":"FormItem","x-component":"ArrayItems","x-component-props":{className:U.ArrayItemsStyle},items:{type:"void","x-component":"Space","x-component-props":{className:U.SpaceStyle},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},input:{type:"string","x-decorator":"FormItem","x-component":"SelectNotifiedPerson"},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}},properties:{add:{type:"void",title:C("Add Notified Person"),"x-component":"AdditionNotifiedPerson"}}},title:{type:"string",title:C("Title"),required:!0,"x-decorator":"FormItem","x-component":"WorkflowVariableCodeMirror","x-component-props":{changeOnSelect:!0,height:100,options:j()}},content:{type:"string",title:C("Content"),"x-decorator":"FormItem","x-component":"WorkflowVariableCodeMirror","x-component-props":{changeOnSelect:!0,options:j()}},showMessageDetail:{type:"void",title:C("Show message detail"),"x-decorator":"FormItem","x-component":"ConfigButtonMessage",properties:{showNoticeDetail:{type:"void","x-component":"ViewShowMessage"}}}}}useCurrentFormVariables(o,n){const s=e.useCompile(),{key:c}=o,{fieldNames:a}=n;return Object.entries(this.fieldset).map(([l,m])=>({[a.label]:s(m==null?void 0:m.title)||l,[a.value]:`${l}`}))}}function j(){return[{label:C("Message variables"),value:"$messageVariables",children:[{label:C("The Notified Person"),value:"notifiedPerson",children:[{label:'{{t("Nickname")}}',value:"nickname"}]}]}]}class ze extends e.Plugin{afterAdd(){return u(this,null,function*(){yield this.app.pm.add(Pe)})}load(){return u(this,null,function*(){this.pm.get(g).registerInstruction(L,Le)})}}const k=t=>`{{t("${t}", ${JSON.stringify({ns:[y,"core"]})})}}`,F="messages",Ke={dumpRules:"required",name:F,title:k("Site Messages"),sortable:!0,createdBy:!0,updatedBy:!0,logging:!0,fields:[{name:"id",type:"bigInt",autoIncrement:!0,primaryKey:!0,allowNull:!1,interface:"id"},{name:"createdAt",interface:"createdAt",type:"date",field:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{showTime:!0},"x-read-pretty":!0}},{name:"title",interface:"input",type:"string",allowNull:!1,unique:!1,uiSchema:{type:"string",title:k("Title"),"x-component":"Input",required:!0}},{name:"content",interface:"input",type:"string",allowNull:!1,unique:!1,uiSchema:{type:"string",title:k("Content"),"x-component":"Input",required:!0}},{name:"collectionName",interface:"input",type:"string"},{name:"dataKey",type:"string",interface:"input"},{name:"jsonContent",interface:"input",type:"jsonb",uiSchema:{type:"array",title:k("Content"),"x-component":"ShowJsonContent","x-component-props":{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}}},{type:"jsonb",name:"snapshot",defaultValue:{}},{name:"read",type:"boolean",interface:"checkbox",defaultValue:!1,description:k("Read"),uiSchema:{"x-component-props":{showUnchecked:!0},type:"boolean","x-component":"Checkbox",title:k("Read")}},{name:"userId",type:"bigInt",interface:"integer",isForeignKey:!0,uiSchema:{type:"number",title:"userId","x-component":"InputNumber","x-read-pretty":!0}},{name:"user",foreignKey:"userId",onDelete:"CASCADE",type:"belongsTo",interface:"m2o",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1,fieldNames:{label:"id",value:"id"}},title:k("User")},target:"users",targetKey:"id"},{name:"schema",type:"belongsTo",target:"uiSchemas",targetKey:"x-uid",foreignKey:"schemaName",constraints:!1}]},_e=t=>{const{collection:o,params:n={filter:{}},action:s="list",children:c}=t,a=e.useCollectionRecordData(),i={collection:o,resource:o,action:s,params:v(f({pageSize:20,sort:["-createdAt"]},n),{filter:a!=null&&a.id?f({dataKey:`${a.id}`},n.filter):f({},n.filter)}),rowKey:"id",showIndex:!0,dragSort:!1};return r.jsx(e.ExtendCollectionsProvider,{collections:[Ke],children:r.jsx(e.TableBlockProvider,v(f({name:o},i),{children:c}))})};function $e(t){const{onClick:o}=t,n=e.useAPIClient(),{refresh:s}=e.useDataBlockRequest(),c=e.useCollectionRecordData(),{id:a,read:i}=c,p=()=>u(this,null,function*(){o==null||o(),a&&!i&&(yield n.resource("messages").update({filter:{id:a},values:{read:!0}}),s())});return v(f({},t),{onClick:p})}const G=h.createContext(null),qe=G.Provider;function Ue(){return h.useContext(G)}function je(){const{snapshot:t}=Ue(),{form:o}=e.useFormBlockContext();return h.useEffect(()=>{o.setValues(t||{})},[o,t]),{form:o}}const Ge=t=>{const{record:o}=t,n=e.useSchemaComponentContext(),{schemaName:s}=o,[c,a]=h.useState({}),i={filterByTk:{}},{run:p}=e.useRequest({resource:o==null?void 0:o.collectionName,action:"get",params:i},{manual:!0,onSuccess(l){a(l.data||{})}});return h.useEffect(()=>{o!=null&&o.dataKey&&!Object.keys(c).length&&(i.filterByTk=o.dataKey,p())},[o]),(Object.keys(c).length||!o.dataKey)&&r.jsx(e.RecordProvider,{record:f({record:o},c),children:r.jsx(qe,{value:o,children:r.jsx(e.SchemaComponentContext.Provider,{value:v(f({},n),{designable:!1}),children:r.jsx(e.RemoteSchemaComponent,{uid:s,noForm:!0})})})})},He=t=>{const{record:o}=t;return{name:`view-${o.id}`,type:"void",title:'{{t("View", {"ns":["messages","client"]})}}',"x-action":"view","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-component-props":{openMode:"drawer"},"x-use-component-props":"usePropsCheckLink",properties:{drawer:{type:"void",title:'{{t("View record", {"ns":["messages","client"]})}}',"x-component":"Action.Drawer","x-component-props":{className:"tb-action-popup"},properties:{checkContent:{type:"void","x-component":"ViewCheckContent","x-component-props":{record:o}}}}}}},Je=()=>{const t=e.useCollectionRecordData(),o=He({record:t});return r.jsx(e.SchemaComponent,{schema:o,components:{ViewCheckContent:Ge},scope:{usePropsCheckLink:$e,usePropsShowDetail:je}})},Ye=e.createStyles(({css:t})=>({columnShowJSON:t`
22
+ `};class Le extends g.Instruction{constructor(){super(...arguments),this.title=C("Site Messages"),this.type=L,this.group=g.BuiltinGroupType.EXTENDED,this.icon="SiteMessage",this.color="#1eca0a",this.description=C("In the workflow, notification messages can be viewed by the notified person in the notification center."),this.components={ArrayItems:P.ArrayItems,SelectNotifiedPerson:g.SelectNotifiedPerson,AdditionNotifiedPerson:g.AdditionNotifiedPerson,ConfigButtonMessage:g.ConfigButtonMessage,WorkflowVariableCodeMirror:g.WorkflowVariableCodeMirror,MessageDetail:q,ViewShowMessage:q},this.fieldset={notifiedPerson:{type:"array",title:C("The Notified Person"),required:!0,"x-decorator":"FormItem","x-component":"ArrayItems","x-component-props":{className:U.ArrayItemsStyle},items:{type:"void","x-component":"Space","x-component-props":{className:U.SpaceStyle},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},input:{type:"string","x-decorator":"FormItem","x-component":"SelectNotifiedPerson"},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}},properties:{add:{type:"void",title:C("Add Notified Person"),"x-component":"AdditionNotifiedPerson"}}},title:{type:"string",title:C("Title"),required:!0,"x-decorator":"FormItem","x-component":"WorkflowVariableCodeMirror","x-component-props":{changeOnSelect:!0,height:100,options:j()}},content:{type:"string",title:C("Content"),"x-decorator":"FormItem","x-component":"WorkflowVariableCodeMirror","x-component-props":{changeOnSelect:!0,options:j()}},showMessageDetail:{type:"void",title:C("Show message detail"),"x-decorator":"FormItem","x-component":"ConfigButtonMessage",properties:{showNoticeDetail:{type:"void","x-component":"ViewShowMessage"}}}}}useCurrentFormVariables(o,n){const s=e.useCompile(),{key:c}=o,{fieldNames:a}=n;return Object.entries(this.fieldset).map(([l,m])=>({[a.label]:s(m==null?void 0:m.title)||l,[a.value]:`${l}`}))}}function j(){return[{label:C("Message variables"),value:"$messageVariables",children:[{label:C("The Notified Person"),value:"notifiedPerson",children:[{label:'{{t("Nickname")}}',value:"nickname"}]}]}]}class ze extends e.Plugin{afterAdd(){return u(this,null,function*(){yield this.app.pm.add(Pe)})}load(){return u(this,null,function*(){this.pm.get(g).registerInstruction(L,Le)})}}const k=t=>`{{t("${t}", ${JSON.stringify({ns:[y,"core"]})})}}`,F="messages",Ke={dumpRules:"required",name:F,title:k("Site Messages"),sortable:!0,createdBy:!0,updatedBy:!0,logging:!0,fields:[{name:"id",type:"bigInt",autoIncrement:!0,primaryKey:!0,allowNull:!1,interface:"id"},{name:"createdAt",interface:"createdAt",type:"date",field:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{showTime:!0},"x-read-pretty":!0}},{name:"title",interface:"input",type:"string",allowNull:!1,unique:!1,uiSchema:{type:"string",title:k("Title"),"x-component":"Input",required:!0}},{name:"content",interface:"input",type:"string",allowNull:!1,unique:!1,uiSchema:{type:"string",title:k("Content"),"x-component":"Input",required:!0}},{name:"collectionName",interface:"input",type:"string"},{name:"dataKey",type:"string",interface:"input"},{name:"jsonContent",interface:"input",type:"jsonb",uiSchema:{type:"array",title:k("Content"),"x-component":"ShowJsonContent","x-component-props":{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}}},{type:"jsonb",name:"snapshot",defaultValue:{}},{name:"read",type:"boolean",interface:"checkbox",defaultValue:!1,description:k("Read"),uiSchema:{"x-component-props":{showUnchecked:!0},type:"boolean","x-component":"Checkbox",title:k("Read")}},{name:"userId",type:"bigInt",interface:"integer",isForeignKey:!0,uiSchema:{type:"number",title:"userId","x-component":"InputNumber","x-read-pretty":!0}},{name:"user",foreignKey:"userId",onDelete:"CASCADE",type:"belongsTo",interface:"m2o",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1,fieldNames:{label:"id",value:"id"}},title:k("User")},target:"users",targetKey:"id"},{name:"schema",type:"belongsTo",target:"uiSchemas",targetKey:"x-uid",foreignKey:"schemaName",constraints:!1}]},_e=t=>{const{collection:o,params:n={filter:{}},action:s="list",children:c}=t,a=e.useCollectionRecordData(),i={collection:o,resource:o,action:s,params:v(f({pageSize:20,sort:["-createdAt"]},n),{filter:a!=null&&a.id?f({dataKey:`${a.id}`},n.filter):f({},n.filter)}),rowKey:"id",showIndex:!0,dragSort:!1};return r.jsx(e.ExtendCollectionsProvider,{collections:[Ke],children:r.jsx(e.TableBlockProvider,v(f({name:o},i),{children:c}))})};function $e(t){const{onClick:o}=t,n=e.useAPIClient(),{refresh:s}=e.useDataBlockRequest(),c=e.useCollectionRecordData(),{id:a,read:i}=c,p=()=>u(null,null,function*(){o==null||o(),a&&!i&&(yield n.resource("messages").update({filter:{id:a},values:{read:!0}}),s())});return v(f({},t),{onClick:p})}const G=h.createContext(null),qe=G.Provider;function Ue(){return h.useContext(G)}function je(){const{snapshot:t}=Ue(),{form:o}=e.useFormBlockContext();return h.useEffect(()=>{o.setValues(t||{})},[o,t]),{form:o}}const Ge=t=>{const{record:o}=t,n=e.useSchemaComponentContext(),{schemaName:s}=o,[c,a]=h.useState({}),i={filterByTk:{}},{run:p}=e.useRequest({resource:o==null?void 0:o.collectionName,action:"get",params:i},{manual:!0,onSuccess(l){a(l.data||{})}});return h.useEffect(()=>{o!=null&&o.dataKey&&!Object.keys(c).length&&(i.filterByTk=o.dataKey,p())},[o]),(Object.keys(c).length||!o.dataKey)&&r.jsx(e.RecordProvider,{record:f({record:o},c),children:r.jsx(qe,{value:o,children:r.jsx(e.SchemaComponentContext.Provider,{value:v(f({},n),{designable:!1}),children:r.jsx(e.RemoteSchemaComponent,{uid:s,noForm:!0})})})})},He=t=>{const{record:o}=t;return{name:`view-${o.id}`,type:"void",title:'{{t("View", {"ns":["messages","client"]})}}',"x-action":"view","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-component-props":{openMode:e.OpenMode.DRAWER_MODE},"x-use-component-props":"usePropsCheckLink",properties:{drawer:{type:"void",title:'{{t("View record", {"ns":["messages","client"]})}}',"x-component":"Action.Drawer","x-component-props":{className:"tb-action-popup"},properties:{checkContent:{type:"void","x-component":"ViewCheckContent","x-component-props":{record:o}}}}}}},Je=()=>{const t=e.useCollectionRecordData(),o=He({record:t});return r.jsx(e.SchemaComponent,{schema:o,components:{ViewCheckContent:Ge},scope:{usePropsCheckLink:$e,usePropsShowDetail:je}})},Re=e.createStyles(({css:t})=>({columnShowJSON:t`
23
23
  text-align: left;
24
24
  .json-item {
25
25
  display: flex;
@@ -41,4 +41,4 @@
41
41
  text-overflow: ellipsis;
42
42
  }
43
43
  }
44
- `})),Re=t=>{const{value:o}=t,n=e.useCollectionRecordData(),s=e.useCollectionManager(),c=e.useCompile(),{styles:a}=Ye(),{collectionName:i}=n,p=h.useMemo(()=>Object.entries(o||{}).map(([l,m])=>{var S,T;const b=s.getCollectionField(`${i}.${l}`),w=Object.prototype.toString.call(m)==="[object Object]"?m==null?void 0:m.name:m;return Ze(w)?{label:c(((S=b==null?void 0:b.uiSchema)==null?void 0:S.title)||l),value:Qe(w)}:{label:c(((T=b==null?void 0:b.uiSchema)==null?void 0:T.title)||l),value:w}}),[]);return r.jsx("div",{className:a.columnShowJSON,children:p.map(l=>r.jsxs("div",{className:"json-item",children:[r.jsxs("div",{className:"item-label",children:[`${l.label}:`,"   "]}),r.jsx("div",{className:"item-value",children:l.value})]},l.label))})},Xe=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;function Ze(t=""){return Xe.test(t)}function Qe(t){return x.dayjs.utc(t).local().format("YYYY-MM-DD HH:mm:ss")}const We=()=>{const{t}=E(),o=e.useCollectionRecordData(),{schemaName:n}=o||{},s=`${location.origin}/r/${n}`;return r.jsx("a",{href:s,target:"_blank",children:t("External link")})},et=t=>{const{record:o}=t;return{name:`delete-${o.id}`,type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-action-settings":{triggerWorkflows:[]},"x-decorator":"ACLActionProvider"}},tt=t=>{const o=e.useCollectionRecordData(),n=et({record:o});return r.jsx(e.SchemaComponent,{schema:n})},ot={type:"void",name:"schemaTableMessages",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:"var(--tb-spacing)"}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-component":"Filter.Action","x-component-props":{icon:"FilterOutlined"},"x-use-component-props":"useFilterActionProps","x-align":"left"},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-action":"refresh","x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"},"x-align":"right"},delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-component":"Action","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0},"x-use-component-props":"useBulkDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-acl-action":"messages:destroy","x-align":"right"},setHaveReaded:{type:"void",title:C("Mark as read"),"x-action":"customize:bulkUpdate","x-action-settings":{assignedValues:{read:!0},updateMode:"selected",onSuccess:{manualClose:!0,redirecting:!1,successMessage:'{{t("Updated successfully")}}'}},"x-component":"Action","x-use-component-props":"useCustomizeBulkUpdateActionProps","x-component-props":{icon:"InboxOutlined"},"x-align":"right"},setAllHaveReaded:{type:"void",title:C("Mark all as read"),"x-component":"Action","x-use-component-props":"useCustomizeBulkUpdateActionProps","x-component-props":{icon:"InboxOutlined"},"x-action":"customize:bulkUpdate","x-action-settings":{assignedValues:{read:!0},updateMode:"all",onSuccess:{manualClose:!0,redirecting:!1,successMessage:'{{t("Updated successfully")}}'}},"x-align":"right"}}},table:{type:"array","x-component":"TableV2","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},"x-use-component-props":"useTableBlockProps",properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-component-props":{width:50,align:"center"},"x-designer":"TableV2.ActionColumnDesigner","x-initializer":"MessageTable:configureItemActions",properties:{actionList:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"},properties:{checkLink:{"x-component":"ViewCheckLink"},delete:{"x-component":"ViewDeleteLink"}}}}},read:{type:"void",title:C("Read"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:20,align:"center"},properties:{read:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0,"x-component-props":{showUnchecked:!0}}}},createdAt:{type:"void",title:C("Created at"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:100,align:"center"},properties:{createdAt:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},title:{type:"void",title:C("Title"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:100,align:"center"},properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},content:{type:"void",title:C("Content"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:100,align:"center"},properties:{content:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},jsonContent:{type:"void",title:C("Summary"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:350,align:"center"},properties:{jsonContent:{type:"string","x-component":"ColumnShowJSON"}}},url:{type:"void",title:C("URL"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:100,align:"center"},properties:{url:{type:"string","x-component":"ColumnShowURL"}}}}}}},nt=()=>r.jsx(e.SchemaComponent,{schema:ot,components:{ViewCheckLink:Je,ViewDeleteLink:tt,ColumnShowURL:We,ColumnShowJSON:Re}}),H=t=>{const{params:o}=t||{};return{type:"void",name:"message-table","x-uid":"message-table","x-decorator":"Messages-ProviderCollectionMessages","x-decorator-props":{collection:F,action:"list",params:o},"x-component":"CardItem","x-acl-action":"messages:list","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:table",properties:{block:{type:"void","x-component":"Messages-ViewTableMessages"}}}},st=()=>{const t=e.useSchemaInitializerItem(),{insert:o}=e.useSchemaInitializer(),n=()=>{const s=H();o(s)};return r.jsx(e.SchemaInitializerItem,v(f({},t),{onClick:n}))},J="otherBlocks.messages",Y={name:"messageBlock",type:"item",title:e.tval("Site Messages"),icon:"BellOutlined",Component:"Messages-ViewBlockInitItem",collection:F,params:{appends:[]}};class rt extends e.Plugin{load(){return u(this,null,function*(){this.app.addComponents({"Messages-ViewBlockInitItem":st}),this.app.schemaInitializerManager.get("page:addBlock").add(J,Y),this.app.schemaInitializerManager.get("popup:common:addBlock").add(J,Y)})}}const at=t=>{const o=H(t);return r.jsx(e.SchemaComponent,{memoized:!0,schema:o})},it={type:"void",properties:{page:{type:"void","x-component":"Page",title:N("Site Messages"),properties:{messages:{type:"void","x-component":"ViewTableMessagesWrapper"}}}}},ct=()=>{const t=e.useSchemaComponentContext();return r.jsx(e.SchemaComponentContext.Provider,{value:v(f({},t),{designable:!1}),children:r.jsx(e.SchemaComponent,{schema:it,components:{ViewTableMessagesWrapper:at}})})};class pt extends e.Plugin{load(){return u(this,null,function*(){this.addRouters()})}addRouters(){this.app.router.add("app.messages",{path:"messages",Component:ct})}}function lt(t=0){var l;const o=e.useAPIClient(),n=e.useCurrentUserContext(),s=(l=n==null?void 0:n.data)==null?void 0:l.data,[c,a]=h.useState(t),i=()=>u(this,null,function*(){var w,S;const m=yield o.request({resource:F,action:"count",params:{filter:{read:!1,userId:s==null?void 0:s.id}}}),b=(S=(w=m==null?void 0:m.data)==null?void 0:w.data)!=null?S:0;a(b)}),p=h.useMemo(()=>M.debounce(i,300),[i]);return e.useNoticeSub(oe,()=>{p()}),h.useEffect(()=>{i()},[]),{badgeCount:c}}const dt=()=>{const t=ee.useNavigate(),{token:o}=e.useToken(),{t:n}=E(),{badgeCount:s}=lt(),c=()=>t("/admin/messages");return r.jsx(I.Tooltip,{title:n("Site Messages"),children:r.jsx(I.Badge,{count:s,overflowCount:99,offset:["-10%","40%"],size:"small",children:r.jsx(I.Button,{icon:r.jsx(W.BellOutlined,{style:{color:o.colorTextHeaderMenu}}),title:n("Site Messages"),onClick:c})})})},mt=t=>r.jsx(e.PinnedPluginListProvider,{items:{nl:{order:220,component:"NotificationLink",pin:!0,isPublic:!0,belongTo:"pinnedmenu"}},children:r.jsx(e.SchemaComponentOptions,{components:{NotificationLink:dt},children:t.children})});class ut extends e.Plugin{afterAdd(){return u(this,null,function*(){this.app.use(mt),yield this.app.pm.add(pt),yield this.app.pm.add(rt)})}load(){return u(this,null,function*(){this.app.addComponents({"Messages-ProviderCollectionMessages":_e,"Messages-ViewTableMessages":nt}),this.app.addScopes({useSubmit:()=>({run(){return u(this,null,function*(){})}})})})}}class D extends e.Plugin{constructor(){super(...arguments),this.channels=new x.Registry}registerChannel(o,n){if(typeof n=="function")this.channels.register(o,new n);else if(n instanceof B)this.channels.register(o,n);else throw new TypeError("invalid channel type to register")}afterAdd(){return u(this,null,function*(){yield this.app.pm.add(Ae),yield this.app.pm.add(ze),yield this.app.pm.add(ut)})}}d.default=D,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
44
+ `})),Ye=t=>{const{value:o}=t,n=e.useCollectionRecordData(),s=e.useCollectionManager(),c=e.useCompile(),{styles:a}=Re(),{collectionName:i}=n,p=h.useMemo(()=>Object.entries(o||{}).map(([l,m])=>{var S,T;const b=s.getCollectionField(`${i}.${l}`),w=Object.prototype.toString.call(m)==="[object Object]"?m==null?void 0:m.name:m;return Xe(w)?{label:c(((S=b==null?void 0:b.uiSchema)==null?void 0:S.title)||l),value:Ze(w)}:{label:c(((T=b==null?void 0:b.uiSchema)==null?void 0:T.title)||l),value:w}}),[]);return r.jsx("div",{className:a.columnShowJSON,children:p.map(l=>r.jsxs("div",{className:"json-item",children:[r.jsxs("div",{className:"item-label",children:[`${l.label}:`,"   "]}),r.jsx("div",{className:"item-value",children:l.value})]},l.label))})},We=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;function Xe(t=""){return We.test(t)}function Ze(t){return x.dayjs.utc(t).local().format("YYYY-MM-DD HH:mm:ss")}const Qe=()=>{const{t}=E(),o=e.useCollectionRecordData(),{schemaName:n}=o||{},s=`${location.origin}/r/${n}`;return r.jsx("a",{href:s,target:"_blank",children:t("External link")})},et=t=>{const{record:o}=t;return{name:`delete-${o.id}`,type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-action-settings":{triggerWorkflows:[]},"x-decorator":"ACLActionProvider"}},tt=t=>{const o=e.useCollectionRecordData(),n=et({record:o});return r.jsx(e.SchemaComponent,{schema:n})},ot={type:"void",name:"schemaTableMessages",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:"var(--tb-spacing)"}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-component":"Filter.Action","x-component-props":{icon:"FilterOutlined"},"x-use-component-props":"useFilterActionProps","x-align":"left"},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-action":"refresh","x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"},"x-align":"right"},delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-component":"Action","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0},"x-use-component-props":"useBulkDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-acl-action":"messages:destroy","x-align":"right"},setHaveReaded:{type:"void",title:C("Mark as read"),"x-action":"customize:bulkUpdate","x-action-settings":{assignedValues:{read:!0},updateMode:"selected",onSuccess:{manualClose:!0,redirecting:!1,successMessage:'{{t("Updated successfully")}}'}},"x-component":"Action","x-use-component-props":"useCustomizeBulkUpdateActionProps","x-component-props":{icon:"InboxOutlined"},"x-align":"right"},setAllHaveReaded:{type:"void",title:C("Mark all as read"),"x-component":"Action","x-use-component-props":"useCustomizeBulkUpdateActionProps","x-component-props":{icon:"InboxOutlined"},"x-action":"customize:bulkUpdate","x-action-settings":{assignedValues:{read:!0},updateMode:"all",onSuccess:{manualClose:!0,redirecting:!1,successMessage:'{{t("Updated successfully")}}'}},"x-align":"right"}}},table:{type:"array","x-component":"TableV2","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},"x-use-component-props":"useTableBlockProps",properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-component-props":{width:50,align:"center"},"x-designer":"TableV2.ActionColumnDesigner","x-initializer":"MessageTable:configureItemActions",properties:{actionList:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"},properties:{checkLink:{"x-component":"ViewCheckLink"},delete:{"x-component":"ViewDeleteLink"}}}}},read:{type:"void",title:C("Read"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:20,align:"center"},properties:{read:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0,"x-component-props":{showUnchecked:!0}}}},createdAt:{type:"void",title:C("Created at"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:100,align:"center"},properties:{createdAt:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},title:{type:"void",title:C("Title"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:100,align:"center"},properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},content:{type:"void",title:C("Content"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:100,align:"center"},properties:{content:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},jsonContent:{type:"void",title:C("Summary"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:350,align:"center"},properties:{jsonContent:{type:"string","x-component":"ColumnShowJSON"}}},url:{type:"void",title:C("URL"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column","x-component-props":{width:100,align:"center"},properties:{url:{type:"string","x-component":"ColumnShowURL"}}}}}}},nt=()=>r.jsx(e.SchemaComponent,{schema:ot,components:{ViewCheckLink:Je,ViewDeleteLink:tt,ColumnShowURL:Qe,ColumnShowJSON:Ye}}),H=t=>{const{params:o}=t||{};return{type:"void",name:"message-table","x-uid":"message-table","x-decorator":"Messages-ProviderCollectionMessages","x-decorator-props":{collection:F,action:"list",params:o},"x-component":"CardItem","x-acl-action":"messages:list","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:table",properties:{block:{type:"void","x-component":"Messages-ViewTableMessages"}}}},st=()=>{const t=e.useSchemaInitializerItem(),{insert:o}=e.useSchemaInitializer(),n=()=>{const s=H();o(s)};return r.jsx(e.SchemaInitializerItem,v(f({},t),{onClick:n}))},J="otherBlocks.messages",R={name:"messageBlock",type:"item",title:e.tval("Site Messages"),icon:"BellOutlined",Component:"Messages-ViewBlockInitItem",collection:F,params:{appends:[]}};class rt extends e.Plugin{load(){return u(this,null,function*(){this.app.addComponents({"Messages-ViewBlockInitItem":st}),this.app.schemaInitializerManager.get("page:addBlock").add(J,R),this.app.schemaInitializerManager.get("popup:common:addBlock").add(J,R)})}}const at=t=>{const o=H(t);return r.jsx(e.SchemaComponent,{memoized:!0,schema:o})},it={type:"void",properties:{page:{type:"void","x-component":"Page",title:N("Site Messages"),properties:{messages:{type:"void","x-component":"ViewTableMessagesWrapper"}}}}},ct=()=>{const t=e.useSchemaComponentContext();return r.jsx(e.SchemaComponentContext.Provider,{value:v(f({},t),{designable:!1}),children:r.jsx(e.SchemaComponent,{schema:it,components:{ViewTableMessagesWrapper:at}})})};class pt extends e.Plugin{load(){return u(this,null,function*(){this.addRouters()})}addRouters(){this.app.router.add("app.messages",{path:"messages",Component:ct})}}function lt(t=0){var l;const o=e.useAPIClient(),n=e.useCurrentUserContext(),s=(l=n==null?void 0:n.data)==null?void 0:l.data,[c,a]=h.useState(t),i=()=>u(null,null,function*(){var w,S;const m=yield o.request({resource:F,action:"count",params:{filter:{read:!1,userId:s==null?void 0:s.id}}}),b=(S=(w=m==null?void 0:m.data)==null?void 0:w.data)!=null?S:0;a(b)}),p=h.useMemo(()=>M.debounce(i,300),[i]);return e.useNoticeSub(oe,()=>{p()}),h.useEffect(()=>{i()},[]),{badgeCount:c}}const dt=()=>{const t=ee.useNavigate(),{token:o}=e.useToken(),{t:n}=E(),{badgeCount:s}=lt(),c=()=>t("/admin/messages");return r.jsx(I.Tooltip,{title:n("Site Messages"),children:r.jsx(I.Badge,{count:s,overflowCount:99,offset:["-10%","40%"],size:"small",children:r.jsx(I.Button,{icon:r.jsx(Q.BellOutlined,{style:{color:o.colorTextHeaderMenu}}),title:n("Site Messages"),onClick:c})})})},mt=t=>r.jsx(e.PinnedPluginListProvider,{items:{nl:{order:220,component:"NotificationLink",pin:!0,isPublic:!0,belongTo:"pinnedmenu"}},children:r.jsx(e.SchemaComponentOptions,{components:{NotificationLink:dt},children:t.children})});class ut extends e.Plugin{afterAdd(){return u(this,null,function*(){this.app.use(mt),yield this.app.pm.add(pt),yield this.app.pm.add(rt)})}load(){return u(this,null,function*(){this.app.addComponents({"Messages-ProviderCollectionMessages":_e,"Messages-ViewTableMessages":nt}),this.app.addScopes({useSubmit:()=>({run(){return u(this,null,function*(){})}})})})}}class D extends e.Plugin{constructor(){super(...arguments),this.channels=new x.Registry}registerChannel(o,n){if(typeof n=="function")this.channels.register(o,new n);else if(n instanceof B)this.channels.register(o,n);else throw new TypeError("invalid channel type to register")}afterAdd(){return u(this,null,function*(){yield this.app.pm.add(Ae),yield this.app.pm.add(ze),yield this.app.pm.add(ut)})}}d.default=D,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,3 +1,4 @@
1
+ import { OpenMode } from '@tachybase/client';
1
2
  export declare const getSchemaCheckLink: (params: any) => {
2
3
  name: string;
3
4
  type: string;
@@ -6,7 +7,7 @@ export declare const getSchemaCheckLink: (params: any) => {
6
7
  'x-decorator': string;
7
8
  'x-component': string;
8
9
  'x-component-props': {
9
- openMode: string;
10
+ openMode: OpenMode;
10
11
  };
11
12
  'x-use-component-props': string;
12
13
  properties: {
@@ -1,16 +1,16 @@
1
1
  module.exports = {
2
- "@tachybase/client": "1.3.16",
3
- "@tachybase/utils": "1.3.16",
4
- "@tachybase/database": "1.3.16",
5
- "@tachybase/server": "1.3.16",
6
- "@tachybase/module-workflow": "1.3.16",
7
- "@tachybase/components": "1.3.16",
2
+ "@tachybase/client": "1.3.18",
3
+ "@tachybase/utils": "1.3.18",
4
+ "@tachybase/database": "1.3.18",
5
+ "@tachybase/server": "1.3.18",
6
+ "@tachybase/module-workflow": "1.3.18",
7
+ "@tachybase/components": "1.3.18",
8
8
  "react": "18.3.1",
9
- "@tachybase/actions": "1.3.16",
10
- "@tachybase/schema": "1.3.16",
9
+ "@tachybase/actions": "1.3.18",
10
+ "@tachybase/schema": "1.3.18",
11
11
  "antd": "5.22.5",
12
12
  "lodash": "4.17.21",
13
13
  "@ant-design/icons": "5.3.7",
14
14
  "react-router-dom": "6.28.1",
15
- "ahooks": "3.8.4"
15
+ "ahooks": "3.9.0"
16
16
  };
package/dist/index.js CHANGED
@@ -26,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var src_exports = {};
30
- __export(src_exports, {
29
+ var index_exports = {};
30
+ __export(index_exports, {
31
31
  default: () => import_server.default
32
32
  });
33
- module.exports = __toCommonJS(src_exports);
34
- __reExport(src_exports, require("./server"), module.exports);
33
+ module.exports = __toCommonJS(index_exports);
34
+ __reExport(index_exports, require("./server"), module.exports);
35
35
  var import_server = __toESM(require("./server"));
36
36
  // Annotate the CommonJS export names for ESM import in node:
37
37
  0 && (module.exports = {