@popmelt.com/core 0.18.2 → 0.19.1
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/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/dist/adapter-react-three-fiber.d.mts +1 -1
- package/dist/adapter-three.d.mts +17 -0
- package/dist/bridge-entry.mjs +57 -57
- package/dist/chunk-N2ZEZCHO.mjs +2 -0
- package/dist/{chunk-UC34UP4S.mjs → chunk-WD47DA42.mjs} +1 -1
- package/dist/cli.mjs +74 -74
- package/dist/index.d.mts +5 -3
- package/dist/index.mjs +41 -40
- package/dist/media.d.mts +3 -3
- package/dist/media.mjs +1 -1
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-vite.mjs +1 -1
- package/dist/{server-PV5AVWEM.mjs → server-TEOE3AK4.mjs} +66 -66
- package/dist/server.mjs +66 -66
- package/dist/{subjects-CeqtFged.d.mts → subjects-C6Bu8uSX.d.mts} +18 -1
- package/dist/{video-adapter-Gq8saCDn.d.mts → video-adapter-UZ8OqP0O.d.mts} +39 -2
- package/package.json +1 -1
- package/dist/chunk-RH6W4F2W.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Camera, Object3D, Raycaster } from 'three';
|
|
2
|
-
import { P as PopmeltSubjectAdapter } from './subjects-
|
|
2
|
+
import { P as PopmeltSubjectAdapter } from './subjects-C6Bu8uSX.mjs';
|
|
3
3
|
|
|
4
4
|
type ThreeSubjectAdapterOptions = {
|
|
5
5
|
/** Unique adapter identity when a page owns more than one Three.js surface. */
|
package/dist/adapter-three.d.mts
CHANGED
|
@@ -87,6 +87,12 @@ type PopmeltSubjectTrackingAnchor = {
|
|
|
87
87
|
/** Vertical position normalized within the subject bounds. */
|
|
88
88
|
y: number;
|
|
89
89
|
};
|
|
90
|
+
type PopmeltSubjectOutlinePoint = {
|
|
91
|
+
/** Horizontal position normalized within the subject bounds. */
|
|
92
|
+
x: number;
|
|
93
|
+
/** Vertical position normalized within the subject bounds. */
|
|
94
|
+
y: number;
|
|
95
|
+
};
|
|
90
96
|
type PopmeltSubject = {
|
|
91
97
|
key: string;
|
|
92
98
|
label: string;
|
|
@@ -101,6 +107,8 @@ type PopmeltSubject = {
|
|
|
101
107
|
videoObject?: VideoObjectContext;
|
|
102
108
|
/** Optional provider-neutral foreground anchors used by motion tracking. */
|
|
103
109
|
trackingAnchors?: readonly PopmeltSubjectTrackingAnchor[];
|
|
110
|
+
/** Optional provider-neutral contour normalized within the subject bounds. */
|
|
111
|
+
outline?: readonly PopmeltSubjectOutlinePoint[];
|
|
104
112
|
};
|
|
105
113
|
type PopmeltSurfaceSnapshot = {
|
|
106
114
|
element: HTMLCanvasElement;
|
|
@@ -125,6 +133,13 @@ type PopmeltSubjectAdapter = {
|
|
|
125
133
|
surfaceKind?: 'image' | 'video';
|
|
126
134
|
/** Resolve once the adapter's persisted subject index is available. */
|
|
127
135
|
whenReady?(): Promise<void>;
|
|
136
|
+
/** Notify Core when asynchronous perception changes hit-testable subjects. */
|
|
137
|
+
subscribe?(listener: () => void): () => void;
|
|
138
|
+
/** Ordered hit candidates, innermost/most-specific first. */
|
|
139
|
+
hitTestAll?(clientPoint: {
|
|
140
|
+
x: number;
|
|
141
|
+
y: number;
|
|
142
|
+
}): readonly PopmeltSubject[];
|
|
128
143
|
hitTest(clientPoint: {
|
|
129
144
|
x: number;
|
|
130
145
|
y: number;
|
|
@@ -147,6 +162,8 @@ type PopmeltSubjectAdapter = {
|
|
|
147
162
|
updateSubjectBounds?(key: string, bounds: PopmeltSubjectBounds): PopmeltSubject | null;
|
|
148
163
|
/** Replace optional foreground anchors normalized within subject bounds. */
|
|
149
164
|
updateSubjectTrackingAnchors?(key: string, anchors: readonly PopmeltSubjectTrackingAnchor[]): PopmeltSubject | null;
|
|
165
|
+
/** Promote a transient perception candidate into a durable subject. */
|
|
166
|
+
promoteSubject?(key: string): PopmeltSubject | null;
|
|
150
167
|
/** Remove a user-created subject or hide an adapter-owned subject. */
|
|
151
168
|
removeSubject?(key: string): void;
|
|
152
169
|
};
|