
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@yandex/ymaps3-drawer-control
Advanced tools
Yandex JS API package
The package is located in the dist
folder:
dist/types
TypeScript typesdist/esm
es6 modules for direct connection in your projectdist/index.js
Yandex JS ModuleRecommended use ymaps3-drawer-control
as usual npm package:
npm install @yandex/ymaps3-drawer-control
You also need to import css styles into your project:
/* index.css */
@import '@yandex/ymaps3-drawer-control/dist/esm/index.css';
and dynamic import
main();
async function main() {
await ymaps3.ready;
const {YMapDrawerControl} = await import('@yandex/ymaps3-drawer-control');
map = new ymaps3.YMap(document.getElementById('app'), {location: LOCATION}, [
/* any map child */
]);
let open = false;
const drawerControl = new YMapDrawerControl({
position: 'left',
width: 300,
open,
onOpenChange: (newOpenValue) => {
open = newOpenValue;
drawerControl.update({open: newOpenValue});
},
content: () => {
const container = document.createElement('div');
const title = document.createElement('h1');
title.textContent = 'Hello world';
container.appendChild(title);
const closeButton = document.createElement('button');
closeButton.textContent = 'Close';
closeButton.addEventListener('click', () => {
open = false;
drawerControl.update({open: false});
});
container.appendChild(closeButton);
return container;
}
});
map.addChild(drawerControl);
}
main();
async function main() {
const [ymaps3React] = await Promise.all([ymaps3.import('@yandex/ymaps3-reactify'), ymaps3.ready]);
const reactify = ymaps3React.reactify.bindTo(React, ReactDOM);
const {useState, useCallback} = React;
const {YMap} = reactify.module(ymaps3);
const {YMapDrawerControl} = reactify.module(await import('@yandex/ymaps3-drawer-control'));
const App = () => {
const [open, setOpen] = useState(false);
const content = useCallback(
() => (
<div>
<h1>Hello world!</h1>
<button onClick={() => setOpen(false)}>Close</button>
</div>
),
[]
);
const onOpenChange = (value: boolean) => {
setOpen(!value);
};
return (
<YMap location={LOCATION}>
{/* any map child */}
<YMapDrawerControl position="left" width={300} content={content} open={open} onOpenChange={onOpenChange} />
</YMap>
);
};
}
You can use CDN with module loading handler in JS API on your page.
By default ymaps3.import
can load self modules.
If you want also load your package, should register cdn:
ymaps3.import.registerCdn('https://cdn.jsdelivr.net/npm/{package}', '@yandex/ymaps3-drawer-control@latest');
Just use ymaps3.import
:
const {YMapDrawerControl} = await ymaps3.import('@yandex/ymaps3-drawer-control');
Name | Type | Default | Description |
---|---|---|---|
position | "left" , "right" , "top" , "bottom" | "left" | Specifies which side of the map the drawer opens from. |
transitionDuration | number , {open: number; close: number} | 500 | Duration of the open/close animation in milliseconds. |
open | boolean | Flag indicating whether the drawer is open. | |
width | string | number | Fixed width of the drawer. If not specified, the drawer adjusts to the content's width. | |
maxWidth | string | number | Maximum width of the drawer. | |
minWidth | string | number | Minimum width of the drawer. | |
height | string | number | Fixed height of the drawer. If not specified, the drawer adjusts to the content's height. | |
maxHeight | string | number | Maximum height of the drawer. | |
minHeight | string | number | Minimum height of the drawer. | |
onOpenChange | (open: boolean) => void | Drawer open status change handler. | |
verticalTriggerPosition | number | "center" | Vertical position of the button that opens the drawer. |
horizontalTriggerPosition | number | "center" | Horizontal position of the button that opens the drawer. |
content | () => HTMLElement | YMapEntity | Function that returns the drawer's content as an HTMLElement or an YMapEntity. |
FAQs
Yandex Maps JS API 3.0 example ymaps3-drawer-control
The npm package @yandex/ymaps3-drawer-control receives a total of 1,950 weekly downloads. As such, @yandex/ymaps3-drawer-control popularity was classified as popular.
We found that @yandex/ymaps3-drawer-control demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.