
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@myuw-web-components/myuw-notifications
Advanced tools
Web component that provides an icon button and menu/list of notifications
Clone this repository.
Run
npm run start
from the root of this repository.
Node will build the project, start a demo server, and open your web browser to a demo page. Then you can use the buttons and form on the page to demo how notifications present.
Import the latest version of the component:
<!-- import the module -->
<script type="module" src="https://unpkg.com//@myuw-web-components/myuw-notifications@latest/dist/myuw-notifications.min.mjs"></script>
<!-- fallback for browsers without ES2015 module support -->
<script nomodule src="https://unpkg.com/@myuw-web-components/myuw-notifications@latest/dist/myuw-notifications.min.js"></script>
And then use the component:
<myuw-notifications
slot="myuw-notifications"
limit="3"
see-all-url="/"
>
<span slot="myuw-notifications-empty">All caught up!</span>
</myuw-notifications>
The component listens for the "myuw-has-notifications
" custom event to tell it when there are notifications ready to display. You can use this event after fetching all notifications from a URL or to add a single notification to the list. Dispatch the event like so:
document.dispatchEvent(new CustomEvent('myuw-has-notifications', {
bubbles: true,
detail: {
notifications: [yourNotificationsArray]
}
}));
Note: The component includes a CustomEvent polyfill for browsers that don't already support them
A single "notification" object must contain the following properties:
{
"id": "",
"title": "",
"actionButton": {
"label": "",
"url": ""
}
}
Notes:
notifications
property MUST be an array, even if you're only displaying a single notificationUsers are able to remove notifications from the list by clicking a notification's "X" dismiss button. Removal from the DOM and from the component's list is handled automatically, but if you need to hook into the event for your own purposes (e.g. to trigger an analytics event), you can listen for the myuw-notification-dismissed
event, like so:
document.addEventListener('myuw-notification-dismissed', (event) => {
// The event passes a detail object with a single
// property: "notificationId", which is the "id" value of
// the dismissed notification
var dismissedNotificationId = event.detail.notificationId;
// Do what you want with this information!
}, false);
In addition, notifications can be dimissed by dispatching a myuw-notification-dismissed
event with the field event.detail.dismissedFromOutside
set to true
, and event.detail.notificationId
set to id of the notification you want to dismiss.
Check out the source HTML files to see all the CSS variables you can override.
The evergreen "latest" version is convenient for development, but for stability in production settings instead use specific release versions and upgrade intentionally.
Instead, import a specific version:
<!-- import the module -->
<script type="module" src="https://unpkg.com//@myuw-web-components/myuw-notifications@1.3.4/dist/myuw-notifications.min.mjs"></script>
<!-- fallback for browsers without ES2015 module support -->
<script nomodule src="https://unpkg.com/@myuw-web-components/myuw-notifications@1.3.4/dist/myuw-notifications.min.js"></script>
FAQs
Web component that provides an icon button and menu/list of notifications
We found that @myuw-web-components/myuw-notifications demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.