@nika-js/onlymap 0.2.1 → 0.2.2
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.
- package/.vscode/onlymap.code-snippets +23 -0
- package/README.md +3 -2
- package/dist/{basemap-COurZNDH.js → basemap-Bn4TmZtQ.js} +1 -1
- package/dist/elements/om-fallback.d.ts +22 -0
- package/dist/{index-COu-3-gN.js → index-3UyMg0Md.js} +1 -1
- package/dist/{index-DuvXK95V.js → index-BZs_x9Dx.js} +2 -2
- package/dist/{index-D-X8KPA1.js → index-D2zVsZ79.js} +1 -1
- package/dist/{index-CgyAD98B.js → index-DSjndBOf.js} +1 -1
- package/dist/{index-CvfuISOc.js → index-oE1Kouy1.js} +839 -818
- package/dist/index.d.ts +2 -0
- package/dist/onlymapjs.css +1 -1
- package/dist/onlymapjs.js +1 -1
- package/dist/onlymapjs.umd.cjs +84 -84
- package/llms.txt +1 -0
- package/onlymapjs.html-data.json +12 -1
- package/package.json +2 -2
- package/skills/onlymapjs/SKILL.md +4 -1
- package/skills/onlymapjs/references/patterns.md +6 -0
- package/skills/onlymapjs/references/syntax.md +22 -2
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
" <!-- Built-in legend — reads label/color from each <om-layer> -->",
|
|
37
37
|
" <om-widget type=\"legend\" title=\"Layers\" position=\"top-right\"></om-widget>",
|
|
38
38
|
"",
|
|
39
|
+
" <!-- Shown only where scripts never run (chat-app/email file previews) — hidden once the map boots -->",
|
|
40
|
+
" <om-fallback>",
|
|
41
|
+
" <p>This interactive map requires JavaScript.<br />Open this file in a web browser such as Chrome, Safari, or Firefox.</p>",
|
|
42
|
+
" </om-fallback>",
|
|
43
|
+
"",
|
|
39
44
|
" </om-map>",
|
|
40
45
|
"",
|
|
41
46
|
"</body>",
|
|
@@ -78,6 +83,11 @@
|
|
|
78
83
|
"",
|
|
79
84
|
" $0",
|
|
80
85
|
"",
|
|
86
|
+
" <!-- Shown only where scripts never run (chat-app/email file previews) -->",
|
|
87
|
+
" <om-fallback>",
|
|
88
|
+
" <p>This interactive map requires JavaScript — open this file in a web browser.</p>",
|
|
89
|
+
" </om-fallback>",
|
|
90
|
+
"",
|
|
81
91
|
"</om-map>"
|
|
82
92
|
]
|
|
83
93
|
},
|
|
@@ -157,6 +167,19 @@
|
|
|
157
167
|
]
|
|
158
168
|
},
|
|
159
169
|
|
|
170
|
+
"!fallback": {
|
|
171
|
+
"scope": "html",
|
|
172
|
+
"prefix": "!fallback",
|
|
173
|
+
"description": "<om-fallback> — no-JS fallback for shared/previewed files (hidden once the map boots)",
|
|
174
|
+
"body": [
|
|
175
|
+
"<!-- Shown only where scripts never run (chat-app/email file previews, iOS QuickLook) -->",
|
|
176
|
+
"<om-fallback>",
|
|
177
|
+
" <p>${1:This interactive map requires JavaScript.}<br />",
|
|
178
|
+
" ${2:Open this file in a web browser such as Chrome, Safari, or Firefox.}</p>",
|
|
179
|
+
"</om-fallback>$0"
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
|
|
160
183
|
"!inline-data": {
|
|
161
184
|
"scope": "html",
|
|
162
185
|
"prefix": "!inline-data",
|
package/README.md
CHANGED
|
@@ -44,13 +44,13 @@ Or with no build step at all, straight from a CDN:
|
|
|
44
44
|
<script type="module" src="https://esm.sh/@nika-js/onlymap"></script>
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
Then `npx @nika-js/onlymap init` wires up VS Code IntelliSense and `!`-prefixed manifest snippets for your project. The library ships with
|
|
47
|
+
Then `npx @nika-js/onlymap init` wires up VS Code IntelliSense and `!`-prefixed manifest snippets for your project. The library ships with 297 unit/behavioral tests and 19 Playwright GPU tests.
|
|
48
48
|
|
|
49
49
|
The [examples](https://github.com/NikaGeospatial/onlymapjs/tree/main/examples) are the best tour: widgets, behaviors & overlays, basemaps, columnar/Arrow data, manual drawing, 3D models, a live WebSocket ship feed, and a polled driver fleet.
|
|
50
50
|
|
|
51
51
|
## The manifest
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
A handful of elements, one rule: **attributes are kebab-case versions of deck.gl props** (`radius-units` → `radiusUnits`), and `get-*` attributes are data-driven accessors.
|
|
54
54
|
|
|
55
55
|
| Element | Role |
|
|
56
56
|
|---|---|
|
|
@@ -60,6 +60,7 @@ Five elements, one rule: **attributes are kebab-case versions of deck.gl props**
|
|
|
60
60
|
| `<om-overlay>` | Rich HTML anchored to a map location — a static `anchor="[lng, lat]"`, the current selection, or a feature's own geometry via `anchor-layer`/`anchor-feature-id`. `{{field}}` interpolates the picked feature, HTML-escaped by default. |
|
|
61
61
|
| `<om-behavior>` | Declarative interactions: `on="click|hover|drag|load|data-loaded"` → a named action. |
|
|
62
62
|
| `<om-story>` | A storyboard: `<om-step>` children fire actions on a timeline. Controlled by the `player` widget, behaviors, or `storyEl.play()/pause()/seek()`. |
|
|
63
|
+
| `<om-fallback>` | What shows where scripts never run — chat-app/email file previews (iOS QuickLook renders HTML attachments with JS off), file managers, sandboxed webviews. A direct child of `<om-map>`, hidden automatically the moment the map boots; pages without one get a text-only default banner from the stylesheet. Good practice on any page that may travel as a file. The gate is pure CSS (`om-map:not(:defined)`), so `onlymapjs.css` must load without JS — a real `<link>`, a bundler-emitted sheet, or an inlined `<style>`. |
|
|
63
64
|
|
|
64
65
|
### Accessors without JavaScript
|
|
65
66
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var sy = Object.defineProperty;
|
|
2
2
|
var oy = (ve, J, me) => J in ve ? sy(ve, J, { enumerable: !0, configurable: !0, writable: !0, value: me }) : ve[J] = me;
|
|
3
3
|
var _s = (ve, J, me) => oy(ve, typeof J != "symbol" ? J + "" : J, me);
|
|
4
|
-
import { a4 as ay, a5 as ly, a6 as cy, a7 as uy, a8 as Ra, a9 as ac, aa as Pd, ab as om, ac as hy, ad as dy, ae as py, af as fy, ag as ju, ah as Cd, ai as my, aj as gy, ak as _y, al as em, am as yy } from "./index-
|
|
4
|
+
import { a4 as ay, a5 as ly, a6 as cy, a7 as uy, a8 as Ra, a9 as ac, aa as Pd, ab as om, ac as hy, ad as dy, ae as py, af as fy, ag as ju, ah as Cd, ai as my, aj as gy, ak as _y, al as em, am as yy } from "./index-oE1Kouy1.js";
|
|
5
5
|
const Ad = Math.PI / 180, vy = 180 / Math.PI;
|
|
6
6
|
function tm(ve, J = 0) {
|
|
7
7
|
const me = Math.min(180, ve) * Ad;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <om-fallback> — static content shown only when the library never boots:
|
|
3
|
+
* scripting-disabled contexts like chat-app/email file previews (iOS
|
|
4
|
+
* QuickLook renders HTML attachments with JS off), file managers, and
|
|
5
|
+
* sandboxed webviews (spec: "Deployment & Distribution / No-JS fallback").
|
|
6
|
+
*
|
|
7
|
+
* Deliberately logic-free: the show/hide gate lives in the shipped
|
|
8
|
+
* stylesheet (src/fallback.css) as `om-map:not(:defined)` rules, because
|
|
9
|
+
* only the CSS engine — not script — still runs where this element earns
|
|
10
|
+
* its keep. The class exists for two reasons: registering it keeps the
|
|
11
|
+
* element out of "unknown tag" territory for tooling, and its
|
|
12
|
+
* connectedCallback hides the element inline as a belt-and-braces for
|
|
13
|
+
* pages that loaded the JS bundle but not onlymapjs.css (if this code
|
|
14
|
+
* runs at all, the map is booting and the fallback must not show).
|
|
15
|
+
*
|
|
16
|
+
* Pages without an <om-fallback> still get a text-only default banner,
|
|
17
|
+
* generated by the stylesheet on `om-map:not(:defined)::before`.
|
|
18
|
+
*/
|
|
19
|
+
import { HTMLElementBase } from "../env";
|
|
20
|
+
export declare class OmFallbackElement extends HTMLElementBase {
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Oe = Object.defineProperty;
|
|
2
2
|
var ke = (r, e, t) => e in r ? Oe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var l = (r, e, t) => ke(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { g as ve, a as ce, b as he, i as Fe, t as je, l as xe } from "./index-
|
|
4
|
+
import { g as ve, a as ce, b as he, i as Fe, t as je, l as xe } from "./index-oE1Kouy1.js";
|
|
5
5
|
import { ai as Ie, h as ue, au as X, a2 as W, af as fe, Y as Ne, F as Le, aR as Ue, S as Me, bP as qe } from "./recordbatch-HRu0SMKp.js";
|
|
6
6
|
import { g as $, a as de, b as Ve, c as $e, d as Pe, e as He, m as ze } from "./table-accessors-DBjWgN0C.js";
|
|
7
7
|
import { c as Qe } from "./convert-arrow-schema-CvZ3cT5m.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var R = Object.defineProperty;
|
|
2
2
|
var N = (t, e, r) => e in t ? R(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var u = (t, e, r) => N(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { c as W, W as x, d as O, e as _, f as m, h as g, j as P, s as z, n as I, k as B, m as k, o as $, p as C, q as F, r as M, u as U, v as D, w as L, x as j, y as v, z as T, A as J } from "./index-
|
|
5
|
-
import { F as Ue, R as De, _ as je, B as ve, C as Je, D as qe, E as Ve, G as Ge, H as He, I as Ke, J as Qe, K as Xe, L as Ye, M as Ze, N as er, O as rr, P as tr, Q as nr, S as ar, T as sr, U as cr, V as or, X as ir, Y as ur, Z as fr } from "./index-
|
|
4
|
+
import { c as W, W as x, d as O, e as _, f as m, h as g, j as P, s as z, n as I, k as B, m as k, o as $, p as C, q as F, r as M, u as U, v as D, w as L, x as j, y as v, z as T, A as J } from "./index-oE1Kouy1.js";
|
|
5
|
+
import { F as Ue, R as De, _ as je, B as ve, C as Je, D as qe, E as Ve, G as Ge, H as He, I as Ke, J as Qe, K as Xe, L as Ye, M as Ze, N as er, O as rr, P as tr, Q as nr, S as ar, T as sr, U as cr, V as or, X as ir, Y as ur, Z as fr } from "./index-oE1Kouy1.js";
|
|
6
6
|
import { g as q, i as V } from "./table-accessors-DBjWgN0C.js";
|
|
7
7
|
async function G(t, e, r = {}, n = {}) {
|
|
8
8
|
const a = W(t), s = x.getWorkerFarm(r), { source: c } = r, o = { name: a, source: c };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ri = Object.defineProperty;
|
|
2
2
|
var Ii = (t, a, i) => a in t ? Ri(t, a, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[a] = i;
|
|
3
3
|
var N = (t, a, i) => Ii(t, typeof a != "symbol" ? a + "" : a, i);
|
|
4
|
-
import { t as zt, $ as ca, a0 as ua, a1 as wi } from "./index-
|
|
4
|
+
import { t as zt, $ as ca, a0 as ua, a1 as wi } from "./index-oE1Kouy1.js";
|
|
5
5
|
import { c as Si } from "./convert-arrow-schema-CvZ3cT5m.js";
|
|
6
6
|
import { ai as Ni, af as Nt, h as Ci, au as Pi, a2 as Oi } from "./recordbatch-HRu0SMKp.js";
|
|
7
7
|
class Ti {
|