feat(share): export the share-view codec and link-path helpers (#1419)

* feat(share): export the share-view codec for host servers

Add `@gods-eye-view/core/share/view-codec` (src/share/viewCodec.js) as a
package export with its own boundary group. The codec is pure (no DOM, no
Cesium, no external dependencies), so a host's server can decode a
/share/<code> link, for example to describe the view in link previews.

* feat(share): export the share-link address helpers

Add `@gods-eye-view/core/share/link-path` (src/share/shareLinkPath.js), so a
host's server reads /share/<code> addresses the way the app does.
This commit is contained in:
Sameh Khamis authored and GitHub committed 2026-10-26 16:20:23 -07:00
1 parent da02fd8645
commit 3d9f153bc0
5 files changed
+45 -1

No files matched your search

@@ -0,0 +1,4 @@
- Hosts can read share links on their server: the share-link codec and the
`/share/<code>` address helpers are now package exports,
`@gods-eye-view/core/share/view-codec` and `@gods-eye-view/core/share/link-path`
(samehkhamis, #1419).
+4
View File
@@ -598,6 +598,10 @@ state subscriptions retain their existing event contract.
tracking handoff. It reads Cockpit admission and uses supplied tracking operations.
- `ui/share-restoration` owns the initial restore transaction, layer coordinator,
status notices and gesture/timer cleanup.
- `share/view-codec` is the share-link codec (`decodeShareView`,
`encodeShareView`). It is pure (no DOM, no Cesium), so a host's server can
read a `/share/<code>` link, for example to describe it in link previews.
`share/link-path` reads and builds the `/share/<code>` address itself.
- `ui/visual-settings` owns style preferences, detection overrides, display inputs
and IR cleanup. Its engine services and panel operations are explicit.
- `ui/panel-chrome` owns disclosure, docking, collapse preferences and temporary
+2 -1
View File
@@ -9,7 +9,8 @@ style, data layers and panel layout. There are two forms.
- **Short form** — `<app>/share/<code>`, where `<app>` is wherever the app is
served (an origin's root, or a base path) and `<code>` is encoded and
decoded by `src/share/viewCodec.js`, which is pure (no DOM, no Cesium) and
needs no server. The share button makes this form. The same code opens on
needs no server. Hosts import it as `@gods-eye-view/core/share/view-codec`
(a server can read a code to describe the view in a link preview). The share button makes this form. The same code opens on
any copy of the app. `src/share/shareLinkPath.js` reads and builds the
address, and `src/share/legacyShareState.js` converts between the long
form's parsed state and the code's state.
+2
View File
@@ -223,6 +223,8 @@
"./data/lifecycle": "./src/data/lifecycle.js",
"./ui/navigation": "./src/ui/navigationController.js",
"./ui/share-restoration": "./src/ui/shareRestoration.js",
"./share/view-codec": "./src/share/viewCodec.js",
"./share/link-path": "./src/share/shareLinkPath.js",
"./ui/visual-settings": "./src/ui/visualSettings.js",
"./ui/panel-chrome": "./src/ui/panelChrome.js",
"./layers/flights/records": "./src/layers/flights/records.js",
+33
View File
@@ -3887,6 +3887,39 @@
],
"external": []
},
"share-view-codec": {
"exports": ["./share/view-codec"],
"modules": [
"src/share/viewCodec.js",
"src/share/follow.js",
"src/share/wire.js",
"src/ui/visualPresets.js",
"src/bloom.js",
"src/styles/anime.js",
"src/styles/noir.js",
"src/styles/retro.js",
"src/styles/snow.js",
"src/styles/surveillance.js",
"src/styles/thermal.js",
"src/view/index.js",
"src/data/layerState.js",
"src/data/layerStateTokenReservations.json",
"src/data/idSwitches.js",
"src/data/detectionPolicy.js",
"src/scopeMaskPolicy.js",
"src/i18n/index.js",
"src/i18n/locale.js",
"src/i18n/locales/es.json",
"src/i18n/locales/ru.json",
"src/i18n/locales/zh-CN.json"
],
"external": []
},
"share-link-path": {
"exports": ["./share/link-path"],
"modules": ["src/share/shareLinkPath.js"],
"external": []
},
"ghostmaps": {
"exports": ["./layers/ghostmaps"],
"modules": [