@nocobase/plugin-notification-in-app-message 2.1.0-beta.43 → 2.1.0-beta.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client-v2/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("ahooks"),require("react-i18next"),require("@emotion/css"),require("@nocobase/plugin-notification-manager/client-v2"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-notification-in-app-message/client-v2",["ahooks","react-i18next","@emotion/css","@nocobase/plugin-notification-manager/client-v2","@nocobase/client-v2","react-router-dom","react","antd","@ant-design/icons","@nocobase/flow-engine","@nocobase/utils/client"],n):"object"==typeof exports?exports["@nocobase/plugin-notification-in-app-message/client-v2"]=n(require("ahooks"),require("react-i18next"),require("@emotion/css"),require("@nocobase/plugin-notification-manager/client-v2"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client")):e["@nocobase/plugin-notification-in-app-message/client-v2"]=n(e.ahooks,e["react-i18next"],e["@emotion/css"],e["@nocobase/plugin-notification-manager/client-v2"],e["@nocobase/client-v2"],e["react-router-dom"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"],e["@nocobase/utils/client"])}(self,function(e,n,t,r,o,i,c,a,u,l,s){return function(){"use strict";var f,p,b,d={247:function(e,n,t){t.d(n,{A:function(){return o},e:function(){return i}});var r=null;function o(e){r=e}function i(){return r}},488:function(e,n,t){t.d(n,{MZ:function(){return l},kj:function(){return u},mG:function(){return a}});var r=t(694),o=t(953),i="notification-in-app-message",c="@nocobase/plugin-notification-in-app-message";function a(){return(0,o.useTranslation)([i,c,"client"],{nsMode:"fallback"})}function u(){var e=(0,r.useFlowEngine)();return function(n,t){return e.context.t(n,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({ns:[i,c,"client"],nsMode:"fallback"},t))}}function l(e){return(0,r.tExpr)(e,{ns:[i,c,"client"]})}},375:function(e){e.exports=u},477:function(e){e.exports=t},485:function(e){e.exports=o},694:function(e){e.exports=l},341:function(e){e.exports=r},768:function(e){e.exports=s},625:function(n){n.exports=e},59:function(e){e.exports=a},155:function(e){e.exports=c},953:function(e){e.exports=n},442:function(e){e.exports=i}},g={};function v(e){var n=g[e];if(void 0!==n)return n.exports;var t=g[e]={exports:{}};return d[e].call(t.exports,t,t.exports,v),t.exports}v.m=d,v.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(n,{a:n}),n},v.d=function(e,n){for(var t in n)v.o(n,t)&&!v.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},v.f={},v.e=function(e){return Promise.all(Object.keys(v.f).reduce(function(n,t){return v.f[t](e,n),n},[]))},v.u=function(e){return""+e+".503d86e234fdb749.js"},v.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),v.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},h={},v.l=function(e,n,t,r){if(h[e])return void h[e].push(n);if(void 0!==t)for(var o,i,c=document.getElementsByTagName("script"),a=0;a<c.length;a++){var u=c[a];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@nocobase/plugin-notification-in-app-message/client-v2:"+t){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,v.nc&&o.setAttribute("nonce",v.nc),o.setAttribute("data-rspack","@nocobase/plugin-notification-in-app-message/client-v2:"+t),o.src=e),h[e]=[n];var l=function(n,t){o.onerror=o.onload=null,clearTimeout(s);var r=h[e];if(delete h[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(t)}),n)return n(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},v.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},v.g.importScripts&&(m=v.g.location+"");var h,m,y=v.g.document;if(!m&&y&&(y.currentScript&&"SCRIPT"===y.currentScript.tagName.toUpperCase()&&(m=y.currentScript.src),!m)){var w=y.getElementsByTagName("script");if(w.length)for(var _=w.length-1;_>-1&&(!m||!/^http(s?):/.test(m));)m=w[_--].src}if(!m)throw Error("Automatic publicPath is not supported in this browser");v.p=m.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},v.f.j=function(e,n){var t=v.o(f,e)?f[e]:void 0;if(0!==t)if(t)n.push(t[2]);else{var r=new Promise(function(n,r){t=f[e]=[n,r]});n.push(t[2]=r);var o=v.p+v.u(e),i=Error();v.l(o,function(n){if(v.o(f,e)&&(0!==(t=f[e])&&(f[e]=void 0),t)){var r=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,t[1](i)}},"chunk-"+e,e)}},p=function(e,n){var t,r,o=n[0],i=n[1],c=n[2],a=0;if(o.some(function(e){return 0!==f[e]})){for(t in i)v.o(i,t)&&(v.m[t]=i[t]);c&&c(v)}for(e&&e(n);a<o.length;a++)r=o[a],v.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(b=self.webpackChunk_nocobase_plugin_notification_in_app_message_client_v2=self.webpackChunk_nocobase_plugin_notification_in_app_message_client_v2||[]).forEach(p.bind(null,0)),b.push=p.bind(null,b.push.bind(b));var x={};return!function(){var e="",n="u">typeof document?document.currentScript:null;if(n&&n.src&&(e=n.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var t=window.__webpack_public_path__||"";t&&("/"!==t.charAt(t.length-1)&&(t+="/"),e=t+"static/plugins/@nocobase/plugin-notification-in-app-message/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",o=r.indexOf("/v2/");e=o>=0?r.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-notification-in-app-message/dist/client-v2/"}v.p=e}(),!function(){v.r(x),v.d(x,{PluginNotificationInAppMessageClientV2:function(){return d},NAMESPACE:function(){return b},default:function(){return g}});var e=v(485),n=v(341),t=v.n(n),r=v(247),o=v(488);function i(e,n,t,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){t(e);return}a.done?n(u):Promise.resolve(u).then(r,o)}function c(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var c=e.apply(n,t);function a(e){i(c,r,o,a,u,"next",e)}function u(e){i(c,r,o,a,u,"throw",e)}a(void 0)})}}function a(e,n,t){return(a=f()?Reflect.construct:function(e,n,t){var r=[null];r.push.apply(r,n);var o=new(Function.bind.apply(e,r));return t&&l(o,t.prototype),o}).apply(null,arguments)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,n){return(l=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function s(e){var n="function"==typeof Map?new Map:void 0;return(s=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!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,u(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),l(t,e)})(e)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function p(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(c,"next",{value:u(0)}),a(c,"throw",{value:u(1)}),a(c,"return",{value:u(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function u(a){return function(u){var l=[a,u];if(t)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var b="notification-in-app-message",d=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,n;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,n=arguments,e=u(e),function(e,n){var t;if(n&&("object"==((t=n)&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)||"function"==typeof n))return n;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,f()?Reflect.construct(e,n||[],u(this).constructor):e.apply(this,n))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&l(i,e),n=[{key:"beforeLoad",value:function(){return c(function(){var e;return p(this,function(n){return(e=this.pm.get(t()))&&e.registerChannelType({type:"in-app-message",title:(0,o.MZ)("In-app message"),components:{},meta:{creatable:!0,editable:!0,deletable:!0}}),[2]})}).call(this)}},{key:"load",value:function(){return c(function(){return p(this,function(e){return(0,r.A)(this.app.apiClient),this.flowEngine.registerModelLoaders({InboxTopbarActionModel:{extends:"TopbarActionModel",loader:function(){return v.e("297").then(v.bind(v,8))}}}),[2]})}).call(this)}}],function(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i.prototype,n),i}(s(e.Plugin)),g=d}(),x}()});
|
|
10
|
+
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("ahooks"),require("react-i18next"),require("@emotion/css"),require("@nocobase/plugin-notification-manager/client-v2"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-notification-in-app-message/client-v2",["ahooks","react-i18next","@emotion/css","@nocobase/plugin-notification-manager/client-v2","@nocobase/client-v2","react-router-dom","react","antd","@ant-design/icons","@nocobase/flow-engine","@nocobase/utils/client"],n):"object"==typeof exports?exports["@nocobase/plugin-notification-in-app-message/client-v2"]=n(require("ahooks"),require("react-i18next"),require("@emotion/css"),require("@nocobase/plugin-notification-manager/client-v2"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client")):e["@nocobase/plugin-notification-in-app-message/client-v2"]=n(e.ahooks,e["react-i18next"],e["@emotion/css"],e["@nocobase/plugin-notification-manager/client-v2"],e["@nocobase/client-v2"],e["react-router-dom"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"],e["@nocobase/utils/client"])}(self,function(e,n,t,r,o,i,c,a,u,l,s){return function(){"use strict";var f,p,b,d={247:function(e,n,t){t.d(n,{A:function(){return o},e:function(){return i}});var r=null;function o(e){r=e}function i(){return r}},488:function(e,n,t){t.d(n,{MZ:function(){return l},kj:function(){return u},mG:function(){return a}});var r=t(694),o=t(953),i="notification-in-app-message",c="@nocobase/plugin-notification-in-app-message";function a(){return(0,o.useTranslation)([i,c,"client"],{nsMode:"fallback"})}function u(){var e=(0,r.useFlowEngine)();return function(n,t){return e.context.t(n,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({ns:[i,c,"client"],nsMode:"fallback"},t))}}function l(e){return(0,r.tExpr)(e,{ns:[i,c,"client"]})}},375:function(e){e.exports=u},477:function(e){e.exports=t},485:function(e){e.exports=o},694:function(e){e.exports=l},341:function(e){e.exports=r},768:function(e){e.exports=s},625:function(n){n.exports=e},59:function(e){e.exports=a},155:function(e){e.exports=c},953:function(e){e.exports=n},442:function(e){e.exports=i}},g={};function v(e){var n=g[e];if(void 0!==n)return n.exports;var t=g[e]={exports:{}};return d[e].call(t.exports,t,t.exports,v),t.exports}v.m=d,v.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(n,{a:n}),n},v.d=function(e,n){for(var t in n)v.o(n,t)&&!v.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},v.f={},v.e=function(e){return Promise.all(Object.keys(v.f).reduce(function(n,t){return v.f[t](e,n),n},[]))},v.u=function(e){return""+e+".503d86e234fdb749.js"},v.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),v.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},h={},v.l=function(e,n,t,r){if(h[e])return void h[e].push(n);if(void 0!==t)for(var o,i,c=document.getElementsByTagName("script"),a=0;a<c.length;a++){var u=c[a];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@nocobase/plugin-notification-in-app-message/client-v2:"+t){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,v.nc&&o.setAttribute("nonce",v.nc),o.setAttribute("data-rspack","@nocobase/plugin-notification-in-app-message/client-v2:"+t),o.src=e),h[e]=[n];var l=function(n,t){o.onerror=o.onload=null,clearTimeout(s);var r=h[e];if(delete h[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(t)}),n)return n(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},v.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},v.g.importScripts&&(m=v.g.location+"");var h,m,y=v.g.document;if(!m&&y&&(y.currentScript&&"SCRIPT"===y.currentScript.tagName.toUpperCase()&&(m=y.currentScript.src),!m)){var w=y.getElementsByTagName("script");if(w.length)for(var _=w.length-1;_>-1&&(!m||!/^http(s?):/.test(m));)m=w[_--].src}if(!m)throw Error("Automatic publicPath is not supported in this browser");v.p=m.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},v.f.j=function(e,n){var t=v.o(f,e)?f[e]:void 0;if(0!==t)if(t)n.push(t[2]);else{var r=new Promise(function(n,r){t=f[e]=[n,r]});n.push(t[2]=r);var o=v.p+v.u(e),i=Error();v.l(o,function(n){if(v.o(f,e)&&(0!==(t=f[e])&&(f[e]=void 0),t)){var r=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,t[1](i)}},"chunk-"+e,e)}},p=function(e,n){var t,r,o=n[0],i=n[1],c=n[2],a=0;if(o.some(function(e){return 0!==f[e]})){for(t in i)v.o(i,t)&&(v.m[t]=i[t]);c&&c(v)}for(e&&e(n);a<o.length;a++)r=o[a],v.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(b=self.webpackChunk_nocobase_plugin_notification_in_app_message_client_v2=self.webpackChunk_nocobase_plugin_notification_in_app_message_client_v2||[]).forEach(p.bind(null,0)),b.push=p.bind(null,b.push.bind(b));var x={};return!function(){var e="",n="u">typeof document?document.currentScript:null;if(n&&n.src&&(e=n.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var t=window.__webpack_public_path__||"";t&&("/"!==t.charAt(t.length-1)&&(t+="/"),e=t+"static/plugins/@nocobase/plugin-notification-in-app-message/dist/client-v2/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",c=i.indexOf(o);e=c>=0?i.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-notification-in-app-message/dist/client-v2/"}v.p=e}(),!function(){v.r(x),v.d(x,{PluginNotificationInAppMessageClientV2:function(){return d},NAMESPACE:function(){return b},default:function(){return g}});var e=v(485),n=v(341),t=v.n(n),r=v(247),o=v(488);function i(e,n,t,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){t(e);return}a.done?n(u):Promise.resolve(u).then(r,o)}function c(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var c=e.apply(n,t);function a(e){i(c,r,o,a,u,"next",e)}function u(e){i(c,r,o,a,u,"throw",e)}a(void 0)})}}function a(e,n,t){return(a=f()?Reflect.construct:function(e,n,t){var r=[null];r.push.apply(r,n);var o=new(Function.bind.apply(e,r));return t&&l(o,t.prototype),o}).apply(null,arguments)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,n){return(l=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function s(e){var n="function"==typeof Map?new Map:void 0;return(s=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!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,u(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),l(t,e)})(e)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function p(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(c,"next",{value:u(0)}),a(c,"throw",{value:u(1)}),a(c,"return",{value:u(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function u(a){return function(u){var l=[a,u];if(t)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var b="notification-in-app-message",d=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,n;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,n=arguments,e=u(e),function(e,n){var t;if(n&&("object"==((t=n)&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)||"function"==typeof n))return n;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,f()?Reflect.construct(e,n||[],u(this).constructor):e.apply(this,n))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&l(i,e),n=[{key:"beforeLoad",value:function(){return c(function(){var e;return p(this,function(n){return(e=this.pm.get(t()))&&e.registerChannelType({type:"in-app-message",title:(0,o.MZ)("In-app message"),components:{},meta:{creatable:!0,editable:!0,deletable:!0}}),[2]})}).call(this)}},{key:"load",value:function(){return c(function(){return p(this,function(e){return(0,r.A)(this.app.apiClient),this.flowEngine.registerModelLoaders({InboxTopbarActionModel:{extends:"TopbarActionModel",loader:function(){return v.e("297").then(v.bind(v,8))}}}),[2]})}).call(this)}}],function(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i.prototype,n),i}(s(e.Plugin)),g=d}(),x}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -9,23 +9,23 @@
|
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"react": "18.2.0",
|
|
12
|
-
"@nocobase/client": "2.1.0-beta.
|
|
13
|
-
"@nocobase/plugin-notification-manager": "2.1.0-beta.
|
|
14
|
-
"@nocobase/plugin-mobile": "2.1.0-beta.
|
|
15
|
-
"@nocobase/utils": "2.1.0-beta.
|
|
16
|
-
"@nocobase/client-v2": "2.1.0-beta.
|
|
17
|
-
"@nocobase/flow-engine": "2.1.0-beta.
|
|
12
|
+
"@nocobase/client": "2.1.0-beta.45",
|
|
13
|
+
"@nocobase/plugin-notification-manager": "2.1.0-beta.45",
|
|
14
|
+
"@nocobase/plugin-mobile": "2.1.0-beta.45",
|
|
15
|
+
"@nocobase/utils": "2.1.0-beta.45",
|
|
16
|
+
"@nocobase/client-v2": "2.1.0-beta.45",
|
|
17
|
+
"@nocobase/flow-engine": "2.1.0-beta.45",
|
|
18
18
|
"react-i18next": "11.18.6",
|
|
19
19
|
"dayjs": "1.11.13",
|
|
20
|
-
"@nocobase/database": "2.1.0-beta.
|
|
21
|
-
"@nocobase/server": "2.1.0-beta.
|
|
20
|
+
"@nocobase/database": "2.1.0-beta.45",
|
|
21
|
+
"@nocobase/server": "2.1.0-beta.45",
|
|
22
22
|
"sequelize": "6.35.2",
|
|
23
|
-
"@nocobase/actions": "2.1.0-beta.
|
|
23
|
+
"@nocobase/actions": "2.1.0-beta.45",
|
|
24
24
|
"antd": "5.24.2",
|
|
25
25
|
"antd-style": "3.7.1",
|
|
26
26
|
"@emotion/css": "11.13.0",
|
|
27
27
|
"@formily/react": "2.3.7",
|
|
28
|
-
"@nocobase/plugin-workflow": "2.1.0-beta.
|
|
28
|
+
"@nocobase/plugin-workflow": "2.1.0-beta.45",
|
|
29
29
|
"react-router-dom": "6.30.1",
|
|
30
30
|
"@formily/reactive": "2.3.7",
|
|
31
31
|
"ahooks": "3.7.8",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"uuid","version":"10.0.0","description":"RFC9562 UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122","rfc9562"],"license":"MIT","bin":{"uuid":"dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/esm-node/index.js":"./dist/esm-browser/index.js","./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.24.6","@babel/core":"7.24.6","@babel/eslint-parser":"7.24.6","@babel/plugin-syntax-import-attributes":"7.24.6","@babel/preset-env":"7.24.6","@commitlint/cli":"19.3.0","@commitlint/config-conventional":"19.2.2","@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6","bundlewatch":"0.3.3","eslint":"9.4.0","eslint-plugin-prettier":"5.1.3","globals":"15.3.0","husky":"9.0.11","jest":"29.7.0","lint-staged":"15.2.5","neostandard":"0.5.1","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"3.3.0","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","test:matching":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/ -t","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && HUSKY=0 npm install && npm test","prettier:check":"prettier --check .","prettier:fix":"prettier --write .","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"npm run build && npx runmd --output=README.md README_js.md","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"git+https://github.com/uuidjs/uuid.git"},"lint-staged":{"*":["prettier --no-error-on-unmatched-pattern --write"],"*.{js,jsx}":["eslint --no-error-on-unmatched-pattern --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"packageManager":"npm@10.8.1+sha256.b8807aebb9656758e2872fa6e7c564b506aa2faa9297439a478d471d2fe32483","_lastModified":"2026-06-
|
|
1
|
+
{"name":"uuid","version":"10.0.0","description":"RFC9562 UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122","rfc9562"],"license":"MIT","bin":{"uuid":"dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/esm-node/index.js":"./dist/esm-browser/index.js","./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.24.6","@babel/core":"7.24.6","@babel/eslint-parser":"7.24.6","@babel/plugin-syntax-import-attributes":"7.24.6","@babel/preset-env":"7.24.6","@commitlint/cli":"19.3.0","@commitlint/config-conventional":"19.2.2","@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6","bundlewatch":"0.3.3","eslint":"9.4.0","eslint-plugin-prettier":"5.1.3","globals":"15.3.0","husky":"9.0.11","jest":"29.7.0","lint-staged":"15.2.5","neostandard":"0.5.1","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"3.3.0","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","test:matching":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/ -t","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && HUSKY=0 npm install && npm test","prettier:check":"prettier --check .","prettier:fix":"prettier --write .","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"npm run build && npx runmd --output=README.md README_js.md","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"git+https://github.com/uuidjs/uuid.git"},"lint-staged":{"*":["prettier --no-error-on-unmatched-pattern --write"],"*.{js,jsx}":["eslint --no-error-on-unmatched-pattern --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"packageManager":"npm@10.8.1+sha256.b8807aebb9656758e2872fa6e7c564b506aa2faa9297439a478d471d2fe32483","_lastModified":"2026-06-08T04:33:43.257Z"}
|
|
@@ -32,14 +32,38 @@ module.exports = __toCommonJS(defineMyInAppChannels_exports);
|
|
|
32
32
|
var import_sequelize = require("sequelize");
|
|
33
33
|
var import_plugin_notification_manager = require("@nocobase/plugin-notification-manager");
|
|
34
34
|
var import_types = require("../types");
|
|
35
|
+
function parseLatestMsgReceiveTimestampLt(filter) {
|
|
36
|
+
const latestMsgReceiveTimestamp = typeof filter === "object" && filter !== null ? filter.latestMsgReceiveTimestamp : null;
|
|
37
|
+
if (typeof latestMsgReceiveTimestamp !== "object" || latestMsgReceiveTimestamp === null || !Object.prototype.hasOwnProperty.call(latestMsgReceiveTimestamp, "$lt")) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const value = latestMsgReceiveTimestamp.$lt;
|
|
41
|
+
if (typeof value === "string" && value.trim() === "") {
|
|
42
|
+
throw new Error("Invalid latest message receive timestamp filter");
|
|
43
|
+
}
|
|
44
|
+
if (typeof value !== "number" && typeof value !== "string") {
|
|
45
|
+
throw new Error("Invalid latest message receive timestamp filter");
|
|
46
|
+
}
|
|
47
|
+
const timestamp = Number(value);
|
|
48
|
+
if (!Number.isFinite(timestamp)) {
|
|
49
|
+
throw new Error("Invalid latest message receive timestamp filter");
|
|
50
|
+
}
|
|
51
|
+
return timestamp;
|
|
52
|
+
}
|
|
35
53
|
function defineMyInAppChannels(app) {
|
|
36
54
|
app.resourceManager.define({
|
|
37
55
|
name: "myInAppChannels",
|
|
38
56
|
actions: {
|
|
39
57
|
list: {
|
|
40
58
|
handler: async (ctx) => {
|
|
41
|
-
var _a
|
|
59
|
+
var _a;
|
|
42
60
|
const { filter = {}, limit = 30 } = ((_a = ctx.action) == null ? void 0 : _a.params) ?? {};
|
|
61
|
+
let latestMsgReceiveTimestampLt;
|
|
62
|
+
try {
|
|
63
|
+
latestMsgReceiveTimestampLt = parseLatestMsgReceiveTimestampLt(filter);
|
|
64
|
+
} catch (error) {
|
|
65
|
+
return ctx.throw(400, error.message);
|
|
66
|
+
}
|
|
43
67
|
const messagesCollection = app.db.getCollection(import_types.InAppMessagesDefinition.name);
|
|
44
68
|
const messagesTableName = messagesCollection.getRealTableName(true);
|
|
45
69
|
const channelsCollection = app.db.getCollection(import_plugin_notification_manager.ChannelsCollectionDefinition.name);
|
|
@@ -77,7 +101,7 @@ function defineMyInAppChannels(app) {
|
|
|
77
101
|
ORDER BY messages.${messagesFieldName.receiveTimestamp} DESC
|
|
78
102
|
LIMIT 1
|
|
79
103
|
)`;
|
|
80
|
-
const latestMsgReceiveTSFilter =
|
|
104
|
+
const latestMsgReceiveTSFilter = latestMsgReceiveTimestampLt !== null ? import_sequelize.Sequelize.where(import_sequelize.Sequelize.literal(latestMsgReceiveTimestampSQL), import_sequelize.Op.lt, latestMsgReceiveTimestampLt) : null;
|
|
81
105
|
const channelIdFilter = (filter == null ? void 0 : filter.id) ? { id: filter.id } : null;
|
|
82
106
|
const channelNameFilter = (filter == null ? void 0 : filter.name) ? { name: filter.name } : null;
|
|
83
107
|
const statusMap = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-notification-in-app-message",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.45",
|
|
4
4
|
"displayName": "Notification: In-app message",
|
|
5
5
|
"displayName.ru-RU": "Уведомления: Всплывающие сообщения внутри приложения",
|
|
6
6
|
"displayName.zh-CN": "通知:站内信",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"react-router-dom": "^6.x"
|
|
34
34
|
},
|
|
35
35
|
"license": "Apache-2.0",
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "42587115fc34c3eb01ef2b2549f1c998e5708318"
|
|
37
37
|
}
|