@nocobase/plugin-file-previewer-office 2.4.0-alpha.5 → 2.4.0-alpha.6

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-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@nocobase/plugin-file-manager/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-previewer-office",["@nocobase/client-v2","react","antd","@nocobase/client","@nocobase/flow-engine","@ant-design/icons","@nocobase/plugin-file-manager/client"],t):"object"==typeof exports?exports["@nocobase/plugin-file-previewer-office"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@nocobase/plugin-file-manager/client")):e["@nocobase/plugin-file-previewer-office"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/client"],e["@nocobase/flow-engine"],e["@ant-design/icons"],e["@nocobase/plugin-file-manager/client"])}(self,function(e,t,n,r,o,i,a){return function(){var l={574:function(e,t,n){var r,o;void 0===(o="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){l(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,a=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,n,a){var l=i.URL||i.webkitURL,c=document.createElement("a");c.download=n=n||e.name||"download",c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?o(c):r(c.href)?t(e,n,a):o(c,c.target="_blank")):(c.href=l.createObjectURL(e),setTimeout(function(){l.revokeObjectURL(c.href)},4e4),setTimeout(function(){o(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,i){if(n=n||e.name||"download","string"!=typeof e){var a;navigator.msSaveOrOpenBlob((void 0===(a=i)?a={autoBom:!1}:"object"!=typeof a&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),n)}else if(r(e))t(e,n,i);else{var l=document.createElement("a");l.href=e,l.target="_blank",setTimeout(function(){o(l)})}}:function(e,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var l="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||l&&c||a)&&"u">typeof FileReader){var s=new FileReader;s.onloadend=function(){var e=s.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},s.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,p=f.createObjectURL(e);o?o.location=p:location.href=p,o=null,setTimeout(function(){f.revokeObjectURL(p)},4e4)}});i.saveAs=l.saveAs=l,e.exports=l})?r.apply(t,[]):r)||(e.exports=o)},375:function(e){"use strict";e.exports=i},342:function(e){"use strict";e.exports=r},485:function(t){"use strict";t.exports=e},694:function(e){"use strict";e.exports=o},609:function(e){"use strict";e.exports=a},59:function(e){"use strict";e.exports=n},155:function(e){"use strict";e.exports=t}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return l[e].call(n.exports,n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.g.importScripts&&(s=u.g.location+"");var s,f=u.g.document;if(!s&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(s=f.currentScript.src),!s)){var p=f.getElementsByTagName("script");if(p.length)for(var d=p.length-1;d>-1&&(!s||!/^http(s?):/.test(s));)s=p[d--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");u.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var v={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-file-previewer-office/dist/client/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-file-previewer-office/dist/client/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-file-previewer-office/dist/client/"}u.p=e}(),!function(){"use strict";u.r(v),u.d(v,{default:function(){return q},PluginFilePreviewerOfficeClient:function(){return M}});var e=u(155),t=u.n(e),n=u(59),r=u(574),o=u(342),i=u(609);function a(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 l(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function c(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var s=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.oasis.opendocument.text"],f=["docx","xlsx","pptx","odt","doc","xls","ppt"],p=function(e){var t="string"==typeof e?e:(null==e?void 0:e.extname)||(null==e?void 0:e.name)||(null==e?void 0:e.filename)||(null==e?void 0:e.url)||"",n=t.split("?")[0].split("#")[0].split("/").filter(Boolean),r=n[n.length-1]||t,o=r;try{o=decodeURIComponent(r)}catch(e){}var i=o.lastIndexOf(".");return -1!==i?o.slice(i+1).toLowerCase():""},d=function(e){var t="string"==typeof e?e:null==e?void 0:e.url;return t?t.startsWith("https://")||t.startsWith("http://")?t:"".concat(location.origin,"/").concat(t.replace(/^\//,"")):""},y=function(e){var t=d(e);if(!t)return"";var n=new URL("https://view.officeapps.live.com/op/embed.aspx");return n.searchParams.set("src",t),n.href},b=/^[A-Za-z0-9_][A-Za-z0-9_-]*$/,h=function(e){var t,n="string"==typeof e?e:null==e?void 0:e.url;if(!n)return null;try{t=new URL(n,location.origin)}catch(e){return null}if(t.origin!==location.origin||t.searchParams.has("temporaryAccessToken"))return null;var r=t.pathname.split("/").filter(Boolean),o=r.length-5;if(o<0||"files"!==r[o])return null;var i=r.slice(o+1);if(4!==i.length)return null;try{var l,c=(l=i.map(decodeURIComponent),function(e){if(Array.isArray(e))return e}(l)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),4!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(l)||function(e){if(e){if("string"==typeof e)return a(e,4);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,4)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=c[0],s=c[1],f=c[2],p=c[3];if(!b.test(u)||!b.test(s)||!b.test(f))return null;var d=p.lastIndexOf("."),v=d>0?p.slice(0,d):p;return{appName:u,dataSourceKey:s,collectionName:f,id:v}}catch(e){return null}},m=function(e,t,n){var r;return(r=function(){var r,o,i,a,l,u,s,f;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(p){switch(p.label){case 0:if(n&&t&&(void 0===t?"undefined":c(t))==="object"&&null!=t.id&&null!=t.storageId)l={"X-Data-Source":(a={dataSourceKey:n.dataSourceKey,collectionName:n.collectionName,id:String(t.id)}).dataSourceKey};else{if(!(u=h(t))||n&&u.collectionName!==n.collectionName)return[2,d(t)];a=u,l={"X-App":u.appName,"X-Data-Source":u.dataSourceKey}}return[4,e.request({url:"".concat(encodeURIComponent(a.collectionName),":createTemporaryURL/").concat(encodeURIComponent(a.id)),method:"post",headers:l})];case 1:if(!(f=(null==(o=(s=p.sent()).data)||null==(r=o.data)?void 0:r.url)||(null==(i=s.data)?void 0:i.url)))throw Error("Temporary file URL is missing");return[2,new URL(f,location.origin).href]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){l(i,n,o,a,c,"next",e)}function c(e){l(i,n,o,a,c,"throw",e)}a(void 0)})})()},w=function(e){if(e&&(void 0===e?"undefined":c(e))==="object"&&e.mimetype&&s.includes(e.mimetype))return!0;var t=p(e);return!!t&&f.includes(t)},g=u(375),x=u(485),S=u(694);function O(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 j(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var A=function(r){var o,i=r.file,a=r.fileCollection,l=r.onDownload,c=r.onPreviewUrlChange,u=(0,x.useApp)(),s=(o=(0,S.useFlowEngine)(),function(e,t){return o.context.t(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){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}({ns:["file-previewer-office","client"]},t))}),f="string"==typeof i?i:null==i?void 0:i.url,p=null==a?void 0:a.dataSourceKey,d=null==a?void 0:a.collectionName,v=E((0,e.useState)(""),2),b=v[0],h=v[1],w=E((0,e.useState)(!1),2),O=w[0],A=w[1],k=E((0,e.useState)(!1),2),P=k[0],_=k[1],C=(0,e.useRef)(0),R=(0,e.useRef)(!1),T=(0,e.useCallback)(function(){var e;return(e=function(){var e,t;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:e=++C.current,A(!0),_(!1),h(""),null==c||c(""),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,m(u.apiClient,i,p&&d?{dataSourceKey:p,collectionName:d}:void 0)];case 2:if(t=n.sent(),e!==C.current)return[2];return h(t),null==c||c(y(t)),[3,5];case 3:return n.sent(),e===C.current&&(h(""),_(!0),null==c||c("")),[3,5];case 4:return e===C.current&&A(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){j(i,r,o,a,l,"next",e)}function l(e){j(i,r,o,a,l,"throw",e)}a(void 0)})})()},[u.apiClient,d,p,i,c]);(0,e.useEffect)(function(){return R.current=!1,T(),function(){C.current+=1}},[T,f]);var U=(0,e.useMemo)(function(){return y(b)},[b]),I=(0,e.useCallback)(function(){R.current?_(!0):(R.current=!0,T())},[T]);return O?t().createElement(n.Spin,{tip:s("Loading preview"),"aria-label":s("Loading preview")}):P?t().createElement(n.Alert,{type:"warning",showIcon:!0,message:s("Failed to load Office preview"),action:t().createElement(n.Button,{icon:t().createElement(g.DownloadOutlined,null),onClick:function(){return l(i)}},s("Download"))}):U?t().createElement("iframe",{src:U,title:s("Office file preview"),width:"100%",height:"100%",style:{border:"none"},onError:I}):null},k=JSON.parse('{"UU":"@nocobase/plugin-file-previewer-office"}');function P(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 _(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function C(e,t,n){return(C=I()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&T(o,n.prototype),o}).apply(null,arguments)}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(e,t){return(T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function U(e){var t="function"==typeof Map?new Map:void 0;return(U=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 C(e,arguments,R(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),T(n,e)})(e)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(I=function(){return!!e})()}function L(i){var a,l,c=i.index,u=i.list,s=i.fileCollection,f=i.onSwitchIndex,p=(a=(0,o.useApp)(),function(e){return a.i18n.t(e,{ns:[k.UU,"client"]})}),d=u[c],v=function(e){if(Array.isArray(e))return e}(l=(0,e.useState)(""))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(l)||function(e){if(e){if("string"==typeof e)return P(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return P(e,2)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),y=v[0],b=v[1],h=(0,e.useCallback)(function(e){e.preventDefault(),e.stopPropagation(),y&&window.open(y)},[y]),m=(0,e.useCallback)(function(e){e.preventDefault(),e.stopPropagation(),(0,r.saveAs)(d.url,"".concat(d.title).concat(d.extname))},[d.extname,d.title,d.url]),w=(0,e.useCallback)(function(){f(null)},[f]);return t().createElement(n.Modal,{open:null!=c,title:d.title,onCancel:w,footer:[t().createElement(n.Button,{key:"open",onClick:h,disabled:!y},p("Open in new window")),t().createElement(n.Button,{key:"download",onClick:m},p("Download")),t().createElement(n.Button,{key:"close",onClick:w},p("Close"))],width:"85vw",centered:!0},t().createElement("div",{style:{width:"100%",height:"calc(85vh - 120px)",background:"white",display:"flex",flexDirection:"column"}},t().createElement(A,{file:d,index:c,list:u,fileCollection:s,onDownload:function(){return(0,r.saveAs)(d.url,"".concat(d.title).concat(d.extname))},onSwitchIndex:f,onPreviewUrlChange:b})))}var M=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=R(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">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,I()?Reflect.construct(e,t||[],R(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&T(n,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){return o.attachmentFileTypes.add({match:w,Previewer:L}),i.filePreviewTypes.add({match:w,Previewer:(0,i.wrapWithModalPreviewer)(A)}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){_(i,r,o,a,l,"next",e)}function l(e){_(i,r,o,a,l,"throw",e)}a(void 0)})})()}}],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}(U(o.Plugin)),q=M}(),v}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@nocobase/plugin-file-manager/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-previewer-office",["@nocobase/client-v2","react","antd","@nocobase/client","@nocobase/flow-engine","@ant-design/icons","@nocobase/plugin-file-manager/client"],t):"object"==typeof exports?exports["@nocobase/plugin-file-previewer-office"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/flow-engine"),require("@ant-design/icons"),require("@nocobase/plugin-file-manager/client")):e["@nocobase/plugin-file-previewer-office"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/client"],e["@nocobase/flow-engine"],e["@ant-design/icons"],e["@nocobase/plugin-file-manager/client"])}(self,function(e,t,n,r,o,i,a){return function(){var l={574:function(e,t,n){var r,o;void 0===(o="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){l(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,a=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,n,a){var l=i.URL||i.webkitURL,c=document.createElement("a");c.download=n=n||e.name||"download",c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?o(c):r(c.href)?t(e,n,a):o(c,c.target="_blank")):(c.href=l.createObjectURL(e),setTimeout(function(){l.revokeObjectURL(c.href)},4e4),setTimeout(function(){o(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,i){if(n=n||e.name||"download","string"!=typeof e){var a;navigator.msSaveOrOpenBlob((void 0===(a=i)?a={autoBom:!1}:"object"!=typeof a&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),n)}else if(r(e))t(e,n,i);else{var l=document.createElement("a");l.href=e,l.target="_blank",setTimeout(function(){o(l)})}}:function(e,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var l="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||l&&c||a)&&"u">typeof FileReader){var s=new FileReader;s.onloadend=function(){var e=s.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},s.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,p=f.createObjectURL(e);o?o.location=p:location.href=p,o=null,setTimeout(function(){f.revokeObjectURL(p)},4e4)}});i.saveAs=l.saveAs=l,e.exports=l})?r.apply(t,[]):r)||(e.exports=o)},375:function(e){"use strict";e.exports=i},342:function(e){"use strict";e.exports=r},485:function(t){"use strict";t.exports=e},694:function(e){"use strict";e.exports=o},609:function(e){"use strict";e.exports=a},59:function(e){"use strict";e.exports=n},155:function(e){"use strict";e.exports=t}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return l[e].call(n.exports,n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.g.importScripts&&(s=u.g.location+"");var s,f=u.g.document;if(!s&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(s=f.currentScript.src),!s)){var p=f.getElementsByTagName("script");if(p.length)for(var d=p.length-1;d>-1&&(!s||!/^http(s?):/.test(s));)s=p[d--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");u.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var v={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-file-previewer-office/dist/client/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-file-previewer-office/dist/client/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-file-previewer-office/dist/client/"}u.p=e}(),!function(){"use strict";u.r(v),u.d(v,{default:function(){return q},PluginFilePreviewerOfficeClient:function(){return M}});var e=u(155),t=u.n(e),n=u(59),r=u(574),o=u(342),i=u(609);function a(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 l(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function c(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var s=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.oasis.opendocument.text"],f=["docx","xlsx","pptx","odt","doc","xls","ppt"],p=function(e){var t="string"==typeof e?e:(null==e?void 0:e.extname)||(null==e?void 0:e.name)||(null==e?void 0:e.filename)||(null==e?void 0:e.url)||"",n=t.split("?")[0].split("#")[0].split("/").filter(Boolean),r=n[n.length-1]||t,o=r;try{o=decodeURIComponent(r)}catch(e){}var i=o.lastIndexOf(".");return -1!==i?o.slice(i+1).toLowerCase():""},d=function(e){var t="string"==typeof e?e:null==e?void 0:e.url;return t?t.startsWith("https://")||t.startsWith("http://")?t:"".concat(location.origin,"/").concat(t.replace(/^\//,"")):""},y=function(e){var t=d(e);if(!t)return"";var n=new URL("https://view.officeapps.live.com/op/embed.aspx");return n.searchParams.set("src",t),n.href},b=/^[A-Za-z0-9_][A-Za-z0-9_-]*$/,h=function(e){var t,n="string"==typeof e?e:null==e?void 0:e.url;if(!n)return null;try{t=new URL(n,location.origin)}catch(e){return null}if(t.origin!==location.origin||t.searchParams.has("temporaryAccessToken"))return null;var r=t.pathname.split("/").filter(Boolean),o=r.length-5;if(o<0||"files"!==r[o])return null;var i=r.slice(o+1);if(4!==i.length)return null;try{var l,c=(l=i.map(decodeURIComponent),function(e){if(Array.isArray(e))return e}(l)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),4!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(l)||function(e){if(e){if("string"==typeof e)return a(e,4);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,4)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=c[0],s=c[1],f=c[2],p=c[3];if(!b.test(u)||!b.test(s)||!b.test(f))return null;var d=p.lastIndexOf("."),v=d>0?p.slice(0,d):p;return{appName:u,dataSourceKey:s,collectionName:f,id:v}}catch(e){return null}},m=function(e,t,n){var r;return(r=function(){var r,o,i,a,l,u,s,f;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(p){switch(p.label){case 0:if(!(a=h(t)))return[2,d(t)];if(n&&t&&(void 0===t?"undefined":c(t))==="object"&&null!=t.id&&null!=t.storageId)u={"X-Data-Source":(l={dataSourceKey:n.dataSourceKey,collectionName:n.collectionName,id:String(t.id)}).dataSourceKey};else{if(n&&a.collectionName!==n.collectionName)return[2,d(t)];l=a,u={"X-App":a.appName,"X-Data-Source":a.dataSourceKey}}return[4,e.request({url:"".concat(encodeURIComponent(l.collectionName),":createTemporaryURL/").concat(encodeURIComponent(l.id)),method:"post",headers:u})];case 1:if(!(f=(null==(o=(s=p.sent()).data)||null==(r=o.data)?void 0:r.url)||(null==(i=s.data)?void 0:i.url)))throw Error("Temporary file URL is missing");return[2,new URL(f,location.origin).href]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){l(i,n,o,a,c,"next",e)}function c(e){l(i,n,o,a,c,"throw",e)}a(void 0)})})()},w=function(e){if(e&&(void 0===e?"undefined":c(e))==="object"&&e.mimetype&&s.includes(e.mimetype))return!0;var t=p(e);return!!t&&f.includes(t)},g=u(375),x=u(485),S=u(694);function O(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 j(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var A=function(r){var o,i=r.file,a=r.fileCollection,l=r.onDownload,c=r.onPreviewUrlChange,u=(0,x.useApp)(),s=(o=(0,S.useFlowEngine)(),function(e,t){return o.context.t(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){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}({ns:["file-previewer-office","client"]},t))}),f="string"==typeof i?i:null==i?void 0:i.url,p=null==a?void 0:a.dataSourceKey,d=null==a?void 0:a.collectionName,v=E((0,e.useState)(""),2),b=v[0],h=v[1],w=E((0,e.useState)(!1),2),O=w[0],A=w[1],k=E((0,e.useState)(!1),2),P=k[0],_=k[1],C=(0,e.useRef)(0),R=(0,e.useRef)(!1),T=(0,e.useCallback)(function(){var e;return(e=function(){var e,t;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:e=++C.current,A(!0),_(!1),h(""),null==c||c(""),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,m(u.apiClient,i,p&&d?{dataSourceKey:p,collectionName:d}:void 0)];case 2:if(t=n.sent(),e!==C.current)return[2];return h(t),null==c||c(y(t)),[3,5];case 3:return n.sent(),e===C.current&&(h(""),_(!0),null==c||c("")),[3,5];case 4:return e===C.current&&A(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){j(i,r,o,a,l,"next",e)}function l(e){j(i,r,o,a,l,"throw",e)}a(void 0)})})()},[u.apiClient,d,p,i,c]);(0,e.useEffect)(function(){return R.current=!1,T(),function(){C.current+=1}},[T,f]);var U=(0,e.useMemo)(function(){return y(b)},[b]),I=(0,e.useCallback)(function(){R.current?_(!0):(R.current=!0,T())},[T]);return O?t().createElement(n.Spin,{tip:s("Loading preview"),"aria-label":s("Loading preview")}):P?t().createElement(n.Alert,{type:"warning",showIcon:!0,message:s("Failed to load Office preview"),action:t().createElement(n.Button,{icon:t().createElement(g.DownloadOutlined,null),onClick:function(){return l(i)}},s("Download"))}):U?t().createElement("iframe",{src:U,title:s("Office file preview"),width:"100%",height:"100%",style:{border:"none"},onError:I}):null},k=JSON.parse('{"UU":"@nocobase/plugin-file-previewer-office"}');function P(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 _(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function C(e,t,n){return(C=I()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&T(o,n.prototype),o}).apply(null,arguments)}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(e,t){return(T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function U(e){var t="function"==typeof Map?new Map:void 0;return(U=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 C(e,arguments,R(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),T(n,e)})(e)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(I=function(){return!!e})()}function L(i){var a,l,c=i.index,u=i.list,s=i.fileCollection,f=i.onSwitchIndex,p=(a=(0,o.useApp)(),function(e){return a.i18n.t(e,{ns:[k.UU,"client"]})}),d=u[c],v=function(e){if(Array.isArray(e))return e}(l=(0,e.useState)(""))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(l)||function(e){if(e){if("string"==typeof e)return P(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return P(e,2)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),y=v[0],b=v[1],h=(0,e.useCallback)(function(e){e.preventDefault(),e.stopPropagation(),y&&window.open(y)},[y]),m=(0,e.useCallback)(function(e){e.preventDefault(),e.stopPropagation(),(0,r.saveAs)(d.url,"".concat(d.title).concat(d.extname))},[d.extname,d.title,d.url]),w=(0,e.useCallback)(function(){f(null)},[f]);return t().createElement(n.Modal,{open:null!=c,title:d.title,onCancel:w,footer:[t().createElement(n.Button,{key:"open",onClick:h,disabled:!y},p("Open in new window")),t().createElement(n.Button,{key:"download",onClick:m},p("Download")),t().createElement(n.Button,{key:"close",onClick:w},p("Close"))],width:"85vw",centered:!0},t().createElement("div",{style:{width:"100%",height:"calc(85vh - 120px)",background:"white",display:"flex",flexDirection:"column"}},t().createElement(A,{file:d,index:c,list:u,fileCollection:s,onDownload:function(){return(0,r.saveAs)(d.url,"".concat(d.title).concat(d.extname))},onSwitchIndex:f,onPreviewUrlChange:b})))}var M=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=R(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">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,I()?Reflect.construct(e,t||[],R(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&T(n,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){return o.attachmentFileTypes.add({match:w,Previewer:L}),i.filePreviewTypes.add({match:w,Previewer:(0,i.wrapWithModalPreviewer)(A)}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){_(i,r,o,a,l,"next",e)}function l(e){_(i,r,o,a,l,"throw",e)}a(void 0)})})()}}],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}(U(o.Plugin)),q=M}(),v}()});
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("antd"),require("@nocobase/plugin-file-manager/client-v2"),require("@nocobase/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-previewer-office/client-v2",["react","antd","@nocobase/plugin-file-manager/client-v2","@nocobase/client-v2","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-file-previewer-office/client-v2"]=t(require("react"),require("antd"),require("@nocobase/plugin-file-manager/client-v2"),require("@nocobase/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-file-previewer-office/client-v2"]=t(e.react,e.antd,e["@nocobase/plugin-file-manager/client-v2"],e["@nocobase/client-v2"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,r,n,o,i){return function(){"use strict";var a={375:function(e){e.exports=o},485:function(e){e.exports=n},694:function(e){e.exports=i},936:function(e){e.exports=r},59:function(e){e.exports=t},155:function(t){t.exports=e}},l={};function c(e){var t=l[e];if(void 0!==t)return t.exports;var r=l[e]={exports:{}};return a[e](r,r.exports,c),r.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(u=c.g.location+"");var u,f=c.g.document;if(!u&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(u=f.currentScript.src),!u)){var s=f.getElementsByTagName("script");if(s.length)for(var p=s.length-1;p>-1&&(!u||!/^http(s?):/.test(u));)u=s[p--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");c.p=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var v={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var r=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");r.indexOf("/static/plugins/@nocobase/plugin-file-previewer-office/dist/client-v2/")>=0&&(e=r.replace(/\/[^\/]+$/,"/"))}if(!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-file-previewer-office/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-file-previewer-office/dist/client-v2/"}c.p=e}(),!function(){c.r(v),c.d(v,{PluginFilePreviewerOfficeClientV2:function(){return C},default:function(){return T}});var e=c(485),t=c(936);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function n(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function o(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var i=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.oasis.opendocument.text"],a=["docx","xlsx","pptx","odt","doc","xls","ppt"],l=function(e){var t="string"==typeof e?e:(null==e?void 0:e.extname)||(null==e?void 0:e.name)||(null==e?void 0:e.filename)||(null==e?void 0:e.url)||"",r=t.split("?")[0].split("#")[0].split("/").filter(Boolean),n=r[r.length-1]||t,o=n;try{o=decodeURIComponent(n)}catch(e){}var i=o.lastIndexOf(".");return -1!==i?o.slice(i+1).toLowerCase():""},u=function(e){var t="string"==typeof e?e:null==e?void 0:e.url;return t?t.startsWith("https://")||t.startsWith("http://")?t:"".concat(location.origin,"/").concat(t.replace(/^\//,"")):""},f=function(e){var t=u(e);if(!t)return"";var r=new URL("https://view.officeapps.live.com/op/embed.aspx");return r.searchParams.set("src",t),r.href},s=/^[A-Za-z0-9_][A-Za-z0-9_-]*$/,p=function(e){var t,n="string"==typeof e?e:null==e?void 0:e.url;if(!n)return null;try{t=new URL(n,location.origin)}catch(e){return null}if(t.origin!==location.origin||t.searchParams.has("temporaryAccessToken"))return null;var o=t.pathname.split("/").filter(Boolean),i=o.length-5;if(i<0||"files"!==o[i])return null;var a=o.slice(i+1);if(4!==a.length)return null;try{var l,c=(l=a.map(decodeURIComponent),function(e){if(Array.isArray(e))return e}(l)||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),4!==o.length);i=!0);}catch(e){a=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw r}}return o}}(l)||function(e){if(e){if("string"==typeof e)return r(e,4);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,4)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=c[0],f=c[1],p=c[2],v=c[3];if(!s.test(u)||!s.test(f)||!s.test(p))return null;var d=v.lastIndexOf("."),y=d>0?v.slice(0,d):v;return{appName:u,dataSourceKey:f,collectionName:p,id:y}}catch(e){return null}},d=function(e,t,r){var i;return(i=function(){var n,i,a,l,c,f,s,v;return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(d){switch(d.label){case 0:if(r&&t&&(void 0===t?"undefined":o(t))==="object"&&null!=t.id&&null!=t.storageId)c={"X-Data-Source":(l={dataSourceKey:r.dataSourceKey,collectionName:r.collectionName,id:String(t.id)}).dataSourceKey};else{if(!(f=p(t))||r&&f.collectionName!==r.collectionName)return[2,u(t)];l=f,c={"X-App":f.appName,"X-Data-Source":f.dataSourceKey}}return[4,e.request({url:"".concat(encodeURIComponent(l.collectionName),":createTemporaryURL/").concat(encodeURIComponent(l.id)),method:"post",headers:c})];case 1:if(!(v=(null==(i=(s=d.sent()).data)||null==(n=i.data)?void 0:n.url)||(null==(a=s.data)?void 0:a.url)))throw Error("Temporary file URL is missing");return[2,new URL(v,location.origin).href]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var a=i.apply(e,t);function l(e){n(a,r,o,l,c,"next",e)}function c(e){n(a,r,o,l,c,"throw",e)}l(void 0)})})()},y=function(e){if(e&&(void 0===e?"undefined":o(e))==="object"&&e.mimetype&&i.includes(e.mimetype))return!0;var t=l(e);return!!t&&a.includes(t)},b=c(155),h=c.n(b),m=c(375),g=c(59),w=c(694);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return S(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var j=function(t){var r,n=t.file,o=t.fileCollection,i=t.onDownload,a=t.onPreviewUrlChange,l=(0,e.useApp)(),c=(r=(0,w.useFlowEngine)(),function(e,t){return r.context.t(e,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({ns:["file-previewer-office","client"]},t))}),u="string"==typeof n?n:null==n?void 0:n.url,s=null==o?void 0:o.dataSourceKey,p=null==o?void 0:o.collectionName,v=O((0,b.useState)(""),2),y=v[0],S=v[1],j=O((0,b.useState)(!1),2),_=j[0],P=j[1],E=O((0,b.useState)(!1),2),A=E[0],I=E[1],k=(0,b.useRef)(0),C=(0,b.useRef)(!1),T=(0,b.useCallback)(function(){var e;return(e=function(){var e,t;return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:e=++k.current,P(!0),I(!1),S(""),null==a||a(""),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,d(l.apiClient,n,s&&p?{dataSourceKey:s,collectionName:p}:void 0)];case 2:if(t=r.sent(),e!==k.current)return[2];return S(t),null==a||a(f(t)),[3,5];case 3:return r.sent(),e===k.current&&(S(""),I(!0),null==a||a("")),[3,5];case 4:return e===k.current&&P(!1),[7];case 5:return[2]}})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){x(i,n,o,a,l,"next",e)}function l(e){x(i,n,o,a,l,"throw",e)}a(void 0)})})()},[l.apiClient,p,s,n,a]);(0,b.useEffect)(function(){return C.current=!1,T(),function(){k.current+=1}},[T,u]);var R=(0,b.useMemo)(function(){return f(y)},[y]),q=(0,b.useCallback)(function(){C.current?I(!0):(C.current=!0,T())},[T]);return _?h().createElement(g.Spin,{tip:c("Loading preview"),"aria-label":c("Loading preview")}):A?h().createElement(g.Alert,{type:"warning",showIcon:!0,message:c("Failed to load Office preview"),action:h().createElement(g.Button,{icon:h().createElement(m.DownloadOutlined,null),onClick:function(){return i(n)}},c("Download"))}):R?h().createElement("iframe",{src:R,title:c("Office file preview"),width:"100%",height:"100%",style:{border:"none"},onError:q}):null};function _(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function P(e,t,r){return(P=k()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&A(o,r.prototype),o}).apply(null,arguments)}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t="function"==typeof Map?new Map:void 0;return(I=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,r)}function r(){return P(e,arguments,E(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),A(r,e)})(e)}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}var C=function(e){var r;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=E(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,k()?Reflect.construct(e,t||[],E(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&A(n,e),r=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){return t.filePreviewTypes.add({match:y,Previewer:(0,t.wrapWithModalPreviewer)(j)}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){_(i,n,o,a,l,"next",e)}function l(e){_(i,n,o,a,l,"throw",e)}a(void 0)})})()}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(n.prototype,r),n}(I(e.Plugin)),T=C}(),v}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("antd"),require("@nocobase/plugin-file-manager/client-v2"),require("@nocobase/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-file-previewer-office/client-v2",["react","antd","@nocobase/plugin-file-manager/client-v2","@nocobase/client-v2","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-file-previewer-office/client-v2"]=t(require("react"),require("antd"),require("@nocobase/plugin-file-manager/client-v2"),require("@nocobase/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-file-previewer-office/client-v2"]=t(e.react,e.antd,e["@nocobase/plugin-file-manager/client-v2"],e["@nocobase/client-v2"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,r,n,o,i){return function(){"use strict";var a={375:function(e){e.exports=o},485:function(e){e.exports=n},694:function(e){e.exports=i},936:function(e){e.exports=r},59:function(e){e.exports=t},155:function(t){t.exports=e}},l={};function c(e){var t=l[e];if(void 0!==t)return t.exports;var r=l[e]={exports:{}};return a[e](r,r.exports,c),r.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(u=c.g.location+"");var u,f=c.g.document;if(!u&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(u=f.currentScript.src),!u)){var s=f.getElementsByTagName("script");if(s.length)for(var p=s.length-1;p>-1&&(!u||!/^http(s?):/.test(u));)u=s[p--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");c.p=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var v={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var r=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");r.indexOf("/static/plugins/@nocobase/plugin-file-previewer-office/dist/client-v2/")>=0&&(e=r.replace(/\/[^\/]+$/,"/"))}if(!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-file-previewer-office/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-file-previewer-office/dist/client-v2/"}c.p=e}(),!function(){c.r(v),c.d(v,{PluginFilePreviewerOfficeClientV2:function(){return C},default:function(){return T}});var e=c(485),t=c(936);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function n(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function o(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var i=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.oasis.opendocument.text"],a=["docx","xlsx","pptx","odt","doc","xls","ppt"],l=function(e){var t="string"==typeof e?e:(null==e?void 0:e.extname)||(null==e?void 0:e.name)||(null==e?void 0:e.filename)||(null==e?void 0:e.url)||"",r=t.split("?")[0].split("#")[0].split("/").filter(Boolean),n=r[r.length-1]||t,o=n;try{o=decodeURIComponent(n)}catch(e){}var i=o.lastIndexOf(".");return -1!==i?o.slice(i+1).toLowerCase():""},u=function(e){var t="string"==typeof e?e:null==e?void 0:e.url;return t?t.startsWith("https://")||t.startsWith("http://")?t:"".concat(location.origin,"/").concat(t.replace(/^\//,"")):""},f=function(e){var t=u(e);if(!t)return"";var r=new URL("https://view.officeapps.live.com/op/embed.aspx");return r.searchParams.set("src",t),r.href},s=/^[A-Za-z0-9_][A-Za-z0-9_-]*$/,p=function(e){var t,n="string"==typeof e?e:null==e?void 0:e.url;if(!n)return null;try{t=new URL(n,location.origin)}catch(e){return null}if(t.origin!==location.origin||t.searchParams.has("temporaryAccessToken"))return null;var o=t.pathname.split("/").filter(Boolean),i=o.length-5;if(i<0||"files"!==o[i])return null;var a=o.slice(i+1);if(4!==a.length)return null;try{var l,c=(l=a.map(decodeURIComponent),function(e){if(Array.isArray(e))return e}(l)||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),4!==o.length);i=!0);}catch(e){a=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw r}}return o}}(l)||function(e){if(e){if("string"==typeof e)return r(e,4);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,4)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=c[0],f=c[1],p=c[2],v=c[3];if(!s.test(u)||!s.test(f)||!s.test(p))return null;var d=v.lastIndexOf("."),y=d>0?v.slice(0,d):v;return{appName:u,dataSourceKey:f,collectionName:p,id:y}}catch(e){return null}},d=function(e,t,r){var i;return(i=function(){var n,i,a,l,c,f,s,v;return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(d){switch(d.label){case 0:if(!(l=p(t)))return[2,u(t)];if(r&&t&&(void 0===t?"undefined":o(t))==="object"&&null!=t.id&&null!=t.storageId)f={"X-Data-Source":(c={dataSourceKey:r.dataSourceKey,collectionName:r.collectionName,id:String(t.id)}).dataSourceKey};else{if(r&&l.collectionName!==r.collectionName)return[2,u(t)];c=l,f={"X-App":l.appName,"X-Data-Source":l.dataSourceKey}}return[4,e.request({url:"".concat(encodeURIComponent(c.collectionName),":createTemporaryURL/").concat(encodeURIComponent(c.id)),method:"post",headers:f})];case 1:if(!(v=(null==(i=(s=d.sent()).data)||null==(n=i.data)?void 0:n.url)||(null==(a=s.data)?void 0:a.url)))throw Error("Temporary file URL is missing");return[2,new URL(v,location.origin).href]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var a=i.apply(e,t);function l(e){n(a,r,o,l,c,"next",e)}function c(e){n(a,r,o,l,c,"throw",e)}l(void 0)})})()},y=function(e){if(e&&(void 0===e?"undefined":o(e))==="object"&&e.mimetype&&i.includes(e.mimetype))return!0;var t=l(e);return!!t&&a.includes(t)},b=c(155),h=c.n(b),m=c(375),g=c(59),w=c(694);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return S(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var j=function(t){var r,n=t.file,o=t.fileCollection,i=t.onDownload,a=t.onPreviewUrlChange,l=(0,e.useApp)(),c=(r=(0,w.useFlowEngine)(),function(e,t){return r.context.t(e,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({ns:["file-previewer-office","client"]},t))}),u="string"==typeof n?n:null==n?void 0:n.url,s=null==o?void 0:o.dataSourceKey,p=null==o?void 0:o.collectionName,v=O((0,b.useState)(""),2),y=v[0],S=v[1],j=O((0,b.useState)(!1),2),_=j[0],P=j[1],E=O((0,b.useState)(!1),2),A=E[0],I=E[1],k=(0,b.useRef)(0),C=(0,b.useRef)(!1),T=(0,b.useCallback)(function(){var e;return(e=function(){var e,t;return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:e=++k.current,P(!0),I(!1),S(""),null==a||a(""),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,d(l.apiClient,n,s&&p?{dataSourceKey:s,collectionName:p}:void 0)];case 2:if(t=r.sent(),e!==k.current)return[2];return S(t),null==a||a(f(t)),[3,5];case 3:return r.sent(),e===k.current&&(S(""),I(!0),null==a||a("")),[3,5];case 4:return e===k.current&&P(!1),[7];case 5:return[2]}})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){x(i,n,o,a,l,"next",e)}function l(e){x(i,n,o,a,l,"throw",e)}a(void 0)})})()},[l.apiClient,p,s,n,a]);(0,b.useEffect)(function(){return C.current=!1,T(),function(){k.current+=1}},[T,u]);var R=(0,b.useMemo)(function(){return f(y)},[y]),q=(0,b.useCallback)(function(){C.current?I(!0):(C.current=!0,T())},[T]);return _?h().createElement(g.Spin,{tip:c("Loading preview"),"aria-label":c("Loading preview")}):A?h().createElement(g.Alert,{type:"warning",showIcon:!0,message:c("Failed to load Office preview"),action:h().createElement(g.Button,{icon:h().createElement(m.DownloadOutlined,null),onClick:function(){return i(n)}},c("Download"))}):R?h().createElement("iframe",{src:R,title:c("Office file preview"),width:"100%",height:"100%",style:{border:"none"},onError:q}):null};function _(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function P(e,t,r){return(P=k()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&A(o,r.prototype),o}).apply(null,arguments)}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t="function"==typeof Map?new Map:void 0;return(I=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,r)}function r(){return P(e,arguments,E(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),A(r,e)})(e)}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}var C=function(e){var r;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=E(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,k()?Reflect.construct(e,t||[],E(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&A(n,e),r=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){return t.filePreviewTypes.add({match:y,Previewer:(0,t.wrapWithModalPreviewer)(j)}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){_(i,n,o,a,l,"next",e)}function l(e){_(i,n,o,a,l,"throw",e)}a(void 0)})})()}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(n.prototype,r),n}(I(e.Plugin)),T=C}(),v}()});
@@ -10,10 +10,10 @@
10
10
  module.exports = {
11
11
  "react": "18.2.0",
12
12
  "antd": "5.24.2",
13
- "@nocobase/client": "2.4.0-alpha.5",
14
- "@nocobase/plugin-file-manager": "2.4.0-alpha.5",
13
+ "@nocobase/client": "2.4.0-alpha.6",
14
+ "@nocobase/plugin-file-manager": "2.4.0-alpha.6",
15
15
  "@ant-design/icons": "5.6.1",
16
- "@nocobase/client-v2": "2.4.0-alpha.5",
17
- "@nocobase/flow-engine": "2.4.0-alpha.5",
18
- "@nocobase/server": "2.4.0-alpha.5"
16
+ "@nocobase/client-v2": "2.4.0-alpha.6",
17
+ "@nocobase/flow-engine": "2.4.0-alpha.6",
18
+ "@nocobase/server": "2.4.0-alpha.6"
19
19
  };
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "A plugin for previewing office files via Microsoft live preview service.",
7
7
  "description.ru-RU": "Плагин для просмотра Office-файлов через Microsoft live preview service.",
8
8
  "description.zh-CN": "基于微软在线服务预览 Office 文件的插件。",
9
- "version": "2.4.0-alpha.5",
9
+ "version": "2.4.0-alpha.6",
10
10
  "main": "dist/server/index.js",
11
11
  "peerDependencies": {
12
12
  "@nocobase/client": "2.x",
@@ -20,5 +20,5 @@
20
20
  "Collection fields"
21
21
  ],
22
22
  "license": "Apache-2.0",
23
- "gitHead": "ce4b0948641b13d2964c44905cb30bebe877a657"
23
+ "gitHead": "1fc4fcd17a0cd79912a642600bdc2103e2104bdb"
24
24
  }