@nika-js/onlymap 0.1.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 (77) hide show
  1. package/.vscode/onlymap.code-snippets +173 -0
  2. package/LICENSE.md +133 -0
  3. package/README.md +188 -0
  4. package/bin/onlymapjs.mjs +182 -0
  5. package/dist/Arrow.dom-7AXne1TU.js +5233 -0
  6. package/dist/actions.d.ts +30 -0
  7. package/dist/attribute-resolution.d.ts +73 -0
  8. package/dist/basemap-D95W0IIA.js +25203 -0
  9. package/dist/basemap.d.ts +72 -0
  10. package/dist/convert-arrow-schema-CvZ3cT5m.js +94 -0
  11. package/dist/csp-sandbox.d.ts +20 -0
  12. package/dist/ctx.d.ts +49 -0
  13. package/dist/d3-bundle.d.ts +218 -0
  14. package/dist/data-emit.d.ts +10 -0
  15. package/dist/data-layer.d.ts +150 -0
  16. package/dist/declarative-filter.d.ts +12 -0
  17. package/dist/dev-error-panel.d.ts +15 -0
  18. package/dist/draw-controller.d.ts +51 -0
  19. package/dist/draw.d.ts +102 -0
  20. package/dist/effects.d.ts +39 -0
  21. package/dist/elements/om-behavior.d.ts +13 -0
  22. package/dist/elements/om-layer.d.ts +11 -0
  23. package/dist/elements/om-map.d.ts +168 -0
  24. package/dist/elements/om-overlay.d.ts +82 -0
  25. package/dist/elements/om-step.d.ts +12 -0
  26. package/dist/elements/om-story.d.ts +67 -0
  27. package/dist/elements/om-widget.d.ts +29 -0
  28. package/dist/env.d.ts +41 -0
  29. package/dist/expr/cache.d.ts +28 -0
  30. package/dist/expr/compile.d.ts +27 -0
  31. package/dist/expr/errors.d.ts +10 -0
  32. package/dist/expr/full-js-block.d.ts +17 -0
  33. package/dist/expr/index.d.ts +12 -0
  34. package/dist/expr/output-type.d.ts +12 -0
  35. package/dist/expr/scale.d.ts +13 -0
  36. package/dist/expr/script-block.d.ts +16 -0
  37. package/dist/expr/whitelist.d.ts +28 -0
  38. package/dist/field-access.d.ts +24 -0
  39. package/dist/html-data.d.ts +25 -0
  40. package/dist/index-2v2NXF_n.js +435 -0
  41. package/dist/index-BFjXVHly.js +605 -0
  42. package/dist/index-C9w78NS9.js +4883 -0
  43. package/dist/index-CU-iOTdr.js +75292 -0
  44. package/dist/index-D74olQ9w.js +3907 -0
  45. package/dist/index-Do7hmHwi.js +1457 -0
  46. package/dist/index.d.ts +76 -0
  47. package/dist/ir-snapshot.d.ts +54 -0
  48. package/dist/ir.d.ts +66 -0
  49. package/dist/layer-registry.d.ts +27 -0
  50. package/dist/layers/popup-layer.d.ts +65 -0
  51. package/dist/onlymapjs.css +1 -0
  52. package/dist/onlymapjs.js +30 -0
  53. package/dist/onlymapjs.umd.cjs +8618 -0
  54. package/dist/parse-manifest.d.ts +19 -0
  55. package/dist/recordbatch-HRu0SMKp.js +4742 -0
  56. package/dist/runtime-core.d.ts +170 -0
  57. package/dist/selection.d.ts +31 -0
  58. package/dist/stats.d.ts +29 -0
  59. package/dist/table-accessors-DBjWgN0C.js +204 -0
  60. package/dist/template-interpolation.d.ts +6 -0
  61. package/dist/testing.d.ts +90 -0
  62. package/dist/timeline.d.ts +37 -0
  63. package/dist/validation.d.ts +22 -0
  64. package/dist/vega-loader.d.ts +22 -0
  65. package/dist/viewport-filter.d.ts +25 -0
  66. package/dist/widget-registry.d.ts +23 -0
  67. package/dist/widget-script.d.ts +1 -0
  68. package/dist/widgets/built-in.d.ts +1 -0
  69. package/dist/widgets/dom-utils.d.ts +4 -0
  70. package/llms.txt +43 -0
  71. package/onlymapjs.html-data.json +1688 -0
  72. package/package.json +111 -0
  73. package/skills/onlymapjs/SKILL.md +61 -0
  74. package/skills/onlymapjs/agents/openai.yaml +4 -0
  75. package/skills/onlymapjs/references/patterns.md +213 -0
  76. package/skills/onlymapjs/references/syntax.md +342 -0
  77. package/skills/onlymapjs/references/testing.md +126 -0
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The action registry (spec: "Module Breakdown / Behavior Engine" — "Action
3
+ * payload contract"). One event name maps to one action handler with one
4
+ * payload schema, honored identically across all three emit surfaces —
5
+ * `ctx.emit(name, payload)`, `data-emit`, and `<om-behavior>` — an action
6
+ * reads the same keys regardless of how it was triggered. `registerAction`
7
+ * is re-exported from the package entry point (index.ts) as the public
8
+ * `OmMap.registerAction` surface.
9
+ */
10
+ import type { RuntimeCore } from "./runtime-core";
11
+ import type { LayerIR } from "./ir";
12
+ export type ActionHandler = (payload: Record<string, unknown>, mapEl: Element, core: RuntimeCore, layerIRs: ReadonlyMap<string, LayerIR>) => void;
13
+ /** Is an action name registered? (Story/behavior validation — custom actions may register later, so absence is a warning, not an error.) */
14
+ export declare function hasAction(name: string): boolean;
15
+ export declare function registerAction(name: string, handler: ActionHandler): void;
16
+ export declare function dispatchAction(name: string, payload: Record<string, unknown>, mapEl: Element, core: RuntimeCore, layerIRs?: ReadonlyMap<string, LayerIR>): void;
17
+ /** Ids in this namespace are runtime-managed plumbing — excluded from ctx.layers (legend, layer-list, user widgets). */
18
+ export declare const RUNTIME_INTERNAL_PREFIX = "__onlymapjs-";
19
+ /** The overlay anchor for a feature: its bbox center for geojson geometry, else its point (flat lon/lat). */
20
+ export declare function featureAnchorPoint(feature: unknown): [number, number] | undefined;
21
+ /**
22
+ * `trace` — progressive draw. Real tracing needs per-vertex time, which is
23
+ * TripsLayer's whole purpose: sweep `currentTime` across the data's
24
+ * timestamp range through the per-frame channel. Other layer types fall
25
+ * back to `fade` with a warning (deck.gl has no dash-offset to fake a
26
+ * draw-on with — documented in the spec).
27
+ */
28
+ export declare const TRACE_TEMP_PREFIX = "__onlymapjs-trace-";
29
+ /** Story scrub restore — drop all trace hide bookkeeping for this core (the channel props themselves are cleared separately by cancelAllLayerEffects). */
30
+ export declare function resetTraceHides(core: RuntimeCore): void;
@@ -0,0 +1,73 @@
1
+ import type { LayerMeta, LayerFilter } from "./ir";
2
+ import type { LayerSchema, PropDescriptor } from "./layer-registry";
3
+ import type { Shape } from "./expr";
4
+ /** Sweeps the shared caches down to exactly the keys still referenced by the current manifest (Q4). */
5
+ export declare function sweepAccessorCache(liveKeys: ReadonlySet<string>): void;
6
+ /**
7
+ * Reserved attributes whose FEATURE is design-only (spec'd, not built).
8
+ * Reserved-ness suppresses the unknown-attribute warning — which is exactly
9
+ * how the streaming attributes (`source`/`key`/`flush`) sat silently inert
10
+ * for weeks before implementation. This list turns a dead promise into a
11
+ * loud one: both the live resolver and the validator warn from it, and
12
+ * implementing the feature means deleting its entry here (the traceability
13
+ * table in the spec tracks the same state).
14
+ */
15
+ export declare const INERT_RESERVED_ATTRS: Map<string, string>;
16
+ /** Attributes with library-level meaning that never reach deck.gl as a prop. */
17
+ export declare const RESERVED_ATTRS: Set<string>;
18
+ /**
19
+ * Filtering (spec: "Filtering") is universal across every layer type — not
20
+ * tied to one schema's props like `pickable` — so it's resolved directly
21
+ * here rather than via `schema.props`, and excluded from the typo-check the
22
+ * same way `RESERVED_ATTRS` is. Single-field only (`filterSize`/`categorySize`
23
+ * fixed at 1); the spec's own example is single-field, and the "up to 4
24
+ * dimensions" case is a documented future extension.
25
+ */
26
+ export declare const FILTER_ATTRS: Set<string>;
27
+ /**
28
+ * Standard global HTML attributes an author (or the library itself, e.g.
29
+ * OmLayerElement setting `style.display = "none"`) may set for reasons
30
+ * unrelated to the layer schema. Never a typo signal.
31
+ */
32
+ export declare const GLOBAL_HTML_ATTRS: Set<string>;
33
+ /** Shared by the live typo-warning below and the standalone validator (validation.ts) — same signal, two surfaces. */
34
+ export declare function isUnknownLayerAttr(attrName: string, schema: LayerSchema): boolean;
35
+ /**
36
+ * `transition="get-fill-color 800ms, get-radius 400ms"` → deck.gl's
37
+ * `transitions` prop (GPU-interpolated per-prop animation — spec: "Map
38
+ * Stories / Animation primitives"). A deck SPECIAL prop invisible to
39
+ * defaultProps-derived schemas, so it's a universal library attribute like
40
+ * `label`/`color`. Prop names accept kebab or camel. Shared by the live
41
+ * resolver and the validator — same grammar, two surfaces.
42
+ */
43
+ export declare function parseTransitionAttr(raw: string): {
44
+ transitions: Record<string, number>;
45
+ invalid: string[];
46
+ };
47
+ /**
48
+ * The js/unsafe-on-columnar rule, stated once for both surfaces (the
49
+ * isUnknownLayerAttr precedent): a full-JS accessor block is an opaque
50
+ * `d => ...` — there is no row object to hand it on a columnar layer, and
51
+ * materializing one per accessor call would silently forfeit the zero-copy
52
+ * path. Restricted accessors are fine: the compiler rewrites them to column
53
+ * access. The live resolver logs it and skips the block; the validator emits
54
+ * it as a structured error — same rule, guaranteed in sync.
55
+ */
56
+ export declare const FULL_JS_COLUMNAR_RULE: {
57
+ applies: (isJs: boolean, shape: Shape) => boolean;
58
+ message: string;
59
+ fix: string;
60
+ };
61
+ /** Coerce a raw attribute string to a primitive: bare/true/false, JSON array/object, number, or string. */
62
+ export declare function coerceValue(raw: string, hint?: PropDescriptor["type"], attrName?: string): unknown;
63
+ export interface ResolvedAttributes {
64
+ props: Record<string, unknown>;
65
+ meta: LayerMeta;
66
+ /** deckProp -> fingerprint, to attach as the layer's `updateTriggers`. */
67
+ updateTriggers: Record<string, string>;
68
+ /** Every cache key this layer currently references — feeds the global mark-and-sweep. */
69
+ liveKeys: Set<string>;
70
+ /** The layer's active declarative filter, if `filter-field`/`filter-range` are present. */
71
+ filter?: LayerFilter;
72
+ }
73
+ export declare function resolveLayerAttributes(el: Element, schema: LayerSchema, shape: Shape): ResolvedAttributes;