@found-in-space/skykit 0.2.0-alpha.1 → 0.2.0-alpha.20260528
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 +142 -11
- package/examples/custom-object-layer/custom-object-layer.js +1 -24
- package/examples/xr-free-roam/index.html +62 -4
- package/examples/xr-free-roam/xr-free-roam.css +249 -18
- package/examples/xr-free-roam/xr-free-roam.js +675 -274
- package/package.json +22 -6
- package/src/__tests__/skykit-anchored-images.test.js +32 -4
- package/src/__tests__/skykit-browser.test.js +267 -0
- package/src/__tests__/skykit-data.test.js +131 -0
- package/src/__tests__/skykit-parallax.test.js +4 -4
- package/src/__tests__/skykit-touch-os.test.js +71 -0
- package/src/__tests__/skykit-xr.test.js +179 -2
- package/src/__tests__/skykit.test.js +142 -506
- package/src/actions.js +0 -8
- package/src/anchored-images.js +14 -15
- package/src/browser-addons.d.ts +16 -0
- package/src/browser-addons.js +155 -0
- package/src/browser-constellations.d.ts +13 -0
- package/src/browser-constellations.js +387 -0
- package/src/browser.d.ts +81 -0
- package/src/browser.js +192 -13
- package/src/data.d.ts +133 -0
- package/src/data.js +447 -0
- package/src/embed.d.ts +5 -0
- package/src/embed.js +53 -2
- package/src/hr-diagram.js +23 -5
- package/src/index.d.ts +21 -73
- package/src/index.js +0 -1
- package/src/plugins.js +22 -708
- package/src/three-shim.d.ts +32 -0
- package/src/touch-os.d.ts +70 -0
- package/src/touch-os.js +275 -0
- package/src/utils.js +96 -6
- package/src/viewer-entry.d.ts +10 -0
- package/src/viewer-entry.js +4 -0
- package/src/viewer.js +110 -12
- package/src/xr/plugins.js +298 -13
- package/src/xr/session.js +60 -14
- package/src/xr.d.ts +40 -0
- package/src/xr.js +2 -0
package/src/index.d.ts
CHANGED
|
@@ -11,17 +11,6 @@ import type {
|
|
|
11
11
|
SpatialTargetInput,
|
|
12
12
|
SpatialVector3,
|
|
13
13
|
} from '@found-in-space/spatial';
|
|
14
|
-
import type {
|
|
15
|
-
CreateTimedJourneyEvaluatorOptions,
|
|
16
|
-
JourneyController,
|
|
17
|
-
JourneyDefinition,
|
|
18
|
-
JourneyGraph,
|
|
19
|
-
JourneySceneSpec,
|
|
20
|
-
TimedJourney,
|
|
21
|
-
TimedJourneyCue,
|
|
22
|
-
TimedJourneyEvaluator,
|
|
23
|
-
TimedJourneyFrame,
|
|
24
|
-
} from '@found-in-space/journey';
|
|
25
14
|
import type {
|
|
26
15
|
StarCellDelta,
|
|
27
16
|
StarCellStore,
|
|
@@ -67,6 +56,18 @@ export interface QuaternionLike {
|
|
|
67
56
|
w: number;
|
|
68
57
|
}
|
|
69
58
|
|
|
59
|
+
export interface SkykitLookAtInput {
|
|
60
|
+
targetPc?: Vector3Like | [number, number, number];
|
|
61
|
+
raDeg?: number;
|
|
62
|
+
raHours?: number;
|
|
63
|
+
decDeg?: number;
|
|
64
|
+
distancePc?: number;
|
|
65
|
+
star?: string | StarObjectRef | StarPickMeta | unknown;
|
|
66
|
+
orientationIcrs?: QuaternionLike;
|
|
67
|
+
positionAngleDeg?: number;
|
|
68
|
+
[key: string]: unknown;
|
|
69
|
+
}
|
|
70
|
+
|
|
70
71
|
export interface SkykitObserverMotion {
|
|
71
72
|
velocityPcPerSec: Vector3Like;
|
|
72
73
|
speedPcPerSec: number;
|
|
@@ -76,8 +77,8 @@ export interface SkykitViewState {
|
|
|
76
77
|
revision: number;
|
|
77
78
|
observerPc: Vector3Like;
|
|
78
79
|
renderObserverPosition: Vector3Like;
|
|
80
|
+
lookAt?: SkykitLookAtInput | null;
|
|
79
81
|
targetPc?: Vector3Like | null;
|
|
80
|
-
directionIcrs?: Vector3Like | null;
|
|
81
82
|
orientationIcrs?: QuaternionLike | null;
|
|
82
83
|
limitingMagnitude: number;
|
|
83
84
|
verticalFovDeg?: number;
|
|
@@ -370,6 +371,8 @@ export interface SkykitViewerOptions {
|
|
|
370
371
|
parts?: Iterable<SkykitThreePart>;
|
|
371
372
|
plugins?: Iterable<SkykitPluginInput>;
|
|
372
373
|
view?: Partial<SkykitViewState>;
|
|
374
|
+
resolveLookAtStar?: (star: unknown, lookAt: SkykitLookAtInput) => SkykitLookAtInput | Vector3Like | [number, number, number] | Promise<SkykitLookAtInput | Vector3Like | [number, number, number] | null> | null;
|
|
375
|
+
resolveLookAtBookmark?: (bookmarkId: string, lookAt: unknown) => SkykitLookAtInput | Vector3Like | [number, number, number] | Promise<SkykitLookAtInput | Vector3Like | [number, number, number] | null> | null;
|
|
373
376
|
autoMountRenderer?: boolean;
|
|
374
377
|
}
|
|
375
378
|
|
|
@@ -412,6 +415,7 @@ export interface SkykitViewer {
|
|
|
412
415
|
readonly observerRig: SkykitObserverRig;
|
|
413
416
|
readonly actions: SkykitActionRegistry;
|
|
414
417
|
addPart(part: SkykitThreePart): SkykitPluginTeardown;
|
|
418
|
+
addPlugin(plugin: SkykitPluginInput): Promise<SkykitPluginTeardown>;
|
|
415
419
|
getViewState(): SkykitViewState;
|
|
416
420
|
requestViewState(patch: Partial<SkykitViewState>, reason?: string): void;
|
|
417
421
|
update(deltaSeconds?: number, frameOptions?: SkykitFrameOptions): void;
|
|
@@ -501,11 +505,11 @@ export interface AnchoredImageCatalog {
|
|
|
501
505
|
resolveTargetPc(key: string, options?: AnchoredImageTargetOptions): Vector3Like | null;
|
|
502
506
|
resolveLookAt(key: string, options?: AnchoredImageLookAtOptions): AnchoredImageLookAtResult | null;
|
|
503
507
|
resolveNearest(
|
|
504
|
-
|
|
508
|
+
lookDirection: Vector3Like | [number, number, number],
|
|
505
509
|
options?: AnchoredImageResolveNearestOptions
|
|
506
510
|
): AnchoredImageMatch | null;
|
|
507
511
|
resolveWithinAngle(
|
|
508
|
-
|
|
512
|
+
lookDirection: Vector3Like | [number, number, number],
|
|
509
513
|
options: AnchoredImageResolveWithinAngleOptions
|
|
510
514
|
): AnchoredImageMatch[];
|
|
511
515
|
}
|
|
@@ -553,6 +557,8 @@ export interface AnchoredImageSkyPluginOptions {
|
|
|
553
557
|
catalog: AnchoredImageCatalog;
|
|
554
558
|
controller: AnchoredImageController;
|
|
555
559
|
loading?: AnchoredImageSkyLoading;
|
|
560
|
+
anchorMode?: SkykitLayerAnchorMode;
|
|
561
|
+
scaleBandId?: string;
|
|
556
562
|
fixedAtInfinity?: boolean;
|
|
557
563
|
radius?: number;
|
|
558
564
|
opacity?: number;
|
|
@@ -674,7 +680,7 @@ export interface SkykitStarSourceRestartRetentionPolicy {
|
|
|
674
680
|
}
|
|
675
681
|
|
|
676
682
|
export interface SkykitHrDiagramTouchOsOptions {
|
|
677
|
-
surfaces?: EmbeddedSurfaceService;
|
|
683
|
+
surfaces?: EmbeddedSurfaceService | (() => EmbeddedSurfaceService | null | undefined);
|
|
678
684
|
sourceId?: string;
|
|
679
685
|
componentId?: string;
|
|
680
686
|
width?: number;
|
|
@@ -891,53 +897,6 @@ export interface SkykitNavigationPluginOptions extends SpatialNavigationAutomati
|
|
|
891
897
|
) => SpatialTargetInput | Promise<SpatialTargetInput | null> | null;
|
|
892
898
|
}
|
|
893
899
|
|
|
894
|
-
export interface SkykitJourneyPluginOptions {
|
|
895
|
-
id?: string;
|
|
896
|
-
priority?: number;
|
|
897
|
-
journey?: JourneyDefinition;
|
|
898
|
-
controller?: JourneyController | null;
|
|
899
|
-
graph?: JourneyGraph;
|
|
900
|
-
scenes?: Record<string, JourneySceneSpec>;
|
|
901
|
-
transitions?: Iterable<Record<string, unknown>>;
|
|
902
|
-
initialSceneId?: string | null;
|
|
903
|
-
timedJourney?: TimedJourney | Record<string, unknown>;
|
|
904
|
-
evaluator?: TimedJourneyEvaluator | null;
|
|
905
|
-
evaluatorOptions?: CreateTimedJourneyEvaluatorOptions;
|
|
906
|
-
autoPlay?: boolean;
|
|
907
|
-
loop?: boolean;
|
|
908
|
-
startTimeSecs?: number;
|
|
909
|
-
disposeController?: boolean;
|
|
910
|
-
applyFrame?: (
|
|
911
|
-
frame: TimedJourneyFrame,
|
|
912
|
-
context: SkykitThreePluginContext | null,
|
|
913
|
-
skykitFrame: { viewer: SkykitViewer; view: SkykitViewState }
|
|
914
|
-
) => boolean | void;
|
|
915
|
-
onScene?: (
|
|
916
|
-
scene: JourneySceneSpec | Record<string, unknown> | null,
|
|
917
|
-
context: SkykitThreePluginContext,
|
|
918
|
-
event: unknown
|
|
919
|
-
) => void;
|
|
920
|
-
onSceneArrive?: (
|
|
921
|
-
scene: JourneySceneSpec | Record<string, unknown>,
|
|
922
|
-
context: SkykitThreePluginContext,
|
|
923
|
-
event: unknown
|
|
924
|
-
) => void | Promise<void>;
|
|
925
|
-
onCue?: (
|
|
926
|
-
cue: TimedJourneyCue,
|
|
927
|
-
frame: TimedJourneyFrame,
|
|
928
|
-
context: SkykitThreePluginContext | null
|
|
929
|
-
) => void;
|
|
930
|
-
onPreloadHints?: (
|
|
931
|
-
hints: SpatialPreloadHint[],
|
|
932
|
-
source: TimedJourneyFrame | JourneySceneSpec | Record<string, unknown>,
|
|
933
|
-
context: SkykitThreePluginContext | null
|
|
934
|
-
) => void;
|
|
935
|
-
onLayerState?: (
|
|
936
|
-
scene: JourneySceneSpec | Record<string, unknown>,
|
|
937
|
-
context: SkykitThreePluginContext
|
|
938
|
-
) => void;
|
|
939
|
-
}
|
|
940
|
-
|
|
941
900
|
export interface SkykitSpatialPreloadStrategyOptions {
|
|
942
901
|
combine?: boolean;
|
|
943
902
|
baseStrategy?: StarCellStrategy;
|
|
@@ -1107,14 +1066,6 @@ export declare const SKYKIT_ACTIONS: {
|
|
|
1107
1066
|
readonly flyToSelected: 'skykit:selection.flyToSelected';
|
|
1108
1067
|
readonly openExternal: 'skykit:selection.openExternal';
|
|
1109
1068
|
};
|
|
1110
|
-
readonly journey: {
|
|
1111
|
-
readonly goToChapter: 'skykit:journey.goToChapter';
|
|
1112
|
-
readonly next: 'skykit:journey.next';
|
|
1113
|
-
readonly previous: 'skykit:journey.previous';
|
|
1114
|
-
readonly seek: 'skykit:journey.seek';
|
|
1115
|
-
readonly play: 'skykit:journey.play';
|
|
1116
|
-
readonly pause: 'skykit:journey.pause';
|
|
1117
|
-
};
|
|
1118
1069
|
readonly xr: {
|
|
1119
1070
|
readonly enter: 'skykit:xr.enter';
|
|
1120
1071
|
readonly exit: 'skykit:xr.exit';
|
|
@@ -1170,9 +1121,6 @@ export declare function createKeyboardNavigationPlugin(options?: SkykitKeyboardN
|
|
|
1170
1121
|
export declare function createSkykitNavigationPlugin(options?: SkykitNavigationPluginOptions): SkykitPlugin & {
|
|
1171
1122
|
getSnapshot(): unknown;
|
|
1172
1123
|
};
|
|
1173
|
-
export declare function createSkykitJourneyPlugin(options?: SkykitJourneyPluginOptions): SkykitPlugin & {
|
|
1174
|
-
getSnapshot(): unknown;
|
|
1175
|
-
};
|
|
1176
1124
|
export declare function createSkykitStarPreloadRequestsFromSpatialHints(
|
|
1177
1125
|
hints: Iterable<SpatialPreloadHint>,
|
|
1178
1126
|
options?: SkykitSpatialPreloadStrategyOptions
|
package/src/index.js
CHANGED