diff --git a/packages/notification/rollup.config.js b/packages/notification/rollup.config.js index 3c158bf990c55606f8df0e89caae51b0bf74aa97..5b589a6b53e7c67349edfa64b3fa0586829a4882 100644 --- a/packages/notification/rollup.config.js +++ b/packages/notification/rollup.config.js @@ -20,7 +20,9 @@ export default { plugins: [ multiEntry(), resolve(), - commonjs(), + commonjs({ + include: 'node_modules/**' + }), json(), replace({ "process.env.BUILD": '"' + build + '"', diff --git a/packages/notification/src/utils.js b/packages/notification/src/utils.js index 15874eb635d3e4dec075b6f4a61fd21ea016a789..92d5ba988575f97b4c5170e6b80305ee531239de 100644 --- a/packages/notification/src/utils.js +++ b/packages/notification/src/utils.js @@ -1,13 +1,10 @@ +export const createUUID = () => { + let dt = new Date().getTime(); + const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { + const r = (dt + Math.random()*16)%16 | 0; + dt = Math.floor(dt/16); + return (c==='x' ? r :(r&0x3|0x8)).toString(16); + }); -module.exports = { - createUUID: () => { - let dt = new Date().getTime(); - const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { - const r = (dt + Math.random()*16)%16 | 0; - dt = Math.floor(dt/16); - return (c==='x' ? r :(r&0x3|0x8)).toString(16); - }); - - return uuid; - } -}; + return uuid; +} diff --git a/packages/notification/src/vpu-notification.js b/packages/notification/src/vpu-notification.js index 14db62452cf7ee3dfd2a1589e03cd2b8f8dd8174..c95fa4b3b8c1748016347a15fc642a1ec1172c7e 100644 --- a/packages/notification/src/vpu-notification.js +++ b/packages/notification/src/vpu-notification.js @@ -1,5 +1,5 @@ import {i18n} from './i18n'; -import utils from './utils' +import {createUUID} from './utils' import {html} from 'lit-element'; import VPULitElement from 'vpu-common/vpu-lit-element'; import commonUtils from 'vpu-common/utils'; @@ -33,7 +33,7 @@ class VPUNotification extends VPULitElement { } that.notificationBlock = that._("#notification"); - const notificationId = `notification-${utils.createUUID()}`; + const notificationId = `notification-${createUUID()}`; const type = typeof e.detail.type !== 'undefined' ? e.detail.type : "info"; const body = typeof e.detail.body !== 'undefined' ? e.detail.body : ""; diff --git a/packages/notification/vendor/common b/packages/notification/vendor/common index 3623e0d1d062c1048ee37ac779d9425b56ffe26b..b30eaa6475ccc65b5f99d2ead86ddbe2b8e015a7 160000 --- a/packages/notification/vendor/common +++ b/packages/notification/vendor/common @@ -1 +1 @@ -Subproject commit 3623e0d1d062c1048ee37ac779d9425b56ffe26b +Subproject commit b30eaa6475ccc65b5f99d2ead86ddbe2b8e015a7