@virtualdisplay.io/client 4.0.0-alpha.22 → 4.0.0-alpha.24
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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +15 -25
- package/dist/virtualdisplay.client.cjs.js +47 -57
- package/dist/virtualdisplay.client.es.js +639 -610
- package/dist/virtualdisplay.client.umd.js +50 -60
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.0-alpha.24
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
Accept `undefined` for the optional `ClientOptions` fields `language`, `debug` and `traceparent`. Projects that enable `exactOptionalPropertyTypes` can now pass a possibly-undefined value straight through without a type error.
|
|
8
|
+
|
|
9
|
+
## 4.0.0-alpha.23
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
Fix the sidebar configurator toggle button appearing separated from the AR and fullscreen buttons on narrow embeds. All three controls now sit together in one row instead of the toggle floating above them.
|
|
14
|
+
|
|
3
15
|
## 4.0.0-alpha.22
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -311,18 +311,6 @@ interface MessengerOptions {
|
|
|
311
311
|
* When false (default), incoming messages are processed immediately.
|
|
312
312
|
*/
|
|
313
313
|
bufferIncoming?: boolean;
|
|
314
|
-
/**
|
|
315
|
-
* When buffering, messages where this returns false bypass the buffer
|
|
316
|
-
* and are routed to handlers immediately. Used for urgent messages
|
|
317
|
-
* like CONFIG that must be handled before the model loads.
|
|
318
|
-
*/
|
|
319
|
-
shouldBuffer?: (message: Message) => boolean;
|
|
320
|
-
/**
|
|
321
|
-
* Restrict postMessage to a specific origin (e.g. 'https://example.com').
|
|
322
|
-
* Defaults to '*' when not set. Set this when the target origin is known
|
|
323
|
-
* to prevent messages from being intercepted by unintended recipients.
|
|
324
|
-
*/
|
|
325
|
-
targetOrigin?: string;
|
|
326
314
|
/**
|
|
327
315
|
* Which protocol to validate incoming messages against — not whether to validate.
|
|
328
316
|
* Both sides always reject browser-extension noise and unknown message types. The
|
|
@@ -357,11 +345,11 @@ interface MessengerOptions {
|
|
|
357
345
|
* messenger.send({ type: 'mutation', mutations, isInitial: true });
|
|
358
346
|
* ```
|
|
359
347
|
*
|
|
360
|
-
* @example Server (inside iframe — both queues
|
|
348
|
+
* @example Server (inside iframe — both queues)
|
|
361
349
|
* ```ts
|
|
362
350
|
* const messenger = new IframeMessenger(
|
|
363
351
|
* () => window.parent !== window ? window.parent : null,
|
|
364
|
-
* { bufferIncoming: true
|
|
352
|
+
* { bufferIncoming: true },
|
|
365
353
|
* );
|
|
366
354
|
* messenger.on('mutation', processMutation);
|
|
367
355
|
* messenger.on('config', applyConfig);
|
|
@@ -376,7 +364,6 @@ declare class IframeMessenger {
|
|
|
376
364
|
private readonly handlers;
|
|
377
365
|
private readonly publisher;
|
|
378
366
|
private readonly consumer;
|
|
379
|
-
private readonly shouldBuffer;
|
|
380
367
|
private listener;
|
|
381
368
|
private readonly sourceId;
|
|
382
369
|
private targetOrigin;
|
|
@@ -386,10 +373,6 @@ declare class IframeMessenger {
|
|
|
386
373
|
* Register a handler for a specific message type
|
|
387
374
|
*/
|
|
388
375
|
on(type: string, handler: MessageCallback): void;
|
|
389
|
-
/**
|
|
390
|
-
* Remove a handler for a specific message type
|
|
391
|
-
*/
|
|
392
|
-
off(type: string): void;
|
|
393
376
|
/**
|
|
394
377
|
* Update the target origin for outgoing postMessage calls.
|
|
395
378
|
* Use when the target origin is discovered at runtime (e.g. from the first incoming message).
|
|
@@ -403,8 +386,8 @@ declare class IframeMessenger {
|
|
|
403
386
|
/**
|
|
404
387
|
* Feed a message through the same routing path as one that just arrived via
|
|
405
388
|
* postMessage, without an actual postMessage round-trip: still validated
|
|
406
|
-
* against `isValid`, and still respects the consumer queue's buffering
|
|
407
|
-
*
|
|
389
|
+
* against `isValid`, and still respects the consumer queue's buffering. For
|
|
390
|
+
* a transport that delivers messages some
|
|
408
391
|
* other way than the iframe channel this messenger already listens on (the
|
|
409
392
|
* viewer engine's SSE-sourced live sync channel, ar-session-handoff) and
|
|
410
393
|
* needs them to land exactly where a postMessage would.
|
|
@@ -866,17 +849,17 @@ interface ClientOptions {
|
|
|
866
849
|
readonly parent: string | HTMLElement;
|
|
867
850
|
readonly model: string;
|
|
868
851
|
readonly license: string;
|
|
869
|
-
readonly debug?: boolean;
|
|
870
|
-
readonly language?: string;
|
|
852
|
+
readonly debug?: boolean | undefined;
|
|
853
|
+
readonly language?: string | undefined;
|
|
871
854
|
/** W3C traceparent string to propagate to the viewer iframe for end-to-end tracing. */
|
|
872
|
-
readonly traceparent?: string;
|
|
855
|
+
readonly traceparent?: string | undefined;
|
|
873
856
|
/**
|
|
874
857
|
* A source viewer session id to restore into this mount (ar-session-handoff): the
|
|
875
858
|
* iframe's metadata fetch merges that session's latest configuration into the
|
|
876
859
|
* attribute defaults, so the viewer boots straight into it. Internal option, used
|
|
877
860
|
* by the AR landing, not a customer-facing setting.
|
|
878
861
|
*/
|
|
879
|
-
readonly session?: string;
|
|
862
|
+
readonly session?: string | undefined;
|
|
880
863
|
/**
|
|
881
864
|
* Override viewer settings from metadata. Omitted fields use the metadata value.
|
|
882
865
|
* A warning is logged when an override differs from the metadata value.
|
|
@@ -966,6 +949,12 @@ interface BaseClientExtensions {
|
|
|
966
949
|
* so the host cannot be a single build-time env shared by both.
|
|
967
950
|
*/
|
|
968
951
|
readonly serverHost?: string;
|
|
952
|
+
/**
|
|
953
|
+
* Extra query parameters for the viewer iframe URL. An extension seam like
|
|
954
|
+
* `serverHost`: a client type's fixed capability flags (the studio client's
|
|
955
|
+
* metadata-override boot mode), never a per-instance public option.
|
|
956
|
+
*/
|
|
957
|
+
readonly iframeParams?: Readonly<Record<string, string>>;
|
|
969
958
|
/**
|
|
970
959
|
* The AR flow behind the standard interface's AR button. The public client
|
|
971
960
|
* composes its `ArActivation` here; the studio composes nothing (the editor
|
|
@@ -999,6 +988,7 @@ declare class BaseClient {
|
|
|
999
988
|
private readonly ui;
|
|
1000
989
|
private readonly options;
|
|
1001
990
|
private readonly serverHost;
|
|
991
|
+
private readonly iframeParams;
|
|
1002
992
|
/** The composed AR flow, or undefined in builds without one (the studio). */
|
|
1003
993
|
private readonly arActivation;
|
|
1004
994
|
/** The composed sync tracker, or undefined in builds without one (the studio). */
|