@nika-js/onlymap 0.4.4 → 0.5.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 (39) hide show
  1. package/README.md +10 -7
  2. package/THIRD-PARTY-LICENSES.md +2 -2
  3. package/bin/onlymapjs.mjs +14 -1
  4. package/dist/{LercDecode.es-CgN9Gb9e.js → LercDecode.es-B-OFS9hR.js} +1 -1
  5. package/dist/{basemap-Bfn5Z__c.js → basemap-CXVNH22A.js} +3 -3
  6. package/dist/cityjson-urQeujQv.js +407 -0
  7. package/dist/cityjson.d.ts +138 -0
  8. package/dist/data-layer.d.ts +10 -0
  9. package/dist/elements/om-map.d.ts +70 -0
  10. package/dist/{index-lXrP3rPo.js → index-BonJP_St.js} +1 -1
  11. package/dist/index-CW1n5LdO.js +4006 -0
  12. package/dist/{index-CnitG1VX.js → index-CjZMcGou.js} +2 -2
  13. package/dist/{index-M8KfTTol.js → index-DE7T4lfa.js} +1 -1
  14. package/dist/{index-KgO0MBqA.js → index-DiYFebYs.js} +11514 -11259
  15. package/dist/{index-C4cWRigY.js → index-DuY3Zn6r.js} +1 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/layer-registry.d.ts +22 -0
  18. package/dist/{lerc-l-QFh62d.js → lerc-BhtFlCQ3.js} +2 -2
  19. package/dist/license.d.ts +34 -8
  20. package/dist/onlymap.standalone.js +23608 -22941
  21. package/dist/onlymapjs.js +69 -65
  22. package/dist/programmatic.d.ts +4 -0
  23. package/dist/quota-notice.d.ts +43 -0
  24. package/dist/raster-BpVAEzbU.js +4842 -0
  25. package/dist/react.js +162 -161
  26. package/dist/runtime-core.d.ts +9 -0
  27. package/dist/testing.d.ts +6 -0
  28. package/dist/version.d.ts +1 -1
  29. package/dist/widget-layout.d.ts +20 -0
  30. package/docs/3d-assets.md +99 -1
  31. package/docs/testing.md +4 -2
  32. package/llms.txt +2 -2
  33. package/onlymapjs.html-data.json +12 -8
  34. package/package.json +3 -2
  35. package/skills/onlymapjs/SKILL.md +4 -2
  36. package/skills/onlymapjs/references/patterns.md +4 -0
  37. package/skills/onlymapjs/references/syntax.md +70 -17
  38. package/skills/onlymapjs/references/testing.md +2 -1
  39. package/dist/raster-BBA_oI-d.js +0 -8843
@@ -1,4 +1,4 @@
1
- import { ai as Bt, ak as Xt, al as Yt, am as Us } from "./index-KgO0MBqA.js";
1
+ import { ai as Bt, av as Xt, aw as Yt, ax as Us } from "./index-DiYFebYs.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";
package/dist/index.d.ts CHANGED
@@ -58,7 +58,7 @@ export type { Entitlements } from "./license";
58
58
  export type { RuntimeContext } from "./ctx";
59
59
  export { MapController, descriptorToIR } from "./programmatic";
60
60
  export type { LayerDescriptor, MapControllerOptions, CameraState, OverlayPositioner, PickListener } from "./programmatic";
61
- export { MANAGED_SLOTS, LEGACY_POSITION_ALIASES, ALL_POSITION_VALUES, FOLD_SIDES, resolveSlot, slotLayout, slotContainerStyle, foldSideForSlot, foldToggleSlot, foldDrawerStyle, foldPanelStyle, foldToggleStyle, parseWidgetStyle, WIDGET_STYLE_KEY_NAMES, } from "./widget-layout";
61
+ export { MANAGED_SLOTS, LEGACY_POSITION_ALIASES, ALL_POSITION_VALUES, FOLD_SIDES, resolveSlot, slotLayout, slotContainerStyle, foldSideForSlot, foldToggleSlot, foldDrawerStyle, foldPanelStyle, foldToggleStyle, resolveFoldBreakpointPx, shouldFoldAtWidth, DEFAULT_FOLD_BREAKPOINT_PX, FOLD_HYSTERESIS_PX, parseWidgetStyle, WIDGET_STYLE_KEY_NAMES, } from "./widget-layout";
62
62
  export type { ManagedSlot, WidgetSlot, FoldSide, SlotLayout, WidgetStyleParse } from "./widget-layout";
63
63
  export { auditLayout, settleLayout, DEFAULT_AUDIT_WIDTHS, EDGE_TOLERANCE_PX, AUDIT_EXEMPTIONS } from "./layout-audit";
64
64
  export type { LayoutAuditPage, LayoutDiagnostic, AuditOptions } from "./layout-audit";
@@ -10,6 +10,20 @@ export interface PropDescriptor {
10
10
  type?: "string" | "number" | "boolean" | "json" | "color";
11
11
  required?: boolean;
12
12
  default?: unknown;
13
+ /**
14
+ * Only for kind: "accessor" — a `$field`-style expression compiled and
15
+ * used AS the accessor when the author writes no `attr` at all (a true
16
+ * zero-attribute default, not a fallback VALUE the way scalar `default`
17
+ * is). Compiled through the exact same accessorCache path an authored
18
+ * attribute would take, so it gets real updateTriggers/caching and — for
19
+ * a `*Color`-named deckProp — the same hex-string-to-RGB conversion. An
20
+ * authored `attr` always wins; this only fills the gap when absent. Keep
21
+ * the field name itself data-agnostic/reserved (e.g. `$fill_color`), not
22
+ * tied to one data format, so the layer schema stays format-agnostic —
23
+ * whichever DataFormat populates that field gets the free default, not
24
+ * just the one that motivated adding it (CityJSON surfaces mode).
25
+ */
26
+ defaultExpr?: string;
13
27
  /** Only for kind: "shorthand" — the deckProp it expands to when no accessor overrides it. */
14
28
  shorthandFor?: string;
15
29
  }
@@ -28,6 +42,14 @@ export interface LayerSchema {
28
42
  props: PropDescriptor[];
29
43
  /** Hand-authored (curated, ~15) vs. runtime-derived from defaultProps (HU1 tiering). */
30
44
  tier: "curated" | "auto-derived";
45
+ /**
46
+ * Carries a deck `Tileset3D` and supports the `onTilesetLoad` deck prop
47
+ * (spec: "Consumer map events / om-tileset-load") — the runtime injects
48
+ * the tileset-load hook only into these types. Declared HERE, at
49
+ * registration, rather than a name-matched set in runtime-core (the
50
+ * `compact`/`neverHides` widget-flag precedent — one source of truth).
51
+ */
52
+ carriesTileset?: boolean;
31
53
  }
32
54
  export declare function registerLayer(schema: Omit<LayerSchema, "tier"> & {
33
55
  tier?: LayerSchema["tier"];
@@ -1,4 +1,4 @@
1
- import { C as a, D as s } from "./raster-BBA_oI-d.js";
1
+ import { C as a, D as s } from "./raster-BpVAEzbU.js";
2
2
  const D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
3
  __proto__: null
4
4
  }, Symbol.toStringTag, { value: "Module" }));
@@ -8,7 +8,7 @@ var t;
8
8
  })(t || (t = {}));
9
9
  let l = !1;
10
10
  async function d() {
11
- const e = await import("./LercDecode.es-CgN9Gb9e.js");
11
+ const e = await import("./LercDecode.es-B-OFS9hR.js");
12
12
  return l || (await e.load(), l = !0), e;
13
13
  }
14
14
  async function i(e, r) {
package/dist/license.d.ts CHANGED
@@ -50,15 +50,41 @@ export declare function domainMatches(hostname: string, domains: string[]): bool
50
50
  * warning — a bad key must never break the map.
51
51
  */
52
52
  export declare function configureLicense(key: string): Promise<void>;
53
+ /** One layer whose data the row cap cut down this pass — drives the viewer-facing notice. */
54
+ export interface TruncatedLayer {
55
+ id: string;
56
+ /** Rows that DID render (the cap). */
57
+ shown: number;
58
+ /** Rows the layer actually had. */
59
+ total: number;
60
+ }
61
+ export interface LicenseGateResult {
62
+ irs: LayerIR[];
63
+ /** Empty (a shared frozen constant) on the overwhelmingly common no-violation pass. */
64
+ truncated: readonly TruncatedLayer[];
65
+ }
53
66
  /**
54
- * DECIDED violation mode: per-layer hard drop, deterministic layers past
55
- * the count cap (manifest order) don't render; an over-cap layer renders
56
- * NOTHING (never a truncated subset truncation looks like a data bug and
57
- * hides the gate). Runtime-internal layers (trace temps, draw preview,
58
- * tooltip plumbing) neither count nor drop. Violations report once per
59
- * (layer, reason) through `report` until the violation clears (`warned` is
60
- * the caller-owned dedup set).
67
+ * DECIDED violation mode (revised 2026-07-28): layers past the COUNT cap
68
+ * (manifest order) still hard-drop a sixth layer has no meaningful partial
69
+ * form. An over-ROW-cap layer now renders its first `maxRowsPerLayer` rows
70
+ * instead of nothing, because the previous hard drop turned one row over the
71
+ * line into a blank layer, and the cliff landed unpredictably: CityJSON's
72
+ * `?om-surfaces=1` emits ~33 rows per building with a long tail (one building
73
+ * in the sample tile is 963 faces), so "how many buildings fit" is not
74
+ * something an author can reason about in advance.
75
+ *
76
+ * The original objection to truncation — that it looks like a data bug and
77
+ * hides the gate — is answered by making it VISIBLE rather than by rendering
78
+ * nothing: `truncated` drives a dismissible viewer-facing notice (see
79
+ * quota-notice.ts), while this `report` stream keeps severity "error" for the
80
+ * dev/agent channel. The subset is arbitrary (source order, which for most
81
+ * formats is not spatially meaningful) and the message says so, since a
82
+ * scattered subset otherwise reads as a rendering fault.
83
+ *
84
+ * Runtime-internal layers (trace temps, draw preview, tooltip plumbing)
85
+ * neither count nor drop. Violations report once per (layer, reason) through
86
+ * `report` until the violation clears (`warned` is the caller-owned dedup set).
61
87
  */
62
- export declare function applyLicenseGates(irs: LayerIR[], report: (entry: ValidationEntry) => void, warned: Set<string>): LayerIR[];
88
+ export declare function applyLicenseGates(irs: LayerIR[], report: (entry: ValidationEntry) => void, warned: Set<string>): LicenseGateResult;
63
89
  export declare function setLicensePublicKeyForTests(rawKey: Uint8Array | null): void;
64
90
  export declare function resetLicenseForTests(): void;