@nika-js/onlymap 0.4.2 → 0.4.4

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 (36) hide show
  1. package/README.md +39 -8
  2. package/bin/onlymapjs.mjs +147 -11
  3. package/dist/{LercDecode.es-CtFZNCJy.js → LercDecode.es-CgN9Gb9e.js} +1 -1
  4. package/dist/{basemap-DfeKYdar.js → basemap-Bfn5Z__c.js} +168 -163
  5. package/dist/basemap.d.ts +3 -1
  6. package/dist/elements/om-map.d.ts +48 -0
  7. package/dist/elements/om-overlay.d.ts +8 -0
  8. package/dist/{index-CeAQFyJG.js → index-C4cWRigY.js} +1 -1
  9. package/dist/{index-CU-Ft1NI.js → index-CnitG1VX.js} +2 -2
  10. package/dist/{index-ULsb51al.js → index-KgO0MBqA.js} +12959 -12470
  11. package/dist/{index-BcbVw4b7.js → index-M8KfTTol.js} +1 -1
  12. package/dist/{index-PfwJVVKI.js → index-lXrP3rPo.js} +1 -1
  13. package/dist/index.d.ts +4 -2
  14. package/dist/layout-audit.d.ts +53 -0
  15. package/dist/{lerc-DsrKzmOh.js → lerc-l-QFh62d.js} +2 -2
  16. package/dist/onlymap.standalone.js +21464 -20970
  17. package/dist/onlymapjs.js +73 -62
  18. package/dist/programmatic.d.ts +3 -1
  19. package/dist/{raster-CXnE4ZJp.js → raster-BBA_oI-d.js} +2 -2
  20. package/dist/react/context.d.ts +9 -1
  21. package/dist/react/om-map.d.ts +3 -1
  22. package/dist/react/om-widget.d.ts +3 -1
  23. package/dist/react.js +333 -202
  24. package/dist/runtime-core.d.ts +12 -1
  25. package/dist/version.d.ts +1 -1
  26. package/dist/widget-layout.d.ts +16 -0
  27. package/docs/basemaps.md +1 -1
  28. package/docs/react.md +2 -1
  29. package/docs/testing.md +10 -0
  30. package/llms.txt +2 -2
  31. package/onlymapjs.html-data.json +27 -0
  32. package/package.json +1 -1
  33. package/skills/onlymapjs/SKILL.md +2 -1
  34. package/skills/onlymapjs/references/react.md +2 -2
  35. package/skills/onlymapjs/references/syntax.md +5 -4
  36. package/skills/onlymapjs/references/testing.md +15 -0
package/dist/onlymapjs.js CHANGED
@@ -1,67 +1,78 @@
1
- import { ay as e, az as r, aA as o, aB as t, aC as i, aq as n, aD as b, aE as l, aF as S, aG as L, aH as p, aI as c, aJ as g, aK as m, aL as T, aM as y, aN as E, ap as A, aO as I, ax as u, aP as d, W as M, aQ as _, aR as C, aS as D, aT as O, aU as f, aV as x, aW as N, aX as h, aY as B, aZ as G, a_ as R, a$ as W, b0 as v, b1 as w, b2 as Y, b3 as F, b4 as P, b5 as k, b6 as z, b7 as H, b8 as J, b9 as V, ba as q, bb as K, bc as U, bd as j, be as Q, bf as X, bg as Z, bh as $, bi as aa, bj as sa, bk as ea, bl as ra, bm as oa, bn as ta, bo as ia, bp as na, bq as ba, br as la, bs as Sa, bt as La } from "./index-ULsb51al.js";
1
+ import { ay as e, az as r, aA as o, aB as t, aC as i, aD as l, aq as b, aE as n, aF as S, aG as L, aH as T, aI as E, aJ as g, aK as y, aL as p, aM as c, aN as m, aO as A, aP as d, aQ as I, aR as u, ap as D, aS as _, ax as M, aT as f, W as C, aU as O, aV as N, aW as x, aX as B, aY as G, aZ as R, a_ as h, a$ as w, b0 as F, b1 as P, b2 as W, b3 as v, b4 as U, b5 as Y, b6 as z, b7 as H, b8 as k, b9 as J, ba as V, bb as X, bc as q, bd as K, be as j, bf as Q, bg as Z, bh as $, bi as aa, bj as sa, bk as ea, bl as ra, bm as oa, bn as ta, bo as ia, bp as la, bq as ba, br as na, bs as Sa, bt as La, bu as Ta, bv as Ea, bw as ga, bx as ya, by as pa, bz as ca, bA as ma, bB as Aa, bC as da, bD as Ia, bE as ua } from "./index-KgO0MBqA.js";
2
2
  export {
3
3
  e as ALL_POSITION_VALUES,
4
- r as AccessorCache,
5
- o as BitmapLayer,
6
- t as COORDINATE_SYSTEM,
7
- i as CompileError,
8
- n as CompositeLayer,
9
- b as GeoJsonLayer,
10
- l as IconLayer,
11
- S as LEGACY_POSITION_ALIASES,
12
- L as LIGHTING_PRESET_NAMES,
4
+ r as AUDIT_EXEMPTIONS,
5
+ o as AccessorCache,
6
+ t as BitmapLayer,
7
+ i as COORDINATE_SYSTEM,
8
+ l as CompileError,
9
+ b as CompositeLayer,
10
+ n as DEFAULT_AUDIT_WIDTHS,
11
+ S as EDGE_TOLERANCE_PX,
12
+ L as FOLD_SIDES,
13
+ T as GeoJsonLayer,
14
+ E as IconLayer,
15
+ g as LEGACY_POSITION_ALIASES,
16
+ y as LIGHTING_PRESET_NAMES,
13
17
  p as Layer,
14
18
  c as LayerExtension,
15
- g as MANAGED_SLOTS,
16
- m as MapController,
17
- T as OmMap,
18
- y as ScatterplotLayer,
19
- E as ScenegraphLayer,
20
- A as SimpleMeshLayer,
21
- I as Tile3DLayer,
22
- u as TileLayer,
23
- d as WIDGET_STYLE_KEY_NAMES,
24
- M as WebMercatorViewport,
25
- _ as arrowTableToColumnar,
26
- C as asRows,
27
- D as compileExpression,
28
- O as compileFullJsAccessorBlockInSandbox,
29
- f as computeTimeline,
30
- x as configureBasemap,
31
- N as configureData,
32
- h as configureLicense,
33
- B as configureTelemetry,
34
- G as descriptorToIR,
35
- R as destroySandbox,
36
- W as evaluateInSandbox,
37
- v as getBasemap,
38
- w as getEntitlements,
39
- Y as getLayerSchema,
40
- F as getTerrain,
41
- P as isBrowser,
42
- k as isColumnar,
43
- z as isStoreToken,
44
- H as loadRasterModule,
45
- J as mountForTest,
46
- V as normalizeData,
47
- q as parseDurationMs,
48
- K as parseTerrainAttrs,
49
- U as parseWidgetStyle,
50
- j as registerAction,
51
- Q as registerBasemap,
52
- X as registerFormat,
53
- Z as registerLayer,
54
- $ as registerSource,
55
- aa as registerTerrain,
56
- sa as registerWidget,
57
- ea as resolveLighting,
58
- ra as resolveSlot,
59
- oa as rowAt,
60
- ta as sandboxHtml,
61
- ia as slotContainerStyle,
62
- na as slotLayout,
63
- ba as snapshotIR,
64
- la as solarAzElDegrees,
65
- Sa as validateManifest,
66
- La as validateManifestString
19
+ m as MANAGED_SLOTS,
20
+ A as MapController,
21
+ d as OmMap,
22
+ I as ScatterplotLayer,
23
+ u as ScenegraphLayer,
24
+ D as SimpleMeshLayer,
25
+ _ as Tile3DLayer,
26
+ M as TileLayer,
27
+ f as WIDGET_STYLE_KEY_NAMES,
28
+ C as WebMercatorViewport,
29
+ O as arrowTableToColumnar,
30
+ N as asRows,
31
+ x as auditLayout,
32
+ B as compileExpression,
33
+ G as compileFullJsAccessorBlockInSandbox,
34
+ R as computeTimeline,
35
+ h as configureBasemap,
36
+ w as configureData,
37
+ F as configureLicense,
38
+ P as configureTelemetry,
39
+ W as descriptorToIR,
40
+ v as destroySandbox,
41
+ U as evaluateInSandbox,
42
+ Y as foldDrawerStyle,
43
+ z as foldPanelStyle,
44
+ H as foldSideForSlot,
45
+ k as foldToggleSlot,
46
+ J as foldToggleStyle,
47
+ V as getBasemap,
48
+ X as getEntitlements,
49
+ q as getLayerSchema,
50
+ K as getTerrain,
51
+ j as isBrowser,
52
+ Q as isColumnar,
53
+ Z as isStoreToken,
54
+ $ as loadRasterModule,
55
+ aa as mountForTest,
56
+ sa as normalizeData,
57
+ ea as parseDurationMs,
58
+ ra as parseTerrainAttrs,
59
+ oa as parseWidgetStyle,
60
+ ta as registerAction,
61
+ ia as registerBasemap,
62
+ la as registerFormat,
63
+ ba as registerLayer,
64
+ na as registerSource,
65
+ Sa as registerTerrain,
66
+ La as registerWidget,
67
+ Ta as resolveLighting,
68
+ Ea as resolveSlot,
69
+ ga as rowAt,
70
+ ya as sandboxHtml,
71
+ pa as settleLayout,
72
+ ca as slotContainerStyle,
73
+ ma as slotLayout,
74
+ Aa as snapshotIR,
75
+ da as solarAzElDegrees,
76
+ Ia as validateManifest,
77
+ ua as validateManifestString
67
78
  };
@@ -14,7 +14,7 @@
14
14
  * through its own event handlers and state (spec: HU2 "the catch"), reading
15
15
  * runtime state through the same RuntimeContext contract widgets get (HU5).
16
16
  */
17
- import { type CameraOptions } from "./runtime-core";
17
+ import { type CameraOptions, type MandatedChromeHosts } from "./runtime-core";
18
18
  import { type LightingIR, type LightingOptions } from "./scene-lighting";
19
19
  import type { TerrainIR } from "./terrain";
20
20
  import { type SnapshotOptions } from "./snapshot";
@@ -106,6 +106,8 @@ export interface MapControllerOptions {
106
106
  onViewChange?: (view: CameraState, origin: ViewOrigin) => void;
107
107
  /** Scene lighting (spec: "Scene Lighting") — the lighting* attributes' programmatic twin; omit for deck's default lights. */
108
108
  lighting?: LightingOptions;
109
+ /** @internal Stable React-owned hosts that place required chrome in managed slots. */
110
+ chromeHosts?: MandatedChromeHosts;
109
111
  }
110
112
  /** Descriptor → layer IR: the programmatic counterpart of one parse-manifest.ts loop iteration. */
111
113
  export declare function descriptorToIR(desc: LayerDescriptor, onDataLoaded: () => void): LayerIR | null;
@@ -1,5 +1,5 @@
1
1
  import { w as kt, t as Ni, f as Oi, m as Ri } from "./mgrs-BY9bIvp4.js";
2
- import { an as Fi, ao as zi, ap as Ks, aq as Ws, ar as Di, b as Bi, as as Ui, l as es, at as ki, d as qi, au as Ki, av as Wi, aw as Xi, ax as Xs } from "./index-ULsb51al.js";
2
+ import { an as Fi, ao as zi, ap as Ks, aq as Ws, ar as Di, b as Bi, as as Ui, l as es, at as ki, d as qi, au as Ki, av as Wi, aw as Xi, ax as Xs } from "./index-KgO0MBqA.js";
3
3
  function Hi(t, e, s) {
4
4
  const { projectedCorners: i } = e, { topLeft: a, topRight: r, bottomRight: o, bottomLeft: n } = i, h = s(a[0], a[1]), l = s(r[0], r[1]), c = s(o[0], o[1]), u = s(n[0], n[1]), d = [
5
5
  h,
@@ -2377,7 +2377,7 @@ it.set(G.Zstd, () => import("./zstd-jXobGRcq.js").then((t) => t.decode));
2377
2377
  it.set(G.Jpeg, () => Promise.resolve(ke));
2378
2378
  it.set(G.Jpeg6, () => Promise.resolve(ke));
2379
2379
  it.set(G.Webp, () => Promise.resolve(ke));
2380
- it.set(G.Lerc, () => import("./lerc-DsrKzmOh.js").then((t) => t.l).then((t) => t.decode));
2380
+ it.set(G.Lerc, () => import("./lerc-l-QFh62d.js").then((t) => t.l).then((t) => t.decode));
2381
2381
  async function qe(t, e, s) {
2382
2382
  const i = it.get(e);
2383
2383
  if (!i)
@@ -1,5 +1,5 @@
1
1
  import type { MapController, LayerDescriptor } from "@nika-js/onlymap";
2
- import type { ManagedSlot } from "@nika-js/onlymap";
2
+ import type { FoldSide, ManagedSlot } from "@nika-js/onlymap";
3
3
  /** A managed slot (spec: "Widget Layout Manager"), a legacy corner alias, or the author-styled `manual` tier. */
4
4
  export type WidgetPosition = ManagedSlot | "manual" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
5
5
  export interface OmMapContextValue {
@@ -9,6 +9,14 @@ export interface OmMapContextValue {
9
9
  overlayPane: HTMLDivElement;
10
10
  /** Slot containers <OmWidget> portals into (filled as OmMap's own DOM mounts). */
11
11
  corners: Readonly<Record<ManagedSlot, HTMLDivElement | null>>;
12
+ /** Hide authored managed widgets without hiding mandated provider/license chrome. */
13
+ widgetsHidden: boolean;
14
+ /** Responsive map-width state shared by every positioning shell. */
15
+ widgetsFolded: boolean;
16
+ /** Per-side disclosure panels used as portal targets while folded. */
17
+ foldPanels: Readonly<Record<FoldSide, HTMLDivElement | null>>;
18
+ /** Registers whether a React widget currently needs a side drawer. */
19
+ registerFoldedWidget(side: FoldSide, token: string, present: boolean): void;
12
20
  }
13
21
  export declare const OmMapContext: import("react").Context<OmMapContextValue | null>;
14
22
  export declare function useOmMapContext(caller: string): OmMapContextValue;
@@ -20,8 +20,10 @@ export interface OmMapProps {
20
20
  };
21
21
  /** Layout-token sugar, the `widget-style` attribute's twin: `"gap:10 opacity:0.9"` → `--om-widget-*` custom properties on the widget layer. */
22
22
  widgetStyle?: string;
23
- /** Hide-all, the `widgets-hidden` attribute's twin: hides every slot container (visibility, not removal widget state survives). MapLibre's attribution control is outside the layer and never hides. */
23
+ /** Hide-all, the `widgets-hidden` attribute's twin: hides authored managed widgets without removal; provider attribution and the license badge never hide. */
24
24
  widgetsHidden?: boolean;
25
+ /** Responsive auto-fold (default true); false is the `widgets-fold="off"` twin. */
26
+ widgetsFold?: boolean;
25
27
  className?: string;
26
28
  style?: CSSProperties;
27
29
  children?: ReactNode;
@@ -5,8 +5,10 @@ export interface OmWidgetProps {
5
5
  position?: WidgetPosition;
6
6
  /** Deterministic in-slot ordering (flex `order`); default is mount order. */
7
7
  order?: number;
8
+ /** Keep this essential control outside responsive drawers. */
9
+ fold?: "never";
8
10
  className?: string;
9
11
  style?: CSSProperties;
10
12
  children?: ReactNode;
11
13
  }
12
- export declare function OmWidget({ position, order, className, style, children }: OmWidgetProps): ReactNode;
14
+ export declare function OmWidget({ position, order, fold, className, style, children }: OmWidgetProps): ReactNode;