@nocobase/plugin-field-attachment-url 2.0.0-alpha.6 → 2.0.0-alpha.61

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(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("@formily/antd-v5"),require("react"),require("@nocobase/flow-engine"),require("@formily/react"),require("lodash"),require("@ant-design/icons"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-attachment-url",["@nocobase/client","@formily/antd-v5","react","@nocobase/flow-engine","@formily/react","lodash","@ant-design/icons","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-field-attachment-url"]=t(require("@nocobase/client"),require("@formily/antd-v5"),require("react"),require("@nocobase/flow-engine"),require("@formily/react"),require("lodash"),require("@ant-design/icons"),require("react-i18next")):e["@nocobase/plugin-field-attachment-url"]=t(e["@nocobase/client"],e["@formily/antd-v5"],e.react,e["@nocobase/flow-engine"],e["@formily/react"],e.lodash,e["@ant-design/icons"],e["react-i18next"])}(self,function(e,t,n,r,o,i,c,u){return function(){var a,l,s,p,f,d,b={133:function(e,t,n){"use strict";n.d(t,{N2:function(){return a},fR:function(){return l},sz:function(){return s}});var r=n(505),o=n(772),i=n(467),c=n(156),u=n(238);function a(e){var t,n,r,i,c,u,a,l=(0,o.useCollectionField)(),s=(n=null!=(t=null==l?void 0:l.storage)?t:"",i=(r=(0,o.useRequest)({url:"storages:getBasicInfo/".concat(n)},{refreshDeps:[n]})).loading,c=r.data,!i&&(null==c?void 0:c.data)||null);return u=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),a=a={rules:s,action:"".concat(l.target,":create").concat(l.storage?"?attachmentField=".concat(l.collectionName,".").concat(l.name):""),toValueItem:function(e){return(null==e?void 0:e.thumbnailRule)?"".concat(null==e?void 0:e.url).concat(null==e?void 0:e.thumbnailRule):null==e?void 0:e.url},getThumbnailURL:function(e){return null==e?void 0:e.url}},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(a)).forEach(function(e){Object.defineProperty(u,e,Object.getOwnPropertyDescriptor(a,e))}),u}var l=function(e){var t=(0,r.useFieldSchema)(),n=(0,o.useDesignable)().insertAfterBegin;return(0,c.useCallback)(function(r){t.reduceProperties(function(t,n){return n["x-component"]==="AssociationField."+e?n:t},null)||n((0,i.cloneDeep)(r))},[e,t,n])},s=function(){(0,u.useTranslation)().t;var e=(0,r.useField)();return{service:{resource:"collections:listFileCollectionsWithPublicStorage",params:{paginate:!1}},manual:!1,fieldNames:{label:"title",value:"name"},onSuccess:function(t){e.data=e.data||{},e.data.options=null==t?void 0:t.data}}}},581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},482:function(e){"use strict";e.exports=c},632:function(e){"use strict";e.exports=t},505:function(e){"use strict";e.exports=o},772:function(t){"use strict";t.exports=e},667:function(e){"use strict";e.exports=r},467:function(e){"use strict";e.exports=i},156:function(e){"use strict";e.exports=n},238:function(e){"use strict";e.exports=u}},m={};function y(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return b[e](n,n.exports,y),n.exports}y.m=b,y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,{a:t}),t},y.d=function(e,t){for(var n in t)y.o(t,n)&&!y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},y.f={},y.e=function(e){return Promise.all(Object.keys(y.f).reduce(function(t,n){return y.f[n](e,t),t},[]))},y.u=function(e){return"8ab1917056f663a6.js"},y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a={},l="@nocobase/plugin-field-attachment-url:",y.l=function(e,t,n,r){if(a[e])return void a[e].push(t);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var s=c[u];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==l+n){o=s;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,y.nc&&o.setAttribute("nonce",y.nc),o.setAttribute("data-webpack",l+n),o.src=e),a[e]=[t];var p=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=a[e];if(delete a[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),i&&document.head.appendChild(o)},y.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(s=window.__nocobase_public_path__||"/").endsWith("/")||(s+="/"),y.p=s+"static/plugins/@nocobase/plugin-field-attachment-url/dist/client/",p={909:0},y.f.j=function(e,t){var n=y.o(p,e)?p[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=p[e]=[t,r]});t.push(n[2]=r);var o=y.p+y.u(e),i=Error();y.l(o,function(t){if(y.o(p,e)&&(0!==(n=p[e])&&(p[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},f=function(e,t){var n,r,o=t[0],i=t[1],c=t[2],u=0;if(o.some(function(e){return 0!==p[e]})){for(n in i)y.o(i,n)&&(y.m[n]=i[n]);c&&c(y)}for(e&&e(t);u<o.length;u++)r=o[u],y.o(p,r)&&p[r]&&p[r][0](),p[r]=0},(d=self.webpackChunk_nocobase_plugin_field_attachment_url=self.webpackChunk_nocobase_plugin_field_attachment_url||[]).forEach(f.bind(null,0)),d.push=f.bind(null,d.push.bind(d));var h={};return!function(){"use strict";y.r(h),y.d(h,{PluginFieldAttachmentUrlClient:function(){return V},default:function(){return W}});var e,t,n=y(772),r=y(133),o=JSON.parse('{"u2":"@nocobase/plugin-field-attachment-url"}'),i=y(238);function c(e){return"{{t(".concat(JSON.stringify(e),", { ns: ['").concat(o.u2,"', 'client'], nsMode: 'fallback' })}}")}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}var p=n.interfacesProperties.defaultProps,f=n.interfacesProperties.operators,d=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,o,i,l;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=a(t),u(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,s()?Reflect.construct(t,o||[],a(this).constructor):t.apply(this,o)),"name","attachmentURL"),u(e,"type","object"),u(e,"group","media"),u(e,"title",c("Attachment (URL)")),u(e,"default",{type:"string",uiSchema:{type:"string","x-component":"AttachmentUrl","x-use-component-props":"useAttachmentUrlFieldProps"}}),u(e,"availableTypes",["string","text"]),u(e,"properties",(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){u(e,t,n[t])})}return e}({},p),l=l={target:{required:!0,type:"string",title:c("Which file collection should it be uploaded to"),"x-decorator":"FormItem","x-component":"RemoteSelect","x-use-component-props":r.sz,"x-reactions":function(e){var t;((null==(t=e.data)?void 0:t.options)||[]).some(function(e){return(null==e?void 0:e.name)==="attachments"})&&(e.initialValue||e.setInitialValue("attachments"))}},targetKey:{"x-hidden":!0,default:"id",type:"string"}},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(l)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(l,e))}),i)),u(e,"filterable",{nested:!0,operators:f.bigField}),u(e,"titleUsable",!0),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&l(n,e),t=[{key:"schemaInitialize",value:function(e,t){var n=t.block;e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].mode="AttachmentUrl",["Table","Kanban"].includes(n)&&(e["x-component-props"].ellipsis=!0,e["x-component-props"].size="small")}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(n.CollectionFieldInterface),b=y(632),m=y(482),v=y(667),g=y(156),O=y.n(g),j=y(505),P=y(467);function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function _(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 r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(F=function(){return!!e})()}var E=function(e){var t,n=(0,j.useField)(),r=(t=(0,g.useState)((0,P.castArray)(e.value||[]).map(function(e){return{url:e}})),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],c=!0,u=!1;try{for(o=o.call(e);!(c=(n=o.next()).done)&&(i.push(n.value),i.length!==t);c=!0);}catch(e){u=!0,r=e}finally{try{c||null==o.return||o.return()}finally{if(u)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return w(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],i=r[1];return(0,g.useEffect)(function(){i((0,P.castArray)(e.value||[]).map(function(e){return{url:e}}))},[e.value]),O().createElement(j.FieldContext.Provider,{value:_(x({},n),{value:o})},O().createElement(b.Upload,_(x({},e),{listType:"picture-card",fileList:o,onChange:function(t){i(t);var n,r=t[0];if(!r){null==(o=e.onChange)||o.call(e,void 0);return}if("done"===r.status){var o,c,u,a=(null==(c=r.response)?void 0:c.url)||r.url;null==(u=e.onChange)||u.call(e,a)}else"removed"===r.status&&(null==(n=e.onChange)||n.call(e,void 0))}}),O().createElement(m.UploadOutlined,{style:{fontSize:20}})))},C=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=S(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,F()?Reflect.construct(e,t||[],S(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&k(n,e),t=[{key:"render",value:function(){return O().createElement(E,this.props)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(n.UploadFieldModel);function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}C.define({label:(0,v.escapeT)("AttachmentURL")}),v.EditableItemModel.bindModelToInterface("AttachmentURLFieldModel",["attachmentURL"],{isDefault:!0});var T=new n.SchemaSettings({name:"fieldSettings:component:AttachmentUrl",items:[{name:"quickUpload",type:"switch",useComponentProps:function(){var e,t=(0,i.useTranslation)().t,r=(0,j.useField)(),o=(0,n.useColumnSchema)().fieldSchema,c=(0,j.useFieldSchema)(),u=o||c,a=(0,n.useDesignable)(),l=a.dn,s=a.refresh;return{title:t("Quick upload"),checked:(null==(e=u["x-component-props"])?void 0:e.quickUpload)!==!1,onChange:function(e){var t=A({},"x-uid",u["x-uid"]);r.componentProps.quickUpload=e,u["x-component-props"]=u["x-component-props"]||{},u["x-component-props"].quickUpload=e,t["x-component-props"]=u["x-component-props"],l.emit("patch",{schema:t}),s()}}},useVisible:function(){var e=(0,n.useColumnSchema)().fieldSchema,t=(0,j.useField)(),r=(0,j.useForm)();return!((null==e?void 0:e["x-read-pretty"])||t.readPretty||r.readPretty)&&!t.componentProps.underFilter}},{name:"selectFile",type:"switch",useComponentProps:function(){var e,t=(0,i.useTranslation)().t,r=(0,j.useField)(),o=(0,n.useColumnSchema)().fieldSchema,c=(0,j.useFieldSchema)(),u=o||c,a=(0,n.useDesignable)(),l=a.dn,s=a.refresh;return{title:t("Select file"),checked:(null==(e=u["x-component-props"])?void 0:e.selectFile)!==!1,onChange:function(e){var t=A({},"x-uid",u["x-uid"]);r.componentProps.selectFile=e,u["x-component-props"]=u["x-component-props"]||{},u["x-component-props"].selectFile=e,t["x-component-props"]=u["x-component-props"],l.emit("patch",{schema:t}),s()}}},useVisible:function(){var e=(0,n.useColumnSchema)().fieldSchema,t=(0,j.useField)(),r=(0,j.useForm)();return!((null==e?void 0:e["x-read-pretty"])||t.readPretty||r.readPretty)&&!t.componentProps.underFilter}},{name:"fieldComponent",type:"select",useComponentProps:function(){var e=(0,i.useTranslation)().t,t=(0,j.useField)(),r=(0,n.useColumnSchema)().fieldSchema,o=(0,j.useFieldSchema)(),c=r||o,u=(0,n.useDesignable)().dn;return{title:e("Field component"),options:[{label:e("URL"),value:"url"},{label:e("Preview"),value:"preview"}],value:c["x-component-props"].componentMode||"preview",onChange:function(e){var n=A({},"x-uid",c["x-uid"]);c["x-component-props"]=c["x-component-props"]||{},c["x-component-props"].componentMode=e,n["x-component-props"]=c["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.componentMode=e,u.emit("patch",{schema:n}),u.refresh()}}},useVisible:function(){var e=(0,n.useIsFieldReadPretty)();return(0,n.useColumnSchema)().fieldSchema,e}},(e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){A(e,t,n[t])})}return e}({},n.fileSizeSetting),t=t={useVisible:function(){var e=(0,n.useIsFieldReadPretty)(),t=(0,n.useColumnSchema)().fieldSchema;return e&&!t}},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e)]}),U=y(581);function R(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function q(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){R(i,r,o,c,u,"next",e)}function u(e){R(i,r,o,c,u,"throw",e)}c(void 0)})}}function D(e,t,n){return(D=z()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&I(o,n.prototype),o}).apply(null,arguments)}function M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e){var t="function"==typeof Map?new Map:void 0;return(L=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 D(e,arguments,M(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),I(n,e)})(e)}function z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(z=function(){return!!e})()}function B(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var a=[i,u];if(n)throw TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var N=(0,n.lazy)(function(){return U("imported_-fj1qvv_component",y.e("542").then(y.bind(y,871)))},"AttachmentUrl").AttachmentUrl,V=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=M(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,z()?Reflect.construct(e,t||[],M(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&I(n,e),t=[{key:"afterAdd",value:function(){return q(function(){return B(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return q(function(){return B(this,function(e){return[2]})})()}},{key:"load",value:function(){var e=this;return q(function(){return B(this,function(t){return e.app.dataSourceManager.addFieldInterfaces([d]),e.app.addScopes({useAttachmentUrlFieldProps:r.N2}),e.app.addComponents({AttachmentUrl:N}),e.app.schemaSettingsManager.add(T),e.flowEngine.registerModels({AttachmentURLFieldModel:C}),[2]})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(L(n.Plugin)),W=V}(),h}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("@formily/antd-v5"),require("react"),require("@nocobase/flow-engine"),require("@formily/react"),require("lodash"),require("@ant-design/icons"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-attachment-url",["@nocobase/client","@formily/antd-v5","react","@nocobase/flow-engine","@formily/react","lodash","@ant-design/icons","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-field-attachment-url"]=t(require("@nocobase/client"),require("@formily/antd-v5"),require("react"),require("@nocobase/flow-engine"),require("@formily/react"),require("lodash"),require("@ant-design/icons"),require("react-i18next")):e["@nocobase/plugin-field-attachment-url"]=t(e["@nocobase/client"],e["@formily/antd-v5"],e.react,e["@nocobase/flow-engine"],e["@formily/react"],e.lodash,e["@ant-design/icons"],e["react-i18next"])}(self,function(e,t,n,r,o,i,c,u){return function(){var a,l,s,p,f,d,b={133:function(e,t,n){"use strict";n.d(t,{N2:function(){return a},fR:function(){return l},sz:function(){return s}});var r=n(505),o=n(772),i=n(467),c=n(156),u=n(238);function a(e){var t,n,r,i,c,u,a,l=(0,o.useCollectionField)(),s=(n=null!=(t=null==l?void 0:l.storage)?t:"",i=(r=(0,o.useRequest)({url:"storages:getBasicInfo/".concat(n)},{refreshDeps:[n]})).loading,c=r.data,!i&&(null==c?void 0:c.data)||null);return u=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),a=a={rules:s,action:"".concat(l.target,":create").concat(l.storage?"?attachmentField=".concat(l.collectionName,".").concat(l.name):""),toValueItem:function(e){return(null==e?void 0:e.thumbnailRule)?"".concat(null==e?void 0:e.url).concat(null==e?void 0:e.thumbnailRule):null==e?void 0:e.url},getThumbnailURL:function(e){return null==e?void 0:e.url}},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(a)).forEach(function(e){Object.defineProperty(u,e,Object.getOwnPropertyDescriptor(a,e))}),u}var l=function(e){var t=(0,r.useFieldSchema)(),n=(0,o.useDesignable)().insertAfterBegin;return(0,c.useCallback)(function(r){t.reduceProperties(function(t,n){return n["x-component"]==="AssociationField."+e?n:t},null)||n((0,i.cloneDeep)(r))},[e,t,n])},s=function(){(0,u.useTranslation)().t;var e=(0,r.useField)();return{service:{resource:"collections:listFileCollectionsWithPublicStorage",params:{paginate:!1}},manual:!1,fieldNames:{label:"title",value:"name"},onSuccess:function(t){e.data=e.data||{},e.data.options=null==t?void 0:t.data}}}},581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},482:function(e){"use strict";e.exports=c},632:function(e){"use strict";e.exports=t},505:function(e){"use strict";e.exports=o},772:function(t){"use strict";t.exports=e},667:function(e){"use strict";e.exports=r},467:function(e){"use strict";e.exports=i},156:function(e){"use strict";e.exports=n},238:function(e){"use strict";e.exports=u}},m={};function y(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return b[e](n,n.exports,y),n.exports}y.m=b,y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,{a:t}),t},y.d=function(e,t){for(var n in t)y.o(t,n)&&!y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},y.f={},y.e=function(e){return Promise.all(Object.keys(y.f).reduce(function(t,n){return y.f[n](e,t),t},[]))},y.u=function(e){return"8ab1917056f663a6.js"},y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a={},l="@nocobase/plugin-field-attachment-url:",y.l=function(e,t,n,r){if(a[e])return void a[e].push(t);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var s=c[u];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==l+n){o=s;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,y.nc&&o.setAttribute("nonce",y.nc),o.setAttribute("data-webpack",l+n),o.src=e),a[e]=[t];var p=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=a[e];if(delete a[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),i&&document.head.appendChild(o)},y.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(s=window.__nocobase_public_path__||"/").endsWith("/")||(s+="/"),y.p=s+"static/plugins/@nocobase/plugin-field-attachment-url/dist/client/",p={909:0},y.f.j=function(e,t){var n=y.o(p,e)?p[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=p[e]=[t,r]});t.push(n[2]=r);var o=y.p+y.u(e),i=Error();y.l(o,function(t){if(y.o(p,e)&&(0!==(n=p[e])&&(p[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},f=function(e,t){var n,r,o=t[0],i=t[1],c=t[2],u=0;if(o.some(function(e){return 0!==p[e]})){for(n in i)y.o(i,n)&&(y.m[n]=i[n]);c&&c(y)}for(e&&e(t);u<o.length;u++)r=o[u],y.o(p,r)&&p[r]&&p[r][0](),p[r]=0},(d=self.webpackChunk_nocobase_plugin_field_attachment_url=self.webpackChunk_nocobase_plugin_field_attachment_url||[]).forEach(f.bind(null,0)),d.push=f.bind(null,d.push.bind(d));var h={};return!function(){"use strict";y.r(h),y.d(h,{PluginFieldAttachmentUrlClient:function(){return V},default:function(){return W}});var e,t,n=y(772),r=y(133),o=JSON.parse('{"u2":"@nocobase/plugin-field-attachment-url"}'),i=y(238);function c(e){return"{{t(".concat(JSON.stringify(e),", { ns: ['").concat(o.u2,"', 'client'], nsMode: 'fallback' })}}")}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}var p=n.interfacesProperties.defaultProps,f=n.interfacesProperties.operators,d=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,o,i,l;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,o=arguments,t=a(t),u(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,s()?Reflect.construct(t,o||[],a(this).constructor):t.apply(this,o)),"name","attachmentURL"),u(e,"type","object"),u(e,"group","media"),u(e,"title",c("Attachment (URL)")),u(e,"default",{type:"string",uiSchema:{type:"string","x-component":"AttachmentUrl","x-use-component-props":"useAttachmentUrlFieldProps"}}),u(e,"availableTypes",["string","text"]),u(e,"properties",(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){u(e,t,n[t])})}return e}({},p),l=l={target:{required:!0,type:"string",title:c("Which file collection should it be uploaded to"),"x-decorator":"FormItem","x-component":"RemoteSelect","x-use-component-props":r.sz,"x-reactions":function(e){var t;((null==(t=e.data)?void 0:t.options)||[]).some(function(e){return(null==e?void 0:e.name)==="attachments"})&&(e.initialValue||e.setInitialValue("attachments"))}},targetKey:{"x-hidden":!0,default:"id",type:"string"}},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(l)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(l,e))}),i)),u(e,"filterable",{nested:!0,operators:f.bigField}),u(e,"titleUsable",!0),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&l(n,e),t=[{key:"schemaInitialize",value:function(e,t){var n=t.block;e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].mode="AttachmentUrl",["Table","Kanban"].includes(n)&&(e["x-component-props"].ellipsis=!0,e["x-component-props"].size="small")}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(n.CollectionFieldInterface),b=y(632),m=y(482),v=y(667),g=y(156),O=y.n(g),j=y(505),P=y(467);function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function _(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 r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(F=function(){return!!e})()}var E=function(e){var t,n=(0,j.useField)(),r=(t=(0,g.useState)((0,P.castArray)(e.value||[]).map(function(e){return{url:e}})),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],c=!0,u=!1;try{for(o=o.call(e);!(c=(n=o.next()).done)&&(i.push(n.value),i.length!==t);c=!0);}catch(e){u=!0,r=e}finally{try{c||null==o.return||o.return()}finally{if(u)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return w(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],i=r[1];return(0,g.useEffect)(function(){i((0,P.castArray)(e.value||[]).map(function(e){return{url:e}}))},[e.value]),O().createElement(j.FieldContext.Provider,{value:_(S({},n),{value:o})},O().createElement(b.Upload,_(S({},e),{listType:"picture-card",fileList:o,onChange:function(t){i(t);var n,r=t[0];if(!r){null==(o=e.onChange)||o.call(e,void 0);return}if("done"===r.status){var o,c,u,a=(null==(c=r.response)?void 0:c.url)||r.url;null==(u=e.onChange)||u.call(e,a)}else"removed"===r.status&&(null==(n=e.onChange)||n.call(e,void 0))}}),O().createElement(m.UploadOutlined,{style:{fontSize:20}})))},C=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=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,F()?Reflect.construct(e,t||[],x(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&k(n,e),t=[{key:"render",value:function(){return O().createElement(E,this.props)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(n.UploadFieldModel);function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}C.define({label:(0,v.tExpr)("AttachmentURL")}),v.EditableItemModel.bindModelToInterface("AttachmentURLFieldModel",["attachmentURL"],{isDefault:!0}),v.DisplayItemModel.bindModelToInterface("DisplayTextFieldModel",["attachmentURL"],{isDefault:!0});var T=new n.SchemaSettings({name:"fieldSettings:component:AttachmentUrl",items:[{name:"quickUpload",type:"switch",useComponentProps:function(){var e,t=(0,i.useTranslation)().t,r=(0,j.useField)(),o=(0,n.useColumnSchema)().fieldSchema,c=(0,j.useFieldSchema)(),u=o||c,a=(0,n.useDesignable)(),l=a.dn,s=a.refresh;return{title:t("Quick upload"),checked:(null==(e=u["x-component-props"])?void 0:e.quickUpload)!==!1,onChange:function(e){var t=A({},"x-uid",u["x-uid"]);r.componentProps.quickUpload=e,u["x-component-props"]=u["x-component-props"]||{},u["x-component-props"].quickUpload=e,t["x-component-props"]=u["x-component-props"],l.emit("patch",{schema:t}),s()}}},useVisible:function(){var e=(0,n.useColumnSchema)().fieldSchema,t=(0,j.useField)(),r=(0,j.useForm)();return!((null==e?void 0:e["x-read-pretty"])||t.readPretty||r.readPretty)&&!t.componentProps.underFilter}},{name:"selectFile",type:"switch",useComponentProps:function(){var e,t=(0,i.useTranslation)().t,r=(0,j.useField)(),o=(0,n.useColumnSchema)().fieldSchema,c=(0,j.useFieldSchema)(),u=o||c,a=(0,n.useDesignable)(),l=a.dn,s=a.refresh;return{title:t("Select file"),checked:(null==(e=u["x-component-props"])?void 0:e.selectFile)!==!1,onChange:function(e){var t=A({},"x-uid",u["x-uid"]);r.componentProps.selectFile=e,u["x-component-props"]=u["x-component-props"]||{},u["x-component-props"].selectFile=e,t["x-component-props"]=u["x-component-props"],l.emit("patch",{schema:t}),s()}}},useVisible:function(){var e=(0,n.useColumnSchema)().fieldSchema,t=(0,j.useField)(),r=(0,j.useForm)();return!((null==e?void 0:e["x-read-pretty"])||t.readPretty||r.readPretty)&&!t.componentProps.underFilter}},{name:"fieldComponent",type:"select",useComponentProps:function(){var e=(0,i.useTranslation)().t,t=(0,j.useField)(),r=(0,n.useColumnSchema)().fieldSchema,o=(0,j.useFieldSchema)(),c=r||o,u=(0,n.useDesignable)().dn;return{title:e("Field component"),options:[{label:e("URL"),value:"url"},{label:e("Preview"),value:"preview"}],value:c["x-component-props"].componentMode||"preview",onChange:function(e){var n=A({},"x-uid",c["x-uid"]);c["x-component-props"]=c["x-component-props"]||{},c["x-component-props"].componentMode=e,n["x-component-props"]=c["x-component-props"],t.componentProps=t.componentProps||{},t.componentProps.componentMode=e,u.emit("patch",{schema:n}),u.refresh()}}},useVisible:function(){var e=(0,n.useIsFieldReadPretty)();return(0,n.useColumnSchema)().fieldSchema,e}},(e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){A(e,t,n[t])})}return e}({},n.fileSizeSetting),t=t={useVisible:function(){var e=(0,n.useIsFieldReadPretty)(),t=(0,n.useColumnSchema)().fieldSchema;return e&&!t}},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e)]}),U=y(581);function D(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function R(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){D(i,r,o,c,u,"next",e)}function u(e){D(i,r,o,c,u,"throw",e)}c(void 0)})}}function q(e,t,n){return(q=z()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&I(o,n.prototype),o}).apply(null,arguments)}function M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e){var t="function"==typeof Map?new Map:void 0;return(L=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 q(e,arguments,M(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),I(n,e)})(e)}function z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(z=function(){return!!e})()}function B(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var a=[i,u];if(n)throw TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var N=(0,n.lazy)(function(){return U("imported_-fj1qvv_component",y.e("542").then(y.bind(y,871)))},"AttachmentUrl").AttachmentUrl,V=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=M(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,z()?Reflect.construct(e,t||[],M(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&I(n,e),t=[{key:"afterAdd",value:function(){return R(function(){return B(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return R(function(){return B(this,function(e){return[2]})})()}},{key:"load",value:function(){var e=this;return R(function(){return B(this,function(t){return e.app.dataSourceManager.addFieldInterfaces([d]),e.app.addScopes({useAttachmentUrlFieldProps:r.N2}),e.app.addComponents({AttachmentUrl:N}),e.app.schemaSettingsManager.add(T),e.flowEngine.registerModels({AttachmentURLFieldModel:C}),[2]})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(L(n.Plugin)),W=V}(),h}()});
@@ -8,16 +8,16 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.0.0-alpha.6",
11
+ "@nocobase/client": "2.0.0-alpha.61",
12
12
  "react-i18next": "11.18.6",
13
- "@nocobase/server": "2.0.0-alpha.6",
14
- "@nocobase/plugin-file-manager": "2.0.0-alpha.6",
15
- "@nocobase/test": "2.0.0-alpha.6",
13
+ "@nocobase/server": "2.0.0-alpha.61",
14
+ "@nocobase/plugin-file-manager": "2.0.0-alpha.61",
15
+ "@nocobase/test": "2.0.0-alpha.61",
16
16
  "@formily/react": "2.3.7",
17
17
  "react": "18.2.0",
18
18
  "@formily/antd-v5": "1.2.3",
19
19
  "@ant-design/icons": "5.6.1",
20
- "@nocobase/flow-engine": "2.0.0-alpha.6",
20
+ "@nocobase/flow-engine": "2.0.0-alpha.61",
21
21
  "lodash": "4.17.21",
22
22
  "@formily/core": "2.3.7"
23
23
  };
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Attachment (URL)",
3
+ "Which file collection should it be uploaded to": "Which file collection should it be uploaded to"
4
+ }
@@ -1 +1,4 @@
1
- {}
1
+ {
2
+ "Attachment (URL)": "Attachment (URL)",
3
+ "Which file collection should it be uploaded to": "Which file collection should it be uploaded to"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Attachment (URL)",
3
+ "Which file collection should it be uploaded to": "Which file collection should it be uploaded to"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Attachment (URL)",
3
+ "Which file collection should it be uploaded to": "Which file collection should it be uploaded to"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Csatolmány (URL)",
3
+ "Which file collection should it be uploaded to": "Melyik fájlgyűjteménybe kerüljön feltöltésre"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Lampiran (URL)",
3
+ "Which file collection should it be uploaded to": "Ke koleksi file mana ini harus diunggah"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Attachment (URL)",
3
+ "Which file collection should it be uploaded to": "Which file collection should it be uploaded to"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "添付ファイル (URL)",
3
+ "Which file collection should it be uploaded to": "アップロード先ファイルコレクション"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "첨부파일 (URL)",
3
+ "Which file collection should it be uploaded to": "어느 파일 컬렉션에 업로드해야 합니까?"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Attachment (URL)",
3
+ "Which file collection should it be uploaded to": "Which file collection should it be uploaded to"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Attachment (URL)",
3
+ "Which file collection should it be uploaded to": "Which file collection should it be uploaded to"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Вложение (URL)",
3
+ "Which file collection should it be uploaded to": "В какую коллекцию файлов это должно быть загружено"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Attachment (URL)",
3
+ "Which file collection should it be uploaded to": "Which file collection should it be uploaded to"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Attachment (URL)",
3
+ "Which file collection should it be uploaded to": "Which file collection should it be uploaded to"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Attachment (URL)",
3
+ "Which file collection should it be uploaded to": "Which file collection should it be uploaded to"
4
+ }
@@ -1,4 +1,4 @@
1
1
  {
2
- "Which file collection should it be uploaded to":"上传到文件表",
3
- "Attachment (URL)":"附件 (URL)"
4
- }
2
+ "Attachment (URL)": "附件 (URL)",
3
+ "Which file collection should it be uploaded to": "上传到文件表"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "Attachment (URL)": "Attachment (URL)",
3
+ "Which file collection should it be uploaded to": "Which file collection should it be uploaded to"
4
+ }
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-field-attachment-url",
3
- "version": "2.0.0-alpha.6",
3
+ "version": "2.0.0-alpha.61",
4
4
  "main": "dist/server/index.js",
5
5
  "displayName": "Collection field: Attachment(URL)",
6
+ "displayName.ru-RU": "Поле коллекции: Вложение (URL)",
6
7
  "displayName.zh-CN": "数据表字段:附件(URL)",
7
8
  "description": "Supports attachments in URL format.",
9
+ "description.ru-RU": "Поддержка вложений в формате URL.",
8
10
  "description.zh-CN": "支持 URL 格式的附件。",
9
11
  "peerDependencies": {
10
12
  "@nocobase/client": "2.x",
@@ -15,5 +17,5 @@
15
17
  "keywords": [
16
18
  "Collection fields"
17
19
  ],
18
- "gitHead": "276a65c0656bbace2df7593be0f53c96b7b0725b"
20
+ "gitHead": "f48b11fd3842abbbbc7bbeb751943d80bc5134bb"
19
21
  }