@nika-js/onlymap 0.8.3 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE.md +2 -0
  3. package/README.md +40 -2
  4. package/dist/{LercDecode.es-DW-G7u1_.js → LercDecode.es-BMcxSLhD.js} +1 -1
  5. package/dist/{basemap-C6mTd_uL.js → basemap-m98j2wxG.js} +780 -780
  6. package/dist/cartograph/elements/om-cartograph.d.ts +6 -0
  7. package/dist/cartograph.js +429 -416
  8. package/dist/cartograph.standalone.js +1235 -1222
  9. package/dist/elements/om-map.d.ts +21 -0
  10. package/dist/{geoparquet-CMESy27r.js → geoparquet-XOwOmChh.js} +1 -1
  11. package/dist/html-data.d.ts +1 -1
  12. package/dist/{index-CgpoaR-U.js → index-BMbpftvm.js} +1 -1
  13. package/dist/{index-DgHzTg2n.js → index-BSAY6CWm.js} +12159 -11695
  14. package/dist/index-CfPbQUqO.js +511 -0
  15. package/dist/{index-CrMM0kHK.js → index-DDNElBTs.js} +106 -106
  16. package/dist/{index-FEPpi86V.js → index-DzOvV-O7.js} +25 -25
  17. package/dist/{index-BfL5W1Ay.js → index-HZWdgtm4.js} +36 -36
  18. package/dist/index.d.ts +8 -3
  19. package/dist/{lerc-BQFrOj7h.js → lerc-qK-nhCaB.js} +2 -2
  20. package/dist/license.d.ts +46 -1
  21. package/dist/onlymap.standalone.js +26793 -25831
  22. package/dist/onlymapjs.js +97 -92
  23. package/dist/post-process/catalogue.d.ts +61 -0
  24. package/dist/post-process/compile.d.ts +37 -0
  25. package/dist/post-process/index.d.ts +71 -0
  26. package/dist/post-process/ops.d.ts +22 -0
  27. package/dist/post-process/presets.d.ts +33 -0
  28. package/dist/post-process/validate.d.ts +8 -0
  29. package/dist/programmatic.d.ts +11 -0
  30. package/dist/{raster-6vW4_NSI.js → raster-Dg5p_99H.js} +3 -3
  31. package/dist/{raster-pipeline-CYiGgsil.js → raster-pipeline-DhjkqDYd.js} +1 -1
  32. package/dist/runtime-core.d.ts +39 -1
  33. package/dist/version.d.ts +1 -1
  34. package/dist/{zarr-BNQZpB1t.js → zarr-D3CzK1Zm.js} +2 -2
  35. package/docs/cartograph.md +10 -2
  36. package/docs/effects.md +197 -0
  37. package/llms.txt +3 -2
  38. package/onlymapjs.html-data.json +171 -0
  39. package/package.json +3 -3
  40. package/skills/onlymapjs/SKILL.md +3 -2
  41. package/skills/onlymapjs/references/syntax.md +10 -3
package/CHANGELOG.md CHANGED
@@ -8,6 +8,23 @@ Note: npm collapsed a few closely-spaced releases — the GPX/FlatGeobuf (0.5.4)
8
8
  and GeoParquet (0.5.5) work shipped to npm together as **0.5.6**, so npm's
9
9
  version list jumps 0.5.3 → 0.5.6. Each logical version is listed here regardless.
10
10
 
11
+ ## 0.9.0 — 2026-09-21
12
+
13
+ ### Added
14
+ - **Give a map a printed finish, in one attribute.** `<om-effect preset="vintage">` inside an `<om-map>` treats the rendered frame — warm paper and ink, a pressed edge, paper tooth, a soft vignette. Seven looks ship: `vintage`, `engraved`, `night`, `blueprint`, `riso`, `newsprint` and `muted` (which just calms a busy sheet, with no texture at all). Presets assume the map beneath them is styled to suit; a night plate still needs dark layers.
15
+ - **Turn the knobs instead, when a preset is nearly right.** Every look is built from named operations you can write yourself — `<om-effect op="grain" amount="0.07" size="0.12mm">` — and compose in document order: `tint`, `levels`, `saturation`, `posterize`, `vignette`, `grain`, `edges`, `blur`, `sharpen`, `halftone`. To start from a preset and change one thing, either override a single knob (`<om-effect preset="vintage" grain-amount="0.02">`) or ask for the preset as markup with `OmMap.expandPreset("vintage")` and edit it.
16
+ - **Or bring your own shader.** An `<om-effect>` carrying an inline `<script type="application/json">` shader module is handed to deck.gl untouched, so anything deck's own `PostProcessEffect` can do is available from the document — multiple passes included.
17
+ - **Looks survive the printer.** Sizes are in millimetres (`size="0.12mm"`), so the grain and ink on a 600 dpi export are the same physical texture you tuned on screen rather than four times finer.
18
+ - **`set-effect`** switches the finish live from a behavior or a widget button, and because it writes the document, undo/redo see it like any other edit. A story step can apply it; scrubbing back does not yet undo it.
19
+
20
+ ### Notes
21
+ - An effect treats deck's own frame. With a MapLibre basemap, which is composited underneath, the data layers are treated and the basemap is not — the validator says so, with the fix.
22
+
23
+ ## 0.8.4 — 2026-09-21
24
+
25
+ ### Added
26
+ - **Keep the OnlyMap badge on a paid plan, if you want to.** Removing the attribution badge is something a commercial license *permits*, not something it requires — so `keep-badge` on `<om-map>` (or `OmMap.setKeepBadge(true)`) lifts the free-tier limits while still crediting OnlyMap. The badge then shows the credit without the "free for non-commercial use" sentence, which wouldn't describe a paid deployment. It has no effect on the free plan, where the badge is the license condition rather than a preference. The setting is page-level and can be changed after load; a cartograph's foot credit follows it, and `<om-cartograph keep-badge>` opts a print sheet in on its own.
27
+
11
28
  ## 0.8.3 — 2026-09-18
12
29
 
13
30
  ### Fixed
package/LICENSE.md CHANGED
@@ -35,6 +35,8 @@ The Software is commercial proprietary software.
35
35
 
36
36
  **Commercial use.** Any use other than Non-Commercial Use requires a purchased and maintained valid commercial license from Licensor, unless Licensor has granted Licensee a separate written license.
37
37
 
38
+ **Attribution removal is a permission, not an obligation.** A valid commercial license permits Licensee to remove the Software's on-map attribution; it does not require removal. Licensee may keep the attribution displayed (`keep-badge`, or `OmMap.setKeepBadge(true)`), in which case the Software renders the credit without the Non-Commercial notice, since that notice would not describe Licensee's use.
39
+
38
40
  **Technical limits are a convenience, not the grant.** The Software may enforce technical limits in some execution contexts and not others (for example, limits may be inactive during local development, when loaded from local files, or inside application shells). The presence, absence, or failure of any technical limit does not grant, extend, or modify any license right. In particular, distributing the Software inside a packaged or installable application (desktop, mobile, or otherwise), or any other Commercial use, requires a valid commercial license under this Section 3 regardless of whether technical limits were active.
39
41
 
40
42
  Access to an npm package, repository, package tarball, source archive, or build artifact does not by itself grant any rights beyond the rights expressly granted in this Agreement.
package/README.md CHANGED
@@ -139,7 +139,7 @@ Private endpoints: `OmMap.configureData({ headers, credentials, fetch })` — ap
139
139
 
140
140
  ### Interaction
141
141
 
142
- Built-in actions wire to picks, widget buttons (`data-emit`), or script (`ctx.emit`) with one shared payload contract: `show-overlay`, `hide-overlay`, `show-tooltip`, `hide-tooltip`, `toggle-layer`, `set-pickable` (a runtime popups-on/off switch per layer), `highlight-feature`, `zoom-to-feature`, `filter-layer`, `set-basemap`, `zoom-in`, `zoom-out`, `undo`, `redo` — plus `OmMap.registerAction` for your own.
142
+ Built-in actions wire to picks, widget buttons (`data-emit`), or script (`ctx.emit`) with one shared payload contract: `show-overlay`, `hide-overlay`, `show-tooltip`, `hide-tooltip`, `toggle-layer`, `set-pickable` (a runtime popups-on/off switch per layer), `highlight-feature`, `zoom-to-feature`, `filter-layer`, `set-basemap`, `set-effect`, `zoom-in`, `zoom-out`, `undo`, `redo` — plus `OmMap.registerAction` for your own.
143
143
 
144
144
  Hovering a pickable feature shows a pointer cursor automatically, so recipients can tell a map is interactive without clicking at random (`pick-cursor` on `<om-map>` customizes or disables it). Hover GPU picking is rest-debounced by default — one pick when the pointer stops instead of one per mouse move — which keeps hover popups smooth even on integrated graphics; `hover-pick="continuous|off|<ms>"` tunes it.
145
145
 
@@ -311,12 +311,42 @@ It is deliberately **not** Navisworks. An axis-aligned box test over-reports any
311
311
  **In-browser IFC.** `loadIfc(bytes)` parses an `.ifc` with web-ifc (WASM) and returns a 3D Tiles model held entirely in memory — nothing uploaded, nothing written to disk. Because the output *is* a tileset, per-element picking, styling, `site-*` and isolate/hide/ghost work on it unchanged. It returns `tilesetUrl`/`edgesUrl` blob URLs, the property table, the georeferencing (`lonLat`, `heading`, `scale`, and a `headingSource` that distinguishes a real reading from an assumption), per-phase `timings`, and a `revoke()` you must call when swapping models. web-ifc is MPL-2.0 and is *not* a package dependency — it's dynamic-imported from unpkg on first use, so it never reaches the bundle and pages that never open an IFC pay nothing (measured: the IFC chunk is 8.5 KB gzipped and contains only the URL). **For offline, air-gapped or strict-CSP deployments**, `npm run vendor:web-ifc public/vendor/web-ifc` copies the four files you serve yourself, then `wasm-path="/vendor/web-ifc/"` on the loader — 1.37 MB gzipped of *static assets*, with the JS bundle unchanged. Note that web-ifc is only one network dependency: a georeferenced model also switches a basemap on, so an offline page wants `basemap="none"` and `telemetry="off"` too. See `dev/examples/features/terrain-3d/inspect-a-bim-model.html`.
312
312
  **Georeferencing is declarative too.** `site-origin="[lng, lat]"` (optionally `[lng, lat, elevation]`), `site-heading` (a bearing, degrees clockwise from true north) and `site-scale` place a model from the markup instead of baking a position into the tileset — `site-origin` overrides whatever the root transform carries, and rotation/scale pivot on the model's own anchor so a heading change spins the building about itself. They work on `Tile3DLayer` and on `PathLayer` (whose paths are then local east/north/up metres), which is what lets an IFC mesh and its outline overlay move together. This matters more than it sounds: authoring tools ship a default project location and a default is indistinguishable from a survey — the buildingSMART Medical-Dental Clinic sample carries Revit's Boston default, the Duplex a Chicago city-centre point — while `IfcMapConversion` is absent from most IFC2x3 exports and `TrueNorth` is routinely unset. Being attributes, corrections are undoable and story-steppable rather than a reconversion. Whenever a model resolves anything short of a real `IfcMapConversion` — `IfcSite` coordinates or no georeference at all — `BIMLayer` and `ifc-loader` raise a structured `"warning"` through the same validation channel other `om-layer` errors use (the `validate` on-page panel, `om-validation-error`'s `detail.warnings`), rather than only a status-line sentence a human has to notice; it never fails the map (`valid` stays `true`), it just names the layer and points at `site-origin`/`site-heading` as the fix. See `dev/examples/features/terrain-3d/inspect-a-bim-model.html`.
313
313
 
314
+ ## Print finishes (post-processing)
315
+
316
+ `<om-effect>` children of an `<om-map>` ARE deck.gl's `effects` array, declared as markup — document order is pipeline order. Three lanes, and an element uses exactly one:
317
+
318
+ ```html
319
+ <om-map basemap="none">
320
+ <!-- 1. a named look -->
321
+ <om-effect preset="vintage" grain-amount="0.02"></om-effect>
322
+
323
+ <!-- 2. the knobs it is made of -->
324
+ <om-effect op="tint" paper="#efe4c8" ink="#2b1b10" amount="0.75"></om-effect>
325
+ <om-effect op="grain" amount="0.06" size="0.12mm"></om-effect>
326
+
327
+ <!-- 3. your own shader, handed to deck untouched -->
328
+ <om-effect uniforms='{"strength":0.8}'>
329
+ <script type="application/json">
330
+ {"name":"mine","fs":"…GLSL…","uniformTypes":{"strength":"f32"},"passes":[{"sampler":true}]}
331
+ </script>
332
+ </om-effect>
333
+ </om-map>
334
+ ```
335
+
336
+ Presets: `vintage`, `engraved`, `night`, `blueprint`, `riso`, `newsprint`, `muted`. Ops: `tint`, `levels`, `saturation`, `posterize`, `vignette`, `grain` (pointwise) and `edges`, `blur`, `sharpen`, `halftone` (neighbourhood). A preset is nothing but a saved op list — `OmMap.expandPreset("vintage")` returns it as markup, so "I like this but want less grain" is paste-and-edit rather than read-the-source.
337
+
338
+ **Spatial knobs are in millimetres** (`size="0.12mm"`, `width="0.08mm"`) and resolve against the live pixel density, so a look keeps its physical texture when a cartograph frame captures it at 300 or 600 dpi. A pixel value is a validation error, because it would silently render finer every time the dpi went up.
339
+
340
+ Consecutive pointwise ops compile into a **single** GPU pass; only a neighbourhood op — one that samples its surroundings — costs a pass of its own. `set-effect {preset}` swaps the finish live from a behavior or widget. Guide: [docs/effects.md](docs/effects.md). It writes the document, so undo/redo treat it like any other edit; a story step can apply it, but seeking back does not yet remove an effect a step added (the rewind machinery restores `<om-map>` attributes, and this action adds a child element).
341
+
342
+ An effect runs over deck's own frame. With a MapLibre basemap, which composites underneath, the data layers are treated and the basemap is not — the validator warns and suggests drawing the base as layers with `basemap="none"`.
343
+
314
344
  ## Programmatic surface
315
345
 
316
346
  - **`OmMap.*`** — `validate`, `snapshotIR`, `snapshotDescriptorIR`, `resolveImageOverlay`, `registerLayer`, `registerWidget`, `registerAction`, `registerSource`, `registerFormat`, `registerBasemap`, `configureBasemap`, `configureData`, `configureTelemetry`, `configureLicense`, `getLayerSchema`
317
347
  - **`@nika-js/onlymap/deck`** — the bundled deck.gl classes (`CompositeLayer`, `TileLayer`, …) for building custom layer types: shims must extend the same class hierarchy the core renders with, not a second installed deck.gl copy. Recipe: [docs/custom-layers.md](docs/custom-layers.md)
318
348
  - **On a `<om-map>` element** — `ready` (promise), `flyTo(coords, zoom?)`, `setLayerVisible(id, bool)`, `getLayers()`, `emit(action, payload)`, `snapshot(opts?)` (canvas-only PNG of basemap + layers at device pixels — DOM widgets/overlays and provider attribution are NOT captured, so exports must render credits themselves; `{as: "blob"}` for files, default dataURL); the `om-view-changed` event fires once the camera settles (debounced; `detail` = `{longitude, latitude, zoom, pitch, bearing, origin}`, where `origin` is `"user"` for gesture-driven bursts vs `"programmatic"` for API/story moves — the echo-suppression signal for state sync) — the camera-persistence hook; the `om-map-point` event (`detail = {coordinate: [lng,lat]|null, kind: "click"|"hover"}`) fires on every click/hover with the map coordinate, including empty-map clicks picks discard — the hook for custom capture tools the built-in draw widget doesn't cover; the `om-tileset-load` event (`detail = {layerId, tileset}`) surfaces a `Tile3DLayer`'s live deck `Tileset3D` for tools that need the real tileset (e.g. region export), not the IR; `document.querySelector("om-map")` is fully typed
319
- - **`MapController`** — the framework-grade programmatic front-end (typed `LayerDescriptor`s → the same reconcile core, no DOM manifest): `setLayers`, `watch`, `emit`, camera methods, `injectPick`, `ready`, `snapshot`, `suspend`/`resume`, an `onViewChange(view, origin)` option (the `om-view-changed` twin), plus `onMapPoint` / `onTilesetLoad` options (the `om-map-point` / `om-tileset-load` twins). Active descriptors own reference-counted fetch/poll/socket handles: layer removal, transport-option change, suspend, and destroy release them. Accessor props normally take functions; schema-declared accessors also accept restricted expression strings such as `getPosition: "[$lon, $lat]"`, which makes the descriptor JSON-safe for native/cross-process bridges. `snapshotDescriptorIR(descriptors)` resolves that lane without fetching URL data. The React adapter rides the function form; vanilla/native hosts may use either
349
+ - **`MapController`** — the framework-grade programmatic front-end (typed `LayerDescriptor`s → the same reconcile core, no DOM manifest): `setLayers`, `watch`, `emit`, camera methods, `injectPick`, `ready`, `snapshot`, `setEffects` (deck `Effect` instances, 1:1 — takes precedence over the document's `<om-effect>` chain while set; `null` hands the chain back), `suspend`/`resume`, an `onViewChange(view, origin)` option (the `om-view-changed` twin), plus `onMapPoint` / `onTilesetLoad` options (the `om-map-point` / `om-tileset-load` twins). Active descriptors own reference-counted fetch/poll/socket handles: layer removal, transport-option change, suspend, and destroy release them. Accessor props normally take functions; schema-declared accessors also accept restricted expression strings such as `getPosition: "[$lon, $lat]"`, which makes the descriptor JSON-safe for native/cross-process bridges. `snapshotDescriptorIR(descriptors)` resolves that lane without fetching URL data. The React adapter rides the function form; vanilla/native hosts may use either
320
350
  - **`getStore(token)`** — the external-store contract: per-token `{subscribe, getSnapshot}` stores (`viewport`/`selection`/`layers`/`data:<id>`) with cached immutable plain-data snapshots and `origin` tagging — directly consumable by `useSyncExternalStore` (the React adapter's own hooks ride it), MobX autoruns, Redux listeners, Zustand mirrors. ~20-line integration-tested recipes for Redux Toolkit, MobX/mobx-keystone, Zustand, and Jotai: [docs/external-stores.md](docs/external-stores.md)
321
351
  - **Testing** — `mountForTest`, and imports are SSR-safe (importing in Node/jsdom never touches browser globals)
322
352
 
@@ -333,6 +363,14 @@ A license key lifts all limits and removes the badge:
333
363
  OmMap.configureLicense("om_live_…"); // or once, in code
334
364
  ```
335
365
 
366
+ Removing the badge is a **permission, not a requirement** — if you'd rather keep crediting OnlyMap on a paid plan, `keep-badge` opts back in, and the badge then renders the credit *without* the "free for non-commercial use" sentence, which wouldn't describe your deployment:
367
+
368
+ ```html
369
+ <om-map license-key="om_live_…" keep-badge> <!-- or OmMap.setKeepBadge(true) -->
370
+ ```
371
+
372
+ It has no effect on the free plan, where the badge is the license condition rather than a preference. The setting is page-level — a print sheet's foot credit follows it too, and `<om-cartograph keep-badge>` opts one in on its own (a static sheet has no map runtime to carry the key).
373
+
336
374
  Packaged native hosts can verify an app-scoped key by passing platform-derived identity:
337
375
 
338
376
  ```ts
@@ -19,7 +19,7 @@ async function v(N = {}) {
19
19
  if (n) {
20
20
  const { createRequire: I } = await import(
21
21
  /*webpackIgnore:true*/
22
- "./lerc-BQFrOj7h.js"
22
+ "./lerc-qK-nhCaB.js"
23
23
  ).then((g) => g._);
24
24
  var O = I(import.meta.url);
25
25
  }