@faclon-labs/app-sdk 0.1.0 → 0.3.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.
- package/README.md +39 -1
- package/dist/IOSenseApp.js +26 -6
- package/dist/SignIn.js +2 -2
- package/dist/auth.d.ts +7 -0
- package/dist/auth.js +35 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/map/globe.d.ts +5 -0
- package/dist/map/globe.js +5 -0
- package/dist/map/index.d.ts +21 -0
- package/dist/map/index.js +21 -0
- package/dist/map/source.d.ts +48 -0
- package/dist/map/source.js +73 -0
- package/dist/map/testing.d.ts +5 -0
- package/dist/map/testing.js +5 -0
- package/dist/session.d.ts +1 -1
- package/dist/session.js +1 -1
- package/package.json +55 -5
- package/vendor/SOURCE.txt +1 -0
- package/vendor/map-engine/cesium/camera.d.ts +10 -0
- package/vendor/map-engine/cesium/camera.js +25 -0
- package/vendor/map-engine/cesium/index.d.ts +2 -0
- package/vendor/map-engine/cesium/index.js +2 -0
- package/vendor/map-engine/cesium/renderer.d.ts +149 -0
- package/vendor/map-engine/cesium/renderer.js +837 -0
- package/vendor/map-engine/commands/index.d.ts +2 -0
- package/vendor/map-engine/commands/index.js +2 -0
- package/vendor/map-engine/commands/post-message.d.ts +32 -0
- package/vendor/map-engine/commands/post-message.js +77 -0
- package/vendor/map-engine/commands/webmcp.d.ts +17 -0
- package/vendor/map-engine/commands/webmcp.js +59 -0
- package/vendor/map-engine/core/commands.d.ts +82 -0
- package/vendor/map-engine/core/commands.js +46 -0
- package/vendor/map-engine/core/emitter.d.ts +9 -0
- package/vendor/map-engine/core/emitter.js +38 -0
- package/vendor/map-engine/core/equal.d.ts +2 -0
- package/vendor/map-engine/core/equal.js +28 -0
- package/vendor/map-engine/core/errors.d.ts +20 -0
- package/vendor/map-engine/core/errors.js +34 -0
- package/vendor/map-engine/core/geometry-family.d.ts +3 -0
- package/vendor/map-engine/core/geometry-family.js +13 -0
- package/vendor/map-engine/core/index.d.ts +4 -0
- package/vendor/map-engine/core/index.js +3 -0
- package/vendor/map-engine/core/types.d.ts +709 -0
- package/vendor/map-engine/core/types.js +7 -0
- package/vendor/map-engine/data/annotations.d.ts +3 -0
- package/vendor/map-engine/data/annotations.js +63 -0
- package/vendor/map-engine/data/contracts.d.ts +172 -0
- package/vendor/map-engine/data/contracts.js +12 -0
- package/vendor/map-engine/data/index.d.ts +4 -0
- package/vendor/map-engine/data/index.js +3 -0
- package/vendor/map-engine/data/schema.d.ts +7 -0
- package/vendor/map-engine/data/schema.js +40 -0
- package/vendor/map-engine/geofence/evaluator.d.ts +35 -0
- package/vendor/map-engine/geofence/evaluator.js +172 -0
- package/vendor/map-engine/geofence/history.d.ts +9 -0
- package/vendor/map-engine/geofence/history.js +19 -0
- package/vendor/map-engine/geofence/index.d.ts +2 -0
- package/vendor/map-engine/geofence/index.js +2 -0
- package/vendor/map-engine/index.d.ts +27 -0
- package/vendor/map-engine/index.js +14 -0
- package/vendor/map-engine/layers/index.d.ts +1 -0
- package/vendor/map-engine/layers/index.js +1 -0
- package/vendor/map-engine/layers/layers.d.ts +49 -0
- package/vendor/map-engine/layers/layers.js +316 -0
- package/vendor/map-engine/maplibre/deck-host.d.ts +105 -0
- package/vendor/map-engine/maplibre/deck-host.js +401 -0
- package/vendor/map-engine/maplibre/icons.d.ts +17 -0
- package/vendor/map-engine/maplibre/icons.js +65 -0
- package/vendor/map-engine/maplibre/index.d.ts +3 -0
- package/vendor/map-engine/maplibre/index.js +2 -0
- package/vendor/map-engine/maplibre/map-like.d.ts +56 -0
- package/vendor/map-engine/maplibre/map-like.js +1 -0
- package/vendor/map-engine/maplibre/renderer.d.ts +173 -0
- package/vendor/map-engine/maplibre/renderer.js +889 -0
- package/vendor/map-engine/maplibre/style.d.ts +84 -0
- package/vendor/map-engine/maplibre/style.js +493 -0
- package/vendor/map-engine/present/decorations.d.ts +25 -0
- package/vendor/map-engine/present/decorations.js +115 -0
- package/vendor/map-engine/present/index.d.ts +2 -0
- package/vendor/map-engine/present/index.js +2 -0
- package/vendor/map-engine/present/present.d.ts +47 -0
- package/vendor/map-engine/present/present.js +149 -0
- package/vendor/map-engine/query/index.d.ts +1 -0
- package/vendor/map-engine/query/index.js +1 -0
- package/vendor/map-engine/query/planner.d.ts +26 -0
- package/vendor/map-engine/query/planner.js +47 -0
- package/vendor/map-engine/react/MapView.d.ts +87 -0
- package/vendor/map-engine/react/MapView.js +270 -0
- package/vendor/map-engine/react/context.d.ts +39 -0
- package/vendor/map-engine/react/context.js +94 -0
- package/vendor/map-engine/react/index.d.ts +2 -0
- package/vendor/map-engine/react/index.js +2 -0
- package/vendor/map-engine/react/store.d.ts +19 -0
- package/vendor/map-engine/react/store.js +18 -0
- package/vendor/map-engine/realtime/apply.d.ts +74 -0
- package/vendor/map-engine/realtime/apply.js +155 -0
- package/vendor/map-engine/realtime/index.d.ts +1 -0
- package/vendor/map-engine/realtime/index.js +1 -0
- package/vendor/map-engine/render/index.d.ts +1 -0
- package/vendor/map-engine/render/index.js +1 -0
- package/vendor/map-engine/render/offline.d.ts +8 -0
- package/vendor/map-engine/render/offline.js +47 -0
- package/vendor/map-engine/render/renderer.d.ts +74 -0
- package/vendor/map-engine/render/renderer.js +1 -0
- package/vendor/map-engine/render/terrarium.d.ts +48 -0
- package/vendor/map-engine/render/terrarium.js +110 -0
- package/vendor/map-engine/runtime/drawing.d.ts +28 -0
- package/vendor/map-engine/runtime/drawing.js +58 -0
- package/vendor/map-engine/runtime/index.d.ts +5 -0
- package/vendor/map-engine/runtime/index.js +2 -0
- package/vendor/map-engine/runtime/offline.d.ts +24 -0
- package/vendor/map-engine/runtime/offline.js +37 -0
- package/vendor/map-engine/runtime/overlays.d.ts +25 -0
- package/vendor/map-engine/runtime/overlays.js +65 -0
- package/vendor/map-engine/runtime/runtime.d.ts +4 -0
- package/vendor/map-engine/runtime/runtime.js +2105 -0
- package/vendor/map-engine/runtime/types.d.ts +407 -0
- package/vendor/map-engine/runtime/types.js +1 -0
- package/vendor/map-engine/scene/index.d.ts +1 -0
- package/vendor/map-engine/scene/index.js +1 -0
- package/vendor/map-engine/scene/scene.d.ts +31 -0
- package/vendor/map-engine/scene/scene.js +216 -0
- package/vendor/map-engine/selection/index.d.ts +1 -0
- package/vendor/map-engine/selection/index.js +1 -0
- package/vendor/map-engine/selection/selection.d.ts +12 -0
- package/vendor/map-engine/selection/selection.js +28 -0
- package/vendor/map-engine/spatial/geojson.d.ts +15 -0
- package/vendor/map-engine/spatial/geojson.js +83 -0
- package/vendor/map-engine/spatial/geometry.d.ts +13 -0
- package/vendor/map-engine/spatial/geometry.js +206 -0
- package/vendor/map-engine/spatial/import.d.ts +27 -0
- package/vendor/map-engine/spatial/import.js +96 -0
- package/vendor/map-engine/spatial/index.d.ts +38 -0
- package/vendor/map-engine/spatial/index.js +37 -0
- package/vendor/map-engine/spatial/line-of-sight.d.ts +35 -0
- package/vendor/map-engine/spatial/line-of-sight.js +43 -0
- package/vendor/map-engine/spatial/measure.d.ts +28 -0
- package/vendor/map-engine/spatial/measure.js +90 -0
- package/vendor/map-engine/spatial/operations.d.ts +21 -0
- package/vendor/map-engine/spatial/operations.js +171 -0
- package/vendor/map-engine/spatial/query.d.ts +17 -0
- package/vendor/map-engine/spatial/query.js +88 -0
- package/vendor/map-engine/spatial/spatial-index.d.ts +24 -0
- package/vendor/map-engine/spatial/spatial-index.js +36 -0
- package/vendor/map-engine/spatial/volume-mesh.d.ts +19 -0
- package/vendor/map-engine/spatial/volume-mesh.js +56 -0
- package/vendor/map-engine/temporal/index.d.ts +3 -0
- package/vendor/map-engine/temporal/index.js +3 -0
- package/vendor/map-engine/temporal/journal.d.ts +20 -0
- package/vendor/map-engine/temporal/journal.js +34 -0
- package/vendor/map-engine/temporal/playback.d.ts +41 -0
- package/vendor/map-engine/temporal/playback.js +80 -0
- package/vendor/map-engine/temporal/tracks.d.ts +33 -0
- package/vendor/map-engine/temporal/tracks.js +119 -0
- package/vendor/map-engine/testing/annotation-store.d.ts +24 -0
- package/vendor/map-engine/testing/annotation-store.js +43 -0
- package/vendor/map-engine/testing/contracts.d.ts +41 -0
- package/vendor/map-engine/testing/contracts.js +328 -0
- package/vendor/map-engine/testing/fixtures-monitoring.d.ts +22 -0
- package/vendor/map-engine/testing/fixtures-monitoring.js +103 -0
- package/vendor/map-engine/testing/fixtures.d.ts +18 -0
- package/vendor/map-engine/testing/fixtures.js +28 -0
- package/vendor/map-engine/testing/index.d.ts +7 -0
- package/vendor/map-engine/testing/index.js +7 -0
- package/vendor/map-engine/testing/mock-ontology.d.ts +13 -0
- package/vendor/map-engine/testing/mock-ontology.js +24 -0
- package/vendor/map-engine/testing/mock-provider.d.ts +97 -0
- package/vendor/map-engine/testing/mock-provider.js +369 -0
- package/vendor/map-engine/testing/test-renderer.d.ts +72 -0
- package/vendor/map-engine/testing/test-renderer.js +153 -0
- package/vendor/map-engine/viewport/index.d.ts +1 -0
- package/vendor/map-engine/viewport/index.js +1 -0
- package/vendor/map-engine/viewport/viewport.d.ts +19 -0
- package/vendor/map-engine/viewport/viewport.js +102 -0
- package/vendor/map-provider-uns/client.d.ts +75 -0
- package/vendor/map-provider-uns/client.js +111 -0
- package/vendor/map-provider-uns/index.d.ts +2 -0
- package/vendor/map-provider-uns/index.js +2 -0
- package/vendor/map-provider-uns/provider.d.ts +131 -0
- package/vendor/map-provider-uns/provider.js +561 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { geometryFamily } from '../core/geometry-family.js';
|
|
2
|
+
import { scaled } from '../present/present.js';
|
|
3
|
+
const FAMILY = { area: 'areas', line: 'lines', point: 'points' };
|
|
4
|
+
const kindOf = (o) => FAMILY[geometryFamily(o.geometry.type)];
|
|
5
|
+
export const ANNOTATION_LAYER = (k) => `__annotations-${k}`;
|
|
6
|
+
export const PROPOSAL_LAYER = (k) => `__proposals-${k}`;
|
|
7
|
+
export const HIGHLIGHT_LAYER = (k) => `__highlight-${k}`;
|
|
8
|
+
const KINDS = ['areas', 'lines', 'points'];
|
|
9
|
+
export const ANNOTATION_COLOR = '#7A3FD6';
|
|
10
|
+
export const PROPOSAL_COLOR = '#D97706';
|
|
11
|
+
export const HIGHLIGHT_COLOR = '#F59E0B';
|
|
12
|
+
const selectable = { selectable: true, hoverable: true };
|
|
13
|
+
const quiet = { selectable: false, hoverable: false };
|
|
14
|
+
function trio(id, z, color, opts) {
|
|
15
|
+
const label = opts.label ? { label: { property: 'label', size: 11 } } : {};
|
|
16
|
+
return [
|
|
17
|
+
{ id: id('areas'), source: {}, visible: true, zIndex: z, interaction: opts.interaction, visualization: { type: 'polygon', style: [{ style: { color, opacity: opts.fill ?? 0.14, strokeColor: color, strokeWidth: 2, ...(opts.dash ? { dash: opts.dash } : {}) } }], ...label } },
|
|
18
|
+
{ id: id('lines'), source: {}, visible: true, zIndex: z + 0.1, interaction: opts.interaction, visualization: { type: 'line', style: [{ style: { color, size: opts.lineWidth ?? 3, ...(opts.dash ? { dash: opts.dash } : {}) } }], ...label } },
|
|
19
|
+
{ id: id('points'), source: {}, visible: true, zIndex: z + 0.2, interaction: opts.interaction, visualization: { type: 'marker', icon: { shape: opts.pointShape ?? 'diamond', size: opts.pointSize ?? 18 }, style: [{ style: { color, strokeColor: '#FFFFFF', opacity: opts.pointOpacity ?? 1 } }], ...label } },
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
export const ANNOTATION_LAYERS = trio(ANNOTATION_LAYER, 9_000, ANNOTATION_COLOR, { interaction: selectable, label: true });
|
|
23
|
+
export const PROPOSAL_LAYERS = trio(PROPOSAL_LAYER, 9_100, PROPOSAL_COLOR, { interaction: selectable, label: true, dash: [2, 1.5], fill: 0.1 });
|
|
24
|
+
/** A wide translucent halo under nothing but the draft: the objects keep their own look, the halo marks them. */
|
|
25
|
+
export function highlightLayers(color) {
|
|
26
|
+
return trio(HIGHLIGHT_LAYER, 9_500, color, { interaction: quiet, fill: 0.28, lineWidth: 12, pointSize: 44, pointOpacity: 0.4, pointShape: 'circle' });
|
|
27
|
+
}
|
|
28
|
+
/** The engine layer ids that carry objects people can select (annotations, proposals). */
|
|
29
|
+
export const SELECTABLE_OVERLAYS = new Set([...ANNOTATION_LAYERS, ...PROPOSAL_LAYERS].map((l) => l.id));
|
|
30
|
+
export const isOverlayLayer = (id) => id.startsWith('__annotations-') || id.startsWith('__proposals-') || id.startsWith('__highlight-');
|
|
31
|
+
/** Per-object look from an annotation's own style, as `$s:` values the renderers read before the layer's rules. */
|
|
32
|
+
function ownStyle(style) {
|
|
33
|
+
const out = {};
|
|
34
|
+
for (const k of ['color', 'strokeColor', 'opacity', 'size', 'strokeWidth'])
|
|
35
|
+
if (style?.[k] !== undefined)
|
|
36
|
+
out[scaled(k)] = style[k];
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
const empty = (id) => Object.fromEntries(KINDS.map((k) => [id(k), []]));
|
|
40
|
+
export function annotationObjects(list) {
|
|
41
|
+
const out = empty(ANNOTATION_LAYER);
|
|
42
|
+
for (const a of list) {
|
|
43
|
+
const o = { objectId: a.id, geometry: a.geometry, properties: { label: a.label ?? '', note: a.note ?? '', kind: a.kind, ...(a.author ? { author: a.author } : {}), ...ownStyle(a.style) } };
|
|
44
|
+
out[ANNOTATION_LAYER(kindOf(o))].push(o);
|
|
45
|
+
}
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
48
|
+
export function proposalObjects(list) {
|
|
49
|
+
const out = empty(PROPOSAL_LAYER);
|
|
50
|
+
for (const p of list) {
|
|
51
|
+
const o = { objectId: p.id, geometry: p.geometry, properties: { label: p.label ? `Proposed: ${p.label}` : 'Proposed', note: p.note ?? '', origin: p.origin } };
|
|
52
|
+
out[PROPOSAL_LAYER(kindOf(o))].push(o);
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
/** Halo objects for the highlighted ids that are on the map now (they follow their objects). */
|
|
57
|
+
export function highlightObjects(h, lookup) {
|
|
58
|
+
const out = empty(HIGHLIGHT_LAYER);
|
|
59
|
+
for (const id of h?.objectIds ?? []) {
|
|
60
|
+
const o = lookup(id);
|
|
61
|
+
if (o)
|
|
62
|
+
out[HIGHLIGHT_LAYER(kindOf(o))].push({ objectId: id, geometry: o.geometry });
|
|
63
|
+
}
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { MapConfig } from '../core/types.js';
|
|
2
|
+
export type { RuntimeState, MapRuntimeEvents, LayerFilter, ObjectInspection, FlyToOptions, LineOfSightOptions, MapRuntimeDeps, MapRuntimeStats, MapRuntimeOptions, MapRuntime, ResolvedReference } from './types.js';
|
|
3
|
+
import type { MapRuntimeDeps, MapRuntimeOptions, MapRuntime } from './types.js';
|
|
4
|
+
export declare function createMapRuntime(config: MapConfig, deps: MapRuntimeDeps, options?: MapRuntimeOptions): MapRuntime;
|