@nocobase/plugin-file-manager 1.3.44-beta → 1.4.0-alpha.0

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.
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- (function(a,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("react"),require("@formily/react"),require("@ant-design/icons"),require("@formily/shared"),require("antd"),require("lodash"),require("react-i18next"),require("@formily/antd-v5")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","react","@formily/react","@ant-design/icons","@formily/shared","antd","lodash","react-i18next","@formily/antd-v5"],t):(a=typeof globalThis!="undefined"?globalThis:a||self,t(a["@nocobase/plugin-file-manager"]={},a["@nocobase/client"],a.jsxRuntime,a.react,a["@formily/react"],a["@ant-design/icons"],a["@formily/shared"],a.antd,a.lodash,a["react-i18next"],a["@formily/antd-v5"]))})(this,function(a,t,r,y,h,D,S,I,b,$,N){"use strict";var ce=Object.defineProperty,le=Object.defineProperties;var ue=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var k=(a,t,r)=>t in a?ce(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,F=(a,t)=>{for(var r in t||(t={}))me.call(t,r)&&k(a,r,t[r]);if(z)for(var r of z(t))de.call(t,r)&&k(a,r,t[r]);return a},A=(a,t)=>le(a,ue(t));var l=(a,t,r)=>(k(a,typeof t!="symbol"?t+"":t,r),r);var L=(a,t,r)=>new Promise((y,h)=>{var D=b=>{try{I(r.next(b))}catch($){h($)}},S=b=>{try{I(r.throw(b))}catch($){h($)}},I=b=>b.done?y(b.value):Promise.resolve(b.value).then(D,S);I((r=r.apply(a,t)).next())});function w(n){const i=n!=null?n:"";t.useAPIClient();const o=h.useField(),{loading:s,data:c,run:u}=t.useRequest({url:`storages:getRules/${i}`},{manual:!0,refreshDeps:[i],cacheKey:i});return y.useEffect(()=>{o.pattern==="editable"&&u()},[o.pattern,u]),!s&&(c==null?void 0:c.data)||null}function U(){const n=t.useCollectionField();return{rules:w(n==null?void 0:n.storage),action:`${n.target}:create${n.storage?`?attachmentField=${n.collectionName}.${n.name}`:""}`}}function E(){const n=t.useCollectionField(),o=t.useCollectionManager().getCollection(n==null?void 0:n.target);return w(o==null?void 0:o.getOption("storage"))}const V=Object.freeze(Object.defineProperty({__proto__:null,useAttachmentFieldProps:U,useFileCollectionStorageRules:E,useStorageRules:w,useUploadFiles:()=>{const n=t.useDataBlockRequest(),{association:i}=t.useDataBlockProps(),{setVisible:o}=t.useActionContext(),s=t.useCollection(),c=t.useSourceId(),u=w(s==null?void 0:s.getOption("storage")),g=y.useMemo(()=>{let f=`${s.name}:create`;if(i){const[x,v]=i.split(".");f=`${x}/${c}/${v}:create`}return f},[s.name,i,c]),{setSelectedRows:d}=y.useContext(t.RecordPickerContext)||{},m={};let C=0;return{action:g,onChange(f){f.forEach(x=>{var v;x.status==="uploading"&&!m[x.uid]&&(C++,m[x.uid]=!0),x.status!=="uploading"&&m[x.uid]&&(delete m[x.uid],--C===0&&((v=n==null?void 0:n.refresh)==null||v.call(n),d==null||d(K=>[...K,...f.filter(P=>P.status==="done").map(P=>P.response.data)])))}),f.every(x=>x.status==="done")&&o(!1)},rules:u}}},Symbol.toStringTag,{value:"Module"})),R=n=>{const i={type:"void","x-action":"create",title:"{{t('Upload')}}","x-designer":"Action.Designer","x-component":"Action","x-decorator":"ACLActionProvider","x-component-props":{openMode:"drawer",type:"primary",icon:"UploadOutlined"},properties:{drawer:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Action.Container",properties:{upload:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Upload.DraggerV2","x-use-component-props":"useUploadFiles","x-component-props":{height:"50vh",multiple:!0,listType:"picture"}}}}}};return r.jsx(t.ActionInitializerItem,A(F({},n),{schema:i}))},Z=n=>r.jsx(t.SchemaComponentOptions,{scope:V,components:{UploadActionInitializer:R},children:n.children}),e="file-manager",G={local:{properties:{documentRoot:{title:`{{t("Destination", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",default:"storage/uploads"}}},"ali-oss":{properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},accessKeySecret:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password",required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"Input"}}},"tx-cos":{properties:{Region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},SecretId:{title:`{{t("SecretId", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},SecretKey:{title:`{{t("SecretKey", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password",required:!0},Bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0}}},s3:{properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},secretAccessKey:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password",required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},endpoint:{title:`{{t("Endpoint", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"}}}},W=h.observer(n=>{const i=h.useForm(),o=h.useField(),[s,c]=y.useState(new h.Schema({}));return y.useEffect(()=>{c(new h.Schema(G[i.values.type]||{}))},[i.values.type]),r.jsx(N.FormLayout,{layout:"vertical",children:r.jsx(h.RecursionField,{basePath:o.address,onlyRenderProperties:!0,schema:s},i.values.type||"local")})},{displayName:"StorageOptions"}),O={name:"storages",fields:[{type:"integer",name:"title",interface:"input",uiSchema:{title:'{{t("Title")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"name",interface:"input",uiSchema:{title:`{{t("Storage name", { ns: "${e}" })}}`,descriptions:`{{t("Will be used for API", { ns: "${e}" })}}`,type:"string","x-component":"Input"}},{type:"string",name:"type",interface:"select",uiSchema:{title:`{{t("Storage type", { ns: "${e}" })}}`,type:"string","x-component":"Select",required:!0,enum:"{{ storageTypes }}"}},{type:"string",name:"baseUrl",interface:"input",uiSchema:{title:`{{t("Access base URL", { ns: "${e}" })}}`,type:"string","x-component":"Input",required:!0}},{type:"string",name:"path",interface:"input",uiSchema:{title:`{{t("Path", { ns: "${e}" })}}`,type:"string","x-component":"Input"}},{type:"boolean",name:"default",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}},{type:"boolean",name:"paranoid",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}}]},X={type:"object",properties:{[S.uid()]:{type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:O,resourceName:"storages",request:{resource:"storages",action:"list",params:{pageSize:50,sort:["id"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:O},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: "${e}" })}}`,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}}"}}}}}}}}}}}},H=()=>{const[n,i]=y.useState({}),o=t.usePlugin(q),s=t.useCompile(),[c,u]=y.useState(!1),{t:g}=$.useTranslation();return r.jsx("div",{children:r.jsxs(t.ActionContext.Provider,{value:{visible:c,setVisible:u},children:[r.jsx(I.Dropdown,{menu:{onClick(d){const m=o.storageTypes.get(d.key);u(!0),i({type:"object",properties:{[S.uid()]:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{type:m.name}},title:s("{{t('Add new')}}")+" - "+s(m.title),properties:A(F({},b.cloneDeep(m.properties)),{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:[...o.storageTypes.values()].map(d=>({key:d.name,label:s(d.title)}))},children:r.jsxs(I.Button,{type:"primary",icon:r.jsx(D.PlusOutlined,{}),children:[g("Add new")," ",r.jsx(D.DownOutlined,{})]})}),r.jsx(t.SchemaComponent,{scope:{createOnly:!0},schema:n})]})})},J=()=>{const n=t.useRecord(),[i,o]=y.useState({}),s=t.usePlugin(q),c=t.useCompile(),[u,g]=y.useState(!1),{t:d}=$.useTranslation();return r.jsx("div",{children:r.jsxs(t.ActionContext.Provider,{value:{visible:u,setVisible:g},children:[r.jsx("a",{onClick:()=>{g(!0);const m=s.storageTypes.get(n.type);m.properties.default&&(m.properties.default["x-reactions"]=C=>{C.initialValue?C.disabled=!0:C.disabled=!1}),o({type:"object",properties:{[S.uid()]:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:F({},n)},title:c("{{t('Edit')}}")+" - "+c(m.title),properties:A(F({},b.cloneDeep(m.properties)),{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 }}"}}}}})}}})},children:d("Edit")}),r.jsx(t.SchemaComponent,{scope:{createOnly:!1},schema:i})]})})},Q=()=>{const{t:n}=$.useTranslation(),i=t.useCompile(),s=[...t.usePlugin(q).storageTypes.values()].map(u=>({value:u.name,label:i(u.title)})),c=r.jsxs("div",{children:[n("See more")," ",r.jsx("a",{target:"_blank",href:"https://help.aliyun.com/zh/oss/user-guide/resize-images-4",rel:"noreferrer",children:"x-oss-process"})]});return r.jsx(I.Card,{bordered:!1,children:r.jsx(t.SchemaComponent,{components:{StorageOptions:W,CreateStorage:H,EditStorage:J},scope:{useNewId:u=>`${u}${S.uid()}`,storageTypes:s,xStyleProcessDesc:c},schema:X})})},Y=1,ee=1024*1024*1024,_=1024*1024*20,p={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: "${e}" })}}`},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: "${e}" })}}`},rules:{type:"object","x-component":"fieldset",properties:{size:{type:"number",title:`{{t("File size limit", { ns: "${e}" })}}`,description:`{{t("Minimum from 1 byte, maximum up to 1GB.", { ns: "${e}" })}}`,"x-decorator":"FormItem","x-component":"FileSizeField",required:!0,default:_},mimetype:{type:"string",title:`{{t("File type (in MIME type format)", { ns: "${e}" })}}`,description:`{{t('Multi-types seperated with comma, for example: "image/*", "image/png", "image/*, application/pdf" etc.', { ns: "${e}" })}}`,"x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:"*"}}}},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Default storage", { ns: "${e}" })}}`},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Keep file in storage when destroy record", { ns: "${e}" })}}`}},te={title:`{{t("Aliyun OSS", { ns: "${e}" })}}`,name:"ali-oss",properties:{title:p.title,name:p.name,baseUrl:p.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",description:`{{t('Aliyun OSS region part of the bucket. For example: "oss-cn-beijing".', { ns: "${e}" })}}`,required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},accessKeySecret:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password",required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:"?x-oss-process=image/auto-orient,1/resize,m_fill,w_94,h_94/quality,q_90"},description:"{{ xStyleProcessDesc }}"}}},path:p.path,rules:p.rules,default:p.default,paranoid:p.paranoid}},oe={title:`{{t("Local storage", { ns: "${e}" })}}`,name:"local",properties:{title:p.title,name:p.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: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input","x-display":"hidden",default:"storage/uploads"}}},path:{"x-component":"CollectionField","x-decorator":"FormItem","x-component-props":{addonBefore:"storage/uploads/"}},rules:p.rules,default:p.default,paranoid:p.paranoid}},ne={title:`{{t("Amazon S3", { ns: "${e}" })}}`,name:"s3",properties:{title:p.title,name:p.name,baseUrl:p.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},secretAccessKey:{title:`{{t("AccessKey Secret", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password",required:!0},bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},endpoint:{title:`{{t("Endpoint", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"}}},path:p.path,rules:p.rules,default:p.default,paranoid:p.paranoid}},re={title:`{{t("Tencent COS", { ns: "${e}" })}}`,name:"tx-cos",properties:{title:p.title,name:p.name,baseUrl:p.baseUrl,options:{type:"object","x-component":"fieldset",properties:{Region:{title:`{{t("Region", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},SecretId:{title:`{{t("SecretId", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},SecretKey:{title:`{{t("SecretKey", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password",required:!0},Bucket:{title:`{{t("Bucket", { ns: "${e}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0}}},path:p.path,rules:p.rules,default:p.default,paranoid:p.paranoid}},ie={local:oe,"ali-oss":te,s3:ne,"tx-cos":re};class se extends t.CollectionFieldInterface{constructor(){super(...arguments);l(this,"name","attachment");l(this,"type","object");l(this,"group","media");l(this,"title",`{{t("Attachment", { ns: "${e}" })}}`);l(this,"isAssociation",!0);l(this,"default",{type:"belongsToMany",target:"attachments",uiSchema:{type:"array","x-component":"Upload.Attachment","x-use-component-props":"useAttachmentFieldProps"}});l(this,"availableTypes",["belongsToMany"]);l(this,"properties",A(F({},t.interfacesProperties.defaultProps),{"uiSchema.x-component-props.accept":{type:"string",title:`{{t("MIME type", { ns: "${e}" })}}`,"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: "${e}" })}}`,"x-decorator":"FormItem","x-component":"Checkbox",default:!0},storage:{type:"string",title:`{{t("Storage", { ns: "${e}" })}}`,description:`{{t('Default storage will be used when not selected', { ns: "${e}" })}}`,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}}));l(this,"filterable",{children:[{name:"id",title:'{{t("Exists")}}',operators:[{label:'{{t("exists")}}',value:"$exists",noValue:!0},{label:'{{t("not exists")}}',value:"$notExists",noValue:!0}],schema:{title:'{{t("Exists")}}',type:"string","x-component":"Input"}},{name:"filename",title:`{{t("Filename", { ns: "${e}" })}}`,operators:t.interfacesProperties.operators.string,schema:{title:`{{t("Filename", { ns: "${e}" })}}`,type:"string","x-component":"Input"}}]})}schemaInitialize(o,{block:s,field:c}){o["x-component-props"]||(o["x-component-props"]={}),["Table","Kanban"].includes(s)&&(o["x-component-props"].size="small"),o["x-use-component-props"]="useAttachmentFieldProps"}initialize(o){o.through||(o.through=`t_${S.uid()}`),o.foreignKey||(o.foreignKey=`f_${S.uid()}`),o.otherKey||(o.otherKey=`f_${S.uid()}`),o.sourceKey||(o.sourceKey="id"),o.targetKey||(o.targetKey="id")}}class ae extends t.CollectionTemplate{constructor(){super(...arguments);l(this,"name","file");l(this,"title",`{{t("File collection", { ns: "${e}" })}}`);l(this,"order",3);l(this,"color","blue");l(this,"default",{createdBy:!0,updatedBy:!0,fields:[{interface:"input",type:"string",name:"title",deletable:!1,uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{interface:"input",type:"string",name:"filename",deletable:!1,uiSchema:{type:"string",title:`{{t("File name", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"extname",deletable:!1,uiSchema:{type:"string",title:`{{t("Extension name", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"integer",type:"integer",name:"size",deletable:!1,uiSchema:{type:"number",title:`{{t("Size", { ns: "${e}" })}}`,"x-component":"InputNumber","x-read-pretty":!0,"x-component-props":{stringMode:!0,step:"0"}}},{interface:"input",type:"string",name:"mimetype",deletable:!1,uiSchema:{type:"string",title:`{{t("MIME type", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"path",deletable:!1,uiSchema:{type:"string",title:`{{t("Path", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"url",type:"string",name:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("URL")}}',"x-component":"Input.URL","x-read-pretty":!0}},{interface:"url",type:"string",name:"preview",field:"url",deletable:!1,uiSchema:{type:"string",title:`{{t("Preview", { ns: "${e}" })}}`,"x-component":"Preview","x-read-pretty":!0}},{comment:"存储引擎",type:"belongsTo",name:"storage",target:"storages",foreignKey:"storageId",deletable:!1,uiSchema:{type:"string",title:`{{t("Storage", { ns: "${e}" })}}`,"x-component":"Input","x-read-pretty":!0}},{type:"jsonb",name:"meta",deletable:!1,defaultValue:{}}]});l(this,"presetFieldsDisabled",!0);l(this,"configurableProperties",F(A(F(A(F({},t.getConfigurableProperties("title","name")),{inherits:A(F({},t.getConfigurableProperties("inherits").inherits),{"x-reactions":["{{useAsyncDataSource(loadCollections)}}"]})}),t.getConfigurableProperties("category","description")),{storage:{type:"string",name:"storage",title:`{{t("File storage", { ns: "${e}" })}}`,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}}),t.getConfigurableProperties("presetFields")))}}const M=[{value:1,label:"Byte"},{value:1024,label:"KB"},{value:1024*1024,label:"MB"},{value:1024*1024*1024,label:"GB"}];function B(n,i=1024*1024){const o=n||i;for(let s=M.length-1;s>=0;s--){const c=M[s];if(o%c.value===0)return c}return M[0]}function j(n,i,o){return Math.min(Math.max(i,n),o)}function pe(n){var P;const{value:i,defaultUnit:o=1024*1024,min:s=Y,max:c=ee,step:u=1,onChange:g}=n,d=(P=n.defaultValue)!=null?P:_,m=B(d,o),C=d/m.value,f=B(i!=null?i:d,o),x=i==null?i:i/f.value,v=y.useCallback(T=>{g==null||g(j(T==null?T:T*f.value,s,c))},[f.value]),K=y.useCallback(T=>{g==null||g(j(x*T,s,c))},[x]);return r.jsxs(I.Space.Compact,{children:[r.jsx(I.InputNumber,{value:x,onChange:v,defaultValue:`${C}`,step:u}),r.jsx(I.Select,{options:M,value:f.value,onChange:K,className:"auto-width"})]})}class q extends t.Plugin{constructor(){super(...arguments);l(this,"storageTypes",new Map)}load(){return L(this,null,function*(){this.app.dataSourceManager.addFieldInterfaces([se]),this.app.dataSourceManager.addCollectionTemplates([ae]),this.app.use(Z),this.app.pluginSettingsManager.add(e,{title:`{{t("File manager", { ns: "${e}" })}}`,icon:"FileOutlined",Component:Q,aclSnippet:"pm.file-manager.storages"}),Object.values(ie).forEach(s=>{this.registerStorageType(s.name,s)});const o=this.app.schemaInitializerManager.get("table:configureActions");o==null||o.add("enableActions.upload",{title:"{{t('Upload')}}",Component:"UploadActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){return t.useCollection().template==="file"}}),this.app.addScopes({useAttachmentFieldProps:U,useFileCollectionStorageRules:E}),this.app.addComponents({FileSizeField:pe})})}registerStorageType(o,s){this.storageTypes.set(o,s)}}a.PluginFileManagerClient=q,a.default=q,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
10
+ (function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("react"),require("@formily/react"),require("@ant-design/icons"),require("@formily/shared"),require("antd"),require("lodash"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","react","@formily/react","@ant-design/icons","@formily/shared","antd","lodash","react-i18next"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a["@nocobase/plugin-file-manager"]={},a["@nocobase/client"],a.jsxRuntime,a.react,a["@formily/react"],a["@ant-design/icons"],a["@formily/shared"],a.antd,a.lodash,a["react-i18next"]))})(this,function(a,e,r,g,D,M,S,h,b,A){"use strict";var se=Object.defineProperty,pe=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var ce=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable;var k=(a,e,r)=>e in a?se(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,I=(a,e)=>{for(var r in e||(e={}))ce.call(e,r)&&k(a,r,e[r]);if(L)for(var r of L(e))ue.call(e,r)&&k(a,r,e[r]);return a},C=(a,e)=>pe(a,le(e));var c=(a,e,r)=>(k(a,typeof e!="symbol"?e+"":e,r),r);var V=(a,e,r)=>new Promise((g,D)=>{var M=b=>{try{h(r.next(b))}catch(A){D(A)}},S=b=>{try{h(r.throw(b))}catch(A){D(A)}},h=b=>b.done?g(b.value):Promise.resolve(b.value).then(M,S);h((r=r.apply(a,e)).next())});function w(o){const i=o!=null?o:"";e.useAPIClient();const n=D.useField(),{loading:s,data:l,run:y}=e.useRequest({url:`storages:getRules/${i}`},{manual:!0,refreshDeps:[i],cacheKey:i});return g.useEffect(()=>{n.pattern==="editable"&&y()},[n.pattern,y]),!s&&(l==null?void 0:l.data)||null}function E(){const o=e.useCollectionField();return{rules:w(o==null?void 0:o.storage),action:`${o.target}:create${o.storage?`?attachmentField=${o.collectionName}.${o.name}`:""}`}}function O(){const o=e.useCollectionField(),n=e.useCollectionManager().getCollection(o==null?void 0:o.target);return w(n==null?void 0:n.getOption("storage"))}const N=Object.freeze(Object.defineProperty({__proto__:null,useAttachmentFieldProps:E,useFileCollectionStorageRules:O,useStorageRules:w,useUploadFiles:()=>{const o=e.useDataBlockRequest(),{association:i}=e.useDataBlockProps(),{setVisible:n}=e.useActionContext(),s=e.useCollection(),l=e.useSourceId(),y=w(s==null?void 0:s.getOption("storage")),x=g.useMemo(()=>{let f=`${s.name}:create`;if(i){const[d,$]=i.split(".");f=`${d}/${l}/${$}:create`}return f},[s.name,i,l]),{setSelectedRows:m}=g.useContext(e.RecordPickerContext)||{},u={};let F=0;return{action:x,onChange(f){f.forEach(d=>{var $;d.status==="uploading"&&!u[d.uid]&&(F++,u[d.uid]=!0),d.status!=="uploading"&&u[d.uid]&&(delete u[d.uid],--F===0&&(($=o==null?void 0:o.refresh)==null||$.call(o),m==null||m(q=>[...q,...f.filter(v=>v.status==="done").map(v=>v.response.data)])))}),f.every(d=>d.status==="done")&&n(!1)},rules:y}}},Symbol.toStringTag,{value:"Module"})),R=o=>{const i={type:"void","x-action":"create",title:"{{t('Upload')}}","x-designer":"Action.Designer","x-component":"Action","x-decorator":"ACLActionProvider","x-component-props":{openMode:"drawer",type:"primary",icon:"UploadOutlined"},properties:{drawer:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Action.Container",properties:{upload:{type:"void",title:'{{ t("Upload files") }}',"x-component":"Upload.DraggerV2","x-use-component-props":"useUploadFiles","x-component-props":{height:"50vh",multiple:!0,listType:"picture"}}}}}};return r.jsx(e.ActionInitializerItem,C(I({},o),{schema:i}))},Z=o=>r.jsx(e.SchemaComponentOptions,{scope:N,components:{UploadActionInitializer:R},children:o.children}),t="file-manager",K={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: "${t}" })}}`,descriptions:`{{t("Will be used for API", { ns: "${t}" })}}`,type:"string","x-component":"Input"}},{type:"string",name:"type",interface:"select",uiSchema:{title:`{{t("Storage type", { ns: "${t}" })}}`,type:"string","x-component":"Select",required:!0,enum:"{{ storageTypeOptions }}"}},{type:"string",name:"baseUrl",interface:"input",uiSchema:{title:`{{t("Access base URL", { ns: "${t}" })}}`,type:"string","x-component":"Input",required:!0}},{type:"string",name:"path",interface:"input",uiSchema:{title:`{{t("Path", { ns: "${t}" })}}`,type:"string","x-component":"Input"}},{type:"boolean",name:"default",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}},{type:"boolean",name:"paranoid",interface:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}}]},G={type:"object",properties:{[S.uid()]:{type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:K,resourceName:"storages",request:{resource:"storages",action:"list",params:{pageSize:50,sort:["id"],appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:K},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: "${t}" })}}`,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}}"}}}}}}}}}}}},W=1,X=1024*1024*1024,_=1024*1024*20,p={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: "${t}" })}}`},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: "${t}" })}}`},rules:{type:"object","x-component":"fieldset",properties:{size:{type:"number",title:`{{t("File size limit", { ns: "${t}" })}}`,description:`{{t("Minimum from 1 byte, maximum up to 1GB.", { ns: "${t}" })}}`,"x-decorator":"FormItem","x-component":"FileSizeField",required:!0,default:_},mimetype:{type:"string",title:`{{t("File type (in MIME type format)", { ns: "${t}" })}}`,description:`{{t('Multi-types seperated with comma, for example: "image/*", "image/png", "image/*, application/pdf" etc.', { ns: "${t}" })}}`,"x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:"*"}}}},default:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Default storage", { ns: "${t}" })}}`},paranoid:{"x-component":"CollectionField","x-decorator":"FormItem","x-content":`{{t("Keep file in storage when destroy record", { ns: "${t}" })}}`}},H={title:`{{t("Aliyun OSS", { ns: "${t}" })}}`,name:"ali-oss",fieldset:{title:p.title,name:p.name,baseUrl:p.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:`{{t("Region", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",description:`{{t('Aliyun OSS region part of the bucket. For example: "oss-cn-beijing".', { ns: "${t}" })}}`,required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},accessKeySecret:{title:`{{t("AccessKey Secret", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password",required:!0},bucket:{title:`{{t("Bucket", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"Input","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:p.path,rules:p.rules,default:p.default,paranoid:p.paranoid},thumbnailRuleLink:"https://help.aliyun.com/zh/oss/user-guide/resize-images-4"},J={title:`{{t("Local storage", { ns: "${t}" })}}`,name:"local",fieldset:{title:p.title,name:p.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: "${t}" })}}`,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:p.rules,default:p.default,paranoid:p.paranoid}},Q={title:`{{t("Amazon S3", { ns: "${t}" })}}`,name:"s3",fieldset:{title:p.title,name:p.name,baseUrl:p.baseUrl,options:{type:"object","x-component":"fieldset",properties:{region:{title:`{{t("Region", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},accessKeyId:{title:`{{t("AccessKey ID", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},secretAccessKey:{title:`{{t("AccessKey Secret", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password",required:!0},bucket:{title:`{{t("Bucket", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},endpoint:{title:`{{t("Endpoint", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input"}}},path:p.path,rules:p.rules,default:p.default,paranoid:p.paranoid}},Y={title:`{{t("Tencent COS", { ns: "${t}" })}}`,name:"tx-cos",fieldset:{title:p.title,name:p.name,baseUrl:p.baseUrl,options:{type:"object","x-component":"fieldset",properties:{Region:{title:`{{t("Region", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},SecretId:{title:`{{t("SecretId", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},SecretKey:{title:`{{t("SecretKey", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Password",required:!0},Bucket:{title:`{{t("Bucket", { ns: "${t}" })}}`,type:"string","x-decorator":"FormItem","x-component":"Input",required:!0},thumbnailRule:{title:"Thumbnail rule",type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:"?imageMogr2/thumbnail/!50p"},description:'{{ renderThumbnailRuleDesc("tx-cos") }}'}}},path:p.path,rules:p.rules,default:p.default,paranoid:p.paranoid},thumbnailRuleLink:"https://cloud.tencent.com/document/product/436/42214"},j={local:J,"ali-oss":H,s3:Q,"tx-cos":Y},ee=()=>{const[o,i]=g.useState({}),n=e.usePlugin(T),s=e.useCompile(),[l,y]=g.useState(!1),{t:x}=A.useTranslation();return r.jsx("div",{children:r.jsxs(e.ActionContext.Provider,{value:{visible:l,setVisible:y},children:[r.jsx(h.Dropdown,{menu:{onClick(m){const u=n.storageTypes.get(m.key);y(!0),i({type:"object",properties:{[S.uid()]:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{type:u.name}},title:s("{{t('Add new')}}")+" - "+s(u.title),properties:C(I({},b.cloneDeep(u.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:[...n.storageTypes.values()].map(m=>({key:m.name,label:s(m.title)}))},children:r.jsxs(h.Button,{type:"primary",icon:r.jsx(M.PlusOutlined,{}),children:[x("Add new")," ",r.jsx(M.DownOutlined,{})]})}),r.jsx(e.SchemaComponent,{scope:{createOnly:!0},schema:o})]})})},te=()=>{const o=e.useRecord(),[i,n]=g.useState({}),s=e.usePlugin(T),l=e.useCompile(),[y,x]=g.useState(!1),{t:m}=A.useTranslation();return r.jsx("div",{children:r.jsxs(e.ActionContext.Provider,{value:{visible:y,setVisible:x},children:[r.jsx("a",{onClick:()=>{x(!0);const u=s.storageTypes.get(o.type);u.fieldset.default&&(u.fieldset.default["x-reactions"]=F=>{F.initialValue?F.disabled=!0:F.disabled=!1}),n({type:"object",properties:{[S.uid()]:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:I({},o)},title:l("{{t('Edit')}}")+" - "+l(u.title),properties:C(I({},b.cloneDeep(u.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 }}"}}}}})}}})},children:m("Edit")}),r.jsx(e.SchemaComponent,{scope:{createOnly:!1},schema:i})]})})};function oe(o){const i=j[o];return i!=null&&i.thumbnailRule?r.jsx("div",{children:r.jsx("a",{target:"_blank",href:i.thumbnailRuleLink,rel:"noreferrer",children:e.i18n.t("See more")})}):null}const ne=()=>{const o=e.useCompile(),s=[...e.usePlugin(T).storageTypes.values()].map(l=>({value:l.name,label:o(l.title)}));return r.jsx(h.Card,{bordered:!1,children:r.jsx(e.SchemaComponent,{components:{CreateStorage:ee,EditStorage:te},scope:{useNewId:l=>`${l}${S.uid()}`,storageTypeOptions:s,renderThumbnailRuleDesc:oe},schema:G})})};class re extends e.CollectionFieldInterface{constructor(){super(...arguments);c(this,"name","attachment");c(this,"type","object");c(this,"group","media");c(this,"title",`{{t("Attachment", { ns: "${t}" })}}`);c(this,"isAssociation",!0);c(this,"default",{type:"belongsToMany",target:"attachments",uiSchema:{type:"array","x-component":"Upload.Attachment","x-use-component-props":"useAttachmentFieldProps"}});c(this,"availableTypes",["belongsToMany"]);c(this,"properties",C(I({},e.interfacesProperties.defaultProps),{"uiSchema.x-component-props.accept":{type:"string",title:`{{t("MIME type", { ns: "${t}" })}}`,"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: "${t}" })}}`,"x-decorator":"FormItem","x-component":"Checkbox",default:!0},storage:{type:"string",title:`{{t("Storage", { ns: "${t}" })}}`,description:`{{t('Default storage will be used when not selected', { ns: "${t}" })}}`,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}}));c(this,"filterable",{children:[{name:"id",title:'{{t("Exists")}}',operators:[{label:'{{t("exists")}}',value:"$exists",noValue:!0},{label:'{{t("not exists")}}',value:"$notExists",noValue:!0}],schema:{title:'{{t("Exists")}}',type:"string","x-component":"Input"}},{name:"filename",title:`{{t("Filename", { ns: "${t}" })}}`,operators:e.interfacesProperties.operators.string,schema:{title:`{{t("Filename", { ns: "${t}" })}}`,type:"string","x-component":"Input"}}]})}schemaInitialize(n,{block:s,field:l}){n["x-component-props"]||(n["x-component-props"]={}),["Table","Kanban"].includes(s)&&(n["x-component-props"].size="small"),n["x-use-component-props"]="useAttachmentFieldProps"}initialize(n){n.through||(n.through=`t_${S.uid()}`),n.foreignKey||(n.foreignKey=`f_${S.uid()}`),n.otherKey||(n.otherKey=`f_${S.uid()}`),n.sourceKey||(n.sourceKey="id"),n.targetKey||(n.targetKey="id")}}class ie extends e.CollectionTemplate{constructor(){super(...arguments);c(this,"name","file");c(this,"title",`{{t("File collection", { ns: "${t}" })}}`);c(this,"order",3);c(this,"color","blue");c(this,"default",{createdBy:!0,updatedBy:!0,fields:[{interface:"input",type:"string",name:"title",deletable:!1,uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{interface:"input",type:"string",name:"filename",deletable:!1,uiSchema:{type:"string",title:`{{t("File name", { ns: "${t}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"extname",deletable:!1,uiSchema:{type:"string",title:`{{t("Extension name", { ns: "${t}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"integer",type:"integer",name:"size",deletable:!1,uiSchema:{type:"number",title:`{{t("Size", { ns: "${t}" })}}`,"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: "${t}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"input",type:"string",name:"path",deletable:!1,uiSchema:{type:"string",title:`{{t("Path", { ns: "${t}" })}}`,"x-component":"Input","x-read-pretty":!0}},{interface:"url",type:"string",name:"url",deletable:!1,uiSchema:{type:"string",title:'{{t("URL")}}',"x-component":"Input.URL","x-read-pretty":!0}},{interface:"url",type:"string",name:"preview",field:"url",deletable:!1,uiSchema:{type:"string",title:`{{t("Preview", { ns: "${t}" })}}`,"x-component":"Preview","x-read-pretty":!0}},{comment:"存储引擎",type:"belongsTo",name:"storage",target:"storages",foreignKey:"storageId",deletable:!1,uiSchema:{type:"string",title:`{{t("Storage", { ns: "${t}" })}}`,"x-component":"Input","x-read-pretty":!0}},{type:"jsonb",name:"meta",deletable:!1,defaultValue:{}}]});c(this,"presetFieldsDisabled",!0);c(this,"configurableProperties",I(C(I(C(I({},e.getConfigurableProperties("title","name")),{inherits:C(I({},e.getConfigurableProperties("inherits").inherits),{"x-reactions":["{{useAsyncDataSource(loadCollections)}}"]})}),e.getConfigurableProperties("category","description")),{storage:{type:"string",name:"storage",title:`{{t("File storage", { ns: "${t}" })}}`,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{service:{resource:"storages",params:{}},manual:!1,fieldNames:{label:"title",value:"name"}}}}),e.getConfigurableProperties("presetFields")))}}const U=[{value:1,label:"Byte"},{value:1024,label:"KB"},{value:1024*1024,label:"MB"},{value:1024*1024*1024,label:"GB"}];function z(o,i=1024*1024){const n=o||i;for(let s=U.length-1;s>=0;s--){const l=U[s];if(n%l.value===0)return l}return U[0]}function B(o,i,n){return Math.min(Math.max(i,o),n)}function ae(o){var v;const{value:i,defaultUnit:n=1024*1024,min:s=W,max:l=X,step:y=1,onChange:x}=o,m=(v=o.defaultValue)!=null?v:_,u=z(m,n),F=m/u.value,f=z(i!=null?i:m,n),d=i==null?i:i/f.value,$=g.useCallback(P=>{x==null||x(B(P==null?P:P*f.value,s,l))},[f.value]),q=g.useCallback(P=>{x==null||x(B(d*P,s,l))},[d]);return r.jsxs(h.Space.Compact,{children:[r.jsx(h.InputNumber,{value:d,onChange:$,defaultValue:`${F}`,step:y}),r.jsx(h.Select,{options:U,value:f.value,onChange:q,className:"auto-width"})]})}class T extends e.Plugin{constructor(){super(...arguments);c(this,"storageTypes",new Map)}load(){return V(this,null,function*(){this.app.dataSourceManager.addFieldInterfaces([re]),this.app.dataSourceManager.addCollectionTemplates([ie]),this.app.use(Z),this.app.pluginSettingsManager.add(t,{title:`{{t("File manager", { ns: "${t}" })}}`,icon:"FileOutlined",Component:ne,aclSnippet:"pm.file-manager.storages"}),Object.values(j).forEach(s=>{this.registerStorageType(s.name,s)});const n=this.app.schemaInitializerManager.get("table:configureActions");n==null||n.add("enableActions.upload",{title:"{{t('Upload')}}",Component:"UploadActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){return e.useCollection().template==="file"}}),this.app.addScopes({useAttachmentFieldProps:E,useFileCollectionStorageRules:O}),this.app.addComponents({FileSizeField:ae})})}registerStorageType(n,s){this.storageTypes.set(n,s)}}a.PluginFileManagerClient=T,a.default=T,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -9,7 +9,7 @@
9
9
  declare const _default: {
10
10
  title: string;
11
11
  name: string;
12
- properties: {
12
+ fieldset: {
13
13
  title: {
14
14
  'x-component': string;
15
15
  'x-decorator': string;
@@ -113,5 +113,6 @@ declare const _default: {
113
113
  'x-content': string;
114
114
  };
115
115
  };
116
+ thumbnailRuleLink: string;
116
117
  };
117
118
  export default _default;
@@ -10,7 +10,7 @@ export declare const storageTypes: {
10
10
  local: {
11
11
  title: string;
12
12
  name: string;
13
- properties: {
13
+ fieldset: {
14
14
  title: {
15
15
  'x-component': string;
16
16
  'x-decorator': string;
@@ -90,7 +90,7 @@ export declare const storageTypes: {
90
90
  'ali-oss': {
91
91
  title: string;
92
92
  name: string;
93
- properties: {
93
+ fieldset: {
94
94
  title: {
95
95
  'x-component': string;
96
96
  'x-decorator': string;
@@ -194,11 +194,12 @@ export declare const storageTypes: {
194
194
  'x-content': string;
195
195
  };
196
196
  };
197
+ thumbnailRuleLink: string;
197
198
  };
198
199
  s3: {
199
200
  title: string;
200
201
  name: string;
201
- properties: {
202
+ fieldset: {
202
203
  title: {
203
204
  'x-component': string;
204
205
  'x-decorator': string;
@@ -301,7 +302,7 @@ export declare const storageTypes: {
301
302
  'tx-cos': {
302
303
  title: string;
303
304
  name: string;
304
- properties: {
305
+ fieldset: {
305
306
  title: {
306
307
  'x-component': string;
307
308
  'x-decorator': string;
@@ -351,6 +352,16 @@ export declare const storageTypes: {
351
352
  'x-component': string;
352
353
  required: boolean;
353
354
  };
355
+ thumbnailRule: {
356
+ title: string;
357
+ type: string;
358
+ 'x-decorator': string;
359
+ 'x-component': string;
360
+ 'x-component-props': {
361
+ placeholder: string;
362
+ };
363
+ description: string;
364
+ };
354
365
  };
355
366
  };
356
367
  path: {
@@ -394,5 +405,6 @@ export declare const storageTypes: {
394
405
  'x-content': string;
395
406
  };
396
407
  };
408
+ thumbnailRuleLink: string;
397
409
  };
398
410
  };
@@ -9,7 +9,7 @@
9
9
  declare const _default: {
10
10
  title: string;
11
11
  name: string;
12
- properties: {
12
+ fieldset: {
13
13
  title: {
14
14
  'x-component': string;
15
15
  'x-decorator': string;
@@ -9,7 +9,7 @@
9
9
  declare const _default: {
10
10
  title: string;
11
11
  name: string;
12
- properties: {
12
+ fieldset: {
13
13
  title: {
14
14
  'x-component': string;
15
15
  'x-decorator': string;
@@ -9,7 +9,7 @@
9
9
  declare const _default: {
10
10
  title: string;
11
11
  name: string;
12
- properties: {
12
+ fieldset: {
13
13
  title: {
14
14
  'x-component': string;
15
15
  'x-decorator': string;
@@ -59,6 +59,16 @@ declare const _default: {
59
59
  'x-component': string;
60
60
  required: boolean;
61
61
  };
62
+ thumbnailRule: {
63
+ title: string;
64
+ type: string;
65
+ 'x-decorator': string;
66
+ 'x-component': string;
67
+ 'x-component-props': {
68
+ placeholder: string;
69
+ };
70
+ description: string;
71
+ };
62
72
  };
63
73
  };
64
74
  path: {
@@ -102,5 +112,6 @@ declare const _default: {
102
112
  'x-content': string;
103
113
  };
104
114
  };
115
+ thumbnailRuleLink: string;
105
116
  };
106
117
  export default _default;
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.3.44-beta",
11
+ "@nocobase/client": "1.4.0-alpha.0",
12
12
  "react": "18.2.0",
13
13
  "antd": "5.12.8",
14
14
  "@ant-design/icons": "5.2.6",
@@ -18,10 +18,10 @@ module.exports = {
18
18
  "@formily/antd-v5": "1.1.9",
19
19
  "@formily/core": "2.3.0",
20
20
  "@formily/react": "2.3.0",
21
- "@nocobase/database": "1.3.44-beta",
22
- "@nocobase/server": "1.3.44-beta",
23
- "@nocobase/utils": "1.3.44-beta",
24
- "@nocobase/test": "1.3.44-beta",
25
- "@nocobase/actions": "1.3.44-beta",
21
+ "@nocobase/database": "1.4.0-alpha.0",
22
+ "@nocobase/server": "1.4.0-alpha.0",
23
+ "@nocobase/utils": "1.4.0-alpha.0",
24
+ "@nocobase/test": "1.4.0-alpha.0",
25
+ "@nocobase/actions": "1.4.0-alpha.0",
26
26
  "multer": "1.4.4"
27
27
  };
@@ -2,7 +2,6 @@
2
2
  "File manager": "ファイルストレージ",
3
3
  "Attachment": "添付ファイル",
4
4
  "MIME type": "ファイル形式",
5
- "Allow uploading multiple files": "複数ファイルのアップロードを許可する",
6
5
  "Storage display name": "ファイルストレージ名",
7
6
  "Storage name": "ファイルストレージ識別子",
8
7
  "Storage type": "ストレージタイプ",
@@ -14,5 +13,29 @@
14
13
  "Aliyun OSS": "Aliyun OSS",
15
14
  "Tencent COS": "Tencent COS",
16
15
  "Amazon S3": "Amazon S3",
17
- "Filename": "ファイル名"
16
+ "Region": "地域",
17
+ "Bucket": "バケット",
18
+ "Path": "パス",
19
+ "Filename": "ファイル名",
20
+ "See more": "続きを見る",
21
+ "Will be used for API": "API で使用されます",
22
+ "File collection": "ファイルデータテーブル",
23
+ "File name": "ファイル名",
24
+ "Extension name": "拡張子",
25
+ "Size": "ファイルサイズ",
26
+ "File size limit": "ファイルサイズ制限",
27
+ "Minimum from 1 byte, maximum up to 1GB.": "最小サイズは1バイト、最大サイズは1GBです。",
28
+ "File type (in MIME type format)": "ファイルタイプ(MIME形式)",
29
+ "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "複数のタイプはカンマで区切ります。 例えば「image/*」「image/png」「image/*、application/pdf」など。",
30
+ "URL": "URL",
31
+ "File storage": "ファイルストレージ",
32
+ "Allow uploading multiple files": "複数ファイルのアップロードを許可する",
33
+ "Storage": "ストレージ",
34
+ "Storages": "ストレージ",
35
+ "Access base URL": "アクセスURLのベース",
36
+ "Base URL for file access, could be your CDN base URL. For example: \"https://cdn.nocobase.com\".": "术语调整,“基礎URL”改为“ベースURL”",
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\".": "更清晰的表达方式,符合技术描述",
38
+ "Default storage will be used when not selected": "空欄の場合はデフォルトのストレージが使用されます。",
39
+ "Keep file in storage when destroy record": "レコード削除時にファイルを保持",
40
+ "Aliyun OSS region part of the bucket. For example: \"oss-cn-beijing\".": "阿里クラウドOSSの地域。 例えば「oss-cn-beijing」。"
18
41
  }
@@ -1 +1 @@
1
- {"name":"@aws-sdk/client-s3","description":"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native","version":"3.474.0","scripts":{"build":"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"tsc -p tsconfig.cjs.json","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3","test":"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha1-browser":"3.0.0","@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sts":"3.474.0","@aws-sdk/core":"3.474.0","@aws-sdk/credential-provider-node":"3.474.0","@aws-sdk/middleware-bucket-endpoint":"3.470.0","@aws-sdk/middleware-expect-continue":"3.468.0","@aws-sdk/middleware-flexible-checksums":"3.468.0","@aws-sdk/middleware-host-header":"3.468.0","@aws-sdk/middleware-location-constraint":"3.468.0","@aws-sdk/middleware-logger":"3.468.0","@aws-sdk/middleware-recursion-detection":"3.468.0","@aws-sdk/middleware-sdk-s3":"3.474.0","@aws-sdk/middleware-signing":"3.468.0","@aws-sdk/middleware-ssec":"3.468.0","@aws-sdk/middleware-user-agent":"3.470.0","@aws-sdk/region-config-resolver":"3.470.0","@aws-sdk/signature-v4-multi-region":"3.474.0","@aws-sdk/types":"3.468.0","@aws-sdk/util-endpoints":"3.470.0","@aws-sdk/util-user-agent-browser":"3.468.0","@aws-sdk/util-user-agent-node":"3.470.0","@aws-sdk/xml-builder":"3.472.0","@smithy/config-resolver":"^2.0.21","@smithy/eventstream-serde-browser":"^2.0.15","@smithy/eventstream-serde-config-resolver":"^2.0.15","@smithy/eventstream-serde-node":"^2.0.15","@smithy/fetch-http-handler":"^2.3.1","@smithy/hash-blob-browser":"^2.0.16","@smithy/hash-node":"^2.0.17","@smithy/hash-stream-node":"^2.0.17","@smithy/invalid-dependency":"^2.0.15","@smithy/md5-js":"^2.0.17","@smithy/middleware-content-length":"^2.0.17","@smithy/middleware-endpoint":"^2.2.3","@smithy/middleware-retry":"^2.0.24","@smithy/middleware-serde":"^2.0.15","@smithy/middleware-stack":"^2.0.9","@smithy/node-config-provider":"^2.1.8","@smithy/node-http-handler":"^2.2.1","@smithy/protocol-http":"^3.0.11","@smithy/smithy-client":"^2.1.18","@smithy/types":"^2.7.0","@smithy/url-parser":"^2.0.15","@smithy/util-base64":"^2.0.1","@smithy/util-body-length-browser":"^2.0.1","@smithy/util-body-length-node":"^2.1.0","@smithy/util-defaults-mode-browser":"^2.0.22","@smithy/util-defaults-mode-node":"^2.0.29","@smithy/util-endpoints":"^1.0.7","@smithy/util-retry":"^2.0.8","@smithy/util-stream":"^2.0.23","@smithy/util-utf8":"^2.0.2","@smithy/util-waiter":"^2.0.15","fast-xml-parser":"4.2.5","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.0.0","@tsconfig/node14":"1.0.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~4.9.5"},"engines":{"node":">=14.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-s3"},"_lastModified":"2024-11-05T07:51:35.817Z"}
1
+ {"name":"@aws-sdk/client-s3","description":"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native","version":"3.474.0","scripts":{"build":"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"tsc -p tsconfig.cjs.json","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3","test":"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha1-browser":"3.0.0","@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sts":"3.474.0","@aws-sdk/core":"3.474.0","@aws-sdk/credential-provider-node":"3.474.0","@aws-sdk/middleware-bucket-endpoint":"3.470.0","@aws-sdk/middleware-expect-continue":"3.468.0","@aws-sdk/middleware-flexible-checksums":"3.468.0","@aws-sdk/middleware-host-header":"3.468.0","@aws-sdk/middleware-location-constraint":"3.468.0","@aws-sdk/middleware-logger":"3.468.0","@aws-sdk/middleware-recursion-detection":"3.468.0","@aws-sdk/middleware-sdk-s3":"3.474.0","@aws-sdk/middleware-signing":"3.468.0","@aws-sdk/middleware-ssec":"3.468.0","@aws-sdk/middleware-user-agent":"3.470.0","@aws-sdk/region-config-resolver":"3.470.0","@aws-sdk/signature-v4-multi-region":"3.474.0","@aws-sdk/types":"3.468.0","@aws-sdk/util-endpoints":"3.470.0","@aws-sdk/util-user-agent-browser":"3.468.0","@aws-sdk/util-user-agent-node":"3.470.0","@aws-sdk/xml-builder":"3.472.0","@smithy/config-resolver":"^2.0.21","@smithy/eventstream-serde-browser":"^2.0.15","@smithy/eventstream-serde-config-resolver":"^2.0.15","@smithy/eventstream-serde-node":"^2.0.15","@smithy/fetch-http-handler":"^2.3.1","@smithy/hash-blob-browser":"^2.0.16","@smithy/hash-node":"^2.0.17","@smithy/hash-stream-node":"^2.0.17","@smithy/invalid-dependency":"^2.0.15","@smithy/md5-js":"^2.0.17","@smithy/middleware-content-length":"^2.0.17","@smithy/middleware-endpoint":"^2.2.3","@smithy/middleware-retry":"^2.0.24","@smithy/middleware-serde":"^2.0.15","@smithy/middleware-stack":"^2.0.9","@smithy/node-config-provider":"^2.1.8","@smithy/node-http-handler":"^2.2.1","@smithy/protocol-http":"^3.0.11","@smithy/smithy-client":"^2.1.18","@smithy/types":"^2.7.0","@smithy/url-parser":"^2.0.15","@smithy/util-base64":"^2.0.1","@smithy/util-body-length-browser":"^2.0.1","@smithy/util-body-length-node":"^2.1.0","@smithy/util-defaults-mode-browser":"^2.0.22","@smithy/util-defaults-mode-node":"^2.0.29","@smithy/util-endpoints":"^1.0.7","@smithy/util-retry":"^2.0.8","@smithy/util-stream":"^2.0.23","@smithy/util-utf8":"^2.0.2","@smithy/util-waiter":"^2.0.15","fast-xml-parser":"4.2.5","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.0.0","@tsconfig/node14":"1.0.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~4.9.5"},"engines":{"node":">=14.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-s3"},"_lastModified":"2024-11-06T06:26:21.376Z"}
@@ -1 +1 @@
1
- {"name":"mime-match","version":"1.0.2","description":"A simple function to check whether a mimetype matches the specified mimetype (with wildcard support)","main":"index.js","scripts":{"test":"node test.js","gendocs":"gendocs > README.md"},"repository":{"type":"git","url":"https://github.com/DamonOehlman/mime-match.git"},"keywords":["mime","wildcard"],"author":"Damon Oehlman <damon.oehlman@gmail.com>","license":"ISC","bugs":{"url":"https://github.com/DamonOehlman/mime-match/issues"},"homepage":"https://github.com/DamonOehlman/mime-match","dependencies":{"wildcard":"^1.1.0"},"devDependencies":{"tape":"^4.5.1"},"_lastModified":"2024-11-05T07:51:26.322Z"}
1
+ {"name":"mime-match","version":"1.0.2","description":"A simple function to check whether a mimetype matches the specified mimetype (with wildcard support)","main":"index.js","scripts":{"test":"node test.js","gendocs":"gendocs > README.md"},"repository":{"type":"git","url":"https://github.com/DamonOehlman/mime-match.git"},"keywords":["mime","wildcard"],"author":"Damon Oehlman <damon.oehlman@gmail.com>","license":"ISC","bugs":{"url":"https://github.com/DamonOehlman/mime-match/issues"},"homepage":"https://github.com/DamonOehlman/mime-match","dependencies":{"wildcard":"^1.1.0"},"devDependencies":{"tape":"^4.5.1"},"_lastModified":"2024-11-06T06:26:11.900Z"}
@@ -1 +1 @@
1
- {"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"0.5.6","publishConfig":{"tag":"legacy"},"author":"James Halliday <mail@substack.net> (http://substack.net)","main":"index.js","keywords":["mkdir","directory"],"repository":{"type":"git","url":"https://github.com/substack/node-mkdirp.git"},"scripts":{"test":"tap test/*.js"},"dependencies":{"minimist":"^1.2.6"},"devDependencies":{"tap":"^16.0.1"},"bin":"bin/cmd.js","license":"MIT","files":["bin","index.js"],"_lastModified":"2024-11-05T07:51:31.380Z"}
1
+ {"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"0.5.6","publishConfig":{"tag":"legacy"},"author":"James Halliday <mail@substack.net> (http://substack.net)","main":"index.js","keywords":["mkdir","directory"],"repository":{"type":"git","url":"https://github.com/substack/node-mkdirp.git"},"scripts":{"test":"tap test/*.js"},"dependencies":{"minimist":"^1.2.6"},"devDependencies":{"tap":"^16.0.1"},"bin":"bin/cmd.js","license":"MIT","files":["bin","index.js"],"_lastModified":"2024-11-06T06:26:17.218Z"}
@@ -1 +1 @@
1
- {"name":"multer-aliyun-oss","version":"2.1.3","description":"Multer Storage for AliYun OSS","main":"index.js","scripts":{},"author":"AngusYoung","license":"ISC","repository":{"type":"git","url":"git+https://github.com/ay86/multer-aliyun-oss.git"},"keywords":["multer","storage","aliyun","oss"],"dependencies":{"ali-oss":"^6.1.0"},"_lastModified":"2024-11-05T07:51:31.294Z"}
1
+ {"name":"multer-aliyun-oss","version":"2.1.3","description":"Multer Storage for AliYun OSS","main":"index.js","scripts":{},"author":"AngusYoung","license":"ISC","repository":{"type":"git","url":"git+https://github.com/ay86/multer-aliyun-oss.git"},"keywords":["multer","storage","aliyun","oss"],"dependencies":{"ali-oss":"^6.1.0"},"_lastModified":"2024-11-06T06:26:17.143Z"}
@@ -1 +1 @@
1
- {"_from":"multer-cos","_id":"multer-cos@1.0.2","_inBundle":false,"_integrity":"sha512-4F8P1VTCSNhiem+BFJFLe3Ixco6cIuAQ6j7U+PBRvdbBJRZgq5Q+vaDMMBWJ1HmPGOOP3AyKS5yk2f0nbFoqqA==","_location":"/multer-cos","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"multer-cos","name":"multer-cos","escapedName":"multer-cos","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/multer-cos/-/multer-cos-1.0.2.tgz","_shasum":"95c7c06cdee1b9311675a895481f9d946de6dcf3","_spec":"multer-cos","_where":"/Users/lanbo/workplace/websocket","author":{"name":"lanbosm"},"bugs":{"url":"https://github.com/lanbosm/multer-COS/issues"},"bundleDependencies":false,"deprecated":false,"description":"Streaming multer storage engine for QCloud COS","devDependencies":{"cos-nodejs-sdk-v5":"^2.2.6","dotenv":"^5.0.1","multer":"^1.3.0"},"engines":{"node":">= 6.10.0"},"homepage":"https://github.com/lanbosm/multer-COS#readme","keywords":["express","multer","COS"],"license":"MIT","main":"index.js","name":"multer-cos","repository":{"type":"git","url":"git+ssh://git@github.com/lanbosm/multer-COS.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"version":"1.0.3","_lastModified":"2024-11-05T07:51:43.439Z"}
1
+ {"_from":"multer-cos","_id":"multer-cos@1.0.2","_inBundle":false,"_integrity":"sha512-4F8P1VTCSNhiem+BFJFLe3Ixco6cIuAQ6j7U+PBRvdbBJRZgq5Q+vaDMMBWJ1HmPGOOP3AyKS5yk2f0nbFoqqA==","_location":"/multer-cos","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"multer-cos","name":"multer-cos","escapedName":"multer-cos","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/multer-cos/-/multer-cos-1.0.2.tgz","_shasum":"95c7c06cdee1b9311675a895481f9d946de6dcf3","_spec":"multer-cos","_where":"/Users/lanbo/workplace/websocket","author":{"name":"lanbosm"},"bugs":{"url":"https://github.com/lanbosm/multer-COS/issues"},"bundleDependencies":false,"deprecated":false,"description":"Streaming multer storage engine for QCloud COS","devDependencies":{"cos-nodejs-sdk-v5":"^2.2.6","dotenv":"^5.0.1","multer":"^1.3.0"},"engines":{"node":">= 6.10.0"},"homepage":"https://github.com/lanbosm/multer-COS#readme","keywords":["express","multer","COS"],"license":"MIT","main":"index.js","name":"multer-cos","repository":{"type":"git","url":"git+ssh://git@github.com/lanbosm/multer-COS.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"version":"1.0.3","_lastModified":"2024-11-06T06:26:28.970Z"}
@@ -1 +1 @@
1
- {"name":"multer-s3","version":"3.0.1","description":"Streaming multer storage engine for AWS S3","main":"index.js","scripts":{"test":"standard && mocha test/basic.js"},"engines":{"node":">= 12.0.0"},"repository":{"type":"git","url":"git+https://github.com/badunk/multer-s3.git"},"keywords":["multer","s3","amazon","aws"],"author":"badunk","license":"MIT","bugs":{"url":"https://github.com/badunk/multer-s3/issues"},"homepage":"https://github.com/badunk/multer-s3#readme","dependencies":{"@aws-sdk/lib-storage":"^3.46.0","file-type":"^3.3.0","html-comment-regex":"^1.1.2","run-parallel":"^1.1.6"},"peerDependencies":{"@aws-sdk/client-s3":"^3.0.0"},"devDependencies":{"express":"^4.13.1","form-data":"^1.0.0-rc3","mocha":"^2.2.5","multer":"^1.1.0","on-finished":"^2.3.0","standard":"^5.4.1","xtend":"^4.0.1"},"_lastModified":"2024-11-05T07:51:39.648Z"}
1
+ {"name":"multer-s3","version":"3.0.1","description":"Streaming multer storage engine for AWS S3","main":"index.js","scripts":{"test":"standard && mocha test/basic.js"},"engines":{"node":">= 12.0.0"},"repository":{"type":"git","url":"git+https://github.com/badunk/multer-s3.git"},"keywords":["multer","s3","amazon","aws"],"author":"badunk","license":"MIT","bugs":{"url":"https://github.com/badunk/multer-s3/issues"},"homepage":"https://github.com/badunk/multer-s3#readme","dependencies":{"@aws-sdk/lib-storage":"^3.46.0","file-type":"^3.3.0","html-comment-regex":"^1.1.2","run-parallel":"^1.1.6"},"peerDependencies":{"@aws-sdk/client-s3":"^3.0.0"},"devDependencies":{"express":"^4.13.1","form-data":"^1.0.0-rc3","mocha":"^2.2.5","multer":"^1.1.0","on-finished":"^2.3.0","standard":"^5.4.1","xtend":"^4.0.1"},"_lastModified":"2024-11-06T06:26:25.479Z"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-file-manager",
3
- "version": "1.3.44-beta",
3
+ "version": "1.4.0-alpha.0",
4
4
  "displayName": "File manager",
5
5
  "displayName.zh-CN": "文件管理器",
6
6
  "description": "Provides files storage services with files collection template and attachment field.",
@@ -43,5 +43,5 @@
43
43
  "Collections",
44
44
  "Collection fields"
45
45
  ],
46
- "gitHead": "1d5666123ac1e2997e434e38defef963ba0d9f90"
46
+ "gitHead": "8ffa7b54bbaf720c0c9857da4b19a99110dffc4b"
47
47
  }
@@ -1,41 +0,0 @@
1
- {
2
- "File manager": "ファイルストレージ",
3
- "Attachment": "添付ファイル",
4
- "MIME type": "ファイル形式",
5
- "Storage display name": "ファイルストレージ名",
6
- "Storage name": "ファイルストレージ識別子",
7
- "Storage type": "ストレージタイプ",
8
- "Default storage": "デフォルトストレージ",
9
- "Storage base URL": "Storage base URL",
10
- "Destination": "ファイルパス",
11
- "Use the built-in static file server": "組み込みの静的ファイル サービスを使用する",
12
- "Local storage": "ローカルストレージ",
13
- "Aliyun OSS": "Aliyun OSS",
14
- "Tencent COS": "Tencent COS",
15
- "Amazon S3": "Amazon S3",
16
- "Region": "地域",
17
- "Bucket": "バケット",
18
- "Path": "パス",
19
- "Filename": "ファイル名",
20
- "See more": "続きを見る",
21
- "Will be used for API": "API で使用されます",
22
- "File collection": "ファイルデータテーブル",
23
- "File name": "ファイル名",
24
- "Extension name": "拡張子",
25
- "Size": "ファイルサイズ",
26
- "File size limit": "ファイルサイズ制限",
27
- "Minimum from 1 byte, maximum up to 1GB.": "最小サイズは1バイト、最大サイズは1GBです。",
28
- "File type (in MIME type format)": "ファイルタイプ(MIME形式)",
29
- "Multi-types seperated with comma, for example: \"image/*\", \"image/png\", \"image/*, application/pdf\" etc.": "複数のタイプはカンマで区切ります。 例えば「image/*」「image/png」「image/*、application/pdf」など。",
30
- "URL": "URL",
31
- "File storage": "ファイルストレージ",
32
- "Allow uploading multiple files": "複数ファイルのアップロードを許可",
33
- "Storage": "ストレージ",
34
- "Storages": "ストレージ",
35
- "Access base URL": "アクセスURLのベース",
36
- "Base URL for file access, could be your CDN base URL. For example: \"https://cdn.nocobase.com\".": "术语调整,“基礎URL”改为“ベースURL”",
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\".": "更清晰的表达方式,符合技术描述",
38
- "Default storage will be used when not selected": "空欄の場合はデフォルトのストレージが使用されます。",
39
- "Keep file in storage when destroy record": "レコード削除時にファイルを保持",
40
- "Aliyun OSS region part of the bucket. For example: \"oss-cn-beijing\".": "阿里クラウドOSSの地域。 例えば「oss-cn-beijing」。"
41
- }
File without changes