@nocobase/plugin-file-manager 2.0.0-alpha.5 → 2.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +8 -8
- package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
- package/dist/node_modules/mime-match/package.json +1 -1
- package/dist/node_modules/mime-types/package.json +1 -1
- package/dist/node_modules/mkdirp/package.json +1 -1
- package/dist/node_modules/multer-aliyun-oss/package.json +1 -1
- package/dist/node_modules/multer-cos/package.json +1 -1
- package/dist/node_modules/multer-s3/package.json +1 -1
- package/dist/node_modules/url-join/package.json +1 -1
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nocobase/flow-engine"),require("lodash"),require("@formily/shared"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("antd"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-manager",["react","@nocobase/flow-engine","lodash","@formily/shared","@nocobase/client","@formily/react","@ant-design/icons","antd","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-file-manager"]=t(require("react"),require("@nocobase/flow-engine"),require("lodash"),require("@formily/shared"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("antd"),require("react-i18next")):e["@nocobase/plugin-file-manager"]=t(e.react,e["@nocobase/flow-engine"],e.lodash,e["@formily/shared"],e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e.antd,e["react-i18next"])}(self,function(e,t,n,o,r,i,a,l,c){return function(){"use strict";var u={482:function(e){e.exports=a},505:function(e){e.exports=i},875:function(e){e.exports=o},772:function(e){e.exports=r},667:function(e){e.exports=t},721:function(e){e.exports=l},467:function(e){e.exports=n},156:function(t){t.exports=e},238:function(e){e.exports=c}},s={};function p(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return u[e](n,n.exports,p),n.exports}p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var f={};return!function(){p.r(f),p.d(f,{PluginFileManagerClient:function(){return e$},default:function(){return eZ}});var e,t,n,o={};p.r(o),p.d(o,{useAttachmentFieldProps:function(){return v},useFileCollectionStorageRules:function(){return x},useStorageRules:function(){return h},useUploadFiles:function(){return b}});var r=p(772),i=Number.POSITIVE_INFINITY,a=p(156),l=p.n(a);function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function u(){var e,t,n,o,i,l,c,u=(0,r.useCollectionField)(),s=(0,r.useCollectionManager)().getCollection(null==u?void 0:u.target),p=(0,r.useCollection)(),f=(0,r.usePlugin)(eZ),m=(t=null!=(e=(null==u?void 0:u.storage)||(null==p?void 0:p.getOption("storage"))||(null==s?void 0:s.getOption("storage")))?e:"",n="storages:getBasicInfo/".concat(t),i=(o=(0,r.useRequest)({url:n},{manual:!0,refreshDeps:[t],cacheKey:n})).loading,l=o.data,c=o.run,(0,a.useEffect)(function(){c()},[c]),!i&&(null==l?void 0:l.data)||null),d=f.getStorageType(null==m?void 0:m.type);return{storage:m,storageType:d}}function s(e){var t=u(),n=t.storage,o=t.storageType,r=null==o?void 0:o.useUploadProps,i=(null==r?void 0:r(c({storage:n,rules:n.rules},e)))||{};return c({rules:null==n?void 0:n.rules},i)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function d(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(e,t)}}var b=function(){var e=(0,r.useDataBlockRequestGetter)().getDataBlockRequest,t=((0,r.useDataBlockProps)()||{}).association,n=(0,r.useActionContext)().setVisible,o=(0,r.useCollection)(),i=(0,r.useSourceId)(),l=(0,a.useMemo)(function(){var e="".concat(o.name,":create");if(t){var n,r=(n=t.split("."),function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(n,2)||y(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=r[0],l=r[1];e="".concat(a,"/").concat(i,"/").concat(l,":create")}return e},[o.name,t,i]),c=((0,a.useContext)(r.RecordPickerContext)||{}).setSelectedRows,u={},p=0,f={action:l,onChange:function(t){t.forEach(function(n){if("uploading"!==n.status||u[n.uid]||(p++,u[n.uid]=!0),"uploading"!==n.status&&u[n.uid]&&(delete u[n.uid],0==--p)){var o,r;null==(r=e())||null==(o=r.refresh)||o.call(r),null==c||c(function(e){return d(e).concat(d(t.filter(function(e){return"done"===e.status}).map(function(e){return e.response.data})))})}}),t.every(function(e){return"done"===e.status})&&n(!1)}},m=s(f);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},f,m)},g=p(505);function h(e){var t,n=null!=e?e:"";(0,r.useAPIClient)();var o=(0,g.useField)(),i=(0,r.useRequest)({url:"storages:getBasicInfo/".concat(n)},{manual:!0,refreshDeps:[n],cacheKey:n}),l=i.loading,c=i.data,u=i.run;return(0,a.useEffect)(function(){"editable"===o.pattern&&u()},[o.pattern,u]),!l&&(null==c||null==(t=c.data)?void 0:t.rules)||null}function v(){var e=(0,r.useCollectionField)(),t="".concat(null==e?void 0:e.target,":create").concat((null==e?void 0:e.storage)?"?attachmentField=".concat(e.collectionName,".").concat(e.name):""),n=s({action:t});return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({action:t},n)}function x(){var e=(0,r.useCollectionField)(),t=(0,r.useCollectionManager)().getCollection(null==e?void 0:e.target);return h(null==t?void 0:t.getOption("storage"))}var O=function(e){var t,n,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 l().createElement(r.ActionInitializerItem,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},e),n=n={schema:o},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))},w={dumpRules:{group:"user"},migrationRules:["schema-only","overwrite"],asStrategyResource:!0,shared:!0,name:"attachments",createdBy:!0,updatedBy:!0,template:"file",filterTargetKey:"id",fields:[{comment:"用户文件名(不含扩展名)",type:"string",name:"title"},{comment:"系统文件名(含扩展名)",type:"string",name:"filename"},{comment:"扩展名(含“.”)",type:"string",name:"extname"},{comment:"文件体积(字节)",type:"integer",name:"size"},{type:"string",name:"mimetype"},{type:"belongsTo",name:"storage",target:"storages",foreignKey:"storageId",deletable:!1,interface:"m2o",uiSchema:{type:"object",title:"{{t('Storage', { ns: '".concat("file-manager","' })}}"),"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"title"}},"x-read-pretty":!0}},{comment:"相对路径(含“/”前缀)",type:"text",name:"path"},{comment:"其他文件信息(如图片的宽高)",type:"jsonb",name:"meta",defaultValue:{}},{comment:"网络访问地址",type:"text",name:"url"}]},S={dumpRules:"required",migrationRules:["overwrite","schema-only"],name:"storages",shared:!0,fields:[{name:"id",type:"snowflakeId",primaryKey:!0,allowNull:!1},{title:"存储引擎名称",comment:"存储引擎名称",type:"string",name:"title",translation:!0,trim:!0},{title:"英文标识",type:"uid",name:"name",unique:!0,trim:!0},{comment:"类型标识,如 local/ali-oss 等",type:"string",name:"type"},{comment:"配置项",type:"jsonb",name:"options",defaultValue:{}},{comment:"文件规则",type:"jsonb",name:"rules",defaultValue:{}},{comment:"存储相对路径模板",type:"text",name:"path",defaultValue:"",trim:!0},{comment:"访问地址前缀",type:"string",name:"baseUrl",defaultValue:"",trim:!0},{comment:"默认引擎",type:"radio",name:"default",defaultValue:!1},{type:"boolean",name:"paranoid",defaultValue:!1}]},j=function(e){return l().createElement(r.ExtendCollectionsProvider,{collections:[w,S]},l().createElement(r.SchemaComponentOptions,{scope:o,components:{UploadActionInitializer:O}},e.children))},P=p(721),E=[{value:1,label:"Byte"},{value:1024,label:"KB"},{value:1048576,label:"MB"},{value:0x40000000,label:"GB"}];function C(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1048576,n=e||t,o=E.length-1;o>=0;o--){var r=E[o];if(n%r.value==0)return r}return E[0]}function A(e,t,n){return Math.min(Math.max(t,e),n)}function I(e){var t,n=e.value,o=e.defaultUnit,r=void 0===o?1048576:o,c=e.min,u=void 0===c?1:c,s=e.max,p=void 0===s?i:s,f=e.step,m=e.onChange,d=null!=(t=e.defaultValue)?t:0x1400000,y=C(d,r),b=d/y.value,g=C(null!=n?n:d,r),h=null==n?n:n/g.value,v=(0,a.useCallback)(function(e){null==m||m(A(null==e?e:e*g.value,u,p))},[g.value]),x=(0,a.useCallback)(function(e){null==m||m(A(h*e,u,p))},[h]);return l().createElement(P.Space.Compact,null,l().createElement(P.InputNumber,{value:h,onChange:v,defaultValue:"".concat(b),step:void 0===f?1:f}),l().createElement(P.Select,{options:E,value:g.value,onChange:x,className:"auto-width"}))}var T=p(482),F=p(875),k=p(467),R=p.n(k),D=p(238),M="file-manager",B={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: "'.concat(M,'" })}}'),descriptions:'{{t("Will be used for API", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Input"}},{type:"string",name:"type",interface:"select",uiSchema:{title:'{{t("Storage type", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Select",required:!0,enum:"{{ storageTypeOptions }}"}},{type:"string",name:"baseUrl",interface:"input",uiSchema:{title:'{{t("Base URL", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"TextAreaWithGlobalScope",required:!0}},{type:"string",name:"path",interface:"input",uiSchema:{title:'{{t("Path", { ns: "'.concat(M,'" })}}'),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"}}]},_={type:"object",properties:(e={},t=(0,F.uid)(),n={type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:B,resourceName:"storages",request:{resource:"storages",action:"list",params:{pageSize:50,sort:["id"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:B},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete')}}",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:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},default:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{t("Default storage", { ns: "'.concat(M,'" })}}'),properties:{default:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:{type:"void",title:'{{t("Edit")}}',"x-component":"EditStorage","x-component-props":{type:"primary"}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:'{{t("Delete")}}',content:'{{t("Are you sure you want to delete it?")}}'},useAction:"{{cm.useDestroyAction}}"}}}}}}}}}},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e)},U={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",description:'{{t(\'Base URL for file access, could be your CDN base URL. For example: "https://cdn.nocobase.com".\', { ns: "'.concat(M,'" })}}')},path:{"x-component":"CollectionField","x-decorator":"FormItem",description:'{{t(\'Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes "/" will be ignored. For example: "user/avatar".\', { ns: "'.concat(M,'" })}}')},rules:{type:"object","x-component":"fieldset",properties:{size:{type:"number",title:'{{t("File size limit", { ns: "'.concat(M,'" })}}'),description:'{{t("Minimum from 1 byte.", { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"FileSizeField",required:!0,default:0x1400000},mimetype:{type:"string",title:'{{t("File type (in MIME type format)", { ns: "'.concat(M,'" })}}'),description:'{{t(\'Multi-types seperated with comma, for example: "image/*", "image/png", "image/*, application/pdf" etc.\', { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:"*"}}}},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Default storage", { ns: "'.concat(M,'" })}}')},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Keep file in storage when destroy the file record", { ns: "'.concat(M,'" })}}'),description:'{{t("Files are only removed when their corresponding records in the file collection are deleted. If a record from another collection includes an associating field referencing the file collection, the file will not be deleted unless cascade deletion is enabled for that association.", { ns: "'.concat(M,'" })}}')}},q={title:'{{t("Aliyun OSS", { ns: "'.concat(M,'" })}}'),name:"ali-oss",fieldset:{title:U.title,name:U.name,baseUrl:U.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",description:'{{t(\'Aliyun OSS region part of the bucket. For example: "oss-cn-beijing".\', { ns: "'.concat(M,'" })}}'),required:!0},accessKeyId:{title:'{{t("AccessKey ID", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeySecret:{title:'{{t("AccessKey Secret", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},timeout:{title:'{{t("Timeout", { ns: "'.concat(M,'" })}}'),description:"{{t('Upload timeout for a single file in milliseconds. Default is 600000.', { ns: \"".concat(M,'" })}}'),type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:6e5},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"},description:'{{ renderThumbnailRuleDesc("ali-oss") }}'}}},path:U.path,rules:U.rules,default:U.default,paranoid:U.paranoid},thumbnailRuleLink:"https://help.aliyun.com/zh/oss/user-guide/resize-images-4"},z={local:{title:'{{t("Local storage", { ns: "'.concat(M,'" })}}'),name:"local",fieldset:{title:U.title,name:U.name,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: "'.concat(M,'" })}}'),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/"}},rules:U.rules,default:U.default,paranoid:U.paranoid}},"ali-oss":q,s3:{title:'{{t("Amazon S3", { ns: "'.concat(M,'" })}}'),name:"s3",fieldset:{title:U.title,name:U.name,baseUrl:U.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:'{{t("AccessKey ID", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},secretAccessKey:{title:'{{t("AccessKey Secret", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},endpoint:{title:'{{t("Endpoint", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"}}},path:U.path,rules:U.rules,default:U.default,paranoid:U.paranoid}},"tx-cos":{title:'{{t("Tencent COS", { ns: "'.concat(M,'" })}}'),name:"tx-cos",fieldset:{title:U.title,name:U.name,baseUrl:U.baseUrl,options:{type:"object","x-component":"fieldset",properties:{Region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretId:{title:'{{t("SecretId", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretKey:{title:'{{t("SecretKey", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},Bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),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:"?imageMogr2/thumbnail/!50p"},description:'{{ renderThumbnailRuleDesc("tx-cos") }}'}}},path:U.path,rules:U.rules,default:U.default,paranoid:U.paranoid},thumbnailRuleLink:"https://cloud.tencent.com/document/product/436/42214"}};function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){K(e,t,n[t])})}return e}function G(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(e,t)||$(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e){return function(e){if(Array.isArray(e))return N(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N(e,t)}}var Z=function(){var e=V((0,a.useState)({}),2),t=e[0],n=e[1],o=(0,r.usePlugin)(eZ),i=(0,r.useCompile)(),c=V((0,a.useState)(!1),2),u=c[0],s=c[1],p=(0,D.useTranslation)().t;return l().createElement("div",null,l().createElement(r.ActionContext.Provider,{value:{visible:u,setVisible:s}},l().createElement(P.Dropdown,{menu:{onClick:function(e){var t=o.storageTypes.get(e.key);s(!0),n({type:"object",properties:K({},(0,F.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{type:t.name}},title:i("{{t('Add new')}}")+" - "+i(t.title),properties:G(L({},R().cloneDeep(t.fieldset)),{footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}})})})},items:W(o.storageTypes.values()).map(function(e){return{key:e.name,label:i(e.title)}})}},l().createElement(P.Button,{type:"primary",icon:l().createElement(T.PlusOutlined,null)},p("Add new")," ",l().createElement(T.DownOutlined,null))),l().createElement(r.SchemaComponent,{scope:{createOnly:!0},schema:t})))},Y=function(){var e=(0,r.useRecord)(),t=V((0,a.useState)({}),2),n=t[0],o=t[1],i=(0,r.usePlugin)(eZ),c=(0,r.useCompile)(),u=V((0,a.useState)(!1),2),s=u[0],p=u[1],f=(0,D.useTranslation)().t;return l().createElement("div",null,l().createElement(r.ActionContext.Provider,{value:{visible:s,setVisible:p}},l().createElement("a",{onClick:function(){p(!0);var t=i.storageTypes.get(e.type);t.fieldset.default&&(t.fieldset.default["x-reactions"]=function(e){e.initialValue?e.disabled=!0:e.disabled=!1}),o({type:"object",properties:K({},(0,F.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:L({},e)},title:c("{{t('Edit')}}")+" - "+c(t.title),properties:G(L({},R().cloneDeep(t.fieldset)),{footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}})})})}},f("Edit")),l().createElement(r.SchemaComponent,{scope:{createOnly:!1},schema:n})))};function H(e){var t=z[e];return(null==t?void 0:t.thumbnailRule)?l().createElement("div",null,l().createElement("a",{target:"_blank",href:t.thumbnailRuleLink,rel:"noreferrer"},r.i18n.t("See more"))):null}var X=function(){var e=(0,r.useCompile)(),t=W((0,r.usePlugin)(eZ).storageTypes.values()).map(function(t){return{value:t.name,label:e(t.title)}});return l().createElement(P.Card,{bordered:!1},l().createElement(r.SchemaComponent,{components:{CreateStorage:Z,EditStorage:Y},scope:{useNewId:function(e){return"".concat(e).concat((0,F.uid)())},storageTypeOptions:t,renderThumbnailRuleDesc:H},schema:_}))};function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q(e){return(Q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ee(e,t){return(ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function et(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(et=function(){return!!e})()}var en=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,o,i,a;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=Q(t),J(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,et()?Reflect.construct(t,o||[],Q(this).constructor):t.apply(this,o)),"name","attachment"),J(e,"type","object"),J(e,"group","media"),J(e,"title",'{{t("Attachment", { ns: "'.concat(M,'" })}}')),J(e,"isAssociation",!0),J(e,"default",{type:"belongsToMany",target:"attachments",uiSchema:{type:"array","x-component":"Upload.Attachment","x-use-component-props":"useAttachmentFieldProps"}}),J(e,"availableTypes",["belongsToMany"]),J(e,"properties",(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){J(e,t,n[t])})}return e}({},r.interfacesProperties.defaultProps),a=a={"uiSchema.x-component-props.accept":{type:"string",title:'{{t("MIME type", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-component-props":{placeholder:"image/*"},"x-decorator":"FormItem",description:"Example: image/png"},"uiSchema.x-component-props.multiple":{type:"boolean","x-content":"{{t('Allow uploading multiple files', { ns: \"".concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"Checkbox",default:!0},storage:{type:"string",title:'{{t("Storage", { ns: "'.concat(M,'" })}}'),description:"{{t('Default storage will be used when not selected', { ns: \"".concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i)),J(e,"filterable",{children:[{name:"id",value:"id",title:'{{t("Exists")}}',label:'{{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",value:"filename",title:'{{t("Filename", { ns: "'.concat(M,'" })}}'),label:'{{t("Filename", { ns: "'.concat(M,'" })}}'),operators:r.interfacesProperties.operators.string,schema:{title:'{{t("Filename", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Input"}}]}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&ee(n,e),t=[{key:"schemaInitialize",value:function(e,t){var n=t.block;t.field,e["x-component-props"]||(e["x-component-props"]={}),["Table","Kanban"].includes(n)&&(e["x-component-props"].size="small"),e["x-use-component-props"]="useAttachmentFieldProps"}},{key:"initialize",value:function(e){e.through||(e.through="t_".concat((0,F.uid)())),e.foreignKey||(e.foreignKey="f_".concat((0,F.uid)())),e.otherKey||(e.otherKey="f_".concat((0,F.uid)())),e.sourceKey||(e.sourceKey="id"),e.targetKey||(e.targetKey="id")}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,t),n}(r.CollectionFieldInterface);function eo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function er(e){return(er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ei(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){eo(e,t,n[t])})}return e}function ea(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function el(e,t){return(el=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ec(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ec=function(){return!!e})()}var eu=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,n,o;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return n=t,o=arguments,n=er(n),eo(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,ec()?Reflect.construct(n,o||[],er(this).constructor):n.apply(this,o)),"name","file"),eo(e,"title",'{{t("File collection", { ns: "'.concat(M,'" })}}')),eo(e,"order",3),eo(e,"color","blue"),eo(e,"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: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"extname",deletable:!1,uiSchema:{type:"string",title:'{{t("Extension name", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"integer",type:"integer",name:"size",deletable:!1,uiSchema:{type:"number",title:'{{t("Size", { ns: "'.concat(M,'" })}}'),"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: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"text",name:"path",deletable:!1,uiSchema:{type:"string",title:'{{t("Path", { ns: "'.concat(M,'" })}}'),"x-component":"TextAreaWithGlobalScope","x-read-pretty":!0}},{interface:"url",type:"text",name:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("URL")}}',"x-component":"Input.URL","x-read-pretty":!0}},{interface:"url",type:"text",name:"preview",field:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("Preview", { ns: "'.concat(M,'" })}}'),"x-component":"Preview","x-read-pretty":!0}},{type:"belongsTo",name:"storage",target:"storages",foreignKey:"storageId",deletable:!1,interface:"m2o",uiSchema:{type:"object",title:'{{t("Storage", { ns: "'.concat(M,'" })}}'),"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"title"}},"x-read-pretty":!0}},{type:"jsonb",name:"meta",deletable:!1,defaultValue:{}}]}),eo(e,"presetFieldsDisabled",!0),eo(e,"configurableProperties",ei(ea(ei(ea(ei({},(0,r.getConfigurableProperties)("title","name")),{inherits:ea(ei({},(0,r.getConfigurableProperties)("inherits").inherits),{"x-reactions":["{{useAsyncDataSource(loadCollections)}}"]})}),(0,r.getConfigurableProperties)("category","description")),{storage:{type:"string",name:"storage",title:'{{t("File storage", { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}}),(0,r.getConfigurableProperties)("presetFields"))),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&el(t,e),t}(r.CollectionTemplate),es=p(667);function ep(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function ef(e){return(ef=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function em(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function ed(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function ey(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function eb(e,t){return(eb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eg(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function eh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eh=function(){return!!e})()}var ev=function(e){var t,n,o=e.file,r=e.size,i=e.showFileName,a="string"==typeof o?o:(null==o?void 0:o.preview)||(null==o?void 0:o.url);if(a){var c="string"==typeof o?a.split("/").pop():(null==o?void 0:o.name)||(null==o?void 0:o.filename)||(null==o||null==(t=o.url)?void 0:t.split("/").pop()),u=(null==(n=a.split(".").pop())?void 0:n.toLowerCase())||"",s={pdf:"/file-placeholder/pdf-200-200.png",mp4:"/file-placeholder/video-200-200.png",mov:"/file-placeholder/video-200-200.png",doc:"/file-placeholder/docx-200-200.png",docx:"/file-placeholder/docx-200-200.png",xls:"/file-placeholder/xlsx-200-200.png",xlsx:"/file-placeholder/xlsx-200-200.png",ppt:"/file-placeholder/ppt-200-200.png",pptx:"/file-placeholder/ppt-200-200.png",jpg:"/file-placeholder/image-200-200.png",jpeg:"/file-placeholder/image-200-200.png",png:"/file-placeholder/image-200-200.png",gif:"/file-placeholder/image-200-200.png",default:"/file-placeholder/unknown-200-200.png"};!function(e){var t="",n="";if("string"==typeof e){var o=e.split("?")[0].split("#")[0],r=o.lastIndexOf(".");-1!==r&&(n=o.substring(r).toLowerCase())}else if((void 0===e?"undefined":eg(e))==="object"&&null!==e&&(t=e.mimetype||"",!(n=(e.extname||"").toLowerCase())&&e.url)){var i=e.url.split("?")[0].split("#")[0],a=i.lastIndexOf(".");-1!==a&&(n=i.substring(a).toLowerCase())}if(!(t&&(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||"application/pdf"===t||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===t)))[".png",".jpg",".jpeg",".webp",".gif",".bmp"].includes(n)||[".mp4",".avi",".mov",".wmv",".flv",".mkv"].includes(n)||[".mp3",".wav",".aac",".ogg"].includes(n)||[".pdf"].includes(n)||[".xlsx"].includes(n)}(o);var p=s[u]||s.default,f=l().createElement(P.Image,{src:a,fallback:p,width:r,height:r,preview:{mask:l().createElement(T.EyeOutlined,null)},style:{borderRadius:4,objectFit:"cover",boxShadow:"0 0 0 2px #fff"}});return l().createElement("div",{style:{textAlign:"center",width:r,wordBreak:"break-all"}},f,i&&l().createElement(P.Tooltip,{title:c},l().createElement("div",{style:{fontSize:12,marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%"}},c)))}},ex=function(e){var t,n=e.value,o=void 0===n?[]:n,i=e.size,a=void 0===i?28:i,c=e.showFileName,u=(t=l().useState(0),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return ep(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ep(e,t)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=u[0],p=u[1],f=(0,D.useTranslation)().t,m=function(){var e=o[s].url,t=e.slice(e.lastIndexOf(".")),n=Date.now()+t;fetch(e).then(function(e){return e.blob()}).then(function(e){var t=URL.createObjectURL(new Blob([e])),o=document.createElement("a");o.href=t,o.download=n,document.body.appendChild(o),o.click(),URL.revokeObjectURL(t),o.remove()})};return l().createElement(P.Image.PreviewGroup,{preview:{toolbarRender:function(e,t){var n=t.transform.scale,r=t.actions,i=r.onActive,a=r.onFlipY,c=r.onFlipX,u=r.onRotateLeft,p=r.onRotateRight,f=r.onZoomOut,d=r.onZoomIn,y=r.onReset;return l().createElement(P.Space,{size:14,className:"toolbar-wrapper",style:{fontSize:"20px"}},l().createElement(T.LeftOutlined,{disabled:0===s,onClick:function(){return null==i?void 0:i(-1)}}),l().createElement(T.RightOutlined,{disabled:s===o.length-1,onClick:function(){return null==i?void 0:i(1)}}),l().createElement(T.DownloadOutlined,{onClick:m}),l().createElement(T.SwapOutlined,{rotate:90,onClick:a}),l().createElement(T.SwapOutlined,{onClick:c}),l().createElement(T.RotateLeftOutlined,{onClick:u}),l().createElement(T.RotateRightOutlined,{onClick:p}),l().createElement(T.ZoomOutOutlined,{disabled:1===n,onClick:f}),l().createElement(T.ZoomInOutlined,{disabled:50===n,onClick:d}),l().createElement(T.UndoOutlined,{onClick:y}))},onChange:function(e){console.log(e),p(e)},imageRender:function(e,t){var n=t.image;if((0,r.matchMimetype)(n,"application/pdf"))return l().createElement("iframe",{src:n.url||n.preview,width:"100%",height:"600px",style:{border:"none"}});if((0,r.matchMimetype)(n,"audio/*"))return l().createElement("audio",{controls:!0},l().createElement("source",{src:n.url||n.preview,type:n.type}),"您的浏览器不支持音频标签。");if((0,r.matchMimetype)(n,"video/*"))return l().createElement("video",{controls:!0,width:"100%"},l().createElement("source",{src:n.url||n.preview,type:n.type}),"您的浏览器不支持视频标签。");if((0,r.matchMimetype)(n,"text/plain"))return l().createElement("iframe",{src:n.url||n.preview,width:"100%",height:"600px",style:{border:"none"}});if((0,r.matchMimetype)(n,"image/*"))return e;else return l().createElement(P.Alert,{type:"warning",description:f("File type is not supported for previewing, please download it to preview."),showIcon:!0})}}},l().createElement(P.Space,{size:5,wrap:!0},Array.isArray(o)&&o.map(function(e,t){return l().createElement(ev,{file:e,size:a,key:t,showFileName:c})})))},eO=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=ef(e),function(e,t){if(t&&("object"===eg(t)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,eh()?Reflect.construct(e,t||[],ef(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&eb(n,e),t=[{key:"render",value:function(){var e,t,n=this,o=this.props,r=o.value,i=o.titleField;return i&&(null==(t=this.context.collectionField)||null==(e=t.targetCollection)?void 0:e.template)!=="file"?(0,k.castArray)(r).flatMap(function(e,t){var o=(null==e?void 0:e[i])?l().createElement(ex,ey(ed({key:t},n.props),{value:(0,k.castArray)(null==e?void 0:e[i])})):l().createElement("span",{key:t},"N/A");return 0===t?[o]:[l().createElement("span",{key:"sep-".concat(t)},", "),o]}):l().createElement(ex,ey(ed({},this.props),{value:(0,k.castArray)(r)}))}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,t),n}(r.FieldModel);eO.registerFlow({key:"previewReadPrettySetting",sort:500,title:(0,es.escapeT)("Preview Settings"),steps:{size:{title:(0,es.escapeT)("Size"),uiSchema:function(e){return em(e.model.parent,r.TableColumnModel)?null:{size:{"x-component":"Select","x-decorator":"FormItem",enum:[{value:300,label:(0,es.escapeT)("Large")},{value:100,label:(0,es.escapeT)("Middle")},{value:28,label:(0,es.escapeT)("Small")}]}}},defaultParams:function(e){return{size:em(e.model.parent,r.DetailsItemModel)?100:28}},handler:function(e,t){e.model.setProps("size",t.size)}},showFileName:{title:(0,es.escapeT)("Show file name"),uiSchema:function(e){return em(e.model.parent,r.TableColumnModel)?null:{showFileName:{"x-component":"Switch","x-decorator":"FormItem"}}},defaultParams:{showFileName:!1},handler:function(e,t){e.model.setProps("showFileName",t.showFileName)}}}}),eO.define({label:(0,es.escapeT)("Preview")}),es.DisplayItemModel.bindModelToInterface("DisplayPreviewFieldModel",["url","attachment","attachmentURL","m2m","m2o","o2o","o2m","oho","obo","mbm"],{isDefault:!0,when:function(e,t){return!t.targetCollection||"file"===t.targetCollection.template}});let ew="bits",eS="bytes",ej="jedec",eP={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function eE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function eC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eA(e,t,n){return(eA="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=eI(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n||e):r.value}})(e,t,n||e)}function eI(e){return(eI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){eC(e,t,n[t])})}return e}function eF(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ek(e,t){return(ek=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eR(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eE(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eD=function(){return!!e})()}var eM=function(e){var t,n,o=(0,es.useFlowContext)(),i=(0,a.useMemo)(function(){var t="".concat(e.context.collection.name,":create");if(null==(r=o.view)||null==(n=r.inputArgs)?void 0:n.sourceId){var n,r,i,a=eR(e.context.blockModel.association.resourceName.split("."),2),l=a[0],c=a[1];t="".concat(l,"/").concat(null==(i=o.view)?void 0:i.inputArgs.sourceId,"/").concat(c,":create")}return t},[e.context.collection.name,null==(n=o.view)||null==(t=n.inputArgs)?void 0:t.sourceId]),l={},c=0,u={action:i,onChange:function(t){var n=t.fileList;n.forEach(function(t){if("uploading"!==t.status||l[t.uid]||(c++,l[t.uid]=!0),"uploading"!==t.status&&l[t.uid]&&(delete l[t.uid],0==--c)){var n,o;null==(n=(o=e.context.blockModel.resource).refresh)||n.call(o)}}),n.every(function(e){return"done"===e.status})&&o.view.close()}},s=function(e,t){var n,o,i,l,c,u,s,p,f,m,d,y,b,g,h,v=(i=(o=(0,es.useFlowContext)()).collectionField,l=null==(n=o.collectionField)?void 0:n.targetCollection,c=(0,r.usePlugin)(eZ),u=t.context.blockModel.collection,p=null!=(s=(null==i?void 0:i.storage)||u.storage||l.storage)?s:"",f="storages:getBasicInfo/".concat(p),d=(m=(0,r.useRequest)({url:f},{manual:!0,refreshDeps:[p],cacheKey:f})).loading,y=m.data,b=m.run,(0,a.useEffect)(function(){b()},[b]),g=!d&&(null==y?void 0:y.data)||null,h=c.getStorageType(null==g?void 0:g.type),{storage:g,storageType:h}),x=v.storage,O=v.storageType,w=null==O?void 0:O.useUploadProps,S=(null==w?void 0:w(eT({storage:x,rules:x.rules},e)))||{};return eT({rules:null==x?void 0:x.rules},S)}(u,e);return eT({},u,s)};function eB(e){var t,n,o,r,i,c,u=e.model,s=(0,es.useFlowContext)(),p=eM(u),f=p.rules,m=null!=f?f:{},d=m.size;m.mimetype;var y=(t=null!=d?d:0x1400000,o=(n=(0,D.useTranslation)()).t,r=function(e,{bits:t=!1,pad:n=!1,base:o=-1,round:r=2,locale:i="",localeOptions:a={},separator:l="",spacer:c=" ",symbols:u={},standard:s="",output:p="string",fullform:f=!1,fullforms:m=[],exponent:d=-1,roundingMethod:y="round",precision:b=0}={}){let g=d,h=Number(e),v=[],x=0,O="";"si"===s?(o=10,s=ej):"iec"===s||s===ej?o=2:2===o?s="iec":(o=10,s=ej);let w=10===o?1e3:1024,S=h<0,j=Math[y];if("bigint"!=typeof e&&isNaN(e))throw TypeError("Invalid number");if("function"!=typeof j)throw TypeError("Invalid rounding method");if(S&&(h=-h),(-1===g||isNaN(g))&&(g=Math.floor(Math.log(h)/Math.log(w)))<0&&(g=0),g>8&&(b>0&&(b+=8-g),g=8),"exponent"===p)return g;if(0===h)v[0]=0,O=v[1]=eP.symbol[s][t?ew:eS][g];else{x=h/(2===o?Math.pow(2,10*g):Math.pow(1e3,g)),t&&(x*=8)>=w&&g<8&&(x/=w,g++);let e=Math.pow(10,g>0?r:0);v[0]=j(x*e)/e,v[0]===w&&g<8&&-1===d&&(v[0]=1,g++),O=v[1]=10===o&&1===g?t?"kbit":"kB":eP.symbol[s][t?ew:eS][g]}if(S&&(v[0]=-v[0]),b>0&&(v[0]=v[0].toPrecision(b)),v[1]=u[v[1]]||v[1],!0===i?v[0]=v[0].toLocaleString():i.length>0?v[0]=v[0].toLocaleString(i,a):l.length>0&&(v[0]=v[0].toString().replace(".",l)),n&&r>0){let e=v[0].toString(),t=l||(e.match(/(\D)/g)||[]).pop()||".",n=e.toString().split(t),o=n[1]||"",i=o.length;v[0]=`${n[0]}${t}${o.padEnd(i+(r-i),"0")}`}return!0===f&&(v[1]=m[g]?m[g]:eP.fullform[s][g]+(t?"bit":"byte")+(1===v[0]?"":"s")),"array"===p?v:"object"===p?{value:v[0],symbol:v[1],exponent:g,unit:O}:v.join(c)}(t,{base:2,standard:"jedec",locale:n.i18n.language}),0!==t?o("File size should not exceed {{size}}.",{size:r}):""),b=eR((0,a.useState)(!1),2),g=b[0],h=b[1],v=(0,a.useCallback)(function(e){e.fileList.some(function(e){return"uploading"===e.status})?h(!0):h(!1)},[]),x=s.view.Header;return l().createElement("div",null,l().createElement(x,{title:s.t("Upload file")}),l().createElement("div",{style:{height:"50vh"}},l().createElement(P.Upload.Dragger,eT({multiple:!0,listType:"picture"},(i=eF(eT({},p),{handleChange:v}),c=(0,es.useFlowContext)(),eT({customRequest:function(e){var t=e.action,n=e.data,o=e.file,r=e.filename,i=e.headers,a=e.onError,l=e.onProgress,u=e.onSuccess,s=e.withCredentials,p=new FormData;return n&&Object.keys(n).forEach(function(e){p.append(e,n[e])}),p.append(r,o),c.api.axios.post(t,p,{withCredentials:s,headers:i,onUploadProgress:function(e){var t=e.total;l({percent:Math.round(e.loaded/t*100).toFixed(2)},o)}}).then(function(e){u(e.data,o)}).catch(a).finally(function(){}),{abort:function(){console.log("upload progress is aborted.")}}}},i))),l().createElement("p",{className:"ant-upload-drag-icon"},g?l().createElement(T.LoadingOutlined,{style:{fontSize:36},spin:!0}):l().createElement(T.InboxOutlined,null)),l().createElement("p",{className:"ant-upload-text"},s.t("Click or drag file to this area to upload")),l().createElement("ul",null,l().createElement("li",{className:"ant-upload-hint"},s.t("Support for a single or bulk upload.")),l().createElement("li",{className:"ant-upload-hint"},y)))))}var e_=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=eI(t),eC(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,eD()?Reflect.construct(t,o||[],eI(this).constructor):t.apply(this,o)),"defaultProps",{type:"primary",title:(0,es.escapeT)("Upload"),icon:"UploadOutlined"}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&ek(n,e),t=[{key:"getAclActionName",value:function(){return"create"}},{key:"onInit",value:function(e){var t=this;eA(eI(n.prototype),"onInit",this).call(this,e),this.onUploadClick=function(e){t.dispatchEvent("openView",{event:e})}}},{key:"onUploadClick",set:function(e){this.setProps({onUploadClick:e})}},{key:"render",value:function(){var e=this.props,t=e.icon?l().createElement(r.Icon,{type:e.icon}):void 0;return l().createElement(P.Button,eF(eT({},e),{onClick:this.props.onUploadClick,icon:t}),e.children||e.title)}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,t),n}(r.ActionModel);function eU(e,t,n,o,r,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(o,r)}function eq(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var i=e.apply(t,n);function a(e){eU(i,o,r,a,l,"next",e)}function l(e){eU(i,o,r,a,l,"throw",e)}a(void 0)})}}function ez(e,t,n){return(ez=eV()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return n&&eL(r,n.prototype),r}).apply(null,arguments)}eC(e_,"scene",r.ActionSceneEnum.collection),e_.define({label:(0,es.escapeT)("Upload")}),e_.registerFlow({key:"selectExitRecordSettings",title:(0,es.escapeT)("Selector setting"),on:{eventName:"openView"},steps:{openView:{title:(0,es.escapeT)("Edit popup"),uiSchema:function(e){return{mode:{type:"string",title:(0,es.escapeT)("Open mode"),enum:[{label:(0,es.escapeT)("Drawer"),value:"drawer"},{label:(0,es.escapeT)("Dialog"),value:"dialog"}],"x-decorator":"FormItem","x-component":"Radio.Group"},size:{type:"string",title:(0,es.escapeT)("Popup size"),enum:[{label:(0,es.escapeT)("Small"),value:"small"},{label:(0,es.escapeT)("Medium"),value:"medium"},{label:(0,es.escapeT)("Large"),value:"large"}],"x-decorator":"FormItem","x-component":"Radio.Group"}}},defaultParams:{mode:"drawer",size:"medium"},handler:function(e,t){var n,o=e.inputArgs.mode||t.mode||"drawer",r=e.inputArgs.size||t.size||"medium";e.viewer.open({type:o,width:{drawer:{small:"30%",medium:"50%",large:"70%"},dialog:{small:"40%",medium:"50%",large:"80%"},embed:{}}[o][r],inheritContext:!1,inputArgs:{sourceId:null==(n=e.resource)?void 0:n.getSourceId()},content:function(){return l().createElement(eB,{model:e.model})},styles:{content:eT({padding:0,backgroundColor:e.model.flowEngine.context.themeToken.colorBgLayout},"embed"===o?{position:"absolute",top:0,left:0,right:0,bottom:0}:{}),body:{padding:0}}})}}}});function eN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eK(e){return(eK=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eL(e,t){return(eL=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eG(e){var t="function"==typeof Map?new Map:void 0;return(eG=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return ez(e,arguments,eK(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),eL(n,e)})(e)}function eV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eV=function(){return!!e})()}function eW(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var c=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&c[0]?o.return:c[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,c[1])).done)return r;switch(o=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,o=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<r[3])){a.label=c[1];break}if(6===c[0]&&a.label<r[1]){a.label=r[1],r=c;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(c);break}r[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],o=0}finally{n=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var e$=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=eK(t),eN(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,eV()?Reflect.construct(t,o||[],eK(this).constructor):t.apply(this,o)),"storageTypes",new Map),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&eL(n,e),t=[{key:"load",value:function(){var e=this;return eq(function(){var t;return eW(this,function(n){return e.app.dataSourceManager.addFieldInterfaces([en]),e.app.dataSourceManager.addCollectionTemplates([eu]),e.app.use(j),e.app.pluginSettingsManager.add(M,{title:'{{t("File manager", { ns: "'.concat(M,'" })}}'),icon:"FileOutlined",Component:X,aclSnippet:"pm.file-manager.storages"}),Object.values(z).forEach(function(t){e.registerStorageType(t.name,t)}),null==(t=e.app.schemaInitializerManager.get("table:configureActions"))||t.add("enableActions.upload",{title:"{{t('Upload')}}",Component:"UploadActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return"file"===(0,r.useCollection)().template}}),e.app.addScopes({useAttachmentFieldProps:v,useFileCollectionStorageRules:x,useStorageCfg:u}),e.app.addComponents({FileSizeField:I}),e.flowEngine.registerModels({DisplayPreviewFieldModel:eO,UploadActionModel:e_}),[2]})})()}},{key:"registerStorageType",value:function(e,t){this.storageTypes.set(e,t)}},{key:"getStorageType",value:function(e){return this.storageTypes.get(e)}},{key:"uploadFile",value:function(e){var t=this;return eq(function(){var n,o,r;return eW(this,function(i){switch(i.label){case 0:if(!(null==(n=t.getStorageType(null==e?void 0:e.storageType))?void 0:n.upload))return[3,2];return[4,n.upload({file:e.file,apiClient:t.app.apiClient,storageType:e.storageType,storageId:e.storageId,storageRules:e.storageRules,fileCollectionName:e.fileCollectionName})];case 1:return[2,i.sent()];case 2:return i.trys.push([2,4,,5]),(r=new FormData).append("file",e.file),[4,t.app.apiClient.request({url:"".concat(e.fileCollectionName||"attachments",":create"),method:"post",data:r})];case 3:return[2,{data:null==(o=i.sent().data)?void 0:o.data}];case 4:return[2,{errorMessage:i.sent().message}];case 5:return[2]}})})()}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,t),n}(eG(r.Plugin));eN(e$,"buildInStorage",["local","ali-oss","s3","tx-cos"]);var eZ=e$}(),f}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nocobase/flow-engine"),require("lodash"),require("@formily/shared"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("antd"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-manager",["react","@nocobase/flow-engine","lodash","@formily/shared","@nocobase/client","@formily/react","@ant-design/icons","antd","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-file-manager"]=t(require("react"),require("@nocobase/flow-engine"),require("lodash"),require("@formily/shared"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("antd"),require("react-i18next")):e["@nocobase/plugin-file-manager"]=t(e.react,e["@nocobase/flow-engine"],e.lodash,e["@formily/shared"],e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e.antd,e["react-i18next"])}(self,function(e,t,n,o,r,i,a,l,c){return function(){"use strict";var u={482:function(e){e.exports=a},505:function(e){e.exports=i},875:function(e){e.exports=o},772:function(e){e.exports=r},667:function(e){e.exports=t},721:function(e){e.exports=l},467:function(e){e.exports=n},156:function(t){t.exports=e},238:function(e){e.exports=c}},s={};function p(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return u[e](n,n.exports,p),n.exports}p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var f={};return!function(){p.r(f),p.d(f,{PluginFileManagerClient:function(){return e$},default:function(){return eZ}});var e,t,n,o={};p.r(o),p.d(o,{useAttachmentFieldProps:function(){return v},useFileCollectionStorageRules:function(){return x},useStorageRules:function(){return h},useUploadFiles:function(){return b}});var r=p(772),i=Number.POSITIVE_INFINITY,a=p(156),l=p.n(a);function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function u(){var e,t,n,o,i,l,c,u=(0,r.useCollectionField)(),s=(0,r.useCollectionManager)().getCollection(null==u?void 0:u.target),p=(0,r.useCollection)(),f=(0,r.usePlugin)(eZ),m=(t=null!=(e=(null==u?void 0:u.storage)||(null==p?void 0:p.getOption("storage"))||(null==s?void 0:s.getOption("storage")))?e:"",n="storages:getBasicInfo/".concat(t),i=(o=(0,r.useRequest)({url:n},{manual:!0,refreshDeps:[t],cacheKey:n})).loading,l=o.data,c=o.run,(0,a.useEffect)(function(){c()},[c]),!i&&(null==l?void 0:l.data)||null),d=f.getStorageType(null==m?void 0:m.type);return{storage:m,storageType:d}}function s(e){var t=u(),n=t.storage,o=t.storageType,r=null==o?void 0:o.useUploadProps,i=(null==r?void 0:r(c({storage:n,rules:n.rules},e)))||{};return c({rules:null==n?void 0:n.rules},i)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function d(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(e,t)}}var b=function(){var e=(0,r.useDataBlockRequestGetter)().getDataBlockRequest,t=((0,r.useDataBlockProps)()||{}).association,n=(0,r.useActionContext)().setVisible,o=(0,r.useCollection)(),i=(0,r.useSourceId)(),l=(0,a.useMemo)(function(){var e="".concat(o.name,":create");if(t){var n,r=(n=t.split("."),function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(n,2)||y(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=r[0],l=r[1];e="".concat(a,"/").concat(i,"/").concat(l,":create")}return e},[o.name,t,i]),c=((0,a.useContext)(r.RecordPickerContext)||{}).setSelectedRows,u={},p=0,f={action:l,onChange:function(t){t.forEach(function(n){if("uploading"!==n.status||u[n.uid]||(p++,u[n.uid]=!0),"uploading"!==n.status&&u[n.uid]&&(delete u[n.uid],0==--p)){var o,r;null==(r=e())||null==(o=r.refresh)||o.call(r),null==c||c(function(e){return d(e).concat(d(t.filter(function(e){return"done"===e.status}).map(function(e){return e.response.data})))})}}),t.every(function(e){return"done"===e.status})&&n(!1)}},m=s(f);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},f,m)},g=p(505);function h(e){var t,n=null!=e?e:"";(0,r.useAPIClient)();var o=(0,g.useField)(),i=(0,r.useRequest)({url:"storages:getBasicInfo/".concat(n)},{manual:!0,refreshDeps:[n],cacheKey:n}),l=i.loading,c=i.data,u=i.run;return(0,a.useEffect)(function(){"editable"===o.pattern&&u()},[o.pattern,u]),!l&&(null==c||null==(t=c.data)?void 0:t.rules)||null}function v(){var e=(0,r.useCollectionField)(),t="".concat(null==e?void 0:e.target,":create").concat((null==e?void 0:e.storage)?"?attachmentField=".concat(e.collectionName,".").concat(e.name):""),n=s({action:t});return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({action:t},n)}function x(){var e=(0,r.useCollectionField)(),t=(0,r.useCollectionManager)().getCollection(null==e?void 0:e.target);return h(null==t?void 0:t.getOption("storage"))}var O=function(e){var t,n,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 l().createElement(r.ActionInitializerItem,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},e),n=n={schema:o},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))},w={dumpRules:{group:"user"},migrationRules:["schema-only","overwrite"],asStrategyResource:!0,shared:!0,name:"attachments",createdBy:!0,updatedBy:!0,template:"file",filterTargetKey:"id",fields:[{comment:"用户文件名(不含扩展名)",type:"string",name:"title"},{comment:"系统文件名(含扩展名)",type:"string",name:"filename"},{comment:"扩展名(含“.”)",type:"string",name:"extname"},{comment:"文件体积(字节)",type:"integer",name:"size"},{type:"string",name:"mimetype"},{type:"belongsTo",name:"storage",target:"storages",foreignKey:"storageId",deletable:!1,interface:"m2o",uiSchema:{type:"object",title:"{{t('Storage', { ns: '".concat("file-manager","' })}}"),"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"title"}},"x-read-pretty":!0}},{comment:"相对路径(含“/”前缀)",type:"text",name:"path"},{comment:"其他文件信息(如图片的宽高)",type:"jsonb",name:"meta",defaultValue:{}},{comment:"网络访问地址",type:"text",name:"url"}]},S={dumpRules:"required",migrationRules:["overwrite","schema-only"],name:"storages",shared:!0,fields:[{name:"id",type:"snowflakeId",primaryKey:!0,allowNull:!1},{title:"存储引擎名称",comment:"存储引擎名称",type:"string",name:"title",translation:!0,trim:!0},{title:"英文标识",type:"uid",name:"name",unique:!0,trim:!0},{comment:"类型标识,如 local/ali-oss 等",type:"string",name:"type"},{comment:"配置项",type:"jsonb",name:"options",defaultValue:{}},{comment:"文件规则",type:"jsonb",name:"rules",defaultValue:{}},{comment:"存储相对路径模板",type:"text",name:"path",defaultValue:"",trim:!0},{comment:"访问地址前缀",type:"string",name:"baseUrl",defaultValue:"",trim:!0},{comment:"默认引擎",type:"radio",name:"default",defaultValue:!1},{type:"boolean",name:"paranoid",defaultValue:!1}]},j=function(e){return l().createElement(r.ExtendCollectionsProvider,{collections:[w,S]},l().createElement(r.SchemaComponentOptions,{scope:o,components:{UploadActionInitializer:O}},e.children))},P=p(721),E=[{value:1,label:"Byte"},{value:1024,label:"KB"},{value:1048576,label:"MB"},{value:0x40000000,label:"GB"}];function C(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1048576,n=e||t,o=E.length-1;o>=0;o--){var r=E[o];if(n%r.value==0)return r}return E[0]}function A(e,t,n){return Math.min(Math.max(t,e),n)}function I(e){var t,n=e.value,o=e.defaultUnit,r=void 0===o?1048576:o,c=e.min,u=void 0===c?1:c,s=e.max,p=void 0===s?i:s,f=e.step,m=e.onChange,d=null!=(t=e.defaultValue)?t:0x1400000,y=C(d,r),b=d/y.value,g=C(null!=n?n:d,r),h=null==n?n:n/g.value,v=(0,a.useCallback)(function(e){null==m||m(A(null==e?e:e*g.value,u,p))},[g.value]),x=(0,a.useCallback)(function(e){null==m||m(A(h*e,u,p))},[h]);return l().createElement(P.Space.Compact,null,l().createElement(P.InputNumber,{value:h,onChange:v,defaultValue:"".concat(b),step:void 0===f?1:f}),l().createElement(P.Select,{options:E,value:g.value,onChange:x,className:"auto-width"}))}var T=p(482),F=p(875),k=p(467),R=p.n(k),D=p(238),M="file-manager",B={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: "'.concat(M,'" })}}'),descriptions:'{{t("Will be used for API", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Input"}},{type:"string",name:"type",interface:"select",uiSchema:{title:'{{t("Storage type", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Select",required:!0,enum:"{{ storageTypeOptions }}"}},{type:"string",name:"baseUrl",interface:"input",uiSchema:{title:'{{t("Base URL", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"TextAreaWithGlobalScope",required:!0}},{type:"string",name:"path",interface:"input",uiSchema:{title:'{{t("Path", { ns: "'.concat(M,'" })}}'),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"}}]},_={type:"object",properties:(e={},t=(0,F.uid)(),n={type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:B,resourceName:"storages",request:{resource:"storages",action:"list",params:{pageSize:50,sort:["id"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:B},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete')}}",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:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},default:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{t("Default storage", { ns: "'.concat(M,'" })}}'),properties:{default:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:{type:"void",title:'{{t("Edit")}}',"x-component":"EditStorage","x-component-props":{type:"primary"}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:'{{t("Delete")}}',content:'{{t("Are you sure you want to delete it?")}}'},useAction:"{{cm.useDestroyAction}}"}}}}}}}}}},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e)},U={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",description:'{{t(\'Base URL for file access, could be your CDN base URL. For example: "https://cdn.nocobase.com".\', { ns: "'.concat(M,'" })}}')},path:{"x-component":"CollectionField","x-decorator":"FormItem",description:'{{t(\'Relative path the file will be saved to. Left blank as root path. The leading and trailing slashes "/" will be ignored. For example: "user/avatar".\', { ns: "'.concat(M,'" })}}')},rules:{type:"object","x-component":"fieldset",properties:{size:{type:"number",title:'{{t("File size limit", { ns: "'.concat(M,'" })}}'),description:'{{t("Minimum from 1 byte.", { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"FileSizeField",required:!0,default:0x1400000},mimetype:{type:"string",title:'{{t("File type (in MIME type format)", { ns: "'.concat(M,'" })}}'),description:'{{t(\'Multi-types seperated with comma, for example: "image/*", "image/png", "image/*, application/pdf" etc.\', { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:"*"}}}},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Default storage", { ns: "'.concat(M,'" })}}')},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Keep file in storage when destroy the file record", { ns: "'.concat(M,'" })}}'),description:'{{t("Files are only removed when their corresponding records in the file collection are deleted. If a record from another collection includes an associating field referencing the file collection, the file will not be deleted unless cascade deletion is enabled for that association.", { ns: "'.concat(M,'" })}}')}},q={title:'{{t("Aliyun OSS", { ns: "'.concat(M,'" })}}'),name:"ali-oss",fieldset:{title:U.title,name:U.name,baseUrl:U.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",description:'{{t(\'Aliyun OSS region part of the bucket. For example: "oss-cn-beijing".\', { ns: "'.concat(M,'" })}}'),required:!0},accessKeyId:{title:'{{t("AccessKey ID", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeySecret:{title:'{{t("AccessKey Secret", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},timeout:{title:'{{t("Timeout", { ns: "'.concat(M,'" })}}'),description:"{{t('Upload timeout for a single file in milliseconds. Default is 600000.', { ns: \"".concat(M,'" })}}'),type:"number","x-decorator":"FormItem","x-component":"InputNumber",default:6e5},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"},description:'{{ renderThumbnailRuleDesc("ali-oss") }}'}}},path:U.path,rules:U.rules,default:U.default,paranoid:U.paranoid},thumbnailRuleLink:"https://help.aliyun.com/zh/oss/user-guide/resize-images-4"},z={local:{title:'{{t("Local storage", { ns: "'.concat(M,'" })}}'),name:"local",fieldset:{title:U.title,name:U.name,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: "'.concat(M,'" })}}'),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/"}},rules:U.rules,default:U.default,paranoid:U.paranoid}},"ali-oss":q,s3:{title:'{{t("Amazon S3", { ns: "'.concat(M,'" })}}'),name:"s3",fieldset:{title:U.title,name:U.name,baseUrl:U.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:'{{t("AccessKey ID", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},secretAccessKey:{title:'{{t("AccessKey Secret", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},endpoint:{title:'{{t("Endpoint", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"}}},path:U.path,rules:U.rules,default:U.default,paranoid:U.paranoid}},"tx-cos":{title:'{{t("Tencent COS", { ns: "'.concat(M,'" })}}'),name:"tx-cos",fieldset:{title:U.title,name:U.name,baseUrl:U.baseUrl,options:{type:"object","x-component":"fieldset",properties:{Region:{title:'{{t("Region", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretId:{title:'{{t("SecretId", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretKey:{title:'{{t("SecretKey", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},Bucket:{title:'{{t("Bucket", { ns: "'.concat(M,'" })}}'),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:"?imageMogr2/thumbnail/!50p"},description:'{{ renderThumbnailRuleDesc("tx-cos") }}'}}},path:U.path,rules:U.rules,default:U.default,paranoid:U.paranoid},thumbnailRuleLink:"https://cloud.tencent.com/document/product/436/42214"}};function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){K(e,t,n[t])})}return e}function G(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(e,t)||$(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e){return function(e){if(Array.isArray(e))return N(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N(e,t)}}var Z=function(){var e=V((0,a.useState)({}),2),t=e[0],n=e[1],o=(0,r.usePlugin)(eZ),i=(0,r.useCompile)(),c=V((0,a.useState)(!1),2),u=c[0],s=c[1],p=(0,D.useTranslation)().t;return l().createElement("div",null,l().createElement(r.ActionContext.Provider,{value:{visible:u,setVisible:s}},l().createElement(P.Dropdown,{menu:{onClick:function(e){var t=o.storageTypes.get(e.key);s(!0),n({type:"object",properties:K({},(0,F.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{type:t.name}},title:i("{{t('Add new')}}")+" - "+i(t.title),properties:G(L({},R().cloneDeep(t.fieldset)),{footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}})})})},items:W(o.storageTypes.values()).map(function(e){return{key:e.name,label:i(e.title)}})}},l().createElement(P.Button,{type:"primary",icon:l().createElement(T.PlusOutlined,null)},p("Add new")," ",l().createElement(T.DownOutlined,null))),l().createElement(r.SchemaComponent,{scope:{createOnly:!0},schema:t})))},Y=function(){var e=(0,r.useRecord)(),t=V((0,a.useState)({}),2),n=t[0],o=t[1],i=(0,r.usePlugin)(eZ),c=(0,r.useCompile)(),u=V((0,a.useState)(!1),2),s=u[0],p=u[1],f=(0,D.useTranslation)().t;return l().createElement("div",null,l().createElement(r.ActionContext.Provider,{value:{visible:s,setVisible:p}},l().createElement("a",{onClick:function(){p(!0);var t=i.storageTypes.get(e.type);t.fieldset.default&&(t.fieldset.default["x-reactions"]=function(e){e.initialValue?e.disabled=!0:e.disabled=!1}),o({type:"object",properties:K({},(0,F.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:L({},e)},title:c("{{t('Edit')}}")+" - "+c(t.title),properties:G(L({},R().cloneDeep(t.fieldset)),{footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}})})})}},f("Edit")),l().createElement(r.SchemaComponent,{scope:{createOnly:!1},schema:n})))};function H(e){var t=z[e];return(null==t?void 0:t.thumbnailRule)?l().createElement("div",null,l().createElement("a",{target:"_blank",href:t.thumbnailRuleLink,rel:"noreferrer"},r.i18n.t("See more"))):null}var X=function(){var e=(0,r.useCompile)(),t=W((0,r.usePlugin)(eZ).storageTypes.values()).map(function(t){return{value:t.name,label:e(t.title)}});return l().createElement(P.Card,{bordered:!1},l().createElement(r.SchemaComponent,{components:{CreateStorage:Z,EditStorage:Y},scope:{useNewId:function(e){return"".concat(e).concat((0,F.uid)())},storageTypeOptions:t,renderThumbnailRuleDesc:H},schema:_}))};function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q(e){return(Q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ee(e,t){return(ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function et(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(et=function(){return!!e})()}var en=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,o,i,a;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=Q(t),J(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,et()?Reflect.construct(t,o||[],Q(this).constructor):t.apply(this,o)),"name","attachment"),J(e,"type","object"),J(e,"group","media"),J(e,"title",'{{t("Attachment", { ns: "'.concat(M,'" })}}')),J(e,"isAssociation",!0),J(e,"default",{type:"belongsToMany",target:"attachments",uiSchema:{type:"array","x-component":"Upload.Attachment","x-use-component-props":"useAttachmentFieldProps"}}),J(e,"availableTypes",["belongsToMany"]),J(e,"properties",(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){J(e,t,n[t])})}return e}({},r.interfacesProperties.defaultProps),a=a={"uiSchema.x-component-props.accept":{type:"string",title:'{{t("MIME type", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-component-props":{placeholder:"image/*"},"x-decorator":"FormItem",description:"Example: image/png"},"uiSchema.x-component-props.multiple":{type:"boolean","x-content":"{{t('Allow uploading multiple files', { ns: \"".concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"Checkbox",default:!0},storage:{type:"string",title:'{{t("Storage", { ns: "'.concat(M,'" })}}'),description:"{{t('Default storage will be used when not selected', { ns: \"".concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i)),J(e,"filterable",{children:[{name:"id",value:"id",title:'{{t("Exists")}}',label:'{{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",value:"filename",title:'{{t("Filename", { ns: "'.concat(M,'" })}}'),label:'{{t("Filename", { ns: "'.concat(M,'" })}}'),operators:r.interfacesProperties.operators.string,schema:{title:'{{t("Filename", { ns: "'.concat(M,'" })}}'),type:"string","x-component":"Input"}}]}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&ee(n,e),t=[{key:"schemaInitialize",value:function(e,t){var n=t.block;t.field,e["x-component-props"]||(e["x-component-props"]={}),["Table","Kanban"].includes(n)&&(e["x-component-props"].size="small"),e["x-use-component-props"]="useAttachmentFieldProps"}},{key:"initialize",value:function(e){e.through||(e.through="t_".concat((0,F.uid)())),e.foreignKey||(e.foreignKey="f_".concat((0,F.uid)())),e.otherKey||(e.otherKey="f_".concat((0,F.uid)())),e.sourceKey||(e.sourceKey="id"),e.targetKey||(e.targetKey="id")}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,t),n}(r.CollectionFieldInterface);function eo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function er(e){return(er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ei(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){eo(e,t,n[t])})}return e}function ea(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function el(e,t){return(el=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ec(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ec=function(){return!!e})()}var eu=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,n,o;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return n=t,o=arguments,n=er(n),eo(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,ec()?Reflect.construct(n,o||[],er(this).constructor):n.apply(this,o)),"name","file"),eo(e,"title",'{{t("File collection", { ns: "'.concat(M,'" })}}')),eo(e,"order",3),eo(e,"color","blue"),eo(e,"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: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"extname",deletable:!1,uiSchema:{type:"string",title:'{{t("Extension name", { ns: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"integer",type:"integer",name:"size",deletable:!1,uiSchema:{type:"number",title:'{{t("Size", { ns: "'.concat(M,'" })}}'),"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: "'.concat(M,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"text",name:"path",deletable:!1,uiSchema:{type:"string",title:'{{t("Path", { ns: "'.concat(M,'" })}}'),"x-component":"TextAreaWithGlobalScope","x-read-pretty":!0}},{interface:"url",type:"text",name:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("URL")}}',"x-component":"Input.URL","x-read-pretty":!0}},{interface:"url",type:"text",name:"preview",field:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("Preview", { ns: "'.concat(M,'" })}}'),"x-component":"Preview","x-read-pretty":!0}},{type:"belongsTo",name:"storage",target:"storages",foreignKey:"storageId",deletable:!1,interface:"m2o",uiSchema:{type:"object",title:'{{t("Storage", { ns: "'.concat(M,'" })}}'),"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"title"}},"x-read-pretty":!0}},{type:"jsonb",name:"meta",deletable:!1,defaultValue:{}}]}),eo(e,"presetFieldsDisabled",!0),eo(e,"configurableProperties",ei(ea(ei(ea(ei({},(0,r.getConfigurableProperties)("title","name")),{inherits:ea(ei({},(0,r.getConfigurableProperties)("inherits").inherits),{"x-reactions":["{{useAsyncDataSource(loadCollections)}}"]})}),(0,r.getConfigurableProperties)("category","description")),{storage:{type:"string",name:"storage",title:'{{t("File storage", { ns: "'.concat(M,'" })}}'),"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}}),(0,r.getConfigurableProperties)("presetFields"))),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&el(t,e),t}(r.CollectionTemplate),es=p(667);function ep(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function ef(e){return(ef=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function em(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function ed(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function ey(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function eb(e,t){return(eb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eg(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function eh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eh=function(){return!!e})()}var ev=function(e){var t,n,o=e.file,r=e.size,i=e.showFileName,a="string"==typeof o?o:(null==o?void 0:o.preview)||(null==o?void 0:o.url);if(a){var c="string"==typeof o?a.split("/").pop():(null==o?void 0:o.name)||(null==o?void 0:o.filename)||(null==o||null==(t=o.url)?void 0:t.split("/").pop()),u=(null==(n=a.split(".").pop())?void 0:n.toLowerCase())||"",s={pdf:"/file-placeholder/pdf-200-200.png",mp4:"/file-placeholder/video-200-200.png",mov:"/file-placeholder/video-200-200.png",doc:"/file-placeholder/docx-200-200.png",docx:"/file-placeholder/docx-200-200.png",xls:"/file-placeholder/xlsx-200-200.png",xlsx:"/file-placeholder/xlsx-200-200.png",ppt:"/file-placeholder/ppt-200-200.png",pptx:"/file-placeholder/ppt-200-200.png",jpg:"/file-placeholder/image-200-200.png",jpeg:"/file-placeholder/image-200-200.png",png:"/file-placeholder/image-200-200.png",gif:"/file-placeholder/image-200-200.png",default:"/file-placeholder/unknown-200-200.png"};!function(e){var t="",n="";if("string"==typeof e){var o=e.split("?")[0].split("#")[0],r=o.lastIndexOf(".");-1!==r&&(n=o.substring(r).toLowerCase())}else if((void 0===e?"undefined":eg(e))==="object"&&null!==e&&(t=e.mimetype||"",!(n=(e.extname||"").toLowerCase())&&e.url)){var i=e.url.split("?")[0].split("#")[0],a=i.lastIndexOf(".");-1!==a&&(n=i.substring(a).toLowerCase())}if(!(t&&(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||"application/pdf"===t||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===t)))[".png",".jpg",".jpeg",".webp",".gif",".bmp"].includes(n)||[".mp4",".avi",".mov",".wmv",".flv",".mkv"].includes(n)||[".mp3",".wav",".aac",".ogg"].includes(n)||[".pdf"].includes(n)||[".xlsx"].includes(n)}(o);var p=s[u]||s.default,f=l().createElement(P.Image,{src:a,fallback:p,width:r,height:r,preview:{mask:l().createElement(T.EyeOutlined,null)},style:{borderRadius:4,objectFit:"cover",boxShadow:"0 0 0 2px #fff"}});return l().createElement("div",{style:{textAlign:"center",width:r,wordBreak:"break-all"}},f,i&&l().createElement(P.Tooltip,{title:c},l().createElement("div",{style:{fontSize:12,marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%"}},c)))}},ex=function(e){var t,n=e.value,o=void 0===n?[]:n,i=e.size,a=void 0===i?28:i,c=e.showFileName,u=(t=l().useState(0),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return ep(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ep(e,t)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=u[0],p=u[1],f=(0,D.useTranslation)().t,m=function(){var e=o[s].url,t=e.slice(e.lastIndexOf(".")),n=Date.now()+t;fetch(e).then(function(e){return e.blob()}).then(function(e){var t=URL.createObjectURL(new Blob([e])),o=document.createElement("a");o.href=t,o.download=n,document.body.appendChild(o),o.click(),URL.revokeObjectURL(t),o.remove()})};return l().createElement(P.Image.PreviewGroup,{preview:{toolbarRender:function(e,t){var n=t.transform.scale,r=t.actions,i=r.onActive,a=r.onFlipY,c=r.onFlipX,u=r.onRotateLeft,p=r.onRotateRight,f=r.onZoomOut,d=r.onZoomIn,y=r.onReset;return l().createElement(P.Space,{size:14,className:"toolbar-wrapper",style:{fontSize:"20px"}},l().createElement(T.LeftOutlined,{disabled:0===s,onClick:function(){return null==i?void 0:i(-1)}}),l().createElement(T.RightOutlined,{disabled:s===o.length-1,onClick:function(){return null==i?void 0:i(1)}}),l().createElement(T.DownloadOutlined,{onClick:m}),l().createElement(T.SwapOutlined,{rotate:90,onClick:a}),l().createElement(T.SwapOutlined,{onClick:c}),l().createElement(T.RotateLeftOutlined,{onClick:u}),l().createElement(T.RotateRightOutlined,{onClick:p}),l().createElement(T.ZoomOutOutlined,{disabled:1===n,onClick:f}),l().createElement(T.ZoomInOutlined,{disabled:50===n,onClick:d}),l().createElement(T.UndoOutlined,{onClick:y}))},onChange:function(e){console.log(e),p(e)},imageRender:function(e,t){var n=t.image;if((0,r.matchMimetype)(n,"application/pdf"))return l().createElement("iframe",{src:n.url||n.preview,width:"100%",height:"600px",style:{border:"none"}});if((0,r.matchMimetype)(n,"audio/*"))return l().createElement("audio",{controls:!0},l().createElement("source",{src:n.url||n.preview,type:n.type}),"您的浏览器不支持音频标签。");if((0,r.matchMimetype)(n,"video/*"))return l().createElement("video",{controls:!0,width:"100%"},l().createElement("source",{src:n.url||n.preview,type:n.type}),"您的浏览器不支持视频标签。");if((0,r.matchMimetype)(n,"text/plain"))return l().createElement("iframe",{src:n.url||n.preview,width:"100%",height:"600px",style:{border:"none"}});if((0,r.matchMimetype)(n,"image/*"))return e;else return l().createElement(P.Alert,{type:"warning",description:f("File type is not supported for previewing, please download it to preview."),showIcon:!0})}}},l().createElement(P.Space,{size:5,wrap:!0},Array.isArray(o)&&o.map(function(e,t){return l().createElement(ev,{file:e,size:a,key:t,showFileName:c})})))},eO=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=ef(e),function(e,t){if(t&&("object"===eg(t)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,eh()?Reflect.construct(e,t||[],ef(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&eb(n,e),t=[{key:"render",value:function(){var e=this,t=this.props,n=t.value,o=t.titleField,r=t.target;return o&&"file"!==r?(0,k.castArray)(n).flatMap(function(t,n){var r=null==t?void 0:t[o],i=(void 0===r?"undefined":eg(r))==="object"?r:t,a=i?l().createElement(ex,ey(ed({key:n},e.props),{value:(0,k.castArray)(i)})):l().createElement("span",{key:n},"N/A");return 0===n?[a]:[l().createElement("span",{key:"sep-".concat(n)},", "),a]}):l().createElement(ex,ey(ed({},this.props),{value:(0,k.castArray)(n)}))}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,t),n}(r.FieldModel);eO.registerFlow({key:"previewReadPrettySetting",sort:500,title:(0,es.escapeT)("Preview Settings"),steps:{size:{title:(0,es.escapeT)("Size"),uiSchema:function(e){return em(e.model.parent,r.TableColumnModel)?null:{size:{"x-component":"Select","x-decorator":"FormItem",enum:[{value:300,label:(0,es.escapeT)("Large")},{value:100,label:(0,es.escapeT)("Middle")},{value:28,label:(0,es.escapeT)("Small")}]}}},defaultParams:function(e){return{size:em(e.model.parent,r.DetailsItemModel)?100:28}},handler:function(e,t){e.model.setProps("size",t.size)}},showFileName:{title:(0,es.escapeT)("Show file name"),uiSchema:function(e){return em(e.model.parent,r.TableColumnModel)?null:{showFileName:{"x-component":"Switch","x-decorator":"FormItem"}}},defaultParams:{showFileName:!1},handler:function(e,t){e.model.setProps("showFileName",t.showFileName)}}}}),eO.define({label:(0,es.escapeT)("Preview")}),es.DisplayItemModel.bindModelToInterface("DisplayPreviewFieldModel",["url","attachment","attachmentURL","m2m","m2o","o2o","o2m","oho","obo","mbm"],{isDefault:!0,when:function(e,t){return!t.targetCollection||"file"===t.targetCollection.template}});let ew="bits",eS="bytes",ej="jedec",eP={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function eE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function eC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eA(e,t,n){return(eA="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=eI(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(n||e):r.value}})(e,t,n||e)}function eI(e){return(eI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){eC(e,t,n[t])})}return e}function eF(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ek(e,t){return(ek=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eR(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eE(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eD=function(){return!!e})()}var eM=function(e){var t,n,o=(0,es.useFlowContext)(),i=(0,a.useMemo)(function(){var t="".concat(e.context.collection.name,":create");if(null==(r=o.view)||null==(n=r.inputArgs)?void 0:n.sourceId){var n,r,i,a=eR(e.context.blockModel.association.resourceName.split("."),2),l=a[0],c=a[1];t="".concat(l,"/").concat(null==(i=o.view)?void 0:i.inputArgs.sourceId,"/").concat(c,":create")}return t},[e.context.collection.name,null==(n=o.view)||null==(t=n.inputArgs)?void 0:t.sourceId]),l={},c=0,u={action:i,onChange:function(t){var n=t.fileList;n.forEach(function(t){if("uploading"!==t.status||l[t.uid]||(c++,l[t.uid]=!0),"uploading"!==t.status&&l[t.uid]&&(delete l[t.uid],0==--c)){var n,o;null==(n=(o=e.context.blockModel.resource).refresh)||n.call(o)}}),n.every(function(e){return"done"===e.status})&&o.view.close()}},s=function(e,t){var n,o,i,l,c,u,s,p,f,m,d,y,b,g,h,v=(i=(o=(0,es.useFlowContext)()).collectionField,l=null==(n=o.collectionField)?void 0:n.targetCollection,c=(0,r.usePlugin)(eZ),u=t.context.blockModel.collection,p=null!=(s=(null==i?void 0:i.storage)||u.storage||l.storage)?s:"",f="storages:getBasicInfo/".concat(p),d=(m=(0,r.useRequest)({url:f},{manual:!0,refreshDeps:[p],cacheKey:f})).loading,y=m.data,b=m.run,(0,a.useEffect)(function(){b()},[b]),g=!d&&(null==y?void 0:y.data)||null,h=c.getStorageType(null==g?void 0:g.type),{storage:g,storageType:h}),x=v.storage,O=v.storageType,w=null==O?void 0:O.useUploadProps,S=(null==w?void 0:w(eT({storage:x,rules:x.rules},e)))||{};return eT({rules:null==x?void 0:x.rules},S)}(u,e);return eT({},u,s)};function eB(e){var t,n,o,r,i,c,u=e.model,s=(0,es.useFlowContext)(),p=eM(u),f=p.rules,m=null!=f?f:{},d=m.size;m.mimetype;var y=(t=null!=d?d:0x1400000,o=(n=(0,D.useTranslation)()).t,r=function(e,{bits:t=!1,pad:n=!1,base:o=-1,round:r=2,locale:i="",localeOptions:a={},separator:l="",spacer:c=" ",symbols:u={},standard:s="",output:p="string",fullform:f=!1,fullforms:m=[],exponent:d=-1,roundingMethod:y="round",precision:b=0}={}){let g=d,h=Number(e),v=[],x=0,O="";"si"===s?(o=10,s=ej):"iec"===s||s===ej?o=2:2===o?s="iec":(o=10,s=ej);let w=10===o?1e3:1024,S=h<0,j=Math[y];if("bigint"!=typeof e&&isNaN(e))throw TypeError("Invalid number");if("function"!=typeof j)throw TypeError("Invalid rounding method");if(S&&(h=-h),(-1===g||isNaN(g))&&(g=Math.floor(Math.log(h)/Math.log(w)))<0&&(g=0),g>8&&(b>0&&(b+=8-g),g=8),"exponent"===p)return g;if(0===h)v[0]=0,O=v[1]=eP.symbol[s][t?ew:eS][g];else{x=h/(2===o?Math.pow(2,10*g):Math.pow(1e3,g)),t&&(x*=8)>=w&&g<8&&(x/=w,g++);let e=Math.pow(10,g>0?r:0);v[0]=j(x*e)/e,v[0]===w&&g<8&&-1===d&&(v[0]=1,g++),O=v[1]=10===o&&1===g?t?"kbit":"kB":eP.symbol[s][t?ew:eS][g]}if(S&&(v[0]=-v[0]),b>0&&(v[0]=v[0].toPrecision(b)),v[1]=u[v[1]]||v[1],!0===i?v[0]=v[0].toLocaleString():i.length>0?v[0]=v[0].toLocaleString(i,a):l.length>0&&(v[0]=v[0].toString().replace(".",l)),n&&r>0){let e=v[0].toString(),t=l||(e.match(/(\D)/g)||[]).pop()||".",n=e.toString().split(t),o=n[1]||"",i=o.length;v[0]=`${n[0]}${t}${o.padEnd(i+(r-i),"0")}`}return!0===f&&(v[1]=m[g]?m[g]:eP.fullform[s][g]+(t?"bit":"byte")+(1===v[0]?"":"s")),"array"===p?v:"object"===p?{value:v[0],symbol:v[1],exponent:g,unit:O}:v.join(c)}(t,{base:2,standard:"jedec",locale:n.i18n.language}),0!==t?o("File size should not exceed {{size}}.",{size:r}):""),b=eR((0,a.useState)(!1),2),g=b[0],h=b[1],v=(0,a.useCallback)(function(e){e.fileList.some(function(e){return"uploading"===e.status})?h(!0):h(!1)},[]),x=s.view.Header;return l().createElement("div",null,l().createElement(x,{title:s.t("Upload file")}),l().createElement("div",{style:{height:"50vh"}},l().createElement(P.Upload.Dragger,eT({multiple:!0,listType:"picture"},(i=eF(eT({},p),{handleChange:v}),c=(0,es.useFlowContext)(),eT({customRequest:function(e){var t=e.action,n=e.data,o=e.file,r=e.filename,i=e.headers,a=e.onError,l=e.onProgress,u=e.onSuccess,s=e.withCredentials,p=new FormData;return n&&Object.keys(n).forEach(function(e){p.append(e,n[e])}),p.append(r,o),c.api.axios.post(t,p,{withCredentials:s,headers:i,onUploadProgress:function(e){var t=e.total;l({percent:Math.round(e.loaded/t*100).toFixed(2)},o)}}).then(function(e){u(e.data,o)}).catch(a).finally(function(){}),{abort:function(){console.log("upload progress is aborted.")}}}},i))),l().createElement("p",{className:"ant-upload-drag-icon"},g?l().createElement(T.LoadingOutlined,{style:{fontSize:36},spin:!0}):l().createElement(T.InboxOutlined,null)),l().createElement("p",{className:"ant-upload-text"},s.t("Click or drag file to this area to upload")),l().createElement("ul",null,l().createElement("li",{className:"ant-upload-hint"},s.t("Support for a single or bulk upload.")),l().createElement("li",{className:"ant-upload-hint"},y)))))}var e_=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=eI(t),eC(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,eD()?Reflect.construct(t,o||[],eI(this).constructor):t.apply(this,o)),"defaultProps",{type:"primary",title:(0,es.escapeT)("Upload"),icon:"UploadOutlined"}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&ek(n,e),t=[{key:"getAclActionName",value:function(){return"create"}},{key:"onInit",value:function(e){var t=this;eA(eI(n.prototype),"onInit",this).call(this,e),this.onUploadClick=function(e){t.dispatchEvent("openView",{event:e})}}},{key:"onUploadClick",set:function(e){this.setProps({onUploadClick:e})}},{key:"render",value:function(){var e=this.props,t=e.icon?l().createElement(r.Icon,{type:e.icon}):void 0;return l().createElement(P.Button,eF(eT({},e),{onClick:this.props.onUploadClick,icon:t}),e.children||e.title)}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,t),n}(r.ActionModel);function eU(e,t,n,o,r,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(o,r)}function eq(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var i=e.apply(t,n);function a(e){eU(i,o,r,a,l,"next",e)}function l(e){eU(i,o,r,a,l,"throw",e)}a(void 0)})}}function ez(e,t,n){return(ez=eV()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return n&&eL(r,n.prototype),r}).apply(null,arguments)}eC(e_,"scene",r.ActionSceneEnum.collection),e_.define({label:(0,es.escapeT)("Upload")}),e_.registerFlow({key:"selectExitRecordSettings",title:(0,es.escapeT)("Selector setting"),on:{eventName:"openView"},steps:{openView:{title:(0,es.escapeT)("Edit popup"),uiSchema:function(e){return{mode:{type:"string",title:(0,es.escapeT)("Open mode"),enum:[{label:(0,es.escapeT)("Drawer"),value:"drawer"},{label:(0,es.escapeT)("Dialog"),value:"dialog"}],"x-decorator":"FormItem","x-component":"Radio.Group"},size:{type:"string",title:(0,es.escapeT)("Popup size"),enum:[{label:(0,es.escapeT)("Small"),value:"small"},{label:(0,es.escapeT)("Medium"),value:"medium"},{label:(0,es.escapeT)("Large"),value:"large"}],"x-decorator":"FormItem","x-component":"Radio.Group"}}},defaultParams:{mode:"drawer",size:"medium"},handler:function(e,t){var n,o=e.inputArgs.mode||t.mode||"drawer",r=e.inputArgs.size||t.size||"medium";e.viewer.open({type:o,width:{drawer:{small:"30%",medium:"50%",large:"70%"},dialog:{small:"40%",medium:"50%",large:"80%"},embed:{}}[o][r],inheritContext:!1,inputArgs:{sourceId:null==(n=e.resource)?void 0:n.getSourceId()},content:function(){return l().createElement(eB,{model:e.model})},styles:{content:eT({padding:0,backgroundColor:e.model.flowEngine.context.themeToken.colorBgLayout},"embed"===o?{position:"absolute",top:0,left:0,right:0,bottom:0}:{}),body:{padding:0}}})}}}});function eN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eK(e){return(eK=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eL(e,t){return(eL=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eG(e){var t="function"==typeof Map?new Map:void 0;return(eG=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return ez(e,arguments,eK(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),eL(n,e)})(e)}function eV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eV=function(){return!!e})()}function eW(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var c=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&c[0]?o.return:c[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,c[1])).done)return r;switch(o=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,o=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<r[3])){a.label=c[1];break}if(6===c[0]&&a.label<r[1]){a.label=r[1],r=c;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(c);break}r[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],o=0}finally{n=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var e$=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=eK(t),eN(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,eV()?Reflect.construct(t,o||[],eK(this).constructor):t.apply(this,o)),"storageTypes",new Map),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&eL(n,e),t=[{key:"load",value:function(){var e=this;return eq(function(){var t;return eW(this,function(n){return e.app.dataSourceManager.addFieldInterfaces([en]),e.app.dataSourceManager.addCollectionTemplates([eu]),e.app.use(j),e.app.pluginSettingsManager.add(M,{title:'{{t("File manager", { ns: "'.concat(M,'" })}}'),icon:"FileOutlined",Component:X,aclSnippet:"pm.file-manager.storages"}),Object.values(z).forEach(function(t){e.registerStorageType(t.name,t)}),null==(t=e.app.schemaInitializerManager.get("table:configureActions"))||t.add("enableActions.upload",{title:"{{t('Upload')}}",Component:"UploadActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return"file"===(0,r.useCollection)().template}}),e.app.addScopes({useAttachmentFieldProps:v,useFileCollectionStorageRules:x,useStorageCfg:u}),e.app.addComponents({FileSizeField:I}),e.flowEngine.registerModels({DisplayPreviewFieldModel:eO,UploadActionModel:e_}),[2]})})()}},{key:"registerStorageType",value:function(e,t){this.storageTypes.set(e,t)}},{key:"getStorageType",value:function(e){return this.storageTypes.get(e)}},{key:"uploadFile",value:function(e){var t=this;return eq(function(){var n,o,r;return eW(this,function(i){switch(i.label){case 0:if(!(null==(n=t.getStorageType(null==e?void 0:e.storageType))?void 0:n.upload))return[3,2];return[4,n.upload({file:e.file,apiClient:t.app.apiClient,storageType:e.storageType,storageId:e.storageId,storageRules:e.storageRules,fileCollectionName:e.fileCollectionName})];case 1:return[2,i.sent()];case 2:return i.trys.push([2,4,,5]),(r=new FormData).append("file",e.file),[4,t.app.apiClient.request({url:"".concat(e.fileCollectionName||"attachments",":create"),method:"post",data:r})];case 3:return[2,{data:null==(o=i.sent().data)?void 0:o.data}];case 4:return[2,{errorMessage:i.sent().message}];case 5:return[2]}})})()}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,t),n}(eG(r.Plugin));eN(e$,"buildInStorage",["local","ali-oss","s3","tx-cos"]);var eZ=e$}(),f}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.0.0-alpha.
|
|
11
|
+
"@nocobase/client": "2.0.0-alpha.7",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"antd": "5.24.2",
|
|
14
14
|
"@ant-design/icons": "5.6.1",
|
|
@@ -19,13 +19,13 @@ module.exports = {
|
|
|
19
19
|
"@formily/core": "2.3.7",
|
|
20
20
|
"@formily/react": "2.3.7",
|
|
21
21
|
"multer": "1.4.5-lts.2",
|
|
22
|
-
"@nocobase/database": "2.0.0-alpha.
|
|
23
|
-
"@nocobase/server": "2.0.0-alpha.
|
|
24
|
-
"@nocobase/utils": "2.0.0-alpha.
|
|
25
|
-
"@nocobase/test": "2.0.0-alpha.
|
|
26
|
-
"@nocobase/flow-engine": "2.0.0-alpha.
|
|
27
|
-
"@nocobase/actions": "2.0.0-alpha.
|
|
22
|
+
"@nocobase/database": "2.0.0-alpha.7",
|
|
23
|
+
"@nocobase/server": "2.0.0-alpha.7",
|
|
24
|
+
"@nocobase/utils": "2.0.0-alpha.7",
|
|
25
|
+
"@nocobase/test": "2.0.0-alpha.7",
|
|
26
|
+
"@nocobase/flow-engine": "2.0.0-alpha.7",
|
|
27
|
+
"@nocobase/actions": "2.0.0-alpha.7",
|
|
28
28
|
"sequelize": "6.35.2",
|
|
29
|
-
"@nocobase/plugin-data-source-main": "2.0.0-alpha.
|
|
29
|
+
"@nocobase/plugin-data-source-main": "2.0.0-alpha.7",
|
|
30
30
|
"axios": "1.7.7"
|
|
31
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@aws-sdk/client-s3","description":"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native","version":"3.750.0","scripts":{"build":"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3","test":"yarn g:vitest run","test:browser":"node ./test/browser-build/esbuild && yarn g:vitest run -c vitest.config.browser.ts","test:browser:watch":"node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.ts","test:e2e":"yarn g:vitest run -c vitest.config.e2e.ts && yarn test:browser","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.ts","test:watch":"yarn g:vitest watch"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.750.0","@aws-sdk/credential-provider-node":"3.750.0","@aws-sdk/middleware-bucket-endpoint":"3.734.0","@aws-sdk/middleware-expect-continue":"3.734.0","@aws-sdk/middleware-flexible-checksums":"3.750.0","@aws-sdk/middleware-host-header":"3.734.0","@aws-sdk/middleware-location-constraint":"3.734.0","@aws-sdk/middleware-logger":"3.734.0","@aws-sdk/middleware-recursion-detection":"3.734.0","@aws-sdk/middleware-sdk-s3":"3.750.0","@aws-sdk/middleware-ssec":"3.734.0","@aws-sdk/middleware-user-agent":"3.750.0","@aws-sdk/region-config-resolver":"3.734.0","@aws-sdk/signature-v4-multi-region":"3.750.0","@aws-sdk/types":"3.734.0","@aws-sdk/util-endpoints":"3.743.0","@aws-sdk/util-user-agent-browser":"3.734.0","@aws-sdk/util-user-agent-node":"3.750.0","@aws-sdk/xml-builder":"3.734.0","@smithy/config-resolver":"^4.0.1","@smithy/core":"^3.1.4","@smithy/eventstream-serde-browser":"^4.0.1","@smithy/eventstream-serde-config-resolver":"^4.0.1","@smithy/eventstream-serde-node":"^4.0.1","@smithy/fetch-http-handler":"^5.0.1","@smithy/hash-blob-browser":"^4.0.1","@smithy/hash-node":"^4.0.1","@smithy/hash-stream-node":"^4.0.1","@smithy/invalid-dependency":"^4.0.1","@smithy/md5-js":"^4.0.1","@smithy/middleware-content-length":"^4.0.1","@smithy/middleware-endpoint":"^4.0.5","@smithy/middleware-retry":"^4.0.6","@smithy/middleware-serde":"^4.0.2","@smithy/middleware-stack":"^4.0.1","@smithy/node-config-provider":"^4.0.1","@smithy/node-http-handler":"^4.0.2","@smithy/protocol-http":"^5.0.1","@smithy/smithy-client":"^4.1.5","@smithy/types":"^4.1.0","@smithy/url-parser":"^4.0.1","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.6","@smithy/util-defaults-mode-node":"^4.0.6","@smithy/util-endpoints":"^3.0.1","@smithy/util-middleware":"^4.0.1","@smithy/util-retry":"^4.0.1","@smithy/util-stream":"^4.1.1","@smithy/util-utf8":"^4.0.0","@smithy/util-waiter":"^4.0.2","tslib":"^2.6.2"},"devDependencies":{"@aws-sdk/signature-v4-crt":"3.750.0","@tsconfig/node18":"18.2.4","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.2.2"},"engines":{"node":">=18.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-s3"},"_lastModified":"2025-10-
|
|
1
|
+
{"name":"@aws-sdk/client-s3","description":"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native","version":"3.750.0","scripts":{"build":"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3","test":"yarn g:vitest run","test:browser":"node ./test/browser-build/esbuild && yarn g:vitest run -c vitest.config.browser.ts","test:browser:watch":"node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.ts","test:e2e":"yarn g:vitest run -c vitest.config.e2e.ts && yarn test:browser","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.ts","test:watch":"yarn g:vitest watch"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.750.0","@aws-sdk/credential-provider-node":"3.750.0","@aws-sdk/middleware-bucket-endpoint":"3.734.0","@aws-sdk/middleware-expect-continue":"3.734.0","@aws-sdk/middleware-flexible-checksums":"3.750.0","@aws-sdk/middleware-host-header":"3.734.0","@aws-sdk/middleware-location-constraint":"3.734.0","@aws-sdk/middleware-logger":"3.734.0","@aws-sdk/middleware-recursion-detection":"3.734.0","@aws-sdk/middleware-sdk-s3":"3.750.0","@aws-sdk/middleware-ssec":"3.734.0","@aws-sdk/middleware-user-agent":"3.750.0","@aws-sdk/region-config-resolver":"3.734.0","@aws-sdk/signature-v4-multi-region":"3.750.0","@aws-sdk/types":"3.734.0","@aws-sdk/util-endpoints":"3.743.0","@aws-sdk/util-user-agent-browser":"3.734.0","@aws-sdk/util-user-agent-node":"3.750.0","@aws-sdk/xml-builder":"3.734.0","@smithy/config-resolver":"^4.0.1","@smithy/core":"^3.1.4","@smithy/eventstream-serde-browser":"^4.0.1","@smithy/eventstream-serde-config-resolver":"^4.0.1","@smithy/eventstream-serde-node":"^4.0.1","@smithy/fetch-http-handler":"^5.0.1","@smithy/hash-blob-browser":"^4.0.1","@smithy/hash-node":"^4.0.1","@smithy/hash-stream-node":"^4.0.1","@smithy/invalid-dependency":"^4.0.1","@smithy/md5-js":"^4.0.1","@smithy/middleware-content-length":"^4.0.1","@smithy/middleware-endpoint":"^4.0.5","@smithy/middleware-retry":"^4.0.6","@smithy/middleware-serde":"^4.0.2","@smithy/middleware-stack":"^4.0.1","@smithy/node-config-provider":"^4.0.1","@smithy/node-http-handler":"^4.0.2","@smithy/protocol-http":"^5.0.1","@smithy/smithy-client":"^4.1.5","@smithy/types":"^4.1.0","@smithy/url-parser":"^4.0.1","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.6","@smithy/util-defaults-mode-node":"^4.0.6","@smithy/util-endpoints":"^3.0.1","@smithy/util-middleware":"^4.0.1","@smithy/util-retry":"^4.0.1","@smithy/util-stream":"^4.1.1","@smithy/util-utf8":"^4.0.0","@smithy/util-waiter":"^4.0.2","tslib":"^2.6.2"},"devDependencies":{"@aws-sdk/signature-v4-crt":"3.750.0","@tsconfig/node18":"18.2.4","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.2.2"},"engines":{"node":">=18.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-s3"},"_lastModified":"2025-10-12T02:35:56.237Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"mime-match","version":"1.0.2","description":"A simple function to check whether a mimetype matches the specified mimetype (with wildcard support)","main":"index.js","scripts":{"test":"node test.js","gendocs":"gendocs > README.md"},"repository":{"type":"git","url":"https://github.com/DamonOehlman/mime-match.git"},"keywords":["mime","wildcard"],"author":"Damon Oehlman <damon.oehlman@gmail.com>","license":"ISC","bugs":{"url":"https://github.com/DamonOehlman/mime-match/issues"},"homepage":"https://github.com/DamonOehlman/mime-match","dependencies":{"wildcard":"^1.1.0"},"devDependencies":{"tape":"^4.5.1"},"_lastModified":"2025-10-
|
|
1
|
+
{"name":"mime-match","version":"1.0.2","description":"A simple function to check whether a mimetype matches the specified mimetype (with wildcard support)","main":"index.js","scripts":{"test":"node test.js","gendocs":"gendocs > README.md"},"repository":{"type":"git","url":"https://github.com/DamonOehlman/mime-match.git"},"keywords":["mime","wildcard"],"author":"Damon Oehlman <damon.oehlman@gmail.com>","license":"ISC","bugs":{"url":"https://github.com/DamonOehlman/mime-match/issues"},"homepage":"https://github.com/DamonOehlman/mime-match","dependencies":{"wildcard":"^1.1.0"},"devDependencies":{"tape":"^4.5.1"},"_lastModified":"2025-10-12T02:35:50.082Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"mime-types","description":"The ultimate javascript content-type utility.","version":"3.0.1","contributors":["Douglas Christopher Wilson <doug@somethingdoug.com>","Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)","Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"],"license":"MIT","keywords":["mime","types"],"repository":"jshttp/mime-types","dependencies":{"mime-db":"^1.54.0"},"devDependencies":{"eslint":"8.33.0","eslint-config-standard":"14.1.1","eslint-plugin-import":"2.27.5","eslint-plugin-markdown":"3.0.0","eslint-plugin-node":"11.1.0","eslint-plugin-promise":"6.1.1","eslint-plugin-standard":"4.1.0","mocha":"10.2.0","nyc":"15.1.0"},"files":["HISTORY.md","LICENSE","index.js","mimeScore.js"],"engines":{"node":">= 0.6"},"scripts":{"lint":"eslint .","test":"mocha --reporter spec test/test.js","test-ci":"nyc --reporter=lcov --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"_lastModified":"2025-10-
|
|
1
|
+
{"name":"mime-types","description":"The ultimate javascript content-type utility.","version":"3.0.1","contributors":["Douglas Christopher Wilson <doug@somethingdoug.com>","Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)","Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"],"license":"MIT","keywords":["mime","types"],"repository":"jshttp/mime-types","dependencies":{"mime-db":"^1.54.0"},"devDependencies":{"eslint":"8.33.0","eslint-config-standard":"14.1.1","eslint-plugin-import":"2.27.5","eslint-plugin-markdown":"3.0.0","eslint-plugin-node":"11.1.0","eslint-plugin-promise":"6.1.1","eslint-plugin-standard":"4.1.0","mocha":"10.2.0","nyc":"15.1.0"},"files":["HISTORY.md","LICENSE","index.js","mimeScore.js"],"engines":{"node":">= 0.6"},"scripts":{"lint":"eslint .","test":"mocha --reporter spec test/test.js","test-ci":"nyc --reporter=lcov --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"_lastModified":"2025-10-12T02:35:50.390Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"0.5.6","publishConfig":{"tag":"legacy"},"author":"James Halliday <mail@substack.net> (http://substack.net)","main":"index.js","keywords":["mkdir","directory"],"repository":{"type":"git","url":"https://github.com/substack/node-mkdirp.git"},"scripts":{"test":"tap test/*.js"},"dependencies":{"minimist":"^1.2.6"},"devDependencies":{"tap":"^16.0.1"},"bin":"bin/cmd.js","license":"MIT","files":["bin","index.js"],"_lastModified":"2025-10-
|
|
1
|
+
{"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"0.5.6","publishConfig":{"tag":"legacy"},"author":"James Halliday <mail@substack.net> (http://substack.net)","main":"index.js","keywords":["mkdir","directory"],"repository":{"type":"git","url":"https://github.com/substack/node-mkdirp.git"},"scripts":{"test":"tap test/*.js"},"dependencies":{"minimist":"^1.2.6"},"devDependencies":{"tap":"^16.0.1"},"bin":"bin/cmd.js","license":"MIT","files":["bin","index.js"],"_lastModified":"2025-10-12T02:35:54.887Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"multer-aliyun-oss","version":"2.1.3","description":"Multer Storage for AliYun OSS","main":"index.js","scripts":{},"author":"AngusYoung","license":"ISC","repository":{"type":"git","url":"git+https://github.com/ay86/multer-aliyun-oss.git"},"keywords":["multer","storage","aliyun","oss"],"dependencies":{"ali-oss":"^6.1.0"},"_lastModified":"2025-10-
|
|
1
|
+
{"name":"multer-aliyun-oss","version":"2.1.3","description":"Multer Storage for AliYun OSS","main":"index.js","scripts":{},"author":"AngusYoung","license":"ISC","repository":{"type":"git","url":"git+https://github.com/ay86/multer-aliyun-oss.git"},"keywords":["multer","storage","aliyun","oss"],"dependencies":{"ali-oss":"^6.1.0"},"_lastModified":"2025-10-12T02:35:54.807Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"_from":"multer-cos","_id":"multer-cos@1.0.2","_inBundle":false,"_integrity":"sha512-4F8P1VTCSNhiem+BFJFLe3Ixco6cIuAQ6j7U+PBRvdbBJRZgq5Q+vaDMMBWJ1HmPGOOP3AyKS5yk2f0nbFoqqA==","_location":"/multer-cos","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"multer-cos","name":"multer-cos","escapedName":"multer-cos","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/multer-cos/-/multer-cos-1.0.2.tgz","_shasum":"95c7c06cdee1b9311675a895481f9d946de6dcf3","_spec":"multer-cos","_where":"/Users/lanbo/workplace/websocket","author":{"name":"lanbosm"},"bugs":{"url":"https://github.com/lanbosm/multer-COS/issues"},"bundleDependencies":false,"deprecated":false,"description":"Streaming multer storage engine for QCloud COS","devDependencies":{"cos-nodejs-sdk-v5":"^2.2.6","dotenv":"^5.0.1","multer":"^1.3.0"},"engines":{"node":">= 6.10.0"},"homepage":"https://github.com/lanbosm/multer-COS#readme","keywords":["express","multer","COS"],"license":"MIT","main":"index.js","name":"multer-cos","repository":{"type":"git","url":"git+ssh://git@github.com/lanbosm/multer-COS.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"version":"1.0.3","_lastModified":"2025-10-
|
|
1
|
+
{"_from":"multer-cos","_id":"multer-cos@1.0.2","_inBundle":false,"_integrity":"sha512-4F8P1VTCSNhiem+BFJFLe3Ixco6cIuAQ6j7U+PBRvdbBJRZgq5Q+vaDMMBWJ1HmPGOOP3AyKS5yk2f0nbFoqqA==","_location":"/multer-cos","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"multer-cos","name":"multer-cos","escapedName":"multer-cos","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/multer-cos/-/multer-cos-1.0.2.tgz","_shasum":"95c7c06cdee1b9311675a895481f9d946de6dcf3","_spec":"multer-cos","_where":"/Users/lanbo/workplace/websocket","author":{"name":"lanbosm"},"bugs":{"url":"https://github.com/lanbosm/multer-COS/issues"},"bundleDependencies":false,"deprecated":false,"description":"Streaming multer storage engine for QCloud COS","devDependencies":{"cos-nodejs-sdk-v5":"^2.2.6","dotenv":"^5.0.1","multer":"^1.3.0"},"engines":{"node":">= 6.10.0"},"homepage":"https://github.com/lanbosm/multer-COS#readme","keywords":["express","multer","COS"],"license":"MIT","main":"index.js","name":"multer-cos","repository":{"type":"git","url":"git+ssh://git@github.com/lanbosm/multer-COS.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"version":"1.0.3","_lastModified":"2025-10-12T02:36:01.615Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"multer-s3","version":"3.0.1","description":"Streaming multer storage engine for AWS S3","main":"index.js","scripts":{"test":"standard && mocha test/basic.js"},"engines":{"node":">= 12.0.0"},"repository":{"type":"git","url":"git+https://github.com/badunk/multer-s3.git"},"keywords":["multer","s3","amazon","aws"],"author":"badunk","license":"MIT","bugs":{"url":"https://github.com/badunk/multer-s3/issues"},"homepage":"https://github.com/badunk/multer-s3#readme","dependencies":{"@aws-sdk/lib-storage":"^3.46.0","file-type":"^3.3.0","html-comment-regex":"^1.1.2","run-parallel":"^1.1.6"},"peerDependencies":{"@aws-sdk/client-s3":"^3.0.0"},"devDependencies":{"express":"^4.13.1","form-data":"^1.0.0-rc3","mocha":"^2.2.5","multer":"^1.1.0","on-finished":"^2.3.0","standard":"^5.4.1","xtend":"^4.0.1"},"_lastModified":"2025-10-
|
|
1
|
+
{"name":"multer-s3","version":"3.0.1","description":"Streaming multer storage engine for AWS S3","main":"index.js","scripts":{"test":"standard && mocha test/basic.js"},"engines":{"node":">= 12.0.0"},"repository":{"type":"git","url":"git+https://github.com/badunk/multer-s3.git"},"keywords":["multer","s3","amazon","aws"],"author":"badunk","license":"MIT","bugs":{"url":"https://github.com/badunk/multer-s3/issues"},"homepage":"https://github.com/badunk/multer-s3#readme","dependencies":{"@aws-sdk/lib-storage":"^3.46.0","file-type":"^3.3.0","html-comment-regex":"^1.1.2","run-parallel":"^1.1.6"},"peerDependencies":{"@aws-sdk/client-s3":"^3.0.0"},"devDependencies":{"express":"^4.13.1","form-data":"^1.0.0-rc3","mocha":"^2.2.5","multer":"^1.1.0","on-finished":"^2.3.0","standard":"^5.4.1","xtend":"^4.0.1"},"_lastModified":"2025-10-12T02:35:57.736Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"url-join","version":"4.0.1","description":"Join urls and normalize as in path.join.","main":"lib/url-join.js","scripts":{"test":"mocha --require should"},"repository":{"type":"git","url":"git://github.com/jfromaniello/url-join.git"},"keywords":["url","join"],"author":"José F. Romaniello <jfromaniello@gmail.com> (http://joseoncode.com)","license":"MIT","devDependencies":{"conventional-changelog":"^1.1.10","mocha":"^3.2.0","should":"~1.2.1"},"_lastModified":"2025-10-
|
|
1
|
+
{"name":"url-join","version":"4.0.1","description":"Join urls and normalize as in path.join.","main":"lib/url-join.js","scripts":{"test":"mocha --require should"},"repository":{"type":"git","url":"git://github.com/jfromaniello/url-join.git"},"keywords":["url","join"],"author":"José F. Romaniello <jfromaniello@gmail.com> (http://joseoncode.com)","license":"MIT","devDependencies":{"conventional-changelog":"^1.1.10","mocha":"^3.2.0","should":"~1.2.1"},"_lastModified":"2025-10-12T02:35:50.168Z"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-file-manager",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.7",
|
|
4
4
|
"displayName": "File manager",
|
|
5
5
|
"displayName.zh-CN": "文件管理器",
|
|
6
6
|
"description": "Provides files storage services with files collection template and attachment field.",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"Collections",
|
|
52
52
|
"Collection fields"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "cb012f93256f534472d3ae56e075839ca1675779"
|
|
55
55
|
}
|