@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.
Files changed (183) hide show
  1. package/README.md +39 -1
  2. package/dist/IOSenseApp.js +26 -6
  3. package/dist/SignIn.js +2 -2
  4. package/dist/auth.d.ts +7 -0
  5. package/dist/auth.js +35 -1
  6. package/dist/config.d.ts +5 -0
  7. package/dist/config.js +1 -0
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/map/globe.d.ts +5 -0
  11. package/dist/map/globe.js +5 -0
  12. package/dist/map/index.d.ts +21 -0
  13. package/dist/map/index.js +21 -0
  14. package/dist/map/source.d.ts +48 -0
  15. package/dist/map/source.js +73 -0
  16. package/dist/map/testing.d.ts +5 -0
  17. package/dist/map/testing.js +5 -0
  18. package/dist/session.d.ts +1 -1
  19. package/dist/session.js +1 -1
  20. package/package.json +55 -5
  21. package/vendor/SOURCE.txt +1 -0
  22. package/vendor/map-engine/cesium/camera.d.ts +10 -0
  23. package/vendor/map-engine/cesium/camera.js +25 -0
  24. package/vendor/map-engine/cesium/index.d.ts +2 -0
  25. package/vendor/map-engine/cesium/index.js +2 -0
  26. package/vendor/map-engine/cesium/renderer.d.ts +149 -0
  27. package/vendor/map-engine/cesium/renderer.js +837 -0
  28. package/vendor/map-engine/commands/index.d.ts +2 -0
  29. package/vendor/map-engine/commands/index.js +2 -0
  30. package/vendor/map-engine/commands/post-message.d.ts +32 -0
  31. package/vendor/map-engine/commands/post-message.js +77 -0
  32. package/vendor/map-engine/commands/webmcp.d.ts +17 -0
  33. package/vendor/map-engine/commands/webmcp.js +59 -0
  34. package/vendor/map-engine/core/commands.d.ts +82 -0
  35. package/vendor/map-engine/core/commands.js +46 -0
  36. package/vendor/map-engine/core/emitter.d.ts +9 -0
  37. package/vendor/map-engine/core/emitter.js +38 -0
  38. package/vendor/map-engine/core/equal.d.ts +2 -0
  39. package/vendor/map-engine/core/equal.js +28 -0
  40. package/vendor/map-engine/core/errors.d.ts +20 -0
  41. package/vendor/map-engine/core/errors.js +34 -0
  42. package/vendor/map-engine/core/geometry-family.d.ts +3 -0
  43. package/vendor/map-engine/core/geometry-family.js +13 -0
  44. package/vendor/map-engine/core/index.d.ts +4 -0
  45. package/vendor/map-engine/core/index.js +3 -0
  46. package/vendor/map-engine/core/types.d.ts +709 -0
  47. package/vendor/map-engine/core/types.js +7 -0
  48. package/vendor/map-engine/data/annotations.d.ts +3 -0
  49. package/vendor/map-engine/data/annotations.js +63 -0
  50. package/vendor/map-engine/data/contracts.d.ts +172 -0
  51. package/vendor/map-engine/data/contracts.js +12 -0
  52. package/vendor/map-engine/data/index.d.ts +4 -0
  53. package/vendor/map-engine/data/index.js +3 -0
  54. package/vendor/map-engine/data/schema.d.ts +7 -0
  55. package/vendor/map-engine/data/schema.js +40 -0
  56. package/vendor/map-engine/geofence/evaluator.d.ts +35 -0
  57. package/vendor/map-engine/geofence/evaluator.js +172 -0
  58. package/vendor/map-engine/geofence/history.d.ts +9 -0
  59. package/vendor/map-engine/geofence/history.js +19 -0
  60. package/vendor/map-engine/geofence/index.d.ts +2 -0
  61. package/vendor/map-engine/geofence/index.js +2 -0
  62. package/vendor/map-engine/index.d.ts +27 -0
  63. package/vendor/map-engine/index.js +14 -0
  64. package/vendor/map-engine/layers/index.d.ts +1 -0
  65. package/vendor/map-engine/layers/index.js +1 -0
  66. package/vendor/map-engine/layers/layers.d.ts +49 -0
  67. package/vendor/map-engine/layers/layers.js +316 -0
  68. package/vendor/map-engine/maplibre/deck-host.d.ts +105 -0
  69. package/vendor/map-engine/maplibre/deck-host.js +401 -0
  70. package/vendor/map-engine/maplibre/icons.d.ts +17 -0
  71. package/vendor/map-engine/maplibre/icons.js +65 -0
  72. package/vendor/map-engine/maplibre/index.d.ts +3 -0
  73. package/vendor/map-engine/maplibre/index.js +2 -0
  74. package/vendor/map-engine/maplibre/map-like.d.ts +56 -0
  75. package/vendor/map-engine/maplibre/map-like.js +1 -0
  76. package/vendor/map-engine/maplibre/renderer.d.ts +173 -0
  77. package/vendor/map-engine/maplibre/renderer.js +889 -0
  78. package/vendor/map-engine/maplibre/style.d.ts +84 -0
  79. package/vendor/map-engine/maplibre/style.js +493 -0
  80. package/vendor/map-engine/present/decorations.d.ts +25 -0
  81. package/vendor/map-engine/present/decorations.js +115 -0
  82. package/vendor/map-engine/present/index.d.ts +2 -0
  83. package/vendor/map-engine/present/index.js +2 -0
  84. package/vendor/map-engine/present/present.d.ts +47 -0
  85. package/vendor/map-engine/present/present.js +149 -0
  86. package/vendor/map-engine/query/index.d.ts +1 -0
  87. package/vendor/map-engine/query/index.js +1 -0
  88. package/vendor/map-engine/query/planner.d.ts +26 -0
  89. package/vendor/map-engine/query/planner.js +47 -0
  90. package/vendor/map-engine/react/MapView.d.ts +87 -0
  91. package/vendor/map-engine/react/MapView.js +270 -0
  92. package/vendor/map-engine/react/context.d.ts +39 -0
  93. package/vendor/map-engine/react/context.js +94 -0
  94. package/vendor/map-engine/react/index.d.ts +2 -0
  95. package/vendor/map-engine/react/index.js +2 -0
  96. package/vendor/map-engine/react/store.d.ts +19 -0
  97. package/vendor/map-engine/react/store.js +18 -0
  98. package/vendor/map-engine/realtime/apply.d.ts +74 -0
  99. package/vendor/map-engine/realtime/apply.js +155 -0
  100. package/vendor/map-engine/realtime/index.d.ts +1 -0
  101. package/vendor/map-engine/realtime/index.js +1 -0
  102. package/vendor/map-engine/render/index.d.ts +1 -0
  103. package/vendor/map-engine/render/index.js +1 -0
  104. package/vendor/map-engine/render/offline.d.ts +8 -0
  105. package/vendor/map-engine/render/offline.js +47 -0
  106. package/vendor/map-engine/render/renderer.d.ts +74 -0
  107. package/vendor/map-engine/render/renderer.js +1 -0
  108. package/vendor/map-engine/render/terrarium.d.ts +48 -0
  109. package/vendor/map-engine/render/terrarium.js +110 -0
  110. package/vendor/map-engine/runtime/drawing.d.ts +28 -0
  111. package/vendor/map-engine/runtime/drawing.js +58 -0
  112. package/vendor/map-engine/runtime/index.d.ts +5 -0
  113. package/vendor/map-engine/runtime/index.js +2 -0
  114. package/vendor/map-engine/runtime/offline.d.ts +24 -0
  115. package/vendor/map-engine/runtime/offline.js +37 -0
  116. package/vendor/map-engine/runtime/overlays.d.ts +25 -0
  117. package/vendor/map-engine/runtime/overlays.js +65 -0
  118. package/vendor/map-engine/runtime/runtime.d.ts +4 -0
  119. package/vendor/map-engine/runtime/runtime.js +2105 -0
  120. package/vendor/map-engine/runtime/types.d.ts +407 -0
  121. package/vendor/map-engine/runtime/types.js +1 -0
  122. package/vendor/map-engine/scene/index.d.ts +1 -0
  123. package/vendor/map-engine/scene/index.js +1 -0
  124. package/vendor/map-engine/scene/scene.d.ts +31 -0
  125. package/vendor/map-engine/scene/scene.js +216 -0
  126. package/vendor/map-engine/selection/index.d.ts +1 -0
  127. package/vendor/map-engine/selection/index.js +1 -0
  128. package/vendor/map-engine/selection/selection.d.ts +12 -0
  129. package/vendor/map-engine/selection/selection.js +28 -0
  130. package/vendor/map-engine/spatial/geojson.d.ts +15 -0
  131. package/vendor/map-engine/spatial/geojson.js +83 -0
  132. package/vendor/map-engine/spatial/geometry.d.ts +13 -0
  133. package/vendor/map-engine/spatial/geometry.js +206 -0
  134. package/vendor/map-engine/spatial/import.d.ts +27 -0
  135. package/vendor/map-engine/spatial/import.js +96 -0
  136. package/vendor/map-engine/spatial/index.d.ts +38 -0
  137. package/vendor/map-engine/spatial/index.js +37 -0
  138. package/vendor/map-engine/spatial/line-of-sight.d.ts +35 -0
  139. package/vendor/map-engine/spatial/line-of-sight.js +43 -0
  140. package/vendor/map-engine/spatial/measure.d.ts +28 -0
  141. package/vendor/map-engine/spatial/measure.js +90 -0
  142. package/vendor/map-engine/spatial/operations.d.ts +21 -0
  143. package/vendor/map-engine/spatial/operations.js +171 -0
  144. package/vendor/map-engine/spatial/query.d.ts +17 -0
  145. package/vendor/map-engine/spatial/query.js +88 -0
  146. package/vendor/map-engine/spatial/spatial-index.d.ts +24 -0
  147. package/vendor/map-engine/spatial/spatial-index.js +36 -0
  148. package/vendor/map-engine/spatial/volume-mesh.d.ts +19 -0
  149. package/vendor/map-engine/spatial/volume-mesh.js +56 -0
  150. package/vendor/map-engine/temporal/index.d.ts +3 -0
  151. package/vendor/map-engine/temporal/index.js +3 -0
  152. package/vendor/map-engine/temporal/journal.d.ts +20 -0
  153. package/vendor/map-engine/temporal/journal.js +34 -0
  154. package/vendor/map-engine/temporal/playback.d.ts +41 -0
  155. package/vendor/map-engine/temporal/playback.js +80 -0
  156. package/vendor/map-engine/temporal/tracks.d.ts +33 -0
  157. package/vendor/map-engine/temporal/tracks.js +119 -0
  158. package/vendor/map-engine/testing/annotation-store.d.ts +24 -0
  159. package/vendor/map-engine/testing/annotation-store.js +43 -0
  160. package/vendor/map-engine/testing/contracts.d.ts +41 -0
  161. package/vendor/map-engine/testing/contracts.js +328 -0
  162. package/vendor/map-engine/testing/fixtures-monitoring.d.ts +22 -0
  163. package/vendor/map-engine/testing/fixtures-monitoring.js +103 -0
  164. package/vendor/map-engine/testing/fixtures.d.ts +18 -0
  165. package/vendor/map-engine/testing/fixtures.js +28 -0
  166. package/vendor/map-engine/testing/index.d.ts +7 -0
  167. package/vendor/map-engine/testing/index.js +7 -0
  168. package/vendor/map-engine/testing/mock-ontology.d.ts +13 -0
  169. package/vendor/map-engine/testing/mock-ontology.js +24 -0
  170. package/vendor/map-engine/testing/mock-provider.d.ts +97 -0
  171. package/vendor/map-engine/testing/mock-provider.js +369 -0
  172. package/vendor/map-engine/testing/test-renderer.d.ts +72 -0
  173. package/vendor/map-engine/testing/test-renderer.js +153 -0
  174. package/vendor/map-engine/viewport/index.d.ts +1 -0
  175. package/vendor/map-engine/viewport/index.js +1 -0
  176. package/vendor/map-engine/viewport/viewport.d.ts +19 -0
  177. package/vendor/map-engine/viewport/viewport.js +102 -0
  178. package/vendor/map-provider-uns/client.d.ts +75 -0
  179. package/vendor/map-provider-uns/client.js +111 -0
  180. package/vendor/map-provider-uns/index.d.ts +2 -0
  181. package/vendor/map-provider-uns/index.js +2 -0
  182. package/vendor/map-provider-uns/provider.d.ts +131 -0
  183. 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;