@tachybase/module-file 1.3.18 → 1.3.20

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.
Files changed (147) hide show
  1. package/dist/client/index.js +1 -1
  2. package/dist/externalVersion.js +8 -8
  3. package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +1 -1
  4. package/dist/node_modules/@aws-sdk/client-s3/dist-es/S3.js +10 -0
  5. package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketMetadataConfigurationCommand.js +31 -0
  6. package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetadataConfigurationCommand.js +26 -0
  7. package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetadataConfigurationCommand.js +28 -0
  8. package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/ListPartsCommand.js +1 -1
  9. package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/UpdateBucketMetadataInventoryTableConfigurationCommand.js +31 -0
  10. package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/UpdateBucketMetadataJournalTableConfigurationCommand.js +31 -0
  11. package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/index.js +5 -0
  12. package/dist/node_modules/@aws-sdk/client-s3/dist-es/models/models_0.js +16 -24
  13. package/dist/node_modules/@aws-sdk/client-s3/dist-es/models/models_1.js +24 -0
  14. package/dist/node_modules/@aws-sdk/client-s3/dist-es/protocols/Aws_restXml.js +325 -3
  15. package/dist/node_modules/@aws-sdk/client-s3/dist-types/S3.d.ts +35 -0
  16. package/dist/node_modules/@aws-sdk/client-s3/dist-types/S3Client.d.ts +7 -2
  17. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/AbortMultipartUploadCommand.d.ts +17 -22
  18. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/CompleteMultipartUploadCommand.d.ts +46 -57
  19. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/CopyObjectCommand.d.ts +95 -106
  20. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateBucketCommand.d.ts +70 -82
  21. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateBucketMetadataConfigurationCommand.d.ts +182 -0
  22. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateBucketMetadataTableConfigurationCommand.d.ts +25 -12
  23. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateMultipartUploadCommand.d.ts +88 -113
  24. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateSessionCommand.d.ts +45 -50
  25. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketAnalyticsConfigurationCommand.d.ts +7 -9
  26. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketCommand.d.ts +10 -12
  27. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketCorsCommand.d.ts +4 -5
  28. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketEncryptionCommand.d.ts +16 -18
  29. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketInventoryConfigurationCommand.d.ts +4 -6
  30. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketLifecycleCommand.d.ts +23 -28
  31. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketMetadataConfigurationCommand.d.ts +114 -0
  32. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketMetadataTableConfigurationCommand.d.ts +26 -8
  33. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketMetricsConfigurationCommand.d.ts +9 -12
  34. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketOwnershipControlsCommand.d.ts +5 -6
  35. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketPolicyCommand.d.ts +20 -23
  36. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketReplicationCommand.d.ts +5 -7
  37. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketTaggingCommand.d.ts +2 -3
  38. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketWebsiteCommand.d.ts +9 -10
  39. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteObjectCommand.d.ts +37 -23
  40. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteObjectTaggingCommand.d.ts +7 -7
  41. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteObjectsCommand.d.ts +37 -44
  42. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeletePublicAccessBlockCommand.d.ts +6 -6
  43. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketAccelerateConfigurationCommand.d.ts +14 -17
  44. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketAclCommand.d.ts +9 -11
  45. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketAnalyticsConfigurationCommand.d.ts +8 -11
  46. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketCorsCommand.d.ts +4 -6
  47. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketEncryptionCommand.d.ts +16 -19
  48. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketInventoryConfigurationCommand.d.ts +6 -8
  49. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketLifecycleConfigurationCommand.d.ts +28 -37
  50. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketLocationCommand.d.ts +4 -5
  51. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketLoggingCommand.d.ts +2 -2
  52. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketMetadataConfigurationCommand.d.ts +146 -0
  53. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketMetadataTableConfigurationCommand.d.ts +25 -8
  54. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketMetricsConfigurationCommand.d.ts +10 -11
  55. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketNotificationConfigurationCommand.d.ts +7 -8
  56. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketOwnershipControlsCommand.d.ts +9 -8
  57. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketPolicyCommand.d.ts +24 -29
  58. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketPolicyStatusCommand.d.ts +5 -6
  59. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketReplicationCommand.d.ts +11 -12
  60. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketRequestPaymentCommand.d.ts +2 -3
  61. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketTaggingCommand.d.ts +2 -3
  62. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketVersioningCommand.d.ts +3 -3
  63. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketWebsiteCommand.d.ts +6 -7
  64. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectAclCommand.d.ts +9 -11
  65. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectAttributesCommand.d.ts +55 -70
  66. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectCommand.d.ts +66 -81
  67. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectLegalHoldCommand.d.ts +1 -2
  68. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectLockConfigurationCommand.d.ts +3 -3
  69. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectRetentionCommand.d.ts +1 -2
  70. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectTaggingCommand.d.ts +8 -10
  71. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectTorrentCommand.d.ts +4 -5
  72. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetPublicAccessBlockCommand.d.ts +10 -12
  73. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/HeadBucketCommand.d.ts +33 -35
  74. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/HeadObjectCommand.d.ts +50 -62
  75. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketAnalyticsConfigurationsCommand.d.ts +14 -17
  76. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketInventoryConfigurationsCommand.d.ts +12 -15
  77. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketMetricsConfigurationsCommand.d.ts +15 -18
  78. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketsCommand.d.ts +10 -9
  79. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListDirectoryBucketsCommand.d.ts +9 -9
  80. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListMultipartUploadsCommand.d.ts +41 -49
  81. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListObjectVersionsCommand.d.ts +7 -9
  82. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListObjectsCommand.d.ts +8 -7
  83. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListObjectsV2Command.d.ts +28 -31
  84. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListPartsCommand.d.ts +21 -24
  85. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketAccelerateConfigurationCommand.d.ts +14 -18
  86. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketAclCommand.d.ts +51 -62
  87. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketAnalyticsConfigurationCommand.d.ts +23 -25
  88. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketCorsCommand.d.ts +23 -27
  89. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketEncryptionCommand.d.ts +40 -48
  90. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketIntelligentTieringConfigurationCommand.d.ts +11 -12
  91. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketInventoryConfigurationCommand.d.ts +33 -37
  92. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketLifecycleConfigurationCommand.d.ts +51 -60
  93. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketLoggingCommand.d.ts +26 -33
  94. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketMetricsConfigurationCommand.d.ts +12 -14
  95. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketNotificationConfigurationCommand.d.ts +29 -35
  96. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketOwnershipControlsCommand.d.ts +4 -6
  97. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketPolicyCommand.d.ts +24 -29
  98. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketReplicationCommand.d.ts +31 -38
  99. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketRequestPaymentCommand.d.ts +4 -5
  100. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketTaggingCommand.d.ts +21 -27
  101. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketVersioningCommand.d.ts +20 -23
  102. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketWebsiteCommand.d.ts +19 -18
  103. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectAclCommand.d.ts +53 -61
  104. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectCommand.d.ts +56 -66
  105. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectLegalHoldCommand.d.ts +1 -3
  106. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectLockConfigurationCommand.d.ts +10 -11
  107. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectRetentionCommand.d.ts +4 -4
  108. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectTaggingCommand.d.ts +18 -24
  109. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutPublicAccessBlockCommand.d.ts +10 -12
  110. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/RenameObjectCommand.d.ts +34 -40
  111. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/RestoreObjectCommand.d.ts +76 -85
  112. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/SelectObjectContentCommand.d.ts +50 -59
  113. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/UpdateBucketMetadataInventoryTableConfigurationCommand.d.ts +161 -0
  114. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/UpdateBucketMetadataJournalTableConfigurationCommand.d.ts +113 -0
  115. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/UploadPartCommand.d.ts +64 -74
  116. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/UploadPartCopyCommand.d.ts +80 -96
  117. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/WriteGetObjectResponseCommand.d.ts +29 -33
  118. package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/index.d.ts +5 -0
  119. package/dist/node_modules/@aws-sdk/client-s3/dist-types/models/models_0.d.ts +2688 -3603
  120. package/dist/node_modules/@aws-sdk/client-s3/dist-types/models/models_1.d.ts +2120 -743
  121. package/dist/node_modules/@aws-sdk/client-s3/dist-types/protocols/Aws_restXml.d.ts +45 -0
  122. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/S3.d.ts +109 -0
  123. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/S3Client.d.ts +30 -0
  124. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/CreateBucketMetadataConfigurationCommand.d.ts +47 -0
  125. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketMetadataConfigurationCommand.d.ts +47 -0
  126. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketMetadataConfigurationCommand.d.ts +51 -0
  127. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListObjectVersionsCommand.d.ts +1 -1
  128. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListObjectsCommand.d.ts +1 -1
  129. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListObjectsV2Command.d.ts +1 -1
  130. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListPartsCommand.d.ts +1 -1
  131. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketAccelerateConfigurationCommand.d.ts +1 -1
  132. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketAclCommand.d.ts +1 -1
  133. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketAnalyticsConfigurationCommand.d.ts +1 -1
  134. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/UpdateBucketMetadataInventoryTableConfigurationCommand.d.ts +47 -0
  135. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/UpdateBucketMetadataJournalTableConfigurationCommand.d.ts +47 -0
  136. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/index.d.ts +5 -0
  137. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_0.d.ts +93 -206
  138. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_1.d.ts +238 -0
  139. package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/protocols/Aws_restXml.d.ts +60 -0
  140. package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
  141. package/dist/node_modules/mime-match/package.json +1 -1
  142. package/dist/node_modules/mkdirp/package.json +1 -1
  143. package/dist/node_modules/multer-aliyun-oss/package.json +1 -1
  144. package/dist/node_modules/multer-cos/package.json +1 -1
  145. package/dist/node_modules/multer-s3/index.js +2 -2
  146. package/dist/node_modules/multer-s3/package.json +1 -1
  147. package/package.json +10 -10
@@ -1 +1 @@
1
- (function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@tachybase/client"),require("react/jsx-runtime"),require("react"),require("antd"),require("react-i18next"),require("@tachybase/schema"),require("@ant-design/icons"),require("@tachybase/components")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react/jsx-runtime","react","antd","react-i18next","@tachybase/schema","@ant-design/icons","@tachybase/components"],t):(n=typeof globalThis!="undefined"?globalThis:n||self,t(n["@tachybase/module-file"]={},n["@tachybase/client"],n.jsxRuntime,n.react,n.antd,n["react-i18next"],n["@tachybase/schema"],n["@ant-design/icons"],n["@tachybase/components"]))})(this,function(n,t,r,m,b,f,p,S,y){"use strict";var J=Object.defineProperty,Q=Object.defineProperties;var X=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var Y=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;var w=(n,t,r)=>t in n?J(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,h=(n,t)=>{for(var r in t||(t={}))Y.call(t,r)&&w(n,r,t[r]);if(q)for(var r of q(t))ee.call(t,r)&&w(n,r,t[r]);return n},A=(n,t)=>Q(n,X(t));var D=(n,t,r)=>new Promise((m,b)=>{var f=y=>{try{S(r.next(y))}catch(e){b(e)}},p=y=>{try{S(r.throw(y))}catch(e){b(e)}},S=y=>y.done?m(y.value):Promise.resolve(y.value).then(f,p);S((r=r.apply(n,t)).next())});const e="file";function K(){return f.useTranslation(e)}const $=1024*1024*1024,W=Object.freeze(Object.defineProperty({__proto__:null,FILE_LIMIT_SIZE:$,useUploadFiles:()=>{const{service:s}=t.useBlockRequestContext(),{t:o}=K(),{setVisible:a}=t.useActionContext(),{props:i}=t.useBlockRequestContext(),d=t.useCollection(),l=t.useSourceIdFromParentRecord(),F=m.useMemo(()=>{let g=`${d.name}:create`;if(i!=null&&i.association){const[x,T]=i.association.split(".");g=`${x}/${l}/${T}:create`}return g},[d.name,i==null?void 0:i.association,l]),{setSelectedRows:u}=m.useContext(t.RecordPickerContext)||{},c={};let I=0;return{action:F,beforeUpload(g){return g.size>$?(b.notification.error({message:`${o("File size cannot exceed")} ${$/1024/1024}M`}),g.status="error",!1):!0},onChange(g){g.forEach(x=>{var T;x.status==="uploading"&&!c[x.uid]&&(I++,c[x.uid]=!0),x.status!=="uploading"&&c[x.uid]&&(delete c[x.uid],--I===0&&((T=s==null?void 0:s.refresh)==null||T.call(s),u==null||u(H=>[...H,...g.filter(P=>P.status==="done").map(P=>P.response.data)])))}),g.every(x=>x.status==="done")&&a(!1)}}}},Symbol.toStringTag,{value:"Module"})),k=s=>{t.useCollection_deprecated();const o={type:"void","x-action":"create",title:"{{t('Upload')}}","x-designer":"Action.Designer","x-component":"Action","x-decorator":"ACLActionProvider","x-component-props":{openMode:t.OpenMode.DRAWER_MODE,type:"primary",icon:"UploadOutlined"},properties:{drawer:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Action.Container",properties:{upload:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Upload.DraggerV2","x-use-component-props":"useUploadFiles","x-component-props":{height:"50vh",multiple:!0,listType:"picture"}}}}}};return r.jsx(t.ActionInitializer,A(h({},s),{schema:o}))},G=({children:s})=>r.jsx(t.SchemaComponentOptions,{scope:W,components:{UploadActionInitializer:k},children:s}),v={name:"storages",fields:[{type:"integer",name:"title",interface:"input",uiSchema:{title:'{{t("Title")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"name",interface:"input",uiSchema:{title:`{{t("Storage name", { ns: "${e}" })}}`,descriptions:`{{t("Will be used for API", { ns: "${e}" })}}`,type:"string","x-component":"Input"}},{type:"string",name:"type",interface:"select",uiSchema:{title:`{{t("Storage type", { ns: "${e}" })}}`,type:"string","x-component":"Select",required:!0,enum:"{{ storageTypes }}"}},{type:"string",name:"baseUrl",interface:"input",uiSchema:{title:`{{t("Storage base URL", { ns: "${e}" })}}`,type:"string","x-component":"TextAreaWithGlobalScope",required:!0}},{type:"string",name:"path",interface:"input",uiSchema:{title:`{{t("Path", { ns: "${e}" })}}`,type:"string","x-component":"TextAreaWithGlobalScope"}},{type:"boolean",name:"default",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}},{type:"boolean",name:"paranoid",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}}]},B={type:"void",properties:{[p.uid()]:{type:"void","x-decorator":"TableBlockProvider","x-component":"CardItem","x-decorator-props":{collection:v,action:"list",params:{pageSize:50,sort:["id"],appends:[]},rowKey:"id"},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action","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?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"CreateStorage","x-component-props":{type:"primary"}}}},table:{type:"array","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{title:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{title:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},default:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",title:`{{t("Default storage", { ns: "${e}" })}}`,properties:{default:{type:"string","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:{type:"void",title:'{{t("Edit")}}',"x-component":"EditStorage"},delete:{type:"void",title:'{{t("Delete")}}',"x-action":"destroy","x-decorator":"ACLActionProvider","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?')}}"}}}}}}}}}}}}},M={local:{properties:{documentRoot:{title:`{{t("Destination", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",default:"storage/uploads"}}},"ali-oss":{properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeySecret:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"}}},"tx-cos":{properties:{Region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretId:{title:`{{t("SecretId", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretKey:{title:`{{t("SecretKey", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},Bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0}}},s3:{properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},secretAccessKey:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},endpoint:{title:`{{t("Endpoint", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"}}}},_=p.observer(s=>{const o=p.useForm(),a=p.useField(),[i,d]=m.useState(new p.Schema({}));return m.useEffect(()=>{d(new p.Schema(M[o.values.type]||{}))},[o.values.type]),r.jsx(y.FormLayout,{layout:"vertical",children:r.jsx(p.RecursionField,{basePath:a.address,onlyRenderProperties:!0,schema:i},o.values.type||"local")})},{displayName:"StorageOptions"}),E=()=>{const[s,o]=m.useState({}),a=t.usePlugin(C),i=t.useCompile(),[d,l]=m.useState(!1),{t:F}=f.useTranslation();return r.jsx("div",{children:r.jsxs(t.ActionContext.Provider,{value:{visible:d,setVisible:l},children:[r.jsx(b.Dropdown,{menu:{onClick(u){const c=a.storageTypes.get(u.key);l(!0),o({properties:{[p.uid()]:{type:"void",title:i("{{t('Add new')}}")+" - "+i(c.title),"x-component":"Action.Drawer",properties:{body:{type:"void","x-decorator":"FormBlockProvider","x-use-decorator-props":"useCreateFormBlockDecoratorProps","x-decorator-props":{dataSource:"main",collection:v},properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useCreateFormBlockProps",properties:h({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":"useCreateActionProps","x-component-props":{type:"primary",htmlType:"submit"},"x-action-settings":{assignedValues:{type:c.name}}}}}},c.properties)}}}}}}})},items:[...a.storageTypes.values()].map(u=>({key:u.name,label:i(u.title)}))},children:r.jsxs(b.Button,{type:"primary",icon:r.jsx(S.PlusOutlined,{}),children:[F("Add new")," ",r.jsx(S.DownOutlined,{})]})}),r.jsx(t.SchemaComponent,{scope:{createOnly:!0},schema:s})]})})},O=()=>{const s=t.useCollectionRecordData(),[o,a]=m.useState({}),i=t.usePlugin(C),d=t.useCompile(),[l,F]=m.useState(!1),{t:u}=f.useTranslation();return r.jsx("div",{children:r.jsxs(t.ActionContext.Provider,{value:{visible:l,setVisible:F},children:[r.jsx("a",{onClick:()=>{F(!0);const c=i.storageTypes.get(s.type);c.properties.default&&(c.properties.default["x-reactions"]=I=>{I.initialValue?I.disabled=!0:I.disabled=!1}),a({properties:{[p.uid()]:{type:"void",title:d("{{t('Edit')}}")+" - "+d(c.title),"x-component":"Action.Drawer",properties:{card:{type:"void","x-decorator":"FormBlockProvider","x-use-decorator-props":"useEditFormBlockDecoratorProps","x-decorator-props":{action:"get",dataSource:"main",collection:v},properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useEditFormBlockProps",properties:h({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"}}}}},c.properties)}}}}}}})},children:u("Edit")}),r.jsx(t.SchemaComponent,{scope:{createOnly:!1},schema:o})]})})},U=()=>{const{t:s}=f.useTranslation(),o=t.useCompile(),i=[...t.usePlugin(C).storageTypes.values()].map(l=>({value:l.name,label:o(l.title)})),d=r.jsxs("div",{children:[s("See more")," ",r.jsx("a",{target:"_blank",href:"https://help.aliyun.com/zh/oss/user-guide/resize-images-4",rel:"noreferrer",children:"x-oss-process"})]});return r.jsx(t.SchemaComponent,{components:{StorageOptions:_,CreateStorage:E,EditStorage:O},scope:{useNewId:l=>`${l}${p.uid()}`,storageTypes:i,xStyleProcessDesc:d},schema:B})};class V extends t.CollectionFieldInterface{constructor(){super(...arguments),this.name="attachment",this.type="object",this.group="media",this.title=`{{t("Attachment", { ns: "${e}" })}}`,this.isAssociation=!0,this.default={type:"belongsToMany",target:"attachments",uiSchema:{type:"array","x-component":"Upload.Attachment","x-component-props":{}}},this.availableTypes=["belongsToMany"],this.properties=A(h({},t.interfacesProperties.defaultProps),{"uiSchema.x-component-props.accept":{type:"string",title:`{{t("MIME type", { ns: "${e}" })}}`,"x-component":"Input","x-decorator":"FormItem",description:"Example: image/png",default:"image/*"},"uiSchema.x-component-props.multiple":{type:"boolean","x-content":`{{t('Allow uploading multiple files', { ns: "${e}" })}}`,"x-decorator":"FormItem","x-component":"Checkbox",default:!0},storage:{type:"string",title:`{{t("Storage", { ns: "${e}" })}}`,description:`{{t('Default storage will be used when not selected', { ns: "${e}" })}}`,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}}),this.filterable={children:[{name:"id",title:'{{t("Exists")}}',operators:[{label:'{{t("exists")}}',value:"$exists",noValue:!0},{label:'{{t("not exists")}}',value:"$notExists",noValue:!0}],schema:{title:'{{t("Exists")}}',type:"string","x-component":"Input"}},{name:"filename",title:`{{t("Filename", { ns: "${e}" })}}`,operators:t.interfacesProperties.operators.string,schema:{title:`{{t("Filename", { ns: "${e}" })}}`,type:"string","x-component":"Input"}}]}}schemaInitialize(o,{block:a,field:i}){["Table","Kanban"].includes(a)&&(o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].size="small"),o["x-component-props"]||(o["x-component-props"]={}),o["x-component-props"].action=`${i.target}:create${i.storage?`?attachmentField=${i.collectionName}.${i.name}`:""}`}initialize(o){o.through||(o.through=`t_${p.uid()}`),o.foreignKey||(o.foreignKey=`f_${p.uid()}`),o.otherKey||(o.otherKey=`f_${p.uid()}`),o.sourceKey||(o.sourceKey="id"),o.targetKey||(o.targetKey="id")}}const z={title:`{{t("Aliyun OSS", { ns: "${e}" })}}`,name:"ali-oss",properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",required:!0,default:'{{ useNewId("s_") }}',description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'},baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"div",properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeySecret:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{placeholder:"?x-oss-process=image/auto-orient,1/resize,m_fill,w_94,h_94/quality,q_90"},default:"?x-oss-process=image/auto-orient,1/resize,m_fill,w_94,h_94/quality,q_90",description:"{{ xStyleProcessDesc }}"}}},path:{"x-component":"CollectionField","x-decorator":"FormItem"},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Default storage", { ns: "${e}" })}}`},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Keep file in storage when destroy record", { ns: "${e}" })}}`}}},j={title:`{{t("Local storage", { ns: "${e}" })}}`,name:"local",properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",required:!0,default:'{{ useNewId("s_") }}',description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'},baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem","x-display":"hidden",default:"/storage/uploads"},options:{type:"object","x-component":"div",properties:{documentRoot:{title:`{{t("Destination", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input","x-display":"hidden",default:"storage/uploads"}}},path:{"x-component":"CollectionField","x-decorator":"FormItem","x-component-props":{addonBefore:"storage/uploads/"}},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Default storage", { ns: "${e}" })}}`},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Keep file in storage when destroy record", { ns: "${e}" })}}`}}},R={title:`{{t("Amazon S3", { ns: "${e}" })}}`,name:"s3",properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",required:!0,default:'{{ useNewId("s_") }}',description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'},baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"div",properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},secretAccessKey:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},endpoint:{title:`{{t("Endpoint", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"}}},path:{"x-component":"CollectionField","x-decorator":"FormItem"},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Default storage", { ns: "${e}" })}}`},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Keep file in storage when destroy record", { ns: "${e}" })}}`}}},N={title:`{{t("Tencent COS", { ns: "${e}" })}}`,name:"tx-cos",properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",required:!0,default:'{{ useNewId("s_") }}',description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'},baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"div",properties:{Region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretId:{title:`{{t("SecretId", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretKey:{title:`{{t("SecretKey", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},Bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0}}},path:{"x-component":"CollectionField","x-decorator":"FormItem"},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Default storage", { ns: "${e}" })}}`},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Keep file in storage when destroy record", { ns: "${e}" })}}`}}},L={local:j,"ali-oss":z,s3:R,"tx-cos":N};class Z extends t.CollectionTemplate{constructor(){super(...arguments),this.name="file",this.title=`{{t("File collection", { ns: "${e}" })}}`,this.order=3,this.color="blue",this.default={createdBy:!0,updatedBy:!0,fields:[{interface:"input",type:"string",name:"title",deletable:!1,uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{interface:"input",type:"string",name:"filename",deletable:!1,uiSchema:{type:"string",title:`{{t("File name", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"extname",deletable:!1,uiSchema:{type:"string",title:`{{t("Extension name", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"integer",type:"integer",name:"size",deletable:!1,uiSchema:{type:"number",title:`{{t("Size", { ns: "${e}" })}}`,"x-component":"InputNumber","x-read-pretty":!0,"x-component-props":{stringMode:!0,step:"0"}}},{interface:"input",type:"string",name:"mimetype",deletable:!1,uiSchema:{type:"string",title:`{{t("MIME type", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"path",deletable:!1,uiSchema:{type:"string",title:`{{t("Path", { ns: "${e}" })}}`,"x-component":"TextAreaWithGlobalScope","x-read-pretty":!0}},{interface:"input",type:"string",name:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("URL")}}',"x-component":"Input.URL","x-read-pretty":!0}},{interface:"url",type:"string",name:"preview",field:"url",deletable:!1,uiSchema:{type:"string",title:`{{t("Preview", { ns: "${e}" })}}`,"x-component":"Preview","x-read-pretty":!0}},{comment:"存储引擎",type:"belongsTo",name:"storage",target:"storages",foreignKey:"storageId",deletable:!1,uiSchema:{type:"string",title:`{{t("Storage", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{type:"jsonb",name:"meta",deletable:!1,defaultValue:{}}]},this.configurableProperties=h(A(h(A(h({},t.getConfigurableProperties("title","name")),{inherits:A(h({},t.getConfigurableProperties("inherits").inherits),{"x-reactions":["{{useAsyncDataSource(loadCollections)}}"]})}),t.getConfigurableProperties("category","description")),{storage:{title:`{{t("File storage", { ns: "${e}" })}}`,type:"hasOne",name:"storage","x-decorator":"FormItem","x-component":"Select","x-reactions":["{{useAsyncDataSource(loadStorages)}}"]}}),t.getConfigurableProperties("presetFields"))}}class C extends t.Plugin{constructor(){super(...arguments),this.storageTypes=new Map}load(){return D(this,null,function*(){this.app.dataSourceManager.addFieldInterfaces([V]),this.app.dataSourceManager.addCollectionTemplates([Z]),this.app.use(G),this.app.systemSettingsManager.add("business-components."+e,{title:`{{t("File manager", { ns: "${e}" })}}`,icon:"FileOutlined",Component:U,aclSnippet:"pm.file-manager.storages"}),Object.values(L).forEach(a=>{this.registerStorageType(a.name,a)});const o=this.app.schemaInitializerManager.get("table:configureActions");o==null||o.add("enableActions.upload",{title:"{{t('Upload')}}",Component:"UploadActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){return t.useCollection().template==="file"}})})}registerStorageType(o,a){this.storageTypes.set(o,a)}}n.FileManagerPlugin=C,n.default=C,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@tachybase/client"),require("react/jsx-runtime"),require("react"),require("antd"),require("react-i18next"),require("@tachybase/schema"),require("@ant-design/icons"),require("@tachybase/components")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react/jsx-runtime","react","antd","react-i18next","@tachybase/schema","@ant-design/icons","@tachybase/components"],t):(n=typeof globalThis!="undefined"?globalThis:n||self,t(n["@tachybase/module-file"]={},n["@tachybase/client"],n.jsxRuntime,n.react,n.antd,n["react-i18next"],n["@tachybase/schema"],n["@ant-design/icons"],n["@tachybase/components"]))})(this,function(n,t,r,m,b,f,p,S,y){"use strict";var J=Object.defineProperty,Q=Object.defineProperties;var X=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var Y=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;var w=(n,t,r)=>t in n?J(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,h=(n,t)=>{for(var r in t||(t={}))Y.call(t,r)&&w(n,r,t[r]);if(q)for(var r of q(t))ee.call(t,r)&&w(n,r,t[r]);return n},A=(n,t)=>Q(n,X(t));var D=(n,t,r)=>new Promise((m,b)=>{var f=y=>{try{S(r.next(y))}catch(e){b(e)}},p=y=>{try{S(r.throw(y))}catch(e){b(e)}},S=y=>y.done?m(y.value):Promise.resolve(y.value).then(f,p);S((r=r.apply(n,t)).next())});const e="file";function K(){return f.useTranslation(e)}const $=1024*1024*1024,k=Object.freeze(Object.defineProperty({__proto__:null,FILE_LIMIT_SIZE:$,useUploadFiles:()=>{const{service:s}=t.useBlockRequestContext(),{t:o}=K(),{setVisible:a}=t.useActionContext(),{props:i}=t.useBlockRequestContext(),d=t.useCollection(),l=t.useSourceIdFromParentRecord(),F=m.useMemo(()=>{let g=`${d.name}:create`;if(i!=null&&i.association){const[x,T]=i.association.split(".");g=`${x}/${l}/${T}:create`}return g},[d.name,i==null?void 0:i.association,l]),{setSelectedRows:u}=m.useContext(t.RecordPickerContext)||{},c={};let I=0;return{action:F,beforeUpload(g){return g.size>$?(b.notification.error({message:`${o("File size cannot exceed")} ${$/1024/1024}M`}),g.status="error",!1):!0},onChange(g){g.forEach(x=>{var T;x.status==="uploading"&&!c[x.uid]&&(I++,c[x.uid]=!0),x.status!=="uploading"&&c[x.uid]&&(delete c[x.uid],--I===0&&((T=s==null?void 0:s.refresh)==null||T.call(s),u==null||u(H=>[...H,...g.filter(P=>P.status==="done").map(P=>P.response.data)])))}),g.every(x=>x.status==="done")&&a(!1)}}}},Symbol.toStringTag,{value:"Module"})),W=s=>{t.useCollection_deprecated();const o={type:"void","x-action":"create",title:"{{t('Upload')}}","x-designer":"Action.Designer","x-component":"Action","x-decorator":"ACLActionProvider","x-component-props":{openMode:"drawer",type:"primary",icon:"UploadOutlined"},properties:{drawer:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Action.Container",properties:{upload:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Upload.DraggerV2","x-use-component-props":"useUploadFiles","x-component-props":{height:"50vh",multiple:!0,listType:"picture"}}}}}};return r.jsx(t.ActionInitializer,A(h({},s),{schema:o}))},G=({children:s})=>r.jsx(t.SchemaComponentOptions,{scope:k,components:{UploadActionInitializer:W},children:s}),v={name:"storages",fields:[{type:"integer",name:"title",interface:"input",uiSchema:{title:'{{t("Title")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"name",interface:"input",uiSchema:{title:`{{t("Storage name", { ns: "${e}" })}}`,descriptions:`{{t("Will be used for API", { ns: "${e}" })}}`,type:"string","x-component":"Input"}},{type:"string",name:"type",interface:"select",uiSchema:{title:`{{t("Storage type", { ns: "${e}" })}}`,type:"string","x-component":"Select",required:!0,enum:"{{ storageTypes }}"}},{type:"string",name:"baseUrl",interface:"input",uiSchema:{title:`{{t("Storage base URL", { ns: "${e}" })}}`,type:"string","x-component":"TextAreaWithGlobalScope",required:!0}},{type:"string",name:"path",interface:"input",uiSchema:{title:`{{t("Path", { ns: "${e}" })}}`,type:"string","x-component":"TextAreaWithGlobalScope"}},{type:"boolean",name:"default",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}},{type:"boolean",name:"paranoid",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}}]},B={type:"void",properties:{[p.uid()]:{type:"void","x-decorator":"TableBlockProvider","x-component":"CardItem","x-decorator-props":{collection:v,action:"list",params:{pageSize:50,sort:["id"],appends:[]},rowKey:"id"},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action","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?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"CreateStorage","x-component-props":{type:"primary"}}}},table:{type:"array","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{title:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{title:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},default:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",title:`{{t("Default storage", { ns: "${e}" })}}`,properties:{default:{type:"string","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:{type:"void",title:'{{t("Edit")}}',"x-component":"EditStorage"},delete:{type:"void",title:'{{t("Delete")}}',"x-action":"destroy","x-decorator":"ACLActionProvider","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?')}}"}}}}}}}}}}}}},_={local:{properties:{documentRoot:{title:`{{t("Destination", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",default:"storage/uploads"}}},"ali-oss":{properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeySecret:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"}}},"tx-cos":{properties:{Region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretId:{title:`{{t("SecretId", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretKey:{title:`{{t("SecretKey", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},Bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0}}},s3:{properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},secretAccessKey:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},endpoint:{title:`{{t("Endpoint", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"}}}},M=p.observer(s=>{const o=p.useForm(),a=p.useField(),[i,d]=m.useState(new p.Schema({}));return m.useEffect(()=>{d(new p.Schema(_[o.values.type]||{}))},[o.values.type]),r.jsx(y.FormLayout,{layout:"vertical",children:r.jsx(p.RecursionField,{basePath:a.address,onlyRenderProperties:!0,schema:i},o.values.type||"local")})},{displayName:"StorageOptions"}),E=()=>{const[s,o]=m.useState({}),a=t.usePlugin(C),i=t.useCompile(),[d,l]=m.useState(!1),{t:F}=f.useTranslation();return r.jsx("div",{children:r.jsxs(t.ActionContext.Provider,{value:{visible:d,setVisible:l},children:[r.jsx(b.Dropdown,{menu:{onClick(u){const c=a.storageTypes.get(u.key);l(!0),o({properties:{[p.uid()]:{type:"void",title:i("{{t('Add new')}}")+" - "+i(c.title),"x-component":"Action.Drawer",properties:{body:{type:"void","x-decorator":"FormBlockProvider","x-use-decorator-props":"useCreateFormBlockDecoratorProps","x-decorator-props":{dataSource:"main",collection:v},properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useCreateFormBlockProps",properties:h({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":"useCreateActionProps","x-component-props":{type:"primary",htmlType:"submit"},"x-action-settings":{assignedValues:{type:c.name}}}}}},c.properties)}}}}}}})},items:[...a.storageTypes.values()].map(u=>({key:u.name,label:i(u.title)}))},children:r.jsxs(b.Button,{type:"primary",icon:r.jsx(S.PlusOutlined,{}),children:[F("Add new")," ",r.jsx(S.DownOutlined,{})]})}),r.jsx(t.SchemaComponent,{scope:{createOnly:!0},schema:s})]})})},O=()=>{const s=t.useCollectionRecordData(),[o,a]=m.useState({}),i=t.usePlugin(C),d=t.useCompile(),[l,F]=m.useState(!1),{t:u}=f.useTranslation();return r.jsx("div",{children:r.jsxs(t.ActionContext.Provider,{value:{visible:l,setVisible:F},children:[r.jsx("a",{onClick:()=>{F(!0);const c=i.storageTypes.get(s.type);c.properties.default&&(c.properties.default["x-reactions"]=I=>{I.initialValue?I.disabled=!0:I.disabled=!1}),a({properties:{[p.uid()]:{type:"void",title:d("{{t('Edit')}}")+" - "+d(c.title),"x-component":"Action.Drawer",properties:{card:{type:"void","x-decorator":"FormBlockProvider","x-use-decorator-props":"useEditFormBlockDecoratorProps","x-decorator-props":{action:"get",dataSource:"main",collection:v},properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useEditFormBlockProps",properties:h({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"}}}}},c.properties)}}}}}}})},children:u("Edit")}),r.jsx(t.SchemaComponent,{scope:{createOnly:!1},schema:o})]})})},U=()=>{const{t:s}=f.useTranslation(),o=t.useCompile(),i=[...t.usePlugin(C).storageTypes.values()].map(l=>({value:l.name,label:o(l.title)})),d=r.jsxs("div",{children:[s("See more")," ",r.jsx("a",{target:"_blank",href:"https://help.aliyun.com/zh/oss/user-guide/resize-images-4",rel:"noreferrer",children:"x-oss-process"})]});return r.jsx(t.SchemaComponent,{components:{StorageOptions:M,CreateStorage:E,EditStorage:O},scope:{useNewId:l=>`${l}${p.uid()}`,storageTypes:i,xStyleProcessDesc:d},schema:B})};class V extends t.CollectionFieldInterface{constructor(){super(...arguments),this.name="attachment",this.type="object",this.group="media",this.title=`{{t("Attachment", { ns: "${e}" })}}`,this.isAssociation=!0,this.default={type:"belongsToMany",target:"attachments",uiSchema:{type:"array","x-component":"Upload.Attachment","x-component-props":{}}},this.availableTypes=["belongsToMany"],this.properties=A(h({},t.interfacesProperties.defaultProps),{"uiSchema.x-component-props.accept":{type:"string",title:`{{t("MIME type", { ns: "${e}" })}}`,"x-component":"Input","x-decorator":"FormItem",description:"Example: image/png",default:"image/*"},"uiSchema.x-component-props.multiple":{type:"boolean","x-content":`{{t('Allow uploading multiple files', { ns: "${e}" })}}`,"x-decorator":"FormItem","x-component":"Checkbox",default:!0},storage:{type:"string",title:`{{t("Storage", { ns: "${e}" })}}`,description:`{{t('Default storage will be used when not selected', { ns: "${e}" })}}`,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}}),this.filterable={children:[{name:"id",title:'{{t("Exists")}}',operators:[{label:'{{t("exists")}}',value:"$exists",noValue:!0},{label:'{{t("not exists")}}',value:"$notExists",noValue:!0}],schema:{title:'{{t("Exists")}}',type:"string","x-component":"Input"}},{name:"filename",title:`{{t("Filename", { ns: "${e}" })}}`,operators:t.interfacesProperties.operators.string,schema:{title:`{{t("Filename", { ns: "${e}" })}}`,type:"string","x-component":"Input"}}]}}schemaInitialize(o,{block:a,field:i}){["Table","Kanban"].includes(a)&&(o["x-component-props"]=o["x-component-props"]||{},o["x-component-props"].size="small"),o["x-component-props"]||(o["x-component-props"]={}),o["x-component-props"].action=`${i.target}:create${i.storage?`?attachmentField=${i.collectionName}.${i.name}`:""}`}initialize(o){o.through||(o.through=`t_${p.uid()}`),o.foreignKey||(o.foreignKey=`f_${p.uid()}`),o.otherKey||(o.otherKey=`f_${p.uid()}`),o.sourceKey||(o.sourceKey="id"),o.targetKey||(o.targetKey="id")}}const z={title:`{{t("Aliyun OSS", { ns: "${e}" })}}`,name:"ali-oss",properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",required:!0,default:'{{ useNewId("s_") }}',description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'},baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"div",properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeySecret:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{placeholder:"?x-oss-process=image/auto-orient,1/resize,m_fill,w_94,h_94/quality,q_90"},default:"?x-oss-process=image/auto-orient,1/resize,m_fill,w_94,h_94/quality,q_90",description:"{{ xStyleProcessDesc }}"}}},path:{"x-component":"CollectionField","x-decorator":"FormItem"},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Default storage", { ns: "${e}" })}}`},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Keep file in storage when destroy record", { ns: "${e}" })}}`}}},j={title:`{{t("Local storage", { ns: "${e}" })}}`,name:"local",properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",required:!0,default:'{{ useNewId("s_") }}',description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'},baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem","x-display":"hidden",default:"/storage/uploads"},options:{type:"object","x-component":"div",properties:{documentRoot:{title:`{{t("Destination", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input","x-display":"hidden",default:"storage/uploads"}}},path:{"x-component":"CollectionField","x-decorator":"FormItem","x-component-props":{addonBefore:"storage/uploads/"}},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Default storage", { ns: "${e}" })}}`},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Keep file in storage when destroy record", { ns: "${e}" })}}`}}},N={title:`{{t("Amazon S3", { ns: "${e}" })}}`,name:"s3",properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",required:!0,default:'{{ useNewId("s_") }}',description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'},baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"div",properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},secretAccessKey:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},endpoint:{title:`{{t("Endpoint", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"}}},path:{"x-component":"CollectionField","x-decorator":"FormItem"},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Default storage", { ns: "${e}" })}}`},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Keep file in storage when destroy record", { ns: "${e}" })}}`}}},L={title:`{{t("Tencent COS", { ns: "${e}" })}}`,name:"tx-cos",properties:{title:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",required:!0,default:'{{ useNewId("s_") }}',description:'{{t("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")}}'},baseUrl:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"div",properties:{Region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretId:{title:`{{t("SecretId", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretKey:{title:`{{t("SecretKey", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},Bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0}}},path:{"x-component":"CollectionField","x-decorator":"FormItem"},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Default storage", { ns: "${e}" })}}`},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Keep file in storage when destroy record", { ns: "${e}" })}}`}}},R={local:j,"ali-oss":z,s3:N,"tx-cos":L};class Z extends t.CollectionTemplate{constructor(){super(...arguments),this.name="file",this.title=`{{t("File collection", { ns: "${e}" })}}`,this.order=3,this.color="blue",this.default={createdBy:!0,updatedBy:!0,fields:[{interface:"input",type:"string",name:"title",deletable:!1,uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{interface:"input",type:"string",name:"filename",deletable:!1,uiSchema:{type:"string",title:`{{t("File name", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"extname",deletable:!1,uiSchema:{type:"string",title:`{{t("Extension name", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"integer",type:"integer",name:"size",deletable:!1,uiSchema:{type:"number",title:`{{t("Size", { ns: "${e}" })}}`,"x-component":"InputNumber","x-read-pretty":!0,"x-component-props":{stringMode:!0,step:"0"}}},{interface:"input",type:"string",name:"mimetype",deletable:!1,uiSchema:{type:"string",title:`{{t("MIME type", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"path",deletable:!1,uiSchema:{type:"string",title:`{{t("Path", { ns: "${e}" })}}`,"x-component":"TextAreaWithGlobalScope","x-read-pretty":!0}},{interface:"input",type:"string",name:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("URL")}}',"x-component":"Input.URL","x-read-pretty":!0}},{interface:"url",type:"string",name:"preview",field:"url",deletable:!1,uiSchema:{type:"string",title:`{{t("Preview", { ns: "${e}" })}}`,"x-component":"Preview","x-read-pretty":!0}},{comment:"存储引擎",type:"belongsTo",name:"storage",target:"storages",foreignKey:"storageId",deletable:!1,uiSchema:{type:"string",title:`{{t("Storage", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{type:"jsonb",name:"meta",deletable:!1,defaultValue:{}}]},this.configurableProperties=h(A(h(A(h({},t.getConfigurableProperties("title","name")),{inherits:A(h({},t.getConfigurableProperties("inherits").inherits),{"x-reactions":["{{useAsyncDataSource(loadCollections)}}"]})}),t.getConfigurableProperties("category","description")),{storage:{title:`{{t("File storage", { ns: "${e}" })}}`,type:"hasOne",name:"storage","x-decorator":"FormItem","x-component":"Select","x-reactions":["{{useAsyncDataSource(loadStorages)}}"]}}),t.getConfigurableProperties("presetFields"))}}class C extends t.Plugin{constructor(){super(...arguments),this.storageTypes=new Map}load(){return D(this,null,function*(){this.app.dataSourceManager.addFieldInterfaces([V]),this.app.dataSourceManager.addCollectionTemplates([Z]),this.app.use(G),this.app.systemSettingsManager.add("business-components."+e,{title:`{{t("File manager", { ns: "${e}" })}}`,icon:"FileOutlined",Component:U,aclSnippet:"pm.file-manager.storages"}),Object.values(R).forEach(a=>{this.registerStorageType(a.name,a)});const o=this.app.schemaInitializerManager.get("table:configureActions");o==null||o.add("enableActions.upload",{title:"{{t('Upload')}}",Component:"UploadActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){return t.useCollection().template==="file"}})})}registerStorageType(o,a){this.storageTypes.set(o,a)}}n.FileManagerPlugin=C,n.default=C,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,16 +1,16 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.3.18",
4
- "@tachybase/schema": "1.3.18",
3
+ "@tachybase/client": "1.3.20",
4
+ "@tachybase/schema": "1.3.20",
5
5
  "@ant-design/icons": "5.5.2",
6
6
  "antd": "5.22.5",
7
7
  "lodash": "4.17.21",
8
8
  "react-i18next": "15.2.0",
9
- "@tachybase/components": "1.3.18",
10
- "@tachybase/database": "1.3.18",
11
- "@tachybase/server": "1.3.18",
12
- "@tachybase/test": "1.3.18",
13
- "@tachybase/utils": "1.3.18",
14
- "@tachybase/actions": "1.3.18",
9
+ "@tachybase/components": "1.3.20",
10
+ "@tachybase/database": "1.3.20",
11
+ "@tachybase/server": "1.3.20",
12
+ "@tachybase/test": "1.3.20",
13
+ "@tachybase/utils": "1.3.20",
14
+ "@tachybase/actions": "1.3.20",
15
15
  "multer": "2.0.1"
16
16
  };