@owl-plantation/owlcore
v0.1.4
Published
Owl Plantation core library - modular utilities and components
Maintainers
Readme
@owl-plantation/owlcore
Owl Core - Modular utilities and components for Owl Plantation projects.
A growing library with multiple sub-modules for maps, utilities, and components.
Installation
npm install @owl-plantation/owlcoreUsage
NPM / Bundler (Vite, Webpack, Rollup)
Import from main entry (tree-shaking friendly)
import { MapManager } from '@owl-plantation/owlcore';
const manager = new MapManager('google', 'map', {
apiKey: 'YOUR_API_KEY',
mapId: 'YOUR_MAP_ID',
centerPoint: { lat: -6.2, lng: 106.8 }
});
await manager.init();Import sub-modules directly
// Map module
import { MapManager, GoogleMapsAdapter } from '@owl-plantation/owlcore/map';
// Window module
import { WindowManager } from '@owl-plantation/owlcore/window';CDN via <script> tag (IIFE)
<script src="https://cdn.jsdelivr.net/npm/@owl-plantation/owlcore/dist/owlcore.iife.js"></script>
<script>
// Access via global `OwlCore` object
const manager = new OwlCore.MapManager('google', 'map', {
apiKey: 'YOUR_API_KEY',
mapId: 'YOUR_MAP_ID',
centerPoint: { lat: -6.2, lng: 106.8 }
});
manager.init();
</script>CDN via ES Module import
<script type="module">
import { MapManager } from 'https://cdn.jsdelivr.net/npm/@owl-plantation/owlcore/dist/owlcore.esm.js';
const manager = new MapManager('google', 'map', {
apiKey: 'YOUR_API_KEY',
mapId: 'YOUR_MAP_ID',
centerPoint: { lat: -6.2, lng: 106.8 }
});
await manager.init();
</script>Import map (clean URLs)
<script type="importmap">
{
"imports": {
"@owl-plantation/owlcore": "https://cdn.jsdelivr.net/npm/@owl-plantation/owlcore/dist/owlcore.esm.js",
"@svgdotjs/svg.js": "https://cdn.jsdelivr.net/npm/@svgdotjs/svg.js@3/dist/svg.min.js"
}
}
</script>
<script type="module">
import { MapManager } from '@owl-plantation/owlcore';
// use as normal...
</script>Available Modules
Map (@owl-plantation/owlcore/map)
import { MapManager, GoogleMapsAdapter, LeafletAdapter, MapPublicControll, MapActionController, CoordMapType } from '@owl-plantation/owlcore/map';Window (@owl-plantation/owlcore/window)
import { WindowManager } from '@owl-plantation/owlcore/window';More modules coming soon
utils- Utility functionscomponents- Reusable UI components
Development
# Install dependencies
npm install
# Build
npm run build
# Watch mode
npx rollup -c --watchContributing
Contributions are welcome! Please open an issue or PR at GitHub.
License
MIT © Owl Plantation
