@yandex/ymaps3-default-ui-theme
Advanced tools
Comparing version 0.0.1-beta.4 to 0.0.1-beta.5
{ | ||
"version": "0.0.1-beta.4", | ||
"version": "0.0.1-beta.5", | ||
"name": "@yandex/ymaps3-default-ui-theme", | ||
@@ -4,0 +4,0 @@ "description": "Yandex Maps JS API 3.0 example @yandex/ymaps3-default-ui-theme", |
@@ -9,3 +9,3 @@ # @yandex/ymaps3-default-ui-theme package | ||
[![npm](https://img.shields.io/npm/dm/@yandex/ymaps3-default-ui-theme.svg)](https://www.npmjs.com/package/@yandex/ymaps3-default-ui-theme) | ||
[![Build Status](https://github.com/yandex/@yandex/ymaps3-default-ui-theme/workflows/Run%20tests/badge.svg)](https://github.com/yandex/@yandex/ymaps3-default-ui-theme/actions/workflows/tests.yml) | ||
[![Build Status](https://github.com/yandex/ymaps3-default-ui-theme/workflows/Run%20tests/badge.svg)](https://github.com/yandex/@yandex/ymaps3-default-ui-theme/actions/workflows/tests.yml) | ||
@@ -20,6 +20,6 @@ ## How use | ||
Recommended use `YMapButtonExample` as usual npm package: | ||
Recommended use `@yandex/ymaps3-default-ui-theme` as usual npm package: | ||
```sh | ||
npm i @yandex/ymaps3-default-ui-theme | ||
npm install @yandex/ymaps3-default-ui-theme | ||
``` | ||
@@ -34,7 +34,7 @@ | ||
const {YMapButtonExample} = await import('@yandex/ymaps3-default-ui-theme'); | ||
const {YMapZoomControl} = await import('@yandex/ymaps3-default-ui-theme'); | ||
// ... | ||
map.addChild(new YMapButtonExample(props)); | ||
map.addChild(new YMapDefaultMarker(props)); | ||
``` | ||
@@ -46,23 +46,16 @@ | ||
Just use `ymaps3.import`: | ||
```js | ||
const pkg = await ymaps3.import('@yandex/ymaps3-default-ui-theme'); | ||
``` | ||
By default `ymaps3.import` can load self modules. | ||
If you want also load your package, should add `loader`: | ||
Just use `ymaps3.registerCdn` and `ymaps3.import`: | ||
```js | ||
// Add loader at start loaders array | ||
ymaps3.import.loaders.unshift(async (pkg) => { | ||
// Process only your package | ||
if (!pkg.includes('@yandex/ymaps3-default-ui-theme')) return; | ||
// register in `ymaps3.import` which CDN to take the package from | ||
ymaps3.import.registerCdn( | ||
'https://cdn.jsdelivr.net/npm/{package}', | ||
'@yandex/ymaps3-default-ui-theme@latest' | ||
); | ||
// Load script directly. You can use another CDN | ||
await ymaps3.import.script(`https://unpkg.com/${pkg}/dist/index.js`); | ||
// ... | ||
// Return result object | ||
return window['@yandex/ymaps3-default-ui-theme']; | ||
}); | ||
// import package from CDN | ||
const pkg = await ymaps3.import('@yandex/ymaps3-default-ui-theme'); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
1244477
58