@zephytiju/prism-geovision-embed 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 (54) hide show
  1. package/README.md +101 -0
  2. package/dist/EmbedBody.d.ts +17 -0
  3. package/dist/EmbedBody.d.ts.map +1 -0
  4. package/dist/EmbedBody.js +81 -0
  5. package/dist/GeovisionEmbed.d.ts +20 -0
  6. package/dist/GeovisionEmbed.d.ts.map +1 -0
  7. package/dist/GeovisionEmbed.js +44 -0
  8. package/dist/describeViews.d.ts +26 -0
  9. package/dist/describeViews.d.ts.map +1 -0
  10. package/dist/describeViews.js +59 -0
  11. package/dist/index.d.ts +13 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +8 -0
  14. package/dist/locales/en.json +29 -0
  15. package/dist/locales/index.d.ts +79 -0
  16. package/dist/locales/index.d.ts.map +1 -0
  17. package/dist/locales/index.js +18 -0
  18. package/dist/locales/zh-CN.json +29 -0
  19. package/dist/map/MiniMap.d.ts +21 -0
  20. package/dist/map/MiniMap.d.ts.map +1 -0
  21. package/dist/map/MiniMap.js +75 -0
  22. package/dist/map/ReplayControl.d.ts +20 -0
  23. package/dist/map/ReplayControl.d.ts.map +1 -0
  24. package/dist/map/ReplayControl.js +37 -0
  25. package/dist/map/heat.d.ts +41 -0
  26. package/dist/map/heat.d.ts.map +1 -0
  27. package/dist/map/heat.js +54 -0
  28. package/dist/map/projection.d.ts +30 -0
  29. package/dist/map/projection.d.ts.map +1 -0
  30. package/dist/map/projection.js +54 -0
  31. package/dist/map/replay.d.ts +52 -0
  32. package/dist/map/replay.d.ts.map +1 -0
  33. package/dist/map/replay.js +91 -0
  34. package/dist/map/sideColoring.d.ts +39 -0
  35. package/dist/map/sideColoring.d.ts.map +1 -0
  36. package/dist/map/sideColoring.js +69 -0
  37. package/dist/map/tokens.d.ts +10 -0
  38. package/dist/map/tokens.d.ts.map +1 -0
  39. package/dist/map/tokens.js +25 -0
  40. package/dist/rail/LayerRailCompact.d.ts +19 -0
  41. package/dist/rail/LayerRailCompact.d.ts.map +1 -0
  42. package/dist/rail/LayerRailCompact.js +85 -0
  43. package/dist/resolveView.d.ts +18 -0
  44. package/dist/resolveView.d.ts.map +1 -0
  45. package/dist/resolveView.js +58 -0
  46. package/dist/seed.d.ts +22 -0
  47. package/dist/seed.d.ts.map +1 -0
  48. package/dist/seed.js +45 -0
  49. package/dist/types.d.ts +63 -0
  50. package/dist/types.d.ts.map +1 -0
  51. package/dist/types.js +9 -0
  52. package/locales/en.json +29 -0
  53. package/locales/zh-CN.json +29 -0
  54. package/package.json +68 -0
@@ -0,0 +1,19 @@
1
+ import type { RailLayerState } from "../types.js";
2
+ import type { GeovisionEmbedStrings } from "../locales/index.js";
3
+ /**
4
+ * The COMPACT layer rail — the same click/long-press contract as the globe's
5
+ * full-density rail, rendered at compact density inside the embed's map
6
+ * card: click toggles a layer, long-press (or right-click) opens the
7
+ * anchored options popover (opacity for paint layers). Defaults come from
8
+ * the saved view; changes are LOCAL to this surface and persisted only via
9
+ * the editor's block config — nothing is published.
10
+ */
11
+ export declare function LayerRailCompact({ layers, disabled, strings, onToggle, onOpacity, }: {
12
+ readonly layers: readonly RailLayerState[];
13
+ /** Static frames disable the rail (no pointer capture). */
14
+ readonly disabled: boolean;
15
+ readonly strings: GeovisionEmbedStrings;
16
+ readonly onToggle: (id: string) => void;
17
+ readonly onOpacity: (id: string, opacity: number) => void;
18
+ }): React.ReactElement;
19
+ //# sourceMappingURL=LayerRailCompact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayerRailCompact.d.ts","sourceRoot":"","sources":["../../src/rail/LayerRailCompact.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAKjE;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAC;IAC3C,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3D,GAAG,KAAK,CAAC,YAAY,CA0HrB"}
@@ -0,0 +1,85 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useRef, useState } from "react";
3
+ /** Long-press window (ms) before the options popover opens. */
4
+ const LONG_PRESS_MS = 600;
5
+ /**
6
+ * The COMPACT layer rail — the same click/long-press contract as the globe's
7
+ * full-density rail, rendered at compact density inside the embed's map
8
+ * card: click toggles a layer, long-press (or right-click) opens the
9
+ * anchored options popover (opacity for paint layers). Defaults come from
10
+ * the saved view; changes are LOCAL to this surface and persisted only via
11
+ * the editor's block config — nothing is published.
12
+ */
13
+ export function LayerRailCompact({ layers, disabled, strings, onToggle, onOpacity, }) {
14
+ const [openFor, setOpenFor] = useState(null);
15
+ const timer = useRef(null);
16
+ const clearTimer = useCallback(() => {
17
+ if (timer.current !== null) {
18
+ window.clearTimeout(timer.current);
19
+ timer.current = null;
20
+ }
21
+ }, []);
22
+ useEffect(() => clearTimer, [clearTimer]);
23
+ const labelFor = (layer) => layer.kind === "overlay"
24
+ ? strings.railOverlay
25
+ : layer.kind === "heat"
26
+ ? `${strings.railHeat} · ${layer.name}`
27
+ : `${strings.railSideColor} · ${layer.name}`;
28
+ return (_jsx("div", { style: {
29
+ position: "absolute",
30
+ left: 6,
31
+ top: 6,
32
+ display: "flex",
33
+ flexDirection: "column",
34
+ gap: 4,
35
+ zIndex: 4,
36
+ }, "data-testid": "geovision-embed-rail", "aria-label": strings.railTitle, children: layers.map((layer) => (_jsxs("div", { style: { position: "relative" }, children: [_jsx("button", { type: "button", disabled: disabled, "data-testid": `geovision-embed-rail-item-${layer.id}`, "data-enabled": String(layer.enabled), title: labelFor(layer), "aria-label": labelFor(layer), "aria-pressed": layer.enabled, onClick: () => {
37
+ if (disabled)
38
+ return;
39
+ if (openFor === layer.id) {
40
+ setOpenFor(null);
41
+ return;
42
+ }
43
+ onToggle(layer.id);
44
+ }, onContextMenu: (event) => {
45
+ event.preventDefault();
46
+ if (!disabled)
47
+ setOpenFor(layer.id);
48
+ }, onMouseDown: () => {
49
+ if (disabled)
50
+ return;
51
+ clearTimer();
52
+ timer.current = window.setTimeout(() => {
53
+ setOpenFor(layer.id);
54
+ }, LONG_PRESS_MS);
55
+ }, onMouseUp: clearTimer, onMouseLeave: clearTimer, onTouchStart: () => {
56
+ if (disabled)
57
+ return;
58
+ clearTimer();
59
+ timer.current = window.setTimeout(() => {
60
+ setOpenFor(layer.id);
61
+ }, LONG_PRESS_MS);
62
+ }, onTouchEnd: clearTimer, style: {
63
+ width: 26,
64
+ height: 22,
65
+ fontSize: 8,
66
+ borderRadius: 4,
67
+ cursor: disabled ? "default" : "pointer",
68
+ border: `1px solid ${layer.enabled ? "var(--mantine-color-accent-filled)" : "var(--mantine-color-border-filled)"}`,
69
+ background: "var(--mantine-color-input-filled)",
70
+ color: layer.enabled ? "var(--mantine-color-accent-filled)" : "var(--mantine-color-muted-filled)",
71
+ padding: 0,
72
+ fontFamily: "var(--mantine-font-family-monospace)",
73
+ }, children: layer.kind === "overlay" ? "◫" : layer.kind === "heat" ? "◈" : "◐" }), openFor === layer.id ? (_jsxs("div", { "data-testid": `geovision-embed-rail-options-${layer.id}`, style: {
74
+ position: "absolute",
75
+ left: 32,
76
+ top: 0,
77
+ width: 132,
78
+ padding: 6,
79
+ borderRadius: 4,
80
+ background: "var(--mantine-color-input-filled)",
81
+ border: "1px solid var(--mantine-color-border-filled)",
82
+ }, children: [_jsx("div", { style: { fontSize: 8, color: "var(--mantine-color-muted-filled)", marginBottom: 3 }, children: `${strings.railOptions} · ${strings.railOpacity}` }), _jsx("input", { type: "range", min: 0.1, max: 1, step: 0.05, value: layer.opacity, "aria-label": strings.railOpacity, "data-testid": `geovision-embed-rail-opacity-${layer.id}`, onChange: (event) => {
83
+ onOpacity(layer.id, Number(event.target.value));
84
+ }, style: { width: "100%" } })] })) : null] }, layer.id))) }));
85
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * { sourceFileRef, viewId } resolution (task cd40ad7c): the embed reads the
3
+ * file through the generated IFileEntry client bound to the HOST-supplied
4
+ * Lattice transport — NO executor is installed by the embed itself, so no
5
+ * live fetches happen beyond the host's own routes. Validation is FAIL-
6
+ * CLOSED through the authoritative bundle format (structure + digest), and
7
+ * the viewId must match the file's single-view identity (the file ref).
8
+ */
9
+ import type { LatticeTransport } from "@zephytiju/prism-react";
10
+ import type { GeovisionViewFile } from "@zephytiju/lattice-common-bundle/geovisionView";
11
+ import type { EmbedFilePhase } from "./types.js";
12
+ export interface ResolvedView {
13
+ readonly phase: EmbedFilePhase;
14
+ readonly file: GeovisionViewFile | null;
15
+ }
16
+ /** Resolves + validates the saved view; re-runs on ref/transport identity change. */
17
+ export declare function useResolvedView(transport: LatticeTransport, sourceFileRef: string, viewId: string): ResolvedView;
18
+ //# sourceMappingURL=resolveView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveView.d.ts","sourceRoot":"","sources":["../src/resolveView.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACzC;AAED,qFAAqF;AACrF,wBAAgB,eAAe,CAC7B,SAAS,EAAE,gBAAgB,EAC3B,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,GACb,YAAY,CA6Cd"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * { sourceFileRef, viewId } resolution (task cd40ad7c): the embed reads the
3
+ * file through the generated IFileEntry client bound to the HOST-supplied
4
+ * Lattice transport — NO executor is installed by the embed itself, so no
5
+ * live fetches happen beyond the host's own routes. Validation is FAIL-
6
+ * CLOSED through the authoritative bundle format (structure + digest), and
7
+ * the viewId must match the file's single-view identity (the file ref).
8
+ */
9
+ import { useEffect, useState } from "react";
10
+ import { createFileEntryClient } from "@zephytiju/lattice-common-interfaces";
11
+ import { readGeovisionView } from "@zephytiju/lattice-common-bundle/geovisionView";
12
+ /** Resolves + validates the saved view; re-runs on ref/transport identity change. */
13
+ export function useResolvedView(transport, sourceFileRef, viewId) {
14
+ const [state, setState] = useState({ phase: { phase: "loading" }, file: null });
15
+ useEffect(() => {
16
+ let cancelled = false;
17
+ setState({ phase: { phase: "loading" }, file: null });
18
+ const client = createFileEntryClient(transport);
19
+ void client
20
+ .read({ ref: sourceFileRef })
21
+ .then((result) => {
22
+ if (cancelled)
23
+ return;
24
+ const check = readGeovisionView(result.content);
25
+ if (!check.ok) {
26
+ setState({
27
+ phase: { phase: "error", code: "invalid", message: check.errors[0]?.message ?? "invalid" },
28
+ file: null,
29
+ });
30
+ return;
31
+ }
32
+ if (viewId !== sourceFileRef) {
33
+ setState({
34
+ phase: { phase: "error", code: "unknown-view", message: viewId },
35
+ file: null,
36
+ });
37
+ return;
38
+ }
39
+ setState({ phase: { phase: "ready" }, file: check.file });
40
+ })
41
+ .catch((error) => {
42
+ if (cancelled)
43
+ return;
44
+ setState({
45
+ phase: {
46
+ phase: "error",
47
+ code: "not-found",
48
+ message: error instanceof Error ? error.message : "read failed",
49
+ },
50
+ file: null,
51
+ });
52
+ });
53
+ return () => {
54
+ cancelled = true;
55
+ };
56
+ }, [transport, sourceFileRef, viewId]);
57
+ return state;
58
+ }
package/dist/seed.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * ChannelScope seeding (pure derivation): the validated file seeds an
3
+ * ISOLATED registry — "query-box.entity-results" carries the snapshot
4
+ * projection and "search-results.selected-entity" the workspace's selected
5
+ * entity (as the EntityReference the mounted packages consume). The real
6
+ * packages mounted inside the scope (relation-fluxboard, timeline-board,
7
+ * stats-panel) bind to the scoped registry through context, so every embed
8
+ * renders its own file and nothing leaks across embeds.
9
+ */
10
+ import type { GeovisionViewFile } from "@zephytiju/lattice-common-bundle/geovisionView";
11
+ import type { EntityReference, TimeWindow } from "@zephytiju/lattice-common-interfaces";
12
+ /** The channel ids the embed seeds (shared conventions of the platform). */
13
+ export declare const ENTITY_RESULTS_CHANNEL = "query-box.entity-results";
14
+ export declare const SELECTED_ENTITY_CHANNEL = "search-results.selected-entity";
15
+ export interface EmbedSeed {
16
+ readonly seed: Readonly<Record<string, unknown>>;
17
+ readonly selected: EntityReference | null;
18
+ /** The replay/timeline window (workspace.replayWindow ?? refs.timelineWindow ?? snapshot span). */
19
+ readonly window: TimeWindow;
20
+ }
21
+ export declare function seedFromFile(file: GeovisionViewFile): EmbedSeed;
22
+ //# sourceMappingURL=seed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../src/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAA2B,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAEjH,4EAA4E;AAC5E,eAAO,MAAM,sBAAsB,6BAA6B,CAAC;AACjE,eAAO,MAAM,uBAAuB,mCAAmC,CAAC;AAExE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IAC1C,mGAAmG;IACnG,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B;AAiBD,wBAAgB,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,CAqB/D"}
package/dist/seed.js ADDED
@@ -0,0 +1,45 @@
1
+ /**
2
+ * ChannelScope seeding (pure derivation): the validated file seeds an
3
+ * ISOLATED registry — "query-box.entity-results" carries the snapshot
4
+ * projection and "search-results.selected-entity" the workspace's selected
5
+ * entity (as the EntityReference the mounted packages consume). The real
6
+ * packages mounted inside the scope (relation-fluxboard, timeline-board,
7
+ * stats-panel) bind to the scoped registry through context, so every embed
8
+ * renders its own file and nothing leaks across embeds.
9
+ */
10
+ /** The channel ids the embed seeds (shared conventions of the platform). */
11
+ export const ENTITY_RESULTS_CHANNEL = "query-box.entity-results";
12
+ export const SELECTED_ENTITY_CHANNEL = "search-results.selected-entity";
13
+ function fallbackWindow(file) {
14
+ const events = file.snapshot.timelineEvents;
15
+ if (events.length > 0) {
16
+ const times = events.map((event) => Date.parse(event.at)).filter((value) => Number.isFinite(value));
17
+ if (times.length > 0) {
18
+ const min = Math.min(...times);
19
+ const max = Math.max(...times);
20
+ return { start: new Date(min).toISOString(), end: new Date(max).toISOString() };
21
+ }
22
+ }
23
+ const saved = Date.parse(file.savedAt);
24
+ const end = Number.isFinite(saved) ? saved : Date.now();
25
+ return { start: new Date(end - 6 * 3600_000).toISOString(), end: new Date(end).toISOString() };
26
+ }
27
+ export function seedFromFile(file) {
28
+ const results = file.snapshot.entityResults;
29
+ const selectedId = file.workspace.selectedEntity;
30
+ const item = selectedId === null
31
+ ? null
32
+ : (results?.items.find((candidate) => candidate.id === selectedId) ?? null);
33
+ const selected = item === null
34
+ ? null
35
+ : { id: item.id, ontologyInterface: "IEntitySummary", label: item.label };
36
+ const window = file.workspace.replayWindow ?? file.refs.timelineWindow ?? fallbackWindow(file);
37
+ return {
38
+ seed: {
39
+ [ENTITY_RESULTS_CHANNEL]: results,
40
+ [SELECTED_ENTITY_CHANNEL]: selected,
41
+ },
42
+ selected,
43
+ window,
44
+ };
45
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Contract + shared types of the geovision-embed micro-UI (component id
3
+ * "geovision-embed"). The handoff implements the CLOSED cross-session
4
+ * contract exactly: { sourceFileRef, viewId, mode, interactionMode, locale,
5
+ * width, height } — chrome (title / SRC FILE / VIEW ▾ / ↗) is the EDITOR's;
6
+ * this component owns only the render slot, and EVERY internal control
7
+ * (layer rail, replay, …) stays inside the slot.
8
+ */
9
+ /** v1 render mode: "static" renders from the snapshot only; "live" is reserved and behaves as static in v1. */
10
+ export type GeovisionEmbedMode = "static" | "live";
11
+ /** "rich" captures pointer events inside the slot for inline interactions; "static" degrades to a static frame. */
12
+ export type GeovisionEmbedInteractionMode = "rich" | "static";
13
+ export interface GeovisionEmbedProps {
14
+ /** Stable file ref addressing the saved geovision-view file (IFileEntry.read). */
15
+ readonly sourceFileRef: string;
16
+ /**
17
+ * The saved view to render. A geovision-view file carries exactly one
18
+ * view; the viewId is its identity — the file ref itself. A mismatch
19
+ * yields the localized "unknown view" failure frame.
20
+ */
21
+ readonly viewId: string;
22
+ /** v1 render mode (default "static"; "live" reserved, behaves as static). */
23
+ readonly mode?: GeovisionEmbedMode;
24
+ /** Interaction mode (default "rich"); also forced static below 240px height. */
25
+ readonly interactionMode?: GeovisionEmbedInteractionMode;
26
+ /** UI locale for the component-fixed strings (default "en"). */
27
+ readonly locale?: "en" | "zh-CN";
28
+ /** Slot width (CSS length or number-in-px). */
29
+ readonly width?: number | string;
30
+ /** Slot height in px; below 240 the embed degrades to a static frame. */
31
+ readonly height?: number | string;
32
+ }
33
+ /** One entry the editor's VIEW dropdown lists (describeViews). */
34
+ export interface GeovisionViewDescriptor {
35
+ /** Stable view id — the file ref (one saved view per file). */
36
+ readonly viewId: string;
37
+ /** Display name derived from the file (savedBy + save time). */
38
+ readonly name: string;
39
+ /** Map variant the view paints: "normal" | "heat" | "side-color". */
40
+ readonly previewKind: "normal" | "heat" | "side-color";
41
+ }
42
+ /** Resolution lifecycle of { sourceFileRef, viewId }. */
43
+ export type EmbedFilePhase = {
44
+ readonly phase: "loading";
45
+ } | {
46
+ readonly phase: "ready";
47
+ } | {
48
+ readonly phase: "error";
49
+ readonly code: "not-found" | "invalid" | "unknown-view";
50
+ readonly message: string;
51
+ };
52
+ /** Rail-visible layer derived from the file's saved layer set. */
53
+ export interface RailLayerState {
54
+ /** Overlay/heat/side-color identity inside the file's layer list. */
55
+ readonly id: string;
56
+ readonly kind: "overlay" | "heat" | "side-color";
57
+ /** Rail label (selection name / variant name). */
58
+ readonly name: string;
59
+ readonly enabled: boolean;
60
+ /** Paint opacity 0..1 (heat/overlay) or 1 for side-color. */
61
+ readonly opacity: number;
62
+ }
63
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,+GAA+G;AAC/G,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEnD,mHAAmH;AACnH,MAAM,MAAM,6BAA6B,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE9D,MAAM,WAAW,mBAAmB;IAClC,kFAAkF;IAClF,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IACnC,gFAAgF;IAChF,QAAQ,CAAC,eAAe,CAAC,EAAE,6BAA6B,CAAC;IACzD,gEAAgE;IAChE,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,yEAAyE;IACzE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC;AAED,kEAAkE;AAClE,MAAM,WAAW,uBAAuB;IACtC,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,WAAW,EAAE,QAAQ,GAAG,MAAM,GAAG,YAAY,CAAC;CACxD;AAED,yDAAyD;AACzD,MAAM,MAAM,cAAc,GACtB;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,cAAc,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnH,kEAAkE;AAClE,MAAM,WAAW,cAAc;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,YAAY,CAAC;IACjD,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B"}
package/dist/types.js ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Contract + shared types of the geovision-embed micro-UI (component id
3
+ * "geovision-embed"). The handoff implements the CLOSED cross-session
4
+ * contract exactly: { sourceFileRef, viewId, mode, interactionMode, locale,
5
+ * width, height } — chrome (title / SRC FILE / VIEW ▾ / ↗) is the EDITOR's;
6
+ * this component owns only the render slot, and EVERY internal control
7
+ * (layer rail, replay, …) stays inside the slot.
8
+ */
9
+ export {};
@@ -0,0 +1,29 @@
1
+ {
2
+ "geovision-embed": {
3
+ "loading": "LOADING VIEW…",
4
+ "errNotFound": "FILE NOT FOUND",
5
+ "errInvalid": "FILE FAILED VALIDATION",
6
+ "errUnknownView": "UNKNOWN VIEW",
7
+ "retry": "RETRY",
8
+ "slotAria": "Geovision embed",
9
+ "mapAria": "Situation mini-map",
10
+ "railTitle": "LAYERS",
11
+ "railOverlay": "MARKERS",
12
+ "railSideColor": "SIDE COLORING",
13
+ "railHeat": "HEAT",
14
+ "railOpacity": "OPACITY",
15
+ "railOptions": "LAYER OPTIONS",
16
+ "replayPlay": "PLAY",
17
+ "replayPause": "PAUSE",
18
+ "replayScrub": "Replay progress",
19
+ "replayTime": "POSITION",
20
+ "replayOff": "NO TIMELINE EVENTS",
21
+ "staticFrame": "STATIC FRAME",
22
+ "fluxTitle": "RELATIONS",
23
+ "fluxSubtitle": "SNAPSHOT GRAPH",
24
+ "timelineTitle": "TIMELINE",
25
+ "timelineSubtitle": "SNAPSHOT EVENTS",
26
+ "statsTitle": "STATISTICS",
27
+ "statsSubtitle": "SNAPSHOT DERIVED"
28
+ }
29
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "geovision-embed": {
3
+ "loading": "正在加载视图…",
4
+ "errNotFound": "文件不存在",
5
+ "errInvalid": "文件校验失败",
6
+ "errUnknownView": "未知视图",
7
+ "retry": "重试",
8
+ "slotAria": "地理视野嵌入",
9
+ "mapAria": "态势小地图",
10
+ "railTitle": "图层",
11
+ "railOverlay": "标记",
12
+ "railSideColor": "阵营配色",
13
+ "railHeat": "热力",
14
+ "railOpacity": "不透明度",
15
+ "railOptions": "图层选项",
16
+ "replayPlay": "播放",
17
+ "replayPause": "暂停",
18
+ "replayScrub": "回放进度",
19
+ "replayTime": "位置",
20
+ "replayOff": "无时间线事件",
21
+ "staticFrame": "静态帧",
22
+ "fluxTitle": "关系图",
23
+ "fluxSubtitle": "快照关系",
24
+ "timelineTitle": "时间线",
25
+ "timelineSubtitle": "快照事件",
26
+ "statsTitle": "统计分析",
27
+ "statsSubtitle": "快照派生"
28
+ }
29
+ }
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@zephytiju/prism-geovision-embed",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Platform Prism geovision-embed micro-UI (component id \"geovision-embed\"): the agreed dossier-embed render component — <GeovisionEmbed sourceFileRef viewId mode? interactionMode? locale? width height /> resolves the geovision-view file via IFileEntry.read, validates it against the authoritative bundle format, seeds an isolated ChannelScope with the snapshot channels and mounts the REAL relation-fluxboard, timeline-board and stats-panel packages plus the simplified SVG mini-map (normal markers / heat density / side coloring) with the video-like replay control. describeViews(sourceFileRef) feeds the editor's VIEW dropdown. Ships en + zh-CN locale bundles.",
6
+ "license": "UNLICENSED",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "./locales/*": "./locales/*"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "locales"
22
+ ],
23
+ "scripts": {
24
+ "dev": "vite --host 127.0.0.1",
25
+ "build": "tsc -p tsconfig.build.json && node scripts/copy-locales.mjs",
26
+ "typecheck": "tsc --noEmit",
27
+ "test": "vitest run",
28
+ "shot-demo": "node scripts/shot-demo.mjs"
29
+ },
30
+ "peerDependencies": {
31
+ "@mantine/core": "^8.1.1",
32
+ "@xyflow/react": "^12.0.0",
33
+ "@zephytiju/lattice-common-bundle": ">=0.2.0",
34
+ "@zephytiju/lattice-common-interfaces": ">=0.3.0",
35
+ "@zephytiju/prism-react": ">=0.2.0",
36
+ "@zephytiju/prism-relation-fluxboard": ">=0.1.0",
37
+ "@zephytiju/prism-stats-panel": ">=0.1.0",
38
+ "@zephytiju/prism-timeline-board": ">=0.1.0",
39
+ "react": "^19.1.0",
40
+ "react-dom": "^19.1.0"
41
+ },
42
+ "devDependencies": {
43
+ "@mantine/core": "8.1.1",
44
+ "@mantine/hooks": "^8.1.1",
45
+ "@testing-library/dom": "^10.4.0",
46
+ "@testing-library/react": "^16.1.0",
47
+ "@types/node": "^22.10.2",
48
+ "@types/react": "^19.1.0",
49
+ "@types/react-dom": "^19.1.0",
50
+ "@xyflow/react": "12.11.6",
51
+ "@zephytiju/lattice-common-bundle": "0.2.0",
52
+ "@zephytiju/lattice-common-interfaces": "0.3.0",
53
+ "@zephytiju/prism-react": "0.2.0",
54
+ "@zephytiju/prism-relation-fluxboard": "file:vendor/zephytiju-prism-relation-fluxboard-0.1.0.tgz",
55
+ "@zephytiju/prism-stats-panel": "file:vendor/zephytiju-prism-stats-panel-0.1.0.tgz",
56
+ "@zephytiju/prism-timeline-board": "file:vendor/zephytiju-prism-timeline-board-0.1.0.tgz",
57
+ "jsdom": "^25.0.1",
58
+ "puppeteer-core": "^24.43.1",
59
+ "react": "19.1.0",
60
+ "react-dom": "19.1.0",
61
+ "typescript": "^5.7.2",
62
+ "vite": "6.0.5",
63
+ "vitest": "^2.1.8"
64
+ },
65
+ "engines": {
66
+ "node": ">=20"
67
+ }
68
+ }