@foxglove/extension 2.46.0 → 2.47.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/package.json +6 -1
- package/src/experimental.ts +1 -105
- package/src/index.ts +1 -1
- package/src/stable.ts +6 -1
package/package.json
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foxglove/extension",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.47.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Foxglove Technologies",
|
|
7
7
|
"email": "support@foxglove.dev"
|
|
8
8
|
},
|
|
9
9
|
"homepage": "https://foxglove.dev/",
|
|
10
|
+
"type": "module",
|
|
10
11
|
"main": "./src/index.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./src/index.ts",
|
|
14
|
+
"./experimental": "./src/experimental.ts"
|
|
15
|
+
},
|
|
11
16
|
"files": [
|
|
12
17
|
"src"
|
|
13
18
|
],
|
package/src/experimental.ts
CHANGED
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
import type { Immutable } from "./immutable.ts";
|
|
3
3
|
import type {
|
|
4
4
|
ExtensionContext as BaseExtensionContext,
|
|
5
|
-
MessageEvent,
|
|
6
5
|
PanelExtensionContext as BasePanelExtensionContext,
|
|
7
|
-
SettingsTreeAction,
|
|
8
|
-
SettingsTreeFields,
|
|
9
|
-
SettingsTreeNode,
|
|
10
|
-
Topic,
|
|
11
6
|
} from "./stable.ts";
|
|
12
7
|
|
|
13
8
|
/**
|
|
@@ -119,7 +114,7 @@ export namespace Experimental {
|
|
|
119
114
|
*/
|
|
120
115
|
export type VideoFrameDecoder = Pick<
|
|
121
116
|
VideoDecoder,
|
|
122
|
-
"close" | "configure" | "decode" | "reset" | "state"
|
|
117
|
+
"close" | "configure" | "decode" | "reset" | "state" | "decodeQueueSize" | "ondequeue"
|
|
123
118
|
>;
|
|
124
119
|
|
|
125
120
|
/**
|
|
@@ -140,13 +135,6 @@ export namespace Experimental {
|
|
|
140
135
|
*/
|
|
141
136
|
registerDataLoader(args: RegisterDataLoaderArgs): void;
|
|
142
137
|
|
|
143
|
-
/**
|
|
144
|
-
* Register a panel overlay extension to create 2D HTML overlays for 3D and Image panels
|
|
145
|
-
*
|
|
146
|
-
* See: {@link PanelOverlayExtensionArgs}
|
|
147
|
-
*/
|
|
148
|
-
registerPanelOverlay(args: PanelOverlayExtensionArgs): void;
|
|
149
|
-
|
|
150
138
|
/**
|
|
151
139
|
* `registerPanel` adds a new panel to the Foxglove interface. To register a panel you provide a
|
|
152
140
|
* `name` and an `initPanel` function.
|
|
@@ -281,98 +269,6 @@ export namespace Experimental {
|
|
|
281
269
|
*/
|
|
282
270
|
export type PanelToolbarItem = PanelToolbarButton | PanelToolbarLink | PanelToolbarDivider;
|
|
283
271
|
|
|
284
|
-
export type PanelOverlayExtensionBaseConfig = { visible: boolean };
|
|
285
|
-
|
|
286
|
-
export type PanelOverlaySubscription<T = unknown> = {
|
|
287
|
-
/**
|
|
288
|
-
* This method will only be run against Topics with schemas that match the topic or schema of the overarching subscription.
|
|
289
|
-
* So if you always want to receive messages from a topic with a given name or schema you can simply return true.
|
|
290
|
-
* These subscriptions will only be active when the custom layer extension's visibility is true.
|
|
291
|
-
*/
|
|
292
|
-
shouldSubscribe?: (topic: string, schema: string) => boolean;
|
|
293
|
-
/** Callback that will be fired for each matching incoming message */
|
|
294
|
-
handler: (messageEvent: MessageEvent<T>) => void;
|
|
295
|
-
/** Queue of messages to be handled since last frame. Will be reassigned to new empty array each frame. */
|
|
296
|
-
queue?: MessageEvent<T>[] | undefined;
|
|
297
|
-
/** Optional callback to be called on `queue` to filter. Returns new queue. */
|
|
298
|
-
filterQueue?: (queue: ReadonlyArray<MessageEvent<T>>) => ReadonlyArray<MessageEvent<T>>;
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
export type AnyPanelOverlaySubscription = Immutable<
|
|
302
|
-
| {
|
|
303
|
-
type: "schema";
|
|
304
|
-
schemaNames: Set<string>;
|
|
305
|
-
// any is used here to allow storing heterogeneous arrays of subscriptions
|
|
306
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
307
|
-
subscription: PanelOverlaySubscription<any>;
|
|
308
|
-
}
|
|
309
|
-
| {
|
|
310
|
-
type: "topic";
|
|
311
|
-
topicName: string;
|
|
312
|
-
// any is used here to allow storing heterogeneous arrays of subscriptions
|
|
313
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
314
|
-
subscription: PanelOverlaySubscription<any>;
|
|
315
|
-
}
|
|
316
|
-
>;
|
|
317
|
-
|
|
318
|
-
export type ActionHandler = (action: SettingsTreeAction) => void;
|
|
319
|
-
|
|
320
|
-
export type SettingsTreeNodeWithActionHandler = SettingsTreeNode & { handler?: ActionHandler };
|
|
321
|
-
|
|
322
|
-
export type SettingsPath = ReadonlyArray<string>;
|
|
323
|
-
|
|
324
|
-
export type SettingsTreeEntry = { path: SettingsPath; node: SettingsTreeNodeWithActionHandler };
|
|
325
|
-
|
|
326
|
-
export interface PanelOverlayExtensionContext<
|
|
327
|
-
Config extends PanelOverlayExtensionBaseConfig = PanelOverlayExtensionBaseConfig,
|
|
328
|
-
> {
|
|
329
|
-
/** Get the current config object for the panel overlay. */
|
|
330
|
-
getConfig: () => PanelOverlayExtensionBaseConfig & Partial<Config>;
|
|
331
|
-
/** Update the config object for the panel overlay.
|
|
332
|
-
* The draft object is meant to be mutated and set to the desired state.
|
|
333
|
-
*/
|
|
334
|
-
updateConfig: (updateHandler: (draft: Partial<Config>) => void) => void;
|
|
335
|
-
/** Get all available topics that can be subscribed to. */
|
|
336
|
-
getTopics: () => readonly Topic[];
|
|
337
|
-
/** Queue an animation frame. This will call the extension's `startFrame` when the next animation frame is ready.*/
|
|
338
|
-
queueAnimationFrame: () => void;
|
|
339
|
-
/** The container element where the panel overlay will be rendered.
|
|
340
|
-
* The extension is meant to either use this as a react root element, or append elements and update them manually.
|
|
341
|
-
*/
|
|
342
|
-
overlayContainerElement: HTMLElement;
|
|
343
|
-
}
|
|
344
|
-
export interface PanelOverlayExtension {
|
|
345
|
-
/** The unique identifier for the panel overlay. */
|
|
346
|
-
readonly id: string;
|
|
347
|
-
/** The label to display in the settings panel for the panel overlay. */
|
|
348
|
-
readonly label?: string;
|
|
349
|
-
getSubscriptions: () => AnyPanelOverlaySubscription[];
|
|
350
|
-
/** Callback that will be fired when the available topics change.
|
|
351
|
-
* To get the new state of topics call `getTopics`.
|
|
352
|
-
*/
|
|
353
|
-
onTopicsChanged: () => void;
|
|
354
|
-
/** Called when there is a user-driven settings change from the settings panel. */
|
|
355
|
-
handleSettingsAction: (action: SettingsTreeAction) => void;
|
|
356
|
-
/** Used to specify the desired fields in the panel overlay's section of the settings tree */
|
|
357
|
-
settingsNodeFields: () => SettingsTreeFields;
|
|
358
|
-
/** Will be called when there is a seek on the playback bar or sometimes when subscriptions change. */
|
|
359
|
-
onSeek: () => void;
|
|
360
|
-
/** Will be called every time the panel canvas is re-rendered by an animation frame. */
|
|
361
|
-
startFrame: () => void;
|
|
362
|
-
/** Will be called when the 3D Renderer is disposed because of a parameter change or the panel is unmounted. */
|
|
363
|
-
dispose: () => void;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
export type PanelOverlayExtensionArgs<
|
|
367
|
-
Config extends PanelOverlayExtensionBaseConfig = PanelOverlayExtensionBaseConfig,
|
|
368
|
-
> = {
|
|
369
|
-
/** The unique identifier for the panel overlay - should match the id of the PanelOverlay */
|
|
370
|
-
id: string;
|
|
371
|
-
/** Specifies the default config for the panel overlay. */
|
|
372
|
-
defaultConfig: Config;
|
|
373
|
-
init: (context: PanelOverlayExtensionContext) => PanelOverlayExtension;
|
|
374
|
-
};
|
|
375
|
-
|
|
376
272
|
export interface PanelExtensionContext extends BasePanelExtensionContext {
|
|
377
273
|
/**
|
|
378
274
|
* Set the items in the panel toolbar.
|
package/src/index.ts
CHANGED
package/src/stable.ts
CHANGED
|
@@ -1361,7 +1361,12 @@ export type SettingsTreeFieldValue =
|
|
|
1361
1361
|
validTypes?: string[];
|
|
1362
1362
|
/** Only include paths from these topics in autocomplete suggestions */
|
|
1363
1363
|
validTopics?: string[];
|
|
1364
|
-
/** True if the input should allow
|
|
1364
|
+
/** True if the input should allow message path functions like "@abs" */
|
|
1365
|
+
supportsMessagePathFunctions?: boolean;
|
|
1366
|
+
/**
|
|
1367
|
+
* @deprecated Use `supportsMessagePathFunctions` instead.
|
|
1368
|
+
* True if the input should allow message path functions like "@abs".
|
|
1369
|
+
*/
|
|
1365
1370
|
supportsMathModifiers?: boolean;
|
|
1366
1371
|
}
|
|
1367
1372
|
| {
|