@nocobase/plugin-file-manager 1.9.31 → 1.9.33
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/client/schemas/storageTypes/ali-oss.d.ts +12 -0
- package/dist/client/schemas/storageTypes/common.d.ts +12 -0
- package/dist/client/schemas/storageTypes/index.d.ts +48 -0
- package/dist/client/schemas/storageTypes/local.d.ts +12 -0
- package/dist/client/schemas/storageTypes/s3.d.ts +12 -0
- package/dist/client/schemas/storageTypes/tx-cos.d.ts +12 -0
- package/dist/common/collections/storages.d.ts +11 -0
- package/dist/common/collections/storages.js +6 -0
- package/dist/externalVersion.js +7 -7
- package/dist/locale/de-DE.json +9 -3
- package/dist/locale/en-US.json +9 -3
- package/dist/locale/es-ES.json +9 -3
- package/dist/locale/fr-FR.json +9 -3
- package/dist/locale/it-IT.json +9 -3
- package/dist/locale/ja-JP.json +9 -3
- package/dist/locale/ko-KR.json +9 -3
- package/dist/locale/nl-NL.json +9 -3
- package/dist/locale/pt-BR.json +9 -3
- package/dist/locale/ru-RU.json +9 -3
- package/dist/locale/tr-TR.json +9 -3
- package/dist/locale/uk-UA.json +9 -3
- package/dist/locale/zh-CN.json +10 -4
- package/dist/locale/zh-TW.json +13 -7
- package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
- package/dist/node_modules/@aws-sdk/lib-storage/LICENSE +201 -0
- package/dist/node_modules/{multer-s3 → @aws-sdk/lib-storage/dist-cjs}/index.js +574 -6229
- package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.browser.js +8 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.js +10 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.native.js +8 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/runtimeConfig.shared.js +6 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/Upload.js +304 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/bytelength.js +27 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunker.js +24 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getChunkStream.js +24 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getChunkUint8Array.js +19 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getDataReadable.js +11 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/chunks/getDataReadableStream.js +24 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/index.js +2 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.browser.js +5 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.js +7 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.native.js +5 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/runtimeConfig.shared.js +3 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-es/types.js +1 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/Upload.d.ts +59 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/bytelength.d.ts +1 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunker.d.ts +3 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getChunkStream.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getChunkUint8Array.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getDataReadable.d.ts +3 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/chunks/getDataReadableStream.d.ts +1 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/index.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.browser.d.ts +7 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.d.ts +8 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.native.d.ts +7 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/runtimeConfig.shared.d.ts +6 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/Upload.d.ts +43 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/bytelength.d.ts +1 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunker.d.ts +6 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getChunkStream.d.ts +6 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getChunkUint8Array.d.ts +5 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getDataReadable.d.ts +4 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/chunks/getDataReadableStream.d.ts +3 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/index.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/runtimeConfig.shared.d.ts +3 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/ts3.4/types.d.ts +22 -0
- package/dist/node_modules/@aws-sdk/lib-storage/dist-types/types.d.ts +51 -0
- package/dist/node_modules/@aws-sdk/lib-storage/package.json +1 -0
- package/dist/node_modules/ali-oss/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-cos/package.json +1 -1
- package/dist/node_modules/url-join/package.json +1 -1
- package/dist/server/storages/index.d.ts +1 -0
- package/dist/server/storages/local.js +1 -1
- package/dist/server/storages/s3.d.ts +10 -3
- package/dist/server/storages/s3.js +121 -29
- package/dist/server/storages/tx-cos.js +1 -1
- package/dist/server/utils.d.ts +1 -0
- package/dist/server/utils.js +43 -0
- package/package.json +3 -2
- package/dist/node_modules/multer-s3/.gitattributes +0 -1
- package/dist/node_modules/multer-s3/.travis.yml +0 -6
- package/dist/node_modules/multer-s3/LICENSE +0 -22
- package/dist/node_modules/multer-s3/package.json +0 -1
- package/dist/node_modules/multer-s3/test/basic.js +0 -293
- package/dist/node_modules/multer-s3/test/files/a.txt +0 -1
- package/dist/node_modules/multer-s3/test/files/test.svg +0 -3
- package/dist/node_modules/multer-s3/test/files/test2.svg +0 -9
- package/dist/node_modules/multer-s3/test/util/mock-s3.js +0 -17
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-i18next"),require("react"),require("lodash"),require("@formily/shared"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-manager",["react-i18next","react","lodash","@formily/shared","@nocobase/client","@formily/react","@ant-design/icons","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-file-manager"]=t(require("react-i18next"),require("react"),require("lodash"),require("@formily/shared"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("antd")):e["@nocobase/plugin-file-manager"]=t(e["react-i18next"],e.react,e.lodash,e["@formily/shared"],e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e.antd)}(self,function(e,t,n,o,r,a,i,c){return function(){"use strict";var l={482:function(e){e.exports=i},505:function(e){e.exports=a},875:function(e){e.exports=o},772:function(e){e.exports=r},721:function(e){e.exports=c},467:function(e){e.exports=n},156:function(e){e.exports=t},238:function(t){t.exports=e}},u={};function s(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return l[e](n,n.exports,s),n.exports}s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return!function(){s.r(p),s.d(p,{PluginFileManagerClient:function(){return ex},default:function(){return ev}});var e,t,n,o={};s.r(o),s.d(o,{useAttachmentFieldProps:function(){return x},useFileCollectionStorageRules:function(){return v},useStorageRules:function(){return h},useUploadFiles:function(){return b}});var r=s(772),a=Number.POSITIVE_INFINITY,i=s(156),c=s.n(i);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){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,a,c,l,u=(0,r.useCollectionField)(),s=(0,r.useCollectionManager)().getCollection(null==u?void 0:u.target),p=(0,r.useCollection)(),m=(0,r.usePlugin)(ev),f=(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),a=(o=(0,r.useRequest)({url:n},{manual:!0,refreshDeps:[t],cacheKey:n})).loading,c=o.data,l=o.run,(0,i.useEffect)(function(){l()},[l]),!a&&(null==c?void 0:c.data)||null),d=m.getStorageType(null==f?void 0:f.type);return{storage:f,storageType:d}}function m(e){var t=u(),n=t.storage,o=t.storageType,r=null==o?void 0:o.useUploadProps,a=(null==r?void 0:r(l({storage:n,rules:n.rules},e)))||{};return l({rules:null==n?void 0:n.rules},a)}function f(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 f(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 f(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 f(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)(),a=(0,r.useSourceId)(),c=(0,i.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 a=[],i=!0,c=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),a.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return a}}(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.")}()),i=r[0],c=r[1];e="".concat(i,"/").concat(a,"/").concat(c,":create")}return e},[o.name,t,a]),l=((0,i.useContext)(r.RecordPickerContext)||{}).setSelectedRows,u={},s=0,p={action:c,onChange:function(t){t.forEach(function(n){if("uploading"!==n.status||u[n.uid]||(s++,u[n.uid]=!0),"uploading"!==n.status&&u[n.uid]&&(delete u[n.uid],0==--s)){var o,r;null==(r=e())||null==(o=r.refresh)||o.call(r),null==l||l(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)}},f=m(p);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}({},p,f)},g=s(505);function h(e){var t,n=null!=e?e:"";(0,r.useAPIClient)();var o=(0,g.useField)(),a=(0,r.useRequest)({url:"storages:getBasicInfo/".concat(n)},{manual:!0,refreshDeps:[n],cacheKey:n}),c=a.loading,l=a.data,u=a.run;return(0,i.useEffect)(function(){"editable"===o.pattern&&u()},[o.pattern,u]),!c&&(null==l||null==(t=l.data)?void 0:t.rules)||null}function x(){var e=(0,r.useCollectionField)(),t="".concat(e.target,":create").concat(e.storage?"?attachmentField=".concat(e.collectionName,".").concat(e.name):""),n=m({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 v(){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 c().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))},S={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"}]},j={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}]},w=function(e){return c().createElement(r.ExtendCollectionsProvider,{collections:[S,j]},c().createElement(r.SchemaComponentOptions,{scope:o,components:{UploadActionInitializer:O}},e.children))},P=s(721),A=[{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=A.length-1;o>=0;o--){var r=A[o];if(n%r.value==0)return r}return A[0]}function I(e,t,n){return Math.min(Math.max(t,e),n)}function F(e){var t,n=e.value,o=e.defaultUnit,r=void 0===o?1048576:o,l=e.min,u=void 0===l?1:l,s=e.max,p=void 0===s?a:s,m=e.step,f=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,x=(0,i.useCallback)(function(e){null==f||f(I(null==e?e:e*g.value,u,p))},[g.value]),v=(0,i.useCallback)(function(e){null==f||f(I(h*e,u,p))},[h]);return c().createElement(P.Space.Compact,null,c().createElement(P.InputNumber,{value:h,onChange:x,defaultValue:"".concat(b),step:void 0===m?1:m}),c().createElement(P.Select,{options:A,value:g.value,onChange:v,className:"auto-width"}))}var T=s(482),E=s(875),D=s(467),k=s.n(D),R=s(238),q="file-manager",_={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(q,'" })}}'),descriptions:'{{t("Will be used for API", { ns: "'.concat(q,'" })}}'),type:"string","x-component":"Input"}},{type:"string",name:"type",interface:"select",uiSchema:{title:'{{t("Storage type", { ns: "'.concat(q,'" })}}'),type:"string","x-component":"Select",required:!0,enum:"{{ storageTypeOptions }}"}},{type:"string",name:"baseUrl",interface:"input",uiSchema:{title:'{{t("Base URL", { ns: "'.concat(q,'" })}}'),type:"string","x-component":"TextAreaWithGlobalScope",required:!0}},{type:"string",name:"path",interface:"input",uiSchema:{title:'{{t("Path", { ns: "'.concat(q,'" })}}'),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"}}]},M={type:"object",properties:(e={},t=(0,E.uid)(),n={type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:_,resourceName:"storages",request:{resource:"storages",action:"list",params:{pageSize:50,sort:["id"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:_},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(q,'" })}}'),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(q,'" })}}')},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(q,'" })}}')},rules:{type:"object","x-component":"fieldset",properties:{size:{type:"number",title:'{{t("File size limit", { ns: "'.concat(q,'" })}}'),description:'{{t("Minimum from 1 byte.", { ns: "'.concat(q,'" })}}'),"x-decorator":"FormItem","x-component":"FileSizeField",required:!0,default:0x1400000},mimetype:{type:"string",title:'{{t("File type (in MIME type format)", { ns: "'.concat(q,'" })}}'),description:'{{t(\'Multi-types seperated with comma, for example: "image/*", "image/png", "image/*, application/pdf" etc.\', { ns: "'.concat(q,'" })}}'),"x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:"*"}}}},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Default storage", { ns: "'.concat(q,'" })}}')},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":'{{t("Keep file in storage when destroy the file record", { ns: "'.concat(q,'" })}}'),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(q,'" })}}')}},B={title:'{{t("Aliyun OSS", { ns: "'.concat(q,'" })}}'),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(q,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",description:'{{t(\'Aliyun OSS region part of the bucket. For example: "oss-cn-beijing".\', { ns: "'.concat(q,'" })}}'),required:!0},accessKeyId:{title:'{{t("AccessKey ID", { ns: "'.concat(q,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeySecret:{title:'{{t("AccessKey Secret", { ns: "'.concat(q,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:'{{t("Bucket", { ns: "'.concat(q,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},timeout:{title:'{{t("Timeout", { ns: "'.concat(q,'" })}}'),description:"{{t('Upload timeout for a single file in milliseconds. Default is 600000.', { ns: \"".concat(q,'" })}}'),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"},K={local:{title:'{{t("Local storage", { ns: "'.concat(q,'" })}}'),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(q,'" })}}'),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":B,s3:{title:'{{t("Amazon S3", { ns: "'.concat(q,'" })}}'),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(q,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeyId:{title:'{{t("AccessKey ID", { ns: "'.concat(q,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},secretAccessKey:{title:'{{t("AccessKey Secret", { ns: "'.concat(q,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},bucket:{title:'{{t("Bucket", { ns: "'.concat(q,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},endpoint:{title:'{{t("Endpoint", { ns: "'.concat(q,'" })}}'),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(q,'" })}}'),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(q,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretId:{title:'{{t("SecretId", { ns: "'.concat(q,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},SecretKey:{title:'{{t("SecretKey", { ns: "'.concat(q,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},Bucket:{title:'{{t("Bucket", { ns: "'.concat(q,'" })}}'),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 V(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 G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(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){G(e,t,n[t])})}return e}function z(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 W(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 a=[],i=!0,c=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return a}}(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 L(e){return function(e){if(Array.isArray(e))return V(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 V(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 V(e,t)}}var Y=function(){var e=W((0,i.useState)({}),2),t=e[0],n=e[1],o=(0,r.usePlugin)(ev),a=(0,r.useCompile)(),l=W((0,i.useState)(!1),2),u=l[0],s=l[1],p=(0,R.useTranslation)().t;return c().createElement("div",null,c().createElement(r.ActionContext.Provider,{value:{visible:u,setVisible:s}},c().createElement(P.Dropdown,{menu:{onClick:function(e){var t=o.storageTypes.get(e.key);s(!0),n({type:"object",properties:G({},(0,E.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{type:t.name}},title:a("{{t('Add new')}}")+" - "+a(t.title),properties:z(N({},k().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:L(o.storageTypes.values()).map(function(e){return{key:e.name,label:a(e.title)}})}},c().createElement(P.Button,{type:"primary",icon:c().createElement(T.PlusOutlined,null)},p("Add new")," ",c().createElement(T.DownOutlined,null))),c().createElement(r.SchemaComponent,{scope:{createOnly:!0},schema:t})))},H=function(){var e=(0,r.useRecord)(),t=W((0,i.useState)({}),2),n=t[0],o=t[1],a=(0,r.usePlugin)(ev),l=(0,r.useCompile)(),u=W((0,i.useState)(!1),2),s=u[0],p=u[1],m=(0,R.useTranslation)().t,f=W(P.message.useMessage(),2),d=f[0],y=f[1],b=(0,i.useCallback)(function(){var t=a.storageTypes.get(e.type);if(!t)return void d.error(m("Storage type {{type}} is not registered, please check if related plugin is enabled.",{ns:q,type:e.type}));p(!0),t.fieldset.default&&(t.fieldset.default["x-reactions"]=function(e){e.initialValue?e.disabled=!0:e.disabled=!1}),o({type:"object",properties:G({},(0,E.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:N({},e)},title:l("{{t('Edit')}}")+" - "+l(t.title),properties:z(N({},k().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 }}"}}}}})})})},[l,a.storageTypes,e]);return c().createElement("div",null,y,c().createElement(r.ActionContext.Provider,{value:{visible:s,setVisible:p}},c().createElement("a",{onClick:b},m("Edit")),c().createElement(r.SchemaComponent,{scope:{createOnly:!1},schema:n})))};function J(e){var t=K[e];return(null==t?void 0:t.thumbnailRule)?c().createElement("div",null,c().createElement("a",{target:"_blank",href:t.thumbnailRuleLink,rel:"noreferrer"},r.i18n.t("See more"))):null}var Q=function(){var e=(0,r.useCompile)(),t=L((0,r.usePlugin)(ev).storageTypes.values()).map(function(t){return{value:t.name,label:e(t.title)}});return c().createElement(P.Card,{bordered:!1},c().createElement(r.SchemaComponent,{components:{CreateStorage:Y,EditStorage:H},scope:{useNewId:function(e){return"".concat(e).concat((0,E.uid)())},storageTypeOptions:t,renderThumbnailRuleDesc:J},schema:M}))};function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){return(Z=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,a,i;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=Z(t),X(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||[],Z(this).constructor):t.apply(this,o)),"name","attachment"),X(e,"type","object"),X(e,"group","media"),X(e,"title",'{{t("Attachment", { ns: "'.concat(q,'" })}}')),X(e,"isAssociation",!0),X(e,"default",{type:"belongsToMany",target:"attachments",uiSchema:{type:"array","x-component":"Upload.Attachment","x-use-component-props":"useAttachmentFieldProps"}}),X(e,"availableTypes",["belongsToMany"]),X(e,"properties",(a=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){X(e,t,n[t])})}return e}({},r.interfacesProperties.defaultProps),i=i={"uiSchema.x-component-props.accept":{type:"string",title:'{{t("MIME type", { ns: "'.concat(q,'" })}}'),"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(q,'" })}}'),"x-decorator":"FormItem","x-component":"Checkbox",default:!0},storage:{type:"string",title:'{{t("Storage", { ns: "'.concat(q,'" })}}'),description:"{{t('Default storage will be used when not selected', { ns: \"".concat(q,'" })}}'),"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}},Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(i)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(i,e))}),a)),X(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(q,'" })}}'),label:'{{t("Filename", { ns: "'.concat(q,'" })}}'),operators:r.interfacesProperties.operators.string,schema:{title:'{{t("Filename", { ns: "'.concat(q,'" })}}'),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,E.uid)())),e.foreignKey||(e.foreignKey="f_".concat((0,E.uid)())),e.otherKey||(e.otherKey="f_".concat((0,E.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 ea(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 ei(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 ec(e,t){return(ec=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function el(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(el=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,el()?Reflect.construct(n,o||[],er(this).constructor):n.apply(this,o)),"name","file"),eo(e,"title",'{{t("File collection", { ns: "'.concat(q,'" })}}')),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(q,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"extname",deletable:!1,uiSchema:{type:"string",title:'{{t("Extension name", { ns: "'.concat(q,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"integer",type:"integer",name:"size",deletable:!1,uiSchema:{type:"number",title:'{{t("Size", { ns: "'.concat(q,'" })}}'),"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(q,'" })}}'),"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"text",name:"path",deletable:!1,uiSchema:{type:"string",title:'{{t("Path", { ns: "'.concat(q,'" })}}'),"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(q,'" })}}'),"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(q,'" })}}'),"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",ea(ei(ea(ei(ea({},(0,r.getConfigurableProperties)("title","name")),{inherits:ei(ea({},(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(q,'" })}}'),"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&&ec(t,e),t}(r.CollectionTemplate);function es(e,t,n,o,r,a,i){try{var c=e[a](i),l=c.value}catch(e){n(e);return}c.done?t(l):Promise.resolve(l).then(o,r)}function ep(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var a=e.apply(t,n);function i(e){es(a,o,r,i,c,"next",e)}function c(e){es(a,o,r,i,c,"throw",e)}i(void 0)})}}function em(e,t,n){return(em=eg()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return n&&ey(r,n.prototype),r}).apply(null,arguments)}function ef(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ed(e){return(ed=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ey(e,t){return(ey=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eb(e){var t="function"==typeof Map?new Map:void 0;return(eb=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 em(e,arguments,ed(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ey(n,e)})(e)}function eg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eg=function(){return!!e})()}function eh(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){var l=[a,c];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var ex=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=ed(t),ef(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,eg()?Reflect.construct(t,o||[],ed(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&&ey(n,e),t=[{key:"load",value:function(){var e=this;return ep(function(){var t;return eh(this,function(n){return e.app.dataSourceManager.addFieldInterfaces([en]),e.app.dataSourceManager.addCollectionTemplates([eu]),e.app.use(w),e.app.pluginSettingsManager.add(q,{title:'{{t("File manager", { ns: "'.concat(q,'" })}}'),icon:"FileOutlined",Component:Q,aclSnippet:"pm.file-manager.storages"}),Object.values(K).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:x,useFileCollectionStorageRules:v,useStorageCfg:u}),e.app.addComponents({FileSizeField:F}),[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 ep(function(){var n,o,r;return eh(this,function(a){switch(a.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,a.sent()];case 2:return a.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=a.sent().data)?void 0:o.data}];case 4:return[2,{errorMessage:a.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}(eb(r.Plugin));ef(ex,"buildInStorage",["local","ali-oss","s3","tx-cos"]);var ev=ex}(),p}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("react"),require("lodash"),require("@formily/shared"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-manager",["react-i18next","react","lodash","@formily/shared","@nocobase/client","@formily/react","@ant-design/icons","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-file-manager"]=t(require("react-i18next"),require("react"),require("lodash"),require("@formily/shared"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("antd")):e["@nocobase/plugin-file-manager"]=t(e["react-i18next"],e.react,e.lodash,e["@formily/shared"],e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e.antd)}(self,function(e,t,n,o,r,a,i,c){return function(){"use strict";var l={482:function(e){e.exports=i},505:function(e){e.exports=a},875:function(e){e.exports=o},772:function(e){e.exports=r},721:function(e){e.exports=c},467:function(e){e.exports=n},156:function(e){e.exports=t},238:function(t){t.exports=e}},u={};function s(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return l[e](n,n.exports,s),n.exports}s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return!function(){s.r(p),s.d(p,{PluginFileManagerClient:function(){return ex},default:function(){return ev}});var e,t,n,o={};s.r(o),s.d(o,{useAttachmentFieldProps:function(){return x},useFileCollectionStorageRules:function(){return v},useStorageRules:function(){return h},useUploadFiles:function(){return b}});var r=s(772),a=Number.POSITIVE_INFINITY,i=s(156),c=s.n(i);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){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,a,c,l,u=(0,r.useCollectionField)(),s=(0,r.useCollectionManager)().getCollection(null==u?void 0:u.target),p=(0,r.useCollection)(),m=(0,r.usePlugin)(ev),d=(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),a=(o=(0,r.useRequest)({url:n},{manual:!0,refreshDeps:[t],cacheKey:n})).loading,c=o.data,l=o.run,(0,i.useEffect)(function(){l()},[l]),!a&&(null==c?void 0:c.data)||null),f=m.getStorageType(null==d?void 0:d.type);return{storage:d,storageType:f}}function m(e){var t=u(),n=t.storage,o=t.storageType,r=null==o?void 0:o.useUploadProps,a=(null==r?void 0:r(l({storage:n,rules:n.rules},e)))||{};return l({rules:null==n?void 0:n.rules},a)}function d(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 f(e){return function(e){if(Array.isArray(e))return d(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 d(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 d(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)(),a=(0,r.useSourceId)(),c=(0,i.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 a=[],i=!0,c=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),a.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return a}}(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.")}()),i=r[0],c=r[1];e="".concat(i,"/").concat(a,"/").concat(c,":create")}return e},[o.name,t,a]),l=((0,i.useContext)(r.RecordPickerContext)||{}).setSelectedRows,u={},s=0,p={action:c,onChange:function(t){t.forEach(function(n){if("uploading"!==n.status||u[n.uid]||(s++,u[n.uid]=!0),"uploading"!==n.status&&u[n.uid]&&(delete u[n.uid],0==--s)){var o,r;null==(r=e())||null==(o=r.refresh)||o.call(r),null==l||l(function(e){return f(e).concat(f(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)}},d=m(p);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}({},p,d)},g=s(505);function h(e){var t,n=null!=e?e:"";(0,r.useAPIClient)();var o=(0,g.useField)(),a=(0,r.useRequest)({url:"storages:getBasicInfo/".concat(n)},{manual:!0,refreshDeps:[n],cacheKey:n}),c=a.loading,l=a.data,u=a.run;return(0,i.useEffect)(function(){"editable"===o.pattern&&u()},[o.pattern,u]),!c&&(null==l||null==(t=l.data)?void 0:t.rules)||null}function x(){var e=(0,r.useCollectionField)(),t="".concat(e.target,":create").concat(e.storage?"?attachmentField=".concat(e.collectionName,".").concat(e.name):""),n=m({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 v(){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 c().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))},S={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"}]},w={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:"string",name:"renameMode",defaultValue:"appendRandomID"},{comment:"默认引擎",type:"radio",name:"default",defaultValue:!1},{type:"boolean",name:"paranoid",defaultValue:!1}]},j=function(e){return c().createElement(r.ExtendCollectionsProvider,{collections:[S,w]},c().createElement(r.SchemaComponentOptions,{scope:o,components:{UploadActionInitializer:O}},e.children))},P=s(721),A=[{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=A.length-1;o>=0;o--){var r=A[o];if(n%r.value==0)return r}return A[0]}function I(e,t,n){return Math.min(Math.max(t,e),n)}function F(e){var t,n=e.value,o=e.defaultUnit,r=void 0===o?1048576:o,l=e.min,u=void 0===l?1:l,s=e.max,p=void 0===s?a:s,m=e.step,d=e.onChange,f=null!=(t=e.defaultValue)?t:0x1400000,y=C(f,r),b=f/y.value,g=C(null!=n?n:f,r),h=null==n?n:n/g.value,x=(0,i.useCallback)(function(e){null==d||d(I(null==e?e:e*g.value,u,p))},[g.value]),v=(0,i.useCallback)(function(e){null==d||d(I(h*e,u,p))},[h]);return c().createElement(P.Space.Compact,null,c().createElement(P.InputNumber,{value:h,onChange:x,defaultValue:"".concat(b),step:void 0===m?1:m}),c().createElement(P.Select,{options:A,value:g.value,onChange:v,className:"auto-width"}))}var T=s(482),E=s(875),D=s(467),R=s.n(D),k=s(238),M="file-manager",q={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,E.uid)(),n={type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:q,resourceName:"storages",request:{resource:"storages",action:"list",params:{pageSize:50,sort:["id"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:q},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 allowed (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,'" })}}')},renameMode:{title:'{{t("Renaming", { ns: "'.concat(M,'" })}}'),description:'{{t("Renaming strategy to avoid filename conflicts when uploading files.", { ns: "'.concat(M,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:'{{t("Append random ID", { ns: "'.concat(M,'" })}}'),value:"appendRandomID"},{label:'{{t("Random string", { ns: "'.concat(M,'" })}}'),value:"random"},{label:'{{t("Keep original filename (will be overwrite if filename is existed)", { ns: "'.concat(M,'" })}}'),value:"none"}],default:"appendRandomID"}},B={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:'{{t("File pre-process parameters", { ns: "'.concat(M,'" })}}'),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,renameMode:U.renameMode,rules:U.rules,default:U.default,paranoid:U.paranoid},thumbnailRuleLink:"https://help.aliyun.com/zh/oss/user-guide/resize-images-4"},K={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/"}},renameMode:U.renameMode,rules:U.rules,default:U.default,paranoid:U.paranoid}},"ali-oss":B,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,renameMode:U.renameMode,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,renameMode:U.renameMode,rules:U.rules,default:U.default,paranoid:U.paranoid},thumbnailRuleLink:"https://cloud.tencent.com/document/product/436/42214"}};function V(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 G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(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){G(e,t,n[t])})}return e}function z(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 W(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 a=[],i=!0,c=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return a}}(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 L(e){return function(e){if(Array.isArray(e))return V(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 V(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 V(e,t)}}var Y=function(){var e=W((0,i.useState)({}),2),t=e[0],n=e[1],o=(0,r.usePlugin)(ev),a=(0,r.useCompile)(),l=W((0,i.useState)(!1),2),u=l[0],s=l[1],p=(0,k.useTranslation)().t;return c().createElement("div",null,c().createElement(r.ActionContext.Provider,{value:{visible:u,setVisible:s}},c().createElement(P.Dropdown,{menu:{onClick:function(e){var t=o.storageTypes.get(e.key);s(!0),n({type:"object",properties:G({},(0,E.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{type:t.name}},title:a("{{t('Add new')}}")+" - "+a(t.title),properties:z(N({},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:L(o.storageTypes.values()).map(function(e){return{key:e.name,label:a(e.title)}})}},c().createElement(P.Button,{type:"primary",icon:c().createElement(T.PlusOutlined,null)},p("Add new")," ",c().createElement(T.DownOutlined,null))),c().createElement(r.SchemaComponent,{scope:{createOnly:!0},schema:t})))},H=function(){var e=(0,r.useRecord)(),t=W((0,i.useState)({}),2),n=t[0],o=t[1],a=(0,r.usePlugin)(ev),l=(0,r.useCompile)(),u=W((0,i.useState)(!1),2),s=u[0],p=u[1],m=(0,k.useTranslation)().t,d=W(P.message.useMessage(),2),f=d[0],y=d[1],b=(0,i.useCallback)(function(){var t=a.storageTypes.get(e.type);if(!t)return void f.error(m("Storage type {{type}} is not registered, please check if related plugin is enabled.",{ns:M,type:e.type}));p(!0),t.fieldset.default&&(t.fieldset.default["x-reactions"]=function(e){e.initialValue?e.disabled=!0:e.disabled=!1}),o({type:"object",properties:G({},(0,E.uid)(),{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:N({},e)},title:l("{{t('Edit')}}")+" - "+l(t.title),properties:z(N({},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 }}"}}}}})})})},[l,a.storageTypes,e]);return c().createElement("div",null,y,c().createElement(r.ActionContext.Provider,{value:{visible:s,setVisible:p}},c().createElement("a",{onClick:b},m("Edit")),c().createElement(r.SchemaComponent,{scope:{createOnly:!1},schema:n})))};function J(e){var t=K[e];return(null==t?void 0:t.thumbnailRule)?c().createElement("div",null,c().createElement("a",{target:"_blank",href:t.thumbnailRuleLink,rel:"noreferrer"},r.i18n.t("See more"))):null}var Q=function(){var e=(0,r.useCompile)(),t=L((0,r.usePlugin)(ev).storageTypes.values()).map(function(t){return{value:t.name,label:e(t.title)}});return c().createElement(P.Card,{bordered:!1},c().createElement(r.SchemaComponent,{components:{CreateStorage:Y,EditStorage:H},scope:{useNewId:function(e){return"".concat(e).concat((0,E.uid)())},storageTypeOptions:t,renderThumbnailRuleDesc:J},schema:_}))};function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){return(Z=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,a,i;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=Z(t),X(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||[],Z(this).constructor):t.apply(this,o)),"name","attachment"),X(e,"type","object"),X(e,"group","media"),X(e,"title",'{{t("Attachment", { ns: "'.concat(M,'" })}}')),X(e,"isAssociation",!0),X(e,"default",{type:"belongsToMany",target:"attachments",uiSchema:{type:"array","x-component":"Upload.Attachment","x-use-component-props":"useAttachmentFieldProps"}}),X(e,"availableTypes",["belongsToMany"]),X(e,"properties",(a=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){X(e,t,n[t])})}return e}({},r.interfacesProperties.defaultProps),i=i={"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(a,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(i)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(i,e))}),a)),X(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,E.uid)())),e.foreignKey||(e.foreignKey="f_".concat((0,E.uid)())),e.otherKey||(e.otherKey="f_".concat((0,E.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 ea(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 ei(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 ec(e,t){return(ec=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function el(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(el=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,el()?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",ea(ei(ea(ei(ea({},(0,r.getConfigurableProperties)("title","name")),{inherits:ei(ea({},(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&&ec(t,e),t}(r.CollectionTemplate);function es(e,t,n,o,r,a,i){try{var c=e[a](i),l=c.value}catch(e){n(e);return}c.done?t(l):Promise.resolve(l).then(o,r)}function ep(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var a=e.apply(t,n);function i(e){es(a,o,r,i,c,"next",e)}function c(e){es(a,o,r,i,c,"throw",e)}i(void 0)})}}function em(e,t,n){return(em=eg()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return n&&ey(r,n.prototype),r}).apply(null,arguments)}function ed(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ef(e){return(ef=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ey(e,t){return(ey=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eb(e){var t="function"==typeof Map?new Map:void 0;return(eb=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 em(e,arguments,ef(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ey(n,e)})(e)}function eg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eg=function(){return!!e})()}function eh(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){var l=[a,c];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var ex=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=ef(t),ed(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,eg()?Reflect.construct(t,o||[],ef(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&&ey(n,e),t=[{key:"load",value:function(){var e=this;return ep(function(){var t;return eh(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:Q,aclSnippet:"pm.file-manager.storages"}),Object.values(K).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:x,useFileCollectionStorageRules:v,useStorageCfg:u}),e.app.addComponents({FileSizeField:F}),[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 ep(function(){var n,o,r;return eh(this,function(a){switch(a.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,a.sent()];case 2:return a.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=a.sent().data)?void 0:o.data}];case 4:return[2,{errorMessage:a.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}(eb(r.Plugin));ed(ex,"buildInStorage",["local","ali-oss","s3","tx-cos"]);var ev=ex}(),p}()});
|
|
@@ -88,6 +88,18 @@ declare const _default: {
|
|
|
88
88
|
'x-decorator': string;
|
|
89
89
|
description: string;
|
|
90
90
|
};
|
|
91
|
+
renameMode: {
|
|
92
|
+
title: string;
|
|
93
|
+
description: string;
|
|
94
|
+
type: string;
|
|
95
|
+
'x-decorator': string;
|
|
96
|
+
'x-component': string;
|
|
97
|
+
enum: {
|
|
98
|
+
label: string;
|
|
99
|
+
value: string;
|
|
100
|
+
}[];
|
|
101
|
+
default: string;
|
|
102
|
+
};
|
|
91
103
|
rules: {
|
|
92
104
|
type: string;
|
|
93
105
|
'x-component': string;
|
|
@@ -65,5 +65,17 @@ declare const _default: {
|
|
|
65
65
|
'x-content': string;
|
|
66
66
|
description: string;
|
|
67
67
|
};
|
|
68
|
+
renameMode: {
|
|
69
|
+
title: string;
|
|
70
|
+
description: string;
|
|
71
|
+
type: string;
|
|
72
|
+
'x-decorator': string;
|
|
73
|
+
'x-component': string;
|
|
74
|
+
enum: {
|
|
75
|
+
label: string;
|
|
76
|
+
value: string;
|
|
77
|
+
}[];
|
|
78
|
+
default: string;
|
|
79
|
+
};
|
|
68
80
|
};
|
|
69
81
|
export default _default;
|
|
@@ -50,6 +50,18 @@ export declare const storageTypes: {
|
|
|
50
50
|
addonBefore: string;
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
+
renameMode: {
|
|
54
|
+
title: string;
|
|
55
|
+
description: string;
|
|
56
|
+
type: string;
|
|
57
|
+
'x-decorator': string;
|
|
58
|
+
'x-component': string;
|
|
59
|
+
enum: {
|
|
60
|
+
label: string;
|
|
61
|
+
value: string;
|
|
62
|
+
}[];
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
53
65
|
rules: {
|
|
54
66
|
type: string;
|
|
55
67
|
'x-component': string;
|
|
@@ -170,6 +182,18 @@ export declare const storageTypes: {
|
|
|
170
182
|
'x-decorator': string;
|
|
171
183
|
description: string;
|
|
172
184
|
};
|
|
185
|
+
renameMode: {
|
|
186
|
+
title: string;
|
|
187
|
+
description: string;
|
|
188
|
+
type: string;
|
|
189
|
+
'x-decorator': string;
|
|
190
|
+
'x-component': string;
|
|
191
|
+
enum: {
|
|
192
|
+
label: string;
|
|
193
|
+
value: string;
|
|
194
|
+
}[];
|
|
195
|
+
default: string;
|
|
196
|
+
};
|
|
173
197
|
rules: {
|
|
174
198
|
type: string;
|
|
175
199
|
'x-component': string;
|
|
@@ -278,6 +302,18 @@ export declare const storageTypes: {
|
|
|
278
302
|
'x-decorator': string;
|
|
279
303
|
description: string;
|
|
280
304
|
};
|
|
305
|
+
renameMode: {
|
|
306
|
+
title: string;
|
|
307
|
+
description: string;
|
|
308
|
+
type: string;
|
|
309
|
+
'x-decorator': string;
|
|
310
|
+
'x-component': string;
|
|
311
|
+
enum: {
|
|
312
|
+
label: string;
|
|
313
|
+
value: string;
|
|
314
|
+
}[];
|
|
315
|
+
default: string;
|
|
316
|
+
};
|
|
281
317
|
rules: {
|
|
282
318
|
type: string;
|
|
283
319
|
'x-component': string;
|
|
@@ -389,6 +425,18 @@ export declare const storageTypes: {
|
|
|
389
425
|
'x-decorator': string;
|
|
390
426
|
description: string;
|
|
391
427
|
};
|
|
428
|
+
renameMode: {
|
|
429
|
+
title: string;
|
|
430
|
+
description: string;
|
|
431
|
+
type: string;
|
|
432
|
+
'x-decorator': string;
|
|
433
|
+
'x-component': string;
|
|
434
|
+
enum: {
|
|
435
|
+
label: string;
|
|
436
|
+
value: string;
|
|
437
|
+
}[];
|
|
438
|
+
default: string;
|
|
439
|
+
};
|
|
392
440
|
rules: {
|
|
393
441
|
type: string;
|
|
394
442
|
'x-component': string;
|
|
@@ -49,6 +49,18 @@ declare const _default: {
|
|
|
49
49
|
addonBefore: string;
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
+
renameMode: {
|
|
53
|
+
title: string;
|
|
54
|
+
description: string;
|
|
55
|
+
type: string;
|
|
56
|
+
'x-decorator': string;
|
|
57
|
+
'x-component': string;
|
|
58
|
+
enum: {
|
|
59
|
+
label: string;
|
|
60
|
+
value: string;
|
|
61
|
+
}[];
|
|
62
|
+
default: string;
|
|
63
|
+
};
|
|
52
64
|
rules: {
|
|
53
65
|
type: string;
|
|
54
66
|
'x-component': string;
|
|
@@ -75,6 +75,18 @@ declare const _default: {
|
|
|
75
75
|
'x-decorator': string;
|
|
76
76
|
description: string;
|
|
77
77
|
};
|
|
78
|
+
renameMode: {
|
|
79
|
+
title: string;
|
|
80
|
+
description: string;
|
|
81
|
+
type: string;
|
|
82
|
+
'x-decorator': string;
|
|
83
|
+
'x-component': string;
|
|
84
|
+
enum: {
|
|
85
|
+
label: string;
|
|
86
|
+
value: string;
|
|
87
|
+
}[];
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
78
90
|
rules: {
|
|
79
91
|
type: string;
|
|
80
92
|
'x-component': string;
|
|
@@ -79,6 +79,18 @@ declare const _default: {
|
|
|
79
79
|
'x-decorator': string;
|
|
80
80
|
description: string;
|
|
81
81
|
};
|
|
82
|
+
renameMode: {
|
|
83
|
+
title: string;
|
|
84
|
+
description: string;
|
|
85
|
+
type: string;
|
|
86
|
+
'x-decorator': string;
|
|
87
|
+
'x-component': string;
|
|
88
|
+
enum: {
|
|
89
|
+
label: string;
|
|
90
|
+
value: string;
|
|
91
|
+
}[];
|
|
92
|
+
default: string;
|
|
93
|
+
};
|
|
82
94
|
rules: {
|
|
83
95
|
type: string;
|
|
84
96
|
'x-component': string;
|
|
@@ -77,6 +77,17 @@ declare const _default: {
|
|
|
77
77
|
title?: undefined;
|
|
78
78
|
translation?: undefined;
|
|
79
79
|
unique?: undefined;
|
|
80
|
+
} | {
|
|
81
|
+
comment: string;
|
|
82
|
+
type: string;
|
|
83
|
+
name: string;
|
|
84
|
+
defaultValue: string;
|
|
85
|
+
primaryKey?: undefined;
|
|
86
|
+
allowNull?: undefined;
|
|
87
|
+
title?: undefined;
|
|
88
|
+
translation?: undefined;
|
|
89
|
+
trim?: undefined;
|
|
90
|
+
unique?: undefined;
|
|
80
91
|
} | {
|
|
81
92
|
comment: string;
|
|
82
93
|
type: string;
|
|
@@ -88,6 +88,12 @@ var storages_default = {
|
|
|
88
88
|
defaultValue: "",
|
|
89
89
|
trim: true
|
|
90
90
|
},
|
|
91
|
+
{
|
|
92
|
+
comment: "\u91CD\u547D\u540D\u6A21\u5F0F",
|
|
93
|
+
type: "string",
|
|
94
|
+
name: "renameMode",
|
|
95
|
+
defaultValue: "appendRandomID"
|
|
96
|
+
},
|
|
91
97
|
// TODO(feature): 需要使用一个实现了可设置默认值的字段
|
|
92
98
|
{
|
|
93
99
|
comment: "\u9ED8\u8BA4\u5F15\u64CE",
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.9.
|
|
11
|
+
"@nocobase/client": "1.9.33",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"antd": "5.24.2",
|
|
14
14
|
"@ant-design/icons": "5.6.1",
|
|
@@ -19,12 +19,12 @@ module.exports = {
|
|
|
19
19
|
"@formily/core": "2.3.0",
|
|
20
20
|
"@formily/react": "2.3.0",
|
|
21
21
|
"multer": "1.4.5-lts.2",
|
|
22
|
-
"@nocobase/database": "1.9.
|
|
23
|
-
"@nocobase/server": "1.9.
|
|
24
|
-
"@nocobase/utils": "1.9.
|
|
25
|
-
"@nocobase/test": "1.9.
|
|
26
|
-
"@nocobase/actions": "1.9.
|
|
22
|
+
"@nocobase/database": "1.9.33",
|
|
23
|
+
"@nocobase/server": "1.9.33",
|
|
24
|
+
"@nocobase/utils": "1.9.33",
|
|
25
|
+
"@nocobase/test": "1.9.33",
|
|
26
|
+
"@nocobase/actions": "1.9.33",
|
|
27
27
|
"sequelize": "6.35.2",
|
|
28
|
-
"@nocobase/plugin-data-source-main": "1.9.
|
|
28
|
+
"@nocobase/plugin-data-source-main": "1.9.33",
|
|
29
29
|
"axios": "1.7.7"
|
|
30
30
|
};
|
package/dist/locale/de-DE.json
CHANGED
|
@@ -11,25 +11,31 @@
|
|
|
11
11
|
"Default storage": "Standardspeicher",
|
|
12
12
|
"Default storage will be used when not selected": "Wenn nicht ausgewählt, wird der Standardspeicher verwendet",
|
|
13
13
|
"Destination": "Ziel",
|
|
14
|
+
"Endpoint": "Endpunkt",
|
|
14
15
|
"Extension name": "Erweiterungsname",
|
|
15
16
|
"File collection": "Dateisammlung",
|
|
16
17
|
"File manager": "Dateimanager",
|
|
18
|
+
"Renaming": "Umbenennung",
|
|
19
|
+
"Keep original filename (will be overwrite if filename is existed)": "Originaldateinamen beibehalten (wird überschrieben, wenn Dateiname existiert)",
|
|
20
|
+
"Random string": "Zufällige Zeichenfolge",
|
|
21
|
+
"Append random ID": "Zufälliges ID anhängen",
|
|
17
22
|
"File name": "Dateiname",
|
|
23
|
+
"File pre-process parameters": "Datei-Vorverarbeitungsparameter",
|
|
18
24
|
"File size limit": "Dateigrößenbegrenzung",
|
|
19
25
|
"File storage": "Dateispeicher",
|
|
20
|
-
"File type (in MIME type format)": "Dateityp (im MIME-Typ-Format)",
|
|
26
|
+
"File type allowed (in MIME type format)": "Erlaubter Dateityp (im MIME-Typ-Format)",
|
|
21
27
|
"Filename": "Dateiname",
|
|
22
28
|
"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.": "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.",
|
|
23
29
|
"Keep file in storage when destroy record": "Datei im Speicher behalten, wenn Datensatz gelöscht wird",
|
|
24
30
|
"Keep file in storage when destroy the file record": "Keep file in storage when destroy the file record",
|
|
25
31
|
"Local storage": "Lokaler Speicher",
|
|
26
32
|
"MIME type": "MIME-Typ",
|
|
27
|
-
"Minimum from 1 byte, maximum up to 1GB.": "Minimum 1 Byte, Maximum bis zu 1GB.",
|
|
28
33
|
"Minimum from 1 byte.": "Minimum from 1 byte.",
|
|
29
34
|
"Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Mehrere Typen durch Kommas getrennt, zum Beispiel: \"image/*\", \"image/png\", \"image/*, application/pdf\" usw.",
|
|
30
35
|
"Path": "Pfad",
|
|
31
36
|
"Region": "Region",
|
|
32
37
|
"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\".": "Relativer Pfad, in dem die Datei gespeichert wird. Leer lassen als Stammpfad. Die führenden und abschließenden Schrägstriche \"/\" werden ignoriert. Zum Beispiel: \"user/avatar\".",
|
|
38
|
+
"Renaming strategy to avoid filename conflicts when uploading files.": "Umbenennungsstrategie, um Dateikonflikte beim Hochladen zu vermeiden.",
|
|
33
39
|
"See more": "Mehr anzeigen",
|
|
34
40
|
"Size": "Größe",
|
|
35
41
|
"Storage": "Speicher",
|
|
@@ -45,4 +51,4 @@
|
|
|
45
51
|
"Upload timeout for a single file in milliseconds. Default is 600000.": "Upload timeout for a single file in milliseconds. Default is 600000.",
|
|
46
52
|
"Use the built-in static file server": "Den integrierten statischen Dateiserver verwenden",
|
|
47
53
|
"Will be used for API": "Wird für API verwendet"
|
|
48
|
-
}
|
|
54
|
+
}
|
package/dist/locale/en-US.json
CHANGED
|
@@ -11,25 +11,31 @@
|
|
|
11
11
|
"Default storage": "Default storage",
|
|
12
12
|
"Default storage will be used when not selected": "Default storage will be used when not selected",
|
|
13
13
|
"Destination": "Destination",
|
|
14
|
+
"Endpoint": "Endpoint",
|
|
14
15
|
"Extension name": "Extension name",
|
|
15
16
|
"File collection": "File collection",
|
|
16
17
|
"File manager": "File manager",
|
|
18
|
+
"Renaming": "Renaming",
|
|
19
|
+
"Keep original filename (will be overwrite if filename is existed)": "Keep original filename (will be overwrite if filename is existed)",
|
|
20
|
+
"Random string": "Random string",
|
|
21
|
+
"Append random ID": "Append random ID",
|
|
17
22
|
"File name": "File name",
|
|
23
|
+
"File pre-process parameters": "File pre-process parameters",
|
|
18
24
|
"File size limit": "File size limit",
|
|
19
25
|
"File storage": "File storage",
|
|
20
|
-
"File type (in MIME type format)": "File type (in MIME type format)",
|
|
26
|
+
"File type allowed (in MIME type format)": "File type allowed (in MIME type format)",
|
|
21
27
|
"Filename": "Filename",
|
|
22
28
|
"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.": "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.",
|
|
23
29
|
"Keep file in storage when destroy record": "Keep file in storage when destroy record",
|
|
24
30
|
"Keep file in storage when destroy the file record": "Keep file in storage when destroy the file record",
|
|
25
31
|
"Local storage": "Local storage",
|
|
26
32
|
"MIME type": "MIME type",
|
|
27
|
-
"Minimum from 1 byte, maximum up to 1GB.": "Minimum from 1 byte, maximum up to 1GB.",
|
|
28
33
|
"Minimum from 1 byte.": "Minimum from 1 byte.",
|
|
29
34
|
"Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.",
|
|
30
35
|
"Path": "Path",
|
|
31
36
|
"Region": "Region",
|
|
32
37
|
"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\".": "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\".",
|
|
38
|
+
"Renaming strategy to avoid filename conflicts when uploading files.": "Renaming strategy to avoid filename conflicts when uploading files.",
|
|
33
39
|
"See more": "See more",
|
|
34
40
|
"Size": "Size",
|
|
35
41
|
"Storage": "Storage",
|
|
@@ -43,4 +49,4 @@
|
|
|
43
49
|
"Upload timeout for a single file in milliseconds. Default is 600000.": "Upload timeout for a single file in milliseconds. Default is 600000.",
|
|
44
50
|
"Use the built-in static file server": "Use the built-in static file server",
|
|
45
51
|
"Will be used for API": "Will be used for API"
|
|
46
|
-
}
|
|
52
|
+
}
|
package/dist/locale/es-ES.json
CHANGED
|
@@ -11,25 +11,31 @@
|
|
|
11
11
|
"Default storage": "Default storage",
|
|
12
12
|
"Default storage will be used when not selected": "Default storage will be used when not selected",
|
|
13
13
|
"Destination": "Destination",
|
|
14
|
+
"Endpoint": "Punto final",
|
|
14
15
|
"Extension name": "Extension name",
|
|
15
16
|
"File collection": "File collection",
|
|
16
17
|
"File manager": "File manager",
|
|
18
|
+
"Renaming": "Renombrar",
|
|
19
|
+
"Keep original filename (will be overwrite if filename is existed)": "Mantener nombre original (se sobrescribirá si existe)",
|
|
20
|
+
"Random string": "Cadena aleatoria",
|
|
21
|
+
"Append random ID": "Añadir ID aleatorio",
|
|
17
22
|
"File name": "File name",
|
|
23
|
+
"File pre-process parameters": "Parámetros de preprocesamiento de archivos",
|
|
18
24
|
"File size limit": "File size limit",
|
|
19
25
|
"File storage": "File storage",
|
|
20
|
-
"File type (in MIME type format)": "
|
|
26
|
+
"File type allowed (in MIME type format)": "Tipo de archivo permitido (en formato MIME)",
|
|
21
27
|
"Filename": "Filename",
|
|
22
28
|
"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.": "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.",
|
|
23
29
|
"Keep file in storage when destroy record": "Keep file in storage when destroy record",
|
|
24
30
|
"Keep file in storage when destroy the file record": "Keep file in storage when destroy the file record",
|
|
25
31
|
"Local storage": "Local storage",
|
|
26
32
|
"MIME type": "MIME type",
|
|
27
|
-
"Minimum from 1 byte, maximum up to 1GB.": "Minimum from 1 byte, maximum up to 1GB.",
|
|
28
33
|
"Minimum from 1 byte.": "Minimum from 1 byte.",
|
|
29
34
|
"Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.",
|
|
30
35
|
"Path": "Path",
|
|
31
36
|
"Region": "Region",
|
|
32
37
|
"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\".": "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\".",
|
|
38
|
+
"Renaming strategy to avoid filename conflicts when uploading files.": "Estrategia de renombrado para evitar conflictos de nombres de archivo al subir archivos.",
|
|
33
39
|
"See more": "See more",
|
|
34
40
|
"Size": "Size",
|
|
35
41
|
"Storage": "Storage",
|
|
@@ -43,4 +49,4 @@
|
|
|
43
49
|
"Upload timeout for a single file in milliseconds. Default is 600000.": "Upload timeout for a single file in milliseconds. Default is 600000.",
|
|
44
50
|
"Use the built-in static file server": "Use the built-in static file server",
|
|
45
51
|
"Will be used for API": "Will be used for API"
|
|
46
|
-
}
|
|
52
|
+
}
|