@nika-js/onlymap 0.10.5 → 0.10.7

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 (40) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +1 -1
  3. package/dist/{basemap-Q-Hd5jE-.js → basemap-BLkOm29L.js} +2 -2
  4. package/dist/cartograph/elements/om-frame.d.ts +55 -2
  5. package/dist/cartograph/elements/om-source.d.ts +23 -0
  6. package/dist/cartograph/frame-sources.d.ts +64 -0
  7. package/dist/cartograph/live-frame.d.ts +23 -3
  8. package/dist/cartograph.js +1324 -1126
  9. package/dist/cartograph.standalone.js +1805 -1607
  10. package/dist/elements/om-map.d.ts +11 -0
  11. package/dist/{geoparquet-mtTpzfNU.js → geoparquet-DbbUXVXd.js} +1 -1
  12. package/dist/{globe-view-D6a6_ADT.js → globe-view-n8TPYgZe.js} +1 -1
  13. package/dist/{hillshade-CY4PNGum.js → hillshade-B6l8L37H.js} +1 -1
  14. package/dist/{index-BwOC7qcd.js → index-B0tkvD0x.js} +1 -1
  15. package/dist/{index--Zswyzcw.js → index-BLAVlsST.js} +1 -1
  16. package/dist/{index-DUJtvAv2.js → index-Bl4588NA.js} +2 -2
  17. package/dist/{index-D6jtcTK4.js → index-CbOQw_BV.js} +3 -3
  18. package/dist/{index-V-VuBp7C.js → index-Dhx6gjQz.js} +1 -1
  19. package/dist/{index-BhH8ySRp.js → index-NAbQYGbu.js} +3 -3
  20. package/dist/{index-yJEyQjKn.js → index-WHzuElLB.js} +54 -18
  21. package/dist/{index-DwIUeLzW.js → index-mjadez7s.js} +1 -1
  22. package/dist/{index-4z9qUdmz.js → index-sBhuo23e.js} +1 -1
  23. package/dist/{lerc-BdO3Bk6b.js → lerc-C5Oz68We.js} +1 -1
  24. package/dist/onlymap.standalone.js +37 -1
  25. package/dist/onlymapjs.js +1 -1
  26. package/dist/{post-process-effect-DqteD0Gr.js → post-process-effect-D_esTgsv.js} +1 -1
  27. package/dist/{raster-3YBp5u4H.js → raster-9bYuOeFR.js} +3 -3
  28. package/dist/{raster-pipeline-P1v9_jgU.js → raster-pipeline-DxRvTCIO.js} +1 -1
  29. package/dist/runtime-core.d.ts +19 -0
  30. package/dist/{text-on-path-DMUvpyS-.js → text-on-path-BGsF6paj.js} +1 -1
  31. package/dist/version.d.ts +1 -1
  32. package/dist/{zarr-CldzO0mP.js → zarr-aO_vxY6e.js} +2 -2
  33. package/docs/cartograph.md +49 -3
  34. package/docs/design/carto-substrate.md +12 -0
  35. package/docs/design/frame-sources.md +229 -0
  36. package/llms.txt +1 -1
  37. package/onlymapjs.html-data.json +28 -0
  38. package/package.json +1 -1
  39. package/skills/onlymapjs/SKILL.md +3 -2
  40. package/skills/onlymapjs/references/syntax.md +13 -2
@@ -286,6 +286,17 @@ export declare class OmMapElement extends HTMLElementBase {
286
286
  }): Promise<{
287
287
  settled: boolean;
288
288
  }>;
289
+ /**
290
+ * Did this map draw anything — a basemap, rows on any layer, a tile
291
+ * template or a resolved image overlay?
292
+ *
293
+ * Public because a HOST may need to tell "settled and empty" from "settled
294
+ * and drew": `whenSettled()` resolves either way, by design. A cartograph
295
+ * frame uses it to decide that a map document it loaded is not worth
296
+ * showing and to fall through to its next source. Never a quality bar —
297
+ * one drawable thing passes.
298
+ */
299
+ hasDrawableContent(): boolean;
289
300
  /** Test surface: is the determinism switch active on the core (issue #37 — must be true BEFORE the first render when data-om-recording is authored; the basemap adapter reads it in its constructor). */
290
301
  isDeterministicInternal(): boolean;
291
302
  /** What the story-time EffectTrack needs to evaluate legs (om-story builds one when the story clock owns effects — paced stories, determinism). getLayerIRs is a LIVE accessor: reconcile REASSIGNS this.layerIRs, so a captured map reference would go stale after the first reconcile of a run. */
@@ -1,4 +1,4 @@
1
- import { a4 as p, a5 as d } from "./index-yJEyQjKn.js";
1
+ import { a4 as p, a5 as d } from "./index-WHzuElLB.js";
2
2
  function g(t) {
3
3
  if (t == null) return !0;
4
4
  const e = t, n = e.id?.code;
@@ -1,4 +1,4 @@
1
- import { d as L, j as x, a6 as A, a7 as E, a8 as d, a9 as h, aa as u, ab as z, p as V, W as Z, G as D } from "./index-yJEyQjKn.js";
1
+ import { d as L, j as x, a6 as A, a7 as E, a8 as d, a9 as h, aa as u, ab as z, p as V, W as Z, G as D } from "./index-WHzuElLB.js";
2
2
  const c = Math.PI / 180, G = 180 / Math.PI;
3
3
  function w(l, t = 0) {
4
4
  const a = Math.min(180, l) * c;
@@ -1,4 +1,4 @@
1
- import { al as P, am as T, an as N, ao as Z, c as B, ap as E, aq as C, ar as b, as as D, at as I, au as O } from "./index-yJEyQjKn.js";
1
+ import { al as P, am as T, an as N, ao as Z, c as B, ap as E, aq as C, ar as b, as as D, at as I, au as O } from "./index-WHzuElLB.js";
2
2
  import { N as _, c as H } from "./hillshade-apron-Bem3DWyJ.js";
3
3
  import { p as $, h as j, m as A, a as U } from "./hillshade-shader-DI2uLSNU.js";
4
4
  function R(t, e, o) {
@@ -1,4 +1,4 @@
1
- import { aA as B } from "./index-yJEyQjKn.js";
1
+ import { aA as B } from "./index-WHzuElLB.js";
2
2
  const V = /* @__PURE__ */ new Set([
3
3
  "GeoJsonLayer",
4
4
  "PolygonLayer",
@@ -1,4 +1,4 @@
1
- import { bx as Be, by as le, bz as ce, bA as De, bB as Oe, bC as ke } from "./index-yJEyQjKn.js";
1
+ import { bx as Be, by as le, bz as ce, bA as De, bB as Oe, bC as ke } from "./index-WHzuElLB.js";
2
2
  import { y as ve, a as he, z as G, R as J, A as ue, C as Fe, F as xe, n as je, S as Ie, E as Ne } from "./recordbatch-Bpc0uxFn.js";
3
3
  import { g as V, a as fe, b as Le, c as Ue, d as Me, e as qe, m as Ve } from "./table-accessors-CYWTzpQI.js";
4
4
  import { c as $e } from "./convert-arrow-schema-DrAihRf9.js";
@@ -1,5 +1,5 @@
1
- import { aM as R, aN as S, aO as E, aP as N, aQ as h, aR as w, aS as W, aT as O, aU as x, aV as I, aW as B, aX as _, aY as P, aZ as k, a_ as $, a$ as z, b0 as C, b1 as F, b2 as v, b3 as M, b4 as p, b5 as U } from "./index-yJEyQjKn.js";
2
- import { b6 as $e, b7 as ze, b8 as Ce, b9 as ve, ba as Me, bb as Ue, bc as je, bd as De, be as qe, bf as Je, bg as Ve, bh as Ge, bi as He, bj as Qe, bk as Xe, bl as Ye, bm as Ze, bn as Ke, bo as et, bp as tt, bq as nt, br as rt, bs as at, bt as st, bu as ot } from "./index-yJEyQjKn.js";
1
+ import { aM as R, aN as S, aO as E, aP as N, aQ as h, aR as w, aS as W, aT as O, aU as x, aV as I, aW as B, aX as _, aY as P, aZ as k, a_ as $, a$ as z, b0 as C, b1 as F, b2 as v, b3 as M, b4 as p, b5 as U } from "./index-WHzuElLB.js";
2
+ import { b6 as $e, b7 as ze, b8 as Ce, b9 as ve, ba as Me, bb as Ue, bc as je, bd as De, be as qe, bf as Je, bg as Ve, bh as Ge, bi as He, bj as Qe, bk as Xe, bl as Ye, bm as Ze, bn as Ke, bo as et, bp as tt, bq as nt, br as rt, bs as at, bt as st, bu as ot } from "./index-WHzuElLB.js";
3
3
  import { g as j, i as D } from "./table-accessors-CYWTzpQI.js";
4
4
  async function q(t, e, n = {}, r = {}) {
5
5
  const a = R(t), s = S.getWorkerFarm(n), { source: o } = n, c = { name: a, source: o };
@@ -1,6 +1,6 @@
1
- import { ac as j, ad as S, ae as A, af as M, ag as L } from "./index-yJEyQjKn.js";
2
- import { ah as H, ai as V, aj as X, ak as K } from "./index-yJEyQjKn.js";
3
- import { P as h } from "./post-process-effect-DqteD0Gr.js";
1
+ import { ac as j, ad as S, ae as A, af as M, ag as L } from "./index-WHzuElLB.js";
2
+ import { ah as H, ai as V, aj as X, ak as K } from "./index-WHzuElLB.js";
3
+ import { P as h } from "./post-process-effect-D_esTgsv.js";
4
4
  const O = `
5
5
  float omfx_lum(vec3 c) { return dot(c, vec3(0.299, 0.587, 0.114)); }
6
6
  float omfx_hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }
@@ -1,4 +1,4 @@
1
- import { bB as Bt, bM as Xt, bN as Yt, bO as Us } from "./index-yJEyQjKn.js";
1
+ import { bB as Bt, bM as Xt, bN as Yt, bO as Us } from "./index-WHzuElLB.js";
2
2
  import { w as gs, t as Hs, f as Ws, m as Qs } from "./mgrs-BY9bIvp4.js";
3
3
  import { c as Xs } from "./convert-arrow-schema-DrAihRf9.js";
4
4
  import { y as Ys, A as bt, a as Ks, z as Vs, R as Zs } from "./recordbatch-Bpc0uxFn.js";
@@ -1,6 +1,6 @@
1
- import { A as t, a as o, b as i, C as l, c as p, d as n, D as _, e as c, f as g, F as h, L as m, g as L, h as y, i as f, j as w, M as S, k as V, O as b, l as C, m as E, P as I, T as P, n as T, o as M, U as d, V as A, p as O, q as u, W as N, r as k, s as x, t as D, u as G, G as R, v as j, w as W, x as q, y as v, z, B as F, E as U, H as Y, I as B, J as H, K as J, N as K, Q, R as X, S as Z, X as $, Y as aa, Z as sa, _ as ea, $ as ra, a0 as ta, a1 as oa, a2 as ia } from "./index-yJEyQjKn.js";
2
- import { P as s } from "./post-process-effect-DqteD0Gr.js";
3
- import { G as pa, a as na } from "./globe-view-D6a6_ADT.js";
1
+ import { A as t, a as o, b as i, C as l, c as p, d as n, D as _, e as c, f as g, F as h, L as m, g as L, h as y, i as f, j as w, M as S, k as V, O as b, l as C, m as E, P as I, T as P, n as T, o as M, U as d, V as A, p as O, q as u, W as N, r as k, s as x, t as D, u as G, G as R, v as j, w as W, x as q, y as v, z, B as F, E as U, H as Y, I as B, J as H, K as J, N as K, Q, R as X, S as Z, X as $, Y as aa, Z as sa, _ as ea, $ as ra, a0 as ta, a1 as oa, a2 as ia } from "./index-WHzuElLB.js";
2
+ import { P as s } from "./post-process-effect-D_esTgsv.js";
3
+ import { G as pa, a as na } from "./globe-view-n8TPYgZe.js";
4
4
  export {
5
5
  t as AmbientLight,
6
6
  o as Attribute,
@@ -31145,7 +31145,7 @@ const bte = {
31145
31145
  }, vte = {
31146
31146
  match: (t, e) => ["csv", "tsv"].includes(go(t) ?? "") || /text\/(csv|tab-separated-values)/i.test(e ?? ""),
31147
31147
  parse: async (t) => {
31148
- const [e, i, n] = await Promise.all([t.text(), import("./index--Zswyzcw.js"), import("./index-DUJtvAv2.js")]), r = await n.parse(e, i.CSVLoader, { csv: { shape: "object-row-table" } });
31148
+ const [e, i, n] = await Promise.all([t.text(), import("./index-BLAVlsST.js"), import("./index-Bl4588NA.js")]), r = await n.parse(e, i.CSVLoader, { csv: { shape: "object-row-table" } });
31149
31149
  return _te(r.data) ?? r.data;
31150
31150
  }
31151
31151
  };
@@ -31167,7 +31167,7 @@ const xte = {
31167
31167
  parse: async (t, e) => {
31168
31168
  t.body?.cancel().catch(() => {
31169
31169
  });
31170
- const [i, n] = await Promise.all([import("./index-DUJtvAv2.js"), import("./index-V-VuBp7C.js")]), r = t.url || e, s = /* @__PURE__ */ new Map(), o = (m) => {
31170
+ const [i, n] = await Promise.all([import("./index-Bl4588NA.js"), import("./index-Dhx6gjQz.js")]), r = t.url || e, s = /* @__PURE__ */ new Map(), o = (m) => {
31171
31171
  const v = String(m);
31172
31172
  let x = s.get(v);
31173
31173
  return x || (x = TO(v), s.set(v, x)), x.then((C) => C.clone());
@@ -31180,13 +31180,13 @@ const xte = {
31180
31180
  }, wte = {
31181
31181
  match: (t, e) => go(t) === "kml" || /application\/vnd\.google-earth\.kml/i.test(e ?? ""),
31182
31182
  parse: async (t) => {
31183
- const [e, i, n] = await Promise.all([t.text(), import("./index-DUJtvAv2.js"), import("./index-4z9qUdmz.js")]);
31183
+ const [e, i, n] = await Promise.all([t.text(), import("./index-Bl4588NA.js"), import("./index-sBhuo23e.js")]);
31184
31184
  return jl(await i.parse(e, n.KMLLoader));
31185
31185
  }
31186
31186
  }, Cte = /* @__PURE__ */ new Set(["waypoint", "track", "route"]), Ste = {
31187
31187
  match: (t, e) => go(t) === "gpx" || /application\/gpx\+xml/i.test(e ?? ""),
31188
31188
  parse: async (t, e) => {
31189
- const [i, n, r] = await Promise.all([t.text(), import("./index-DUJtvAv2.js"), import("./index-4z9qUdmz.js")]), o = ((await n.parse(i, r.GPXLoader)).features ?? []).map((l) => {
31189
+ const [i, n, r] = await Promise.all([t.text(), import("./index-Bl4588NA.js"), import("./index-sBhuo23e.js")]), o = ((await n.parse(i, r.GPXLoader)).features ?? []).map((l) => {
31190
31190
  const u = l.properties?._gpxType, h = u === "trk" ? "track" : u === "rte" ? "route" : "waypoint";
31191
31191
  return { ...l, properties: { ...l.properties, _gpxKind: h } };
31192
31192
  }), a = e.split("#")[1]?.toLowerCase().replace(/s$/, "");
@@ -31219,7 +31219,7 @@ const xte = {
31219
31219
  t.arrayBuffer(),
31220
31220
  import("./index-BYbMtNVH.js"),
31221
31221
  import("./index-CgPV7QlM.js"),
31222
- import("./geoparquet-mtTpzfNU.js")
31222
+ import("./geoparquet-DbbUXVXd.js")
31223
31223
  ]), o = new Uint8Array(i);
31224
31224
  if (o.length < 8 || o[0] !== 80 || o[1] !== 65 || o[2] !== 82 || o[3] !== 49)
31225
31225
  throw new Error(`data="${e}": not a Parquet file (missing PAR1 magic bytes).`);
@@ -69096,7 +69096,7 @@ cn({
69096
69096
  type: "COGLayer",
69097
69097
  carriesRasterWindow: !0,
69098
69098
  carriesRasterIdentify: !0,
69099
- loadClass: () => import("./raster-3YBp5u4H.js").then((t) => t.r).then((t) => t.OmCOGLayer),
69099
+ loadClass: () => import("./raster-9bYuOeFR.js").then((t) => t.r).then((t) => t.OmCOGLayer),
69100
69100
  props: [
69101
69101
  { attr: "src", kind: "scalar", deckProp: "geotiff", type: "string", required: !0 },
69102
69102
  // COG v2 (issue #13): 1-based band selection — a single band (colormap-
@@ -69132,7 +69132,7 @@ cn({
69132
69132
  });
69133
69133
  cn({
69134
69134
  type: "ZarrLayer",
69135
- loadClass: () => import("./zarr-CldzO0mP.js").then((t) => t.OmZarrLayer),
69135
+ loadClass: () => import("./zarr-aO_vxY6e.js").then((t) => t.OmZarrLayer),
69136
69136
  props: [
69137
69137
  { attr: "src", kind: "scalar", deckProp: "src", type: "string", required: !0 },
69138
69138
  { attr: "variable", kind: "scalar", deckProp: "variable", type: "string" },
@@ -69164,7 +69164,7 @@ cn({
69164
69164
  });
69165
69165
  cn({
69166
69166
  type: "HillshadeLayer",
69167
- loadClass: () => import("./hillshade-CY4PNGum.js").then((t) => t.OmHillshadeLayer),
69167
+ loadClass: () => import("./hillshade-B6l8L37H.js").then((t) => t.OmHillshadeLayer),
69168
69168
  warpsInPlane: !0,
69169
69169
  props: [
69170
69170
  { attr: "src", kind: "scalar", deckProp: "src", type: "string", required: !0 },
@@ -69194,7 +69194,7 @@ cn({
69194
69194
  });
69195
69195
  cn({
69196
69196
  type: "TextOnPathLayer",
69197
- loadClass: () => import("./text-on-path-DMUvpyS-.js").then((t) => t.OmTextOnPathLayer),
69197
+ loadClass: () => import("./text-on-path-BGsF6paj.js").then((t) => t.OmTextOnPathLayer),
69198
69198
  props: [
69199
69199
  { attr: "get-path", kind: "accessor", deckProp: "getPath", type: "string" },
69200
69200
  { attr: "get-text", kind: "accessor", deckProp: "getText", type: "string" },
@@ -82225,7 +82225,7 @@ class R8 {
82225
82225
  `[onlymapjs] basemap="${e}" (Mapbox GL) is not implemented yet in this version — falling back to standalone (no basemap). Use a maplibre-* basemap instead (no token required).`
82226
82226
  );
82227
82227
  else {
82228
- this.mode = "basemap", this.basemapAttr = e, import("./basemap-Q-Hd5jE-.js").then(({ MapLibreBasemapAdapter: s }) => {
82228
+ this.mode = "basemap", this.basemapAttr = e, import("./basemap-BLkOm29L.js").then(({ MapLibreBasemapAdapter: s }) => {
82229
82229
  this.destroyed || i !== this.rendererGeneration || (this.basemap = new s(
82230
82230
  this.parent,
82231
82231
  // this.basemapAttr, not the captured param: a style switch that
@@ -82525,7 +82525,7 @@ class R8 {
82525
82525
  this.postProcess = null, this.applyEffects();
82526
82526
  return;
82527
82527
  }
82528
- import("./index-D6jtcTK4.js").then(({ buildPostProcessEffects: i }) => {
82528
+ import("./index-CbOQw_BV.js").then(({ buildPostProcessEffects: i }) => {
82529
82529
  this.destroyed || this.effectsIR !== e || (this.postProcess = i(e, this.pixelsPerMm()), this.applyEffects());
82530
82530
  });
82531
82531
  }
@@ -82743,6 +82743,29 @@ class R8 {
82743
82743
  basemapIdle() {
82744
82744
  return this.mode === "basemap" && !this.basemap ? !1 : this.basemap?.isIdle?.() ?? !0;
82745
82745
  }
82746
+ /**
82747
+ * Does this map put ANYTHING on screen?
82748
+ *
82749
+ * Not a quality judgement and deliberately not "every layer loaded": one
82750
+ * drawable thing is the whole bar. A sheet whose fifth layer 404s is
82751
+ * degraded, not failed, and a caller that treated it as failed would be
82752
+ * adjudicating cartography, which this cannot do.
82753
+ *
82754
+ * It exists for a caller that must distinguish "loaded and drew nothing"
82755
+ * from "drew" — `<om-frame>`'s ordered sources, where a map document whose
82756
+ * every layer failed to fetch settles successfully with an empty canvas.
82757
+ * `layersReady()` says true there (nothing is still pending) and deck still
82758
+ * lists the layers, each holding `data: []`, so neither answers the
82759
+ * question. The IRs do: an empty `data` is "no rows", by its own contract.
82760
+ *
82761
+ * Counted as drawable: a basemap; rows on any layer; a tile template or an
82762
+ * image overlay, which draw from the network rather than from `data`.
82763
+ */
82764
+ hasDrawableContent() {
82765
+ return this.mode === "basemap" ? !0 : this.lastIRs.some(
82766
+ (e) => (e.data?.length ?? 0) > 0 || e.tileData != null || e.asset?.status === "resolved"
82767
+ );
82768
+ }
82746
82769
  /** deck's own per-layer readiness (async layer/pipeline init) — whenSettled gates on this too; a capture before it is stably missing content (issue #37's flaky first frame). Headless/basemap-pending count as ready. */
82747
82770
  layersReady() {
82748
82771
  const e = this.deck?.getLayers?.() ?? this.basemap?.getDeckLayers?.();
@@ -82843,7 +82866,7 @@ class R8 {
82843
82866
  * than the export failing.
82844
82867
  */
82845
82868
  async captureBand(e, i) {
82846
- const { bandScaleFor: n } = await import("./index-BwOC7qcd.js"), r = n(i);
82869
+ const { bandScaleFor: n } = await import("./index-B0tkvD0x.js"), r = n(i);
82847
82870
  return this.withCapturePixelRatio(r, async () => {
82848
82871
  this.bandIsolation = e ? new Set(e) : null;
82849
82872
  try {
@@ -82865,7 +82888,7 @@ class R8 {
82865
82888
  async resolvedPostProcessPass() {
82866
82889
  const e = this.buildEffects();
82867
82890
  if (e.length === 0) return { present: !1 };
82868
- const { PostProcessEffect: i } = await import("./index-BhH8ySRp.js");
82891
+ const { PostProcessEffect: i } = await import("./index-NAbQYGbu.js");
82869
82892
  for (const n of e)
82870
82893
  if (n instanceof i) {
82871
82894
  const r = n;
@@ -83223,7 +83246,7 @@ class R8 {
83223
83246
  const { width: n, height: r } = i, s = (v) => {
83224
83247
  const x = i.project([v[0], v[1]]);
83225
83248
  return [x[0], x[1]];
83226
- }, o = i.unproject([n / 2, r / 2]), a = i.unproject([n / 2 + 1, r / 2]), l = Math.max(da([o[0], o[1]], [a[0], a[1]]), 1e-9), u = await this.resolvedPostProcessPass(), { serializeToSvg: h } = await import("./index-BwOC7qcd.js"), m = await h(this.lastIRs, {
83249
+ }, o = i.unproject([n / 2, r / 2]), a = i.unproject([n / 2 + 1, r / 2]), l = Math.max(da([o[0], o[1]], [a[0], a[1]]), 1e-9), u = await this.resolvedPostProcessPass(), { serializeToSvg: h } = await import("./index-B0tkvD0x.js"), m = await h(this.lastIRs, {
83227
83250
  width: n,
83228
83251
  height: r,
83229
83252
  project: s,
@@ -83965,7 +83988,7 @@ function k8(t, e, i, n, r, s) {
83965
83988
  if (u) return u;
83966
83989
  const h = `${r}|${l}#${o.length}`;
83967
83990
  if (!Ny.has(h)) {
83968
- const m = import("./index-DwIUeLzW.js").then(async ({ runTransforms: v }) => {
83991
+ const m = import("./index-mjadez7s.js").then(async ({ runTransforms: v }) => {
83969
83992
  mP(a, l, await v(o, e, i, n, r));
83970
83993
  }).catch((v) => {
83971
83994
  console.error(`[onlymapjs] ${r} failed to load the geometry transforms:`, v), mP(a, l, t);
@@ -84193,7 +84216,7 @@ function G8({ layerIRs: t, core: e, mapEl: i, selection: n, history: r, featureT
84193
84216
  }
84194
84217
  };
84195
84218
  }
84196
- const H8 = "0.10.5", DMe = "https://om-api.nika.eco/v1/t", to = { endpoint: DMe };
84219
+ const H8 = "0.10.7", DMe = "https://om-api.nika.eco/v1/t", to = { endpoint: DMe };
84197
84220
  function UMe(t) {
84198
84221
  for (const e of Object.keys(t))
84199
84222
  to[e] = t[e];
@@ -87170,6 +87193,19 @@ class KRe extends _o {
87170
87193
  async whenSettled(e = {}) {
87171
87194
  return await this.ready, this.core ? this.core.whenSettled(e) : { settled: !0 };
87172
87195
  }
87196
+ /**
87197
+ * Did this map draw anything — a basemap, rows on any layer, a tile
87198
+ * template or a resolved image overlay?
87199
+ *
87200
+ * Public because a HOST may need to tell "settled and empty" from "settled
87201
+ * and drew": `whenSettled()` resolves either way, by design. A cartograph
87202
+ * frame uses it to decide that a map document it loaded is not worth
87203
+ * showing and to fall through to its next source. Never a quality bar —
87204
+ * one drawable thing passes.
87205
+ */
87206
+ hasDrawableContent() {
87207
+ return this.core?.hasDrawableContent() ?? !1;
87208
+ }
87173
87209
  /** Test surface: is the determinism switch active on the core (issue #37 — must be true BEFORE the first render when data-om-recording is authored; the basemap adapter reads it in its constructor). */
87174
87210
  isDeterministicInternal() {
87175
87211
  return this.core?.isDeterministic() ?? !1;
@@ -87432,7 +87468,7 @@ class KRe extends _o {
87432
87468
  this.core?.setEffects([]);
87433
87469
  return;
87434
87470
  }
87435
- import("./index-D6jtcTK4.js").then(({ parseEffectEls: i }) => {
87471
+ import("./index-CbOQw_BV.js").then(({ parseEffectEls: i }) => {
87436
87472
  !this.core || !this.isConnected || this.core.setEffects(i(this));
87437
87473
  });
87438
87474
  }
@@ -89243,7 +89279,7 @@ async function CPe(t) {
89243
89279
  e(t);
89244
89280
  }
89245
89281
  async function DIe() {
89246
- return import("./raster-3YBp5u4H.js").then((t) => t.r);
89282
+ return import("./raster-9bYuOeFR.js").then((t) => t.r);
89247
89283
  }
89248
89284
  const SPe = {
89249
89285
  registerLayer: cn,
@@ -1,4 +1,4 @@
1
- import { aB as tt, aC as et, aD as j, at as nt, au as ot, aE as B, aF as rt, aG as U, aq as st, ar as _, aH as C, aI as it } from "./index-yJEyQjKn.js";
1
+ import { aB as tt, aC as et, aD as j, at as nt, au as ot, aE as B, aF as rt, aG as U, aq as st, ar as _, aH as C, aI as it } from "./index-WHzuElLB.js";
2
2
  const J = Math.PI / 180, T = tt * J;
3
3
  function Q(t, r) {
4
4
  const n = Math.max(Math.cos(r * J), 1e-6);
@@ -1,4 +1,4 @@
1
- import { bv as _t, bw as Ct } from "./index-yJEyQjKn.js";
1
+ import { bv as _t, bw as Ct } from "./index-WHzuElLB.js";
2
2
  function Yt(e, r, t = 2, i, o = "xy") {
3
3
  const s = r && r.length, l = s ? r[0] * t : e.length;
4
4
  let c = Ut(e, 0, l, t, !0, i && i[0], o);
@@ -1,4 +1,4 @@
1
- import { C as o, D as s } from "./raster-3YBp5u4H.js";
1
+ import { C as o, D as s } from "./raster-9bYuOeFR.js";
2
2
  var t;
3
3
  (function(e) {
4
4
  e[e.None = 0] = "None", e[e.Deflate = 1] = "Deflate", e[e.Zstd = 2] = "Zstd";
@@ -95378,6 +95378,29 @@ class oyA {
95378
95378
  basemapIdle() {
95379
95379
  return this.mode === "basemap" && !this.basemap ? !1 : this.basemap?.isIdle?.() ?? !0;
95380
95380
  }
95381
+ /**
95382
+ * Does this map put ANYTHING on screen?
95383
+ *
95384
+ * Not a quality judgement and deliberately not "every layer loaded": one
95385
+ * drawable thing is the whole bar. A sheet whose fifth layer 404s is
95386
+ * degraded, not failed, and a caller that treated it as failed would be
95387
+ * adjudicating cartography, which this cannot do.
95388
+ *
95389
+ * It exists for a caller that must distinguish "loaded and drew nothing"
95390
+ * from "drew" — `<om-frame>`'s ordered sources, where a map document whose
95391
+ * every layer failed to fetch settles successfully with an empty canvas.
95392
+ * `layersReady()` says true there (nothing is still pending) and deck still
95393
+ * lists the layers, each holding `data: []`, so neither answers the
95394
+ * question. The IRs do: an empty `data` is "no rows", by its own contract.
95395
+ *
95396
+ * Counted as drawable: a basemap; rows on any layer; a tile template or an
95397
+ * image overlay, which draw from the network rather than from `data`.
95398
+ */
95399
+ hasDrawableContent() {
95400
+ return this.mode === "basemap" ? !0 : this.lastIRs.some(
95401
+ (A) => (A.data?.length ?? 0) > 0 || A.tileData != null || A.asset?.status === "resolved"
95402
+ );
95403
+ }
95381
95404
  /** deck's own per-layer readiness (async layer/pipeline init) — whenSettled gates on this too; a capture before it is stably missing content (issue #37's flaky first frame). Headless/basemap-pending count as ready. */
95382
95405
  layersReady() {
95383
95406
  const A = this.deck?.getLayers?.() ?? this.basemap?.getDeckLayers?.();
@@ -96828,7 +96851,7 @@ function dyA({ layerIRs: e, core: A, mapEl: t, selection: i, history: r, feature
96828
96851
  }
96829
96852
  };
96830
96853
  }
96831
- const fyA = "0.10.5", T0e = "https://om-api.nika.eco/v1/t", Vu = { endpoint: T0e };
96854
+ const fyA = "0.10.7", T0e = "https://om-api.nika.eco/v1/t", Vu = { endpoint: T0e };
96832
96855
  function P0e(e) {
96833
96856
  for (const A of Object.keys(e))
96834
96857
  Vu[A] = e[A];
@@ -99805,6 +99828,19 @@ class Xpe extends LE {
99805
99828
  async whenSettled(A = {}) {
99806
99829
  return await this.ready, this.core ? this.core.whenSettled(A) : { settled: !0 };
99807
99830
  }
99831
+ /**
99832
+ * Did this map draw anything — a basemap, rows on any layer, a tile
99833
+ * template or a resolved image overlay?
99834
+ *
99835
+ * Public because a HOST may need to tell "settled and empty" from "settled
99836
+ * and drew": `whenSettled()` resolves either way, by design. A cartograph
99837
+ * frame uses it to decide that a map document it loaded is not worth
99838
+ * showing and to fall through to its next source. Never a quality bar —
99839
+ * one drawable thing passes.
99840
+ */
99841
+ hasDrawableContent() {
99842
+ return this.core?.hasDrawableContent() ?? !1;
99843
+ }
99808
99844
  /** Test surface: is the determinism switch active on the core (issue #37 — must be true BEFORE the first render when data-om-recording is authored; the basemap adapter reads it in its constructor). */
99809
99845
  isDeterministicInternal() {
99810
99846
  return this.core?.isDeterministic() ?? !1;
package/dist/onlymapjs.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bP as e, bQ as r, bR as t, as as c, C as o, bS as i, c as n, bT as d, bU as l, bV as S, bW as E, ah as g, bX as L, bY as T, bZ as _, b_ as A, b$ as p, c0 as m, c1 as I, c2 as D, L as M, g as u, c3 as b, c4 as y, c5 as f, c6 as O, c7 as P, bE as R, c8 as C, ap as N, c9 as F, aB as h, ca as B, W as v, cb as x, aA as G, cc as U, cd as W, ce as w, cf as Y, cg as k, ch as X, ci as H, cj as K, ck as V, cl as j, cm as z, cn as J, co as q, cp as Q, cq as Z, cr as $, ak as aa, cs as sa, ct as ea, cu as ra, cv as ta, cw as ca, cx as oa, cy as ia, cz as na, cA as da, cB as la, cC as Sa, cD as Ea, aq as ga, cE as La, cF as Ta, ae as _a, cG as Aa, cH as pa, cI as ma, cJ as Ia, cK as Da, cL as Ma, cM as ua, cN as ba, cO as ya, cP as fa, cQ as Oa, cR as Pa, cS as Ra, cT as Ca, cU as Na, cV as Fa, cW as ha, cX as Ba, cY as va, cZ as xa, c_ as Ga, c$ as Ua, d0 as Wa, d1 as wa, d2 as Ya, d3 as ka, d4 as Xa, d5 as Ha, d6 as Ka, aC as Va, d7 as ja, d8 as za, d9 as Ja, da as qa, db as Qa, dc as Za, dd as $a, de as as, df as ss, dg as es, dh as rs, di as ts, dj as cs, dk as os, dl as is, dm as ns, dn as ds } from "./index-yJEyQjKn.js";
1
+ import { bP as e, bQ as r, bR as t, as as c, C as o, bS as i, c as n, bT as d, bU as l, bV as S, bW as E, ah as g, bX as L, bY as T, bZ as _, b_ as A, b$ as p, c0 as m, c1 as I, c2 as D, L as M, g as u, c3 as b, c4 as y, c5 as f, c6 as O, c7 as P, bE as R, c8 as C, ap as N, c9 as F, aB as h, ca as B, W as v, cb as x, aA as G, cc as U, cd as W, ce as w, cf as Y, cg as k, ch as X, ci as H, cj as K, ck as V, cl as j, cm as z, cn as J, co as q, cp as Q, cq as Z, cr as $, ak as aa, cs as sa, ct as ea, cu as ra, cv as ta, cw as ca, cx as oa, cy as ia, cz as na, cA as da, cB as la, cC as Sa, cD as Ea, aq as ga, cE as La, cF as Ta, ae as _a, cG as Aa, cH as pa, cI as ma, cJ as Ia, cK as Da, cL as Ma, cM as ua, cN as ba, cO as ya, cP as fa, cQ as Oa, cR as Pa, cS as Ra, cT as Ca, cU as Na, cV as Fa, cW as ha, cX as Ba, cY as va, cZ as xa, c_ as Ga, c$ as Ua, d0 as Wa, d1 as wa, d2 as Ya, d3 as ka, d4 as Xa, d5 as Ha, d6 as Ka, aC as Va, d7 as ja, d8 as za, d9 as Ja, da as qa, db as Qa, dc as Za, dd as $a, de as as, df as ss, dg as es, dh as rs, di as ts, dj as cs, dk as os, dl as is, dm as ns, dn as ds } from "./index-WHzuElLB.js";
2
2
  export {
3
3
  e as ALL_POSITION_VALUES,
4
4
  r as AUDIT_EXEMPTIONS,
@@ -1,4 +1,4 @@
1
- import { av as m, aw as h, ax as P, ay as S, az as C } from "./index-yJEyQjKn.js";
1
+ import { av as m, aw as h, ax as P, ay as S, az as C } from "./index-WHzuElLB.js";
2
2
  const x = (
3
3
  /* wgsl */
4
4
  `struct VertexInputs {
@@ -1,7 +1,7 @@
1
- import { c as se, t as $e, i as Ct, a as ke, s as Lt, C as It, b as Gt, F as vt, A as Et, d as Ft, R as ye, e as At, p as jt, m as Rt, f as Mt, g as We, h as Ut, r as le, j as Ot, k as xt, l as Kt, n as Dt } from "./raster-pipeline-P1v9_jgU.js";
1
+ import { c as se, t as $e, i as Ct, a as ke, s as Lt, C as It, b as Gt, F as vt, A as Et, d as Ft, R as ye, e as At, p as jt, m as Rt, f as Mt, g as We, h as Ut, r as le, j as Ot, k as xt, l as Kt, n as Dt } from "./raster-pipeline-DxRvTCIO.js";
2
2
  import { N as Nt, c as zt } from "./hillshade-apron-Bem3DWyJ.js";
3
3
  import { r as Bt } from "./hillshade-shader-DI2uLSNU.js";
4
- import { bK as _t, bL as $t } from "./index-yJEyQjKn.js";
4
+ import { bK as _t, bL as $t } from "./index-WHzuElLB.js";
5
5
  import we from "./index-CW1n5LdO.js";
6
6
  function kt(e, t) {
7
7
  const n = e.length / 3, r = new Uint8ClampedArray(n * 4), o = 0, i = n, a = n * 2;
@@ -1072,7 +1072,7 @@ j.set(f.Zstd, () => import("./zstd-jXobGRcq.js").then((e) => e.decode));
1072
1072
  j.set(f.Jpeg, () => Promise.resolve(ce));
1073
1073
  j.set(f.Jpeg6, () => Promise.resolve(ce));
1074
1074
  j.set(f.Webp, () => Promise.resolve(ce));
1075
- j.set(f.Lerc, () => import("./lerc-BdO3Bk6b.js").then((e) => e.decode));
1075
+ j.set(f.Lerc, () => import("./lerc-C5Oz68We.js").then((e) => e.decode));
1076
1076
  async function ue(e, t, n) {
1077
1077
  const r = j.get(t);
1078
1078
  if (!r)
@@ -1,5 +1,5 @@
1
1
  import { w as he } from "./mgrs-BY9bIvp4.js";
2
- import { a3 as de, bD as fe, bE as re, c as oe, bF as me, G as pe, bG as ge, aK as Z, bH as ve, N as be, bI as xe, bJ as Pe, al as Te, ap as ie } from "./index-yJEyQjKn.js";
2
+ import { a3 as de, bD as fe, bE as re, c as oe, bF as me, G as pe, bG as ge, aK as Z, bH as ve, N as be, bI as xe, bJ as Pe, al as Te, ap as ie } from "./index-WHzuElLB.js";
3
3
  import { p as ye, a as Le, h as we } from "./hillshade-shader-DI2uLSNU.js";
4
4
  function Oe(n, e, t) {
5
5
  const { projectedCorners: s } = e, { topLeft: r, topRight: o, bottomRight: i, bottomLeft: a } = s, c = t(r[0], r[1]), u = t(o[0], o[1]), l = t(i[0], i[1]), d = t(a[0], a[1]), f = [
@@ -685,6 +685,25 @@ export declare class RuntimeCore {
685
685
  */
686
686
  /** The basemap's own settle state (style + tiles for the current view) — true when standalone/headless. NOT vacuously true while a basemap-mode adapter is absent (initial chunk load, a determinism-flip remount): a settle or paced gate polling that window must hold until the mount lands, not capture a frame with no basemap canvas. */
687
687
  basemapIdle(): boolean;
688
+ /**
689
+ * Does this map put ANYTHING on screen?
690
+ *
691
+ * Not a quality judgement and deliberately not "every layer loaded": one
692
+ * drawable thing is the whole bar. A sheet whose fifth layer 404s is
693
+ * degraded, not failed, and a caller that treated it as failed would be
694
+ * adjudicating cartography, which this cannot do.
695
+ *
696
+ * It exists for a caller that must distinguish "loaded and drew nothing"
697
+ * from "drew" — `<om-frame>`'s ordered sources, where a map document whose
698
+ * every layer failed to fetch settles successfully with an empty canvas.
699
+ * `layersReady()` says true there (nothing is still pending) and deck still
700
+ * lists the layers, each holding `data: []`, so neither answers the
701
+ * question. The IRs do: an empty `data` is "no rows", by its own contract.
702
+ *
703
+ * Counted as drawable: a basemap; rows on any layer; a tile template or an
704
+ * image overlay, which draw from the network rather than from `data`.
705
+ */
706
+ hasDrawableContent(): boolean;
688
707
  /** deck's own per-layer readiness (async layer/pipeline init) — whenSettled gates on this too; a capture before it is stably missing content (issue #37's flaky first frame). Headless/basemap-pending count as ready. */
689
708
  layersReady(): boolean;
690
709
  /**
@@ -1,4 +1,4 @@
1
- import { c as E, a3 as N } from "./index-yJEyQjKn.js";
1
+ import { c as E, a3 as N } from "./index-WHzuElLB.js";
2
2
  const z = Math.PI / 180, O = 45, W = 24, T = /* @__PURE__ */ new Map();
3
3
  let b = null;
4
4
  function I(e) {
package/dist/version.d.ts CHANGED
@@ -5,4 +5,4 @@
5
5
  * the build rootDir, and a `define` would need repeating across vite/vitest/
6
6
  * vite-node configs.
7
7
  */
8
- export declare const LIBRARY_VERSION = "0.10.5";
8
+ export declare const LIBRARY_VERSION = "0.10.7";
@@ -1,5 +1,5 @@
1
- import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, k as pr, l as mr } from "./raster-pipeline-P1v9_jgU.js";
2
- import { c as gr } from "./index-yJEyQjKn.js";
1
+ import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, k as pr, l as mr } from "./raster-pipeline-DxRvTCIO.js";
2
+ import { c as gr } from "./index-WHzuElLB.js";
3
3
  import $t from "./index-CW1n5LdO.js";
4
4
  var Et;
5
5
  function h(e, t, n) {
@@ -22,8 +22,8 @@ to PDF at true page size via CSS `@page` and exports PNG/JPEG at print DPI throu
22
22
  <html>
23
23
  <head>
24
24
  <meta charset="utf-8">
25
- <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.10.5/dist/cartograph.standalone.js"></script>
26
- <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.10.5/dist/cartograph.css">
25
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.10.7/dist/cartograph.standalone.js"></script>
26
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.10.7/dist/cartograph.css">
27
27
  </head>
28
28
  <body>
29
29
  <om-cartograph cartograph-id="cg-lot-12" format="cartograph/2" size="A4" theme="minimal"
@@ -78,7 +78,8 @@ The authoritative attribute lists (with editor IntelliSense) are generated from
78
78
  | Element | Purpose | Status |
79
79
  |---|---|---|
80
80
  | `<om-cartograph>` | Page root: `cartograph-id`, `format="cartograph/2"`, `size` (A5–A0/Letter/Legal) or `width`/`height` (mm), `orientation`, `theme`, `title`, `attribution`; print controls `bleed`, `crop-marks`, `safe-zone`, `dpi`, `flatten`, `color-profile`; `cvd`; `allow-url-actions` | implemented |
81
- | `<om-frame>` | A placed map. `mode="static"`: a georeferenced `<img>` child placed by `crs` + `corners`. `mode="live"` (the default): mounts `<om-map>` from `src=` or an inline child with the frame's own `center/zoom/bearing/pitch`; `overview-of` draws another frame's footprint | implemented |
81
+ | `<om-frame>` | A placed map. `mode="static"`: a georeferenced `<img>` child placed by `crs` + `corners`. `mode="live"` (the default): mounts `<om-map>` from `src=`, an `<om-source>` child or an inline child with the frame's own `center/zoom/bearing/pitch`; `overview-of` draws another frame's footprint | implemented |
82
+ | `<om-source>` | One place a frame's picture may come from — `src` (a map document `.html`, or a capture image), plus `corners`/`crs`/`crs-def` for a capture. A frame tries its sources in document order and shows the first that renders | implemented |
82
83
  | `<om-text>` | Text block — `kind` (title/text/attribution), `font-size` (pt), `weight`, `align`, `font`, `color`, `bg`; body may use `{{tokens}}` | implemented |
83
84
  | `<om-scalebar>` | Scale bar — `for`, `units` (metric/imperial/nautical), `segments`, `segment-length`, `kind` (single/double/line/ticks) | implemented |
84
85
  | `<om-north>` | North indicator — `for`, `kind` (arrow/rose). Direction is derived from the frame's georeference | implemented |
@@ -158,6 +159,51 @@ A live frame mounts the real map runtime with the FRAME's own camera:
158
159
  `om-frame-error`; a failed frame shows a visible inline placeholder rather than an empty
159
160
  box, which on a printed page is indistinguishable from a design choice.
160
161
 
162
+ ## Ordered sources
163
+
164
+ `src=` names one place the picture comes from and assumes it works. That holds in the app
165
+ that wrote the sheet and essentially nowhere else: a relative path into a host's storage
166
+ and a host-local protocol for the layer data are both app-local, so the same file opened
167
+ elsewhere mounts a map with zero drawable layers and *reports success*. The frame looks
168
+ like a blank box surrounded by correct furniture.
169
+
170
+ A frame can therefore declare several sources and show the first that **renders**:
171
+
172
+ ```html
173
+ <om-frame id="main" x="15" y="41" w="255" h="155" center="[-96, 38]" zoom="3.25">
174
+ <om-source src="../maps/map-abc.html"></om-source>
175
+ <om-source src="captures/main@2x.png"
176
+ corners="[[-126,50],[-66,50],[-66,23],[-126,23]]" crs="EPSG:5070"></om-source>
177
+ </om-frame>
178
+ ```
179
+
180
+ - **`src=` on the frame is shorthand** for the first `<om-source src=>`, so every existing
181
+ document keeps working and the common case stays one line. Writing both is fine: the
182
+ frame's `src=` is tried first, then each `<om-source>` in document order. An inline
183
+ `<om-map>` child always outranks both — the author put the map *in* the frame.
184
+ - **One attribute, `src`, for both kinds.** The kind is read from the extension (`.html`
185
+ is a map document; `.png`/`.jpg`/`.jpeg`/`.webp`/`.avif`/`.gif`/`.svg` is a capture).
186
+ An unrecognised extension is a validation error naming both, never a silent guess.
187
+ - **"Rendered" means one drawable thing**, checked after the map settles: a basemap, or
188
+ rows on any layer, or a tile template. Deliberately not "every layer loaded" — a sheet
189
+ whose fifth layer 404s is degraded, not failed, and swapping it for a stale capture
190
+ would be worse than showing it.
191
+ - **A capture carries its own `corners` (and `crs`)**, because when the capture is what
192
+ gets shown the live map did not load and its projection is unknowable. The corners are
193
+ required on a capture source and are what furniture is placed against.
194
+ - **The frame says which source it settled on** — `data-om-carto-source="<index>"` plus an
195
+ `om-frame-source` event (`{ id, index, kind, src }`). A capture shown silently is its own
196
+ trap: an editor should be able to report "showing a capture". `om-frame-view` fires too,
197
+ so the graticule, scale bar and north arrow re-place against the new georeference.
198
+ - A source that fails by drawing nothing costs a full settle before the next is tried (up
199
+ to the existing 20 s timeout). That is paid once, on a stored file; in the app the first
200
+ source succeeds and the mechanism costs nothing.
201
+
202
+ **A stored sheet is renderable in place, not portable.** Capture paths are relative, so
203
+ moving the file alone breaks them exactly as it already breaks a relative `src=`. Export is
204
+ what produces a file that survives being sent to someone — it inlines the map and embeds
205
+ the rasters.
206
+
161
207
  ### Export and print resolution
162
208
 
163
209
  `renderCartograph()` and `print()` capture each live frame through the core's
@@ -949,6 +949,18 @@ Two other designs are in flight against this codebase — **layer extensions**
949
949
  They were written independently and they touch this one in six places. Recording the
950
950
  interactions here so none of them is discovered by a failing gate.
951
951
 
952
+ ### 13.0 Frame sources — `frame-sources.md`
953
+
954
+ Written later, and it touches §7 in one place. `freeze()` converts a live frame to a
955
+ static one and stamps `corners` + `crs`; that georef contract is reused there for a
956
+ RASTER SOURCE on a frame that is still live, rather than a second contract being
957
+ invented. Freeze remains the only way a frame stops being live.
958
+
959
+ The motivating failure is worth recording here because it is invisible from this
960
+ document: a sheet's live `src` resolves outside the host app and the map it names then
961
+ draws nothing, because its layers are on a host-local protocol. The failure is silent,
962
+ so anything hung off an error path never fires.
963
+
952
964
  ### 13.1 The rasterise trigger is a post-process pass, by type
953
965
 
954
966
  The sharpest one, and it has a wrong answer on each side.