@mml-io/mml-web-client 0.21.1 → 0.21.3
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/build/index.js +110 -102
- package/build/index.js.map +4 -4
- package/package.json +5 -5
package/build/index.js
CHANGED
|
@@ -2435,7 +2435,7 @@
|
|
|
2435
2435
|
peerConnection.onicegatheringstatechange = () => peerConnection.iceGatheringState === "complete" && resolve(peerConnection.localDescription);
|
|
2436
2436
|
});
|
|
2437
2437
|
}
|
|
2438
|
-
var colors, AttributeHandler, scene, documentTimeManager, MELEMENT_PROPERTY_NAME, consumeEventEventName, MElement, defaultAttribute, defaultStart, defaultEnd, defaultLoop, defaultPingPong, defaultEasing, defaultStartTime, defaultPauseTime, defaultAnimDuration, defaultPingPongDelay, defaultColor, _AttributeAnimation, AttributeAnimation, defaultAttribute2, defaultEasing2, defaultLerpDuration, _AttributeLerp, AttributeLerp, AnimatedAttributeHelper, easingFunctions, easingsByName, StartOfAnimationSymbol, EndOfAnimationSymbol, Quat, Vect3, Vect3Zeroes, Vect3Ones, _Matr4, Matr4, epsilon, matrix1, vector1, OrientedBoundingBox, CanvasText, collideAttributeName, collisionIntervalAttributeName, defaultCollideable, _CollideableHelper, CollideableHelper, clickableAttributeName, defaultClickable, _ClickableHelper, ClickableHelper, debugAttributeName, DebugHelper, _EulXYZ, EulXYZ, defaultVisible, _TransformableElement, TransformableElement, defaultModelSrc, defaultModelAnim, defaultModelAnimLoop, defaultModelAnimEnabled, defaultModelAnimStartTime, defaultModelAnimPauseTime, defaultModelCastShadows, defaultModelDebug, _Model, Model, defaultAnimationSrc, defaultAnimationWeight, defaultAnimationSpeed, defaultAnimationLoop, defaultAnimationStartTime, defaultAnimationPauseTime, defaultAnimationRatio, _Animation, Animation, defaultAudioVolume, defaultAudioLoop, defaultAudioEnabled, defaultAudioStartTime, defaultAudioPauseTime, defaultAudioSrc, defaultAudioInnerConeAngle, defaultAudioOuterConeAngle, defaultAudioDebug, _Audio, Audio2, Character, tempContainerMatrix, tempTargetMatrix, tempPositionVector, tempRotationEuler, tempRotationQuaternion, tempScaleVector, defaultChatProbeRange, defaultChatProbeDebug, chatProbeChatEventName, _ChatProbe, ChatProbe, defaultCubeColor, defaultCubeWidth, defaultCubeHeight, defaultCubeDepth, defaultCubeOpacity, defaultCubeCastShadows, _Cube, Cube, defaultCylinderColor, defaultCylinderRadius, defaultCylinderHeight, defaultCylinderOpacity, defaultCylinderCastShadows, _Cylinder, Cylinder, noManagerSymbol, LoadingInstanceManager, LoadingProgressManager, LoadingProgressBar, LoadingSpinner, domParser, RemoteDocumentWrapper, StaticHTMLFrameInstance, WebSocketFrameInstance, defaultUnloadRange, defaultFrameDebug, _Frame, Frame, _Group, Group, defaultImageSrc, defaultImageWidth, defaultImageHeight, defaultImageOpacity, defaultImageCastShadows, defaultImageEmissive, _Image, Image2, defaultInteractionRange, defaultInteractionInFocus, defaultInteractionLineOfSight, defaultInteractionPriority, defaultInteractionPrompt, defaultInteractionDebug, _Interaction, Interaction, MLabelAlignment, defaultLabelColor, defaultFontColor, defaultLabelAlignment, defaultLabelFontSize, defaultLabelPadding, defaultLabelWidth, defaultLabelHeight, defaultLabelCastShadows, defaultEmissive, _Label, Label, LightTypes, defaultLightColor, defaultLightIntensity, defaultLightAngle, defaultLightEnabled, defaultLightDebug, defaultLightDistance, defaultLightCastShadows, defaultLightType, _Light, Light, _Link, Link, OverlayAnchor, _Overlay, Overlay, defaultPlaneColor, defaultPlaneWidth, defaultPlaneHeight, defaultPlaneOpacity, defaultPlaneCastShadows, _Plane, Plane, defaultPositionProbeRange, defaultPositionProbeInterval, defaultPositionProbeMinimumInterval, defaultPositionProbeDebug, positionProbeEnterEventName, positionProbePositionMoveEventName, positionProbeLeaveEventName, _PositionProbe, PositionProbe, _Prompt, Prompt, MMLDocumentTimeManager, RemoteDocument, defaultSphereColor, defaultSphereRadius, defaultSphereOpacity, defaultSphereCastShadows, _Sphere, Sphere, defaultVideoWidth, defaultVideoHeight, defaultVideoVolume, defaultVideoLoop, defaultVideoEnabled, defaultVideoStartTime, defaultVideoPauseTime, defaultVideoSrc, defaultVideoCastShadows, defaultVideoEmissive, _Video, Video, EventHandlerCollection, _InteractionManager, InteractionManager, Modal, ConfirmModal, PromptModal, PromptManager, MMLScene, FullScreenMMLScene, AnimationGraphics, AudioGraphics, ChatProbeGraphics, CubeGraphics, CylinderGraphics, DebugHelperGraphics, FrameGraphics, ImageGraphics, InteractionGraphics, LabelGraphics, LightGraphics, LinkGraphics, MElementGraphics, ModelGraphics, OverlayGraphics, PlaneGraphics, PositionProbeGraphics, PromptGraphics, RemoteDocumentGraphics, SphereGraphics, TransformableGraphics, VideoGraphics, IframeWrapper,
|
|
2438
|
+
var colors, AttributeHandler, scene, documentTimeManager, MELEMENT_PROPERTY_NAME, consumeEventEventName, MElement, defaultAttribute, defaultStart, defaultEnd, defaultLoop, defaultPingPong, defaultEasing, defaultStartTime, defaultPauseTime, defaultAnimDuration, defaultPingPongDelay, defaultColor, _AttributeAnimation, AttributeAnimation, defaultAttribute2, defaultEasing2, defaultLerpDuration, _AttributeLerp, AttributeLerp, AnimatedAttributeHelper, easingFunctions, easingsByName, StartOfAnimationSymbol, EndOfAnimationSymbol, Quat, Vect3, Vect3Zeroes, Vect3Ones, _Matr4, Matr4, epsilon, matrix1, vector1, OrientedBoundingBox, CanvasText, collideAttributeName, collisionIntervalAttributeName, defaultCollideable, _CollideableHelper, CollideableHelper, clickableAttributeName, defaultClickable, _ClickableHelper, ClickableHelper, debugAttributeName, DebugHelper, _EulXYZ, EulXYZ, defaultVisible, _TransformableElement, TransformableElement, defaultModelSrc, defaultModelAnim, defaultModelAnimLoop, defaultModelAnimEnabled, defaultModelAnimStartTime, defaultModelAnimPauseTime, defaultModelCastShadows, defaultModelDebug, _Model, Model, defaultAnimationSrc, defaultAnimationWeight, defaultAnimationSpeed, defaultAnimationLoop, defaultAnimationStartTime, defaultAnimationPauseTime, defaultAnimationRatio, _Animation, Animation, defaultAudioVolume, defaultAudioLoop, defaultAudioEnabled, defaultAudioStartTime, defaultAudioPauseTime, defaultAudioSrc, defaultAudioInnerConeAngle, defaultAudioOuterConeAngle, defaultAudioDebug, _Audio, Audio2, Character, tempContainerMatrix, tempTargetMatrix, tempPositionVector, tempRotationEuler, tempRotationQuaternion, tempScaleVector, defaultChatProbeRange, defaultChatProbeDebug, chatProbeChatEventName, _ChatProbe, ChatProbe, defaultCubeColor, defaultCubeWidth, defaultCubeHeight, defaultCubeDepth, defaultCubeOpacity, defaultCubeCastShadows, _Cube, Cube, defaultCylinderColor, defaultCylinderRadius, defaultCylinderHeight, defaultCylinderOpacity, defaultCylinderCastShadows, _Cylinder, Cylinder, noManagerSymbol, LoadingInstanceManager, LoadingProgressManager, LoadingProgressBar, LoadingSpinner, domParser, RemoteDocumentWrapper, StaticHTMLFrameInstance, MMLNetworkSource, WebSocketFrameInstance, defaultUnloadRange, defaultFrameDebug, _Frame, Frame, _Group, Group, defaultImageSrc, defaultImageWidth, defaultImageHeight, defaultImageOpacity, defaultImageCastShadows, defaultImageEmissive, _Image, Image2, defaultInteractionRange, defaultInteractionInFocus, defaultInteractionLineOfSight, defaultInteractionPriority, defaultInteractionPrompt, defaultInteractionDebug, _Interaction, Interaction, MLabelAlignment, defaultLabelColor, defaultFontColor, defaultLabelAlignment, defaultLabelFontSize, defaultLabelPadding, defaultLabelWidth, defaultLabelHeight, defaultLabelCastShadows, defaultEmissive, _Label, Label, LightTypes, defaultLightColor, defaultLightIntensity, defaultLightAngle, defaultLightEnabled, defaultLightDebug, defaultLightDistance, defaultLightCastShadows, defaultLightType, _Light, Light, _Link, Link, OverlayAnchor, _Overlay, Overlay, defaultPlaneColor, defaultPlaneWidth, defaultPlaneHeight, defaultPlaneOpacity, defaultPlaneCastShadows, _Plane, Plane, defaultPositionProbeRange, defaultPositionProbeInterval, defaultPositionProbeMinimumInterval, defaultPositionProbeDebug, positionProbeEnterEventName, positionProbePositionMoveEventName, positionProbeLeaveEventName, _PositionProbe, PositionProbe, _Prompt, Prompt, MMLDocumentTimeManager, RemoteDocument, defaultSphereColor, defaultSphereRadius, defaultSphereOpacity, defaultSphereCastShadows, _Sphere, Sphere, defaultVideoWidth, defaultVideoHeight, defaultVideoVolume, defaultVideoLoop, defaultVideoEnabled, defaultVideoStartTime, defaultVideoPauseTime, defaultVideoSrc, defaultVideoCastShadows, defaultVideoEmissive, _Video, Video, EventHandlerCollection, _InteractionManager, InteractionManager, Modal, ConfirmModal, PromptModal, PromptManager, MMLScene, FullScreenMMLScene, AnimationGraphics, AudioGraphics, ChatProbeGraphics, CubeGraphics, CylinderGraphics, DebugHelperGraphics, FrameGraphics, ImageGraphics, InteractionGraphics, LabelGraphics, LightGraphics, LinkGraphics, MElementGraphics, ModelGraphics, OverlayGraphics, PlaneGraphics, PositionProbeGraphics, PromptGraphics, RemoteDocumentGraphics, SphereGraphics, TransformableGraphics, VideoGraphics, IframeWrapper, StatusUI, tagAdapterDefaultTheme, TagDebugAdapterDebugHelper, TagDebugAttribute, ignoredAttributes, TagDebugMElement, TagDebugAdapterGraphicsInterface, StandaloneTagDebugAdapter, StaticFileVideoSource, WHEPVideoSource;
|
|
2439
2439
|
var init_build3 = __esm({
|
|
2440
2440
|
"../mml-web/build/index.js"() {
|
|
2441
2441
|
init_build2();
|
|
@@ -6136,6 +6136,114 @@
|
|
|
6136
6136
|
this.loadingProgressManager.removeLoadingDocument(this);
|
|
6137
6137
|
}
|
|
6138
6138
|
};
|
|
6139
|
+
MMLNetworkSource = class _MMLNetworkSource {
|
|
6140
|
+
constructor(options) {
|
|
6141
|
+
this.options = options;
|
|
6142
|
+
this.websocket = null;
|
|
6143
|
+
}
|
|
6144
|
+
static create(options) {
|
|
6145
|
+
const mmlNetworkSource = new _MMLNetworkSource(options);
|
|
6146
|
+
mmlNetworkSource.init();
|
|
6147
|
+
return mmlNetworkSource;
|
|
6148
|
+
}
|
|
6149
|
+
init() {
|
|
6150
|
+
let overriddenHandler = null;
|
|
6151
|
+
const eventHandler = (element, event) => {
|
|
6152
|
+
if (!overriddenHandler) {
|
|
6153
|
+
throw new Error("overriddenHandler not set");
|
|
6154
|
+
}
|
|
6155
|
+
overriddenHandler(element, event);
|
|
6156
|
+
};
|
|
6157
|
+
const loadingProgressManager = new LoadingProgressManager();
|
|
6158
|
+
const wrappedScene = createWrappedScene(this.options.mmlScene, loadingProgressManager);
|
|
6159
|
+
const src = this.options.url;
|
|
6160
|
+
this.remoteDocumentWrapper = new RemoteDocumentWrapper(
|
|
6161
|
+
src,
|
|
6162
|
+
this.options.windowTarget,
|
|
6163
|
+
wrappedScene,
|
|
6164
|
+
eventHandler
|
|
6165
|
+
);
|
|
6166
|
+
this.options.targetForWrappers.append(this.remoteDocumentWrapper.remoteDocument);
|
|
6167
|
+
let sceneLoadingProgressManager = null;
|
|
6168
|
+
if (this.options.mmlScene.getLoadingProgressManager) {
|
|
6169
|
+
sceneLoadingProgressManager = this.options.mmlScene.getLoadingProgressManager();
|
|
6170
|
+
loadingProgressManager.addProgressCallback(() => {
|
|
6171
|
+
sceneLoadingProgressManager == null ? void 0 : sceneLoadingProgressManager.updateDocumentProgress(this);
|
|
6172
|
+
});
|
|
6173
|
+
}
|
|
6174
|
+
const isWebsocket = src.startsWith("ws://") || src.startsWith("wss://");
|
|
6175
|
+
if (isWebsocket) {
|
|
6176
|
+
const websocket = new NetworkedDOMWebsocket(
|
|
6177
|
+
this.options.url,
|
|
6178
|
+
NetworkedDOMWebsocket.createWebSocket,
|
|
6179
|
+
this.remoteDocumentWrapper.remoteDocument,
|
|
6180
|
+
(time2) => {
|
|
6181
|
+
this.remoteDocumentWrapper.setDocumentTime(time2);
|
|
6182
|
+
},
|
|
6183
|
+
(status) => {
|
|
6184
|
+
if (status === NetworkedDOMWebsocketStatus.Reconnecting) {
|
|
6185
|
+
this.remoteDocumentWrapper.remoteDocument.showError(true);
|
|
6186
|
+
loadingProgressManager.setInitialLoad(new Error("Failed to connect"));
|
|
6187
|
+
} else if (status === NetworkedDOMWebsocketStatus.Connected) {
|
|
6188
|
+
this.remoteDocumentWrapper.remoteDocument.showError(false);
|
|
6189
|
+
loadingProgressManager.setInitialLoad(true);
|
|
6190
|
+
} else {
|
|
6191
|
+
this.remoteDocumentWrapper.remoteDocument.showError(false);
|
|
6192
|
+
}
|
|
6193
|
+
this.options.statusUpdated(status);
|
|
6194
|
+
},
|
|
6195
|
+
{
|
|
6196
|
+
tagPrefix: "m-",
|
|
6197
|
+
// If overlays are allowed, allow SVG elements to populate them
|
|
6198
|
+
allowSVGElements: this.options.allowOverlay,
|
|
6199
|
+
connectionToken: this.options.connectionToken ?? null
|
|
6200
|
+
}
|
|
6201
|
+
);
|
|
6202
|
+
this.websocket = websocket;
|
|
6203
|
+
overriddenHandler = (element, event) => {
|
|
6204
|
+
websocket.handleEvent(element, event);
|
|
6205
|
+
};
|
|
6206
|
+
} else {
|
|
6207
|
+
fetchRemoteStaticMML(this.options.url).then((remoteDocumentBody) => {
|
|
6208
|
+
this.remoteDocumentWrapper.remoteDocument.append(remoteDocumentBody);
|
|
6209
|
+
loadingProgressManager == null ? void 0 : loadingProgressManager.setInitialLoad(true);
|
|
6210
|
+
}).catch((err2) => {
|
|
6211
|
+
loadingProgressManager == null ? void 0 : loadingProgressManager.setInitialLoad(err2);
|
|
6212
|
+
});
|
|
6213
|
+
overriddenHandler = () => {
|
|
6214
|
+
};
|
|
6215
|
+
}
|
|
6216
|
+
sceneLoadingProgressManager == null ? void 0 : sceneLoadingProgressManager.addLoadingDocument(this, this.options.url, loadingProgressManager);
|
|
6217
|
+
}
|
|
6218
|
+
/**
|
|
6219
|
+
* Returns a URL relative to the given host if the src starts with "ws:///" or "wss:///".
|
|
6220
|
+
* If the src does not start with either prefix, it is returned unchanged.
|
|
6221
|
+
*
|
|
6222
|
+
* @param {string} host - The host to use for constructing the potentially relative URL.
|
|
6223
|
+
* @param {string} src - The URL, which may be relative (starting with "ws:///" or "wss:///") or absolute.
|
|
6224
|
+
* @returns {string} The absolute URL (if it were previously relative ws:/// or wss:///).
|
|
6225
|
+
*/
|
|
6226
|
+
static resolveRelativeUrl(host, src) {
|
|
6227
|
+
const insecurePrefix = "ws:///";
|
|
6228
|
+
const securePrefix = "wss:///";
|
|
6229
|
+
if (src.startsWith(insecurePrefix)) {
|
|
6230
|
+
return `ws://${host}/${src.substring(insecurePrefix.length)}`;
|
|
6231
|
+
} else if (src.startsWith(securePrefix)) {
|
|
6232
|
+
return `wss://${host}/${src.substring(securePrefix.length)}`;
|
|
6233
|
+
} else {
|
|
6234
|
+
return src;
|
|
6235
|
+
}
|
|
6236
|
+
}
|
|
6237
|
+
dispose() {
|
|
6238
|
+
var _a2, _b2, _c;
|
|
6239
|
+
if (this.websocket) {
|
|
6240
|
+
this.websocket.stop();
|
|
6241
|
+
this.websocket = null;
|
|
6242
|
+
}
|
|
6243
|
+
(_c = (_b2 = (_a2 = this.options.mmlScene).getLoadingProgressManager) == null ? void 0 : _b2.call(_a2)) == null ? void 0 : _c.removeLoadingDocument(this);
|
|
6244
|
+
this.remoteDocumentWrapper.remoteDocument.remove();
|
|
6245
|
+
}
|
|
6246
|
+
};
|
|
6139
6247
|
WebSocketFrameInstance = class {
|
|
6140
6248
|
constructor(targetElement, src, scene22) {
|
|
6141
6249
|
var _a2, _b2;
|
|
@@ -6155,7 +6263,7 @@
|
|
|
6155
6263
|
var _a22, _b22;
|
|
6156
6264
|
(_b22 = (_a22 = scene22.getLoadingProgressManager) == null ? void 0 : _a22.call(scene22)) == null ? void 0 : _b22.updateDocumentProgress(this);
|
|
6157
6265
|
});
|
|
6158
|
-
const websocketAddress = this.
|
|
6266
|
+
const websocketAddress = MMLNetworkSource.resolveRelativeUrl(this.getDocumentHost(), this.src);
|
|
6159
6267
|
(_b2 = (_a2 = scene22.getLoadingProgressManager) == null ? void 0 : _a2.call(scene22)) == null ? void 0 : _b2.addLoadingDocument(this, websocketAddress, this.loadingProgressManager);
|
|
6160
6268
|
const wrappedScene = createWrappedScene(this.scene, this.loadingProgressManager);
|
|
6161
6269
|
this.remoteDocumentWrapper = new RemoteDocumentWrapper(
|
|
@@ -6199,17 +6307,6 @@
|
|
|
6199
6307
|
this.domWebsocket.handleEvent(element, event);
|
|
6200
6308
|
};
|
|
6201
6309
|
}
|
|
6202
|
-
srcToAddress(src) {
|
|
6203
|
-
const insecurePrefix = "ws:///";
|
|
6204
|
-
const securePrefix = "wss:///";
|
|
6205
|
-
if (src.startsWith(insecurePrefix)) {
|
|
6206
|
-
return `ws://${this.getDocumentHost()}/${src.substring(insecurePrefix.length)}`;
|
|
6207
|
-
} else if (src.startsWith(securePrefix)) {
|
|
6208
|
-
return `wss://${this.getDocumentHost()}/${src.substring(securePrefix.length)}`;
|
|
6209
|
-
} else {
|
|
6210
|
-
return src;
|
|
6211
|
-
}
|
|
6212
|
-
}
|
|
6213
6310
|
getDocumentHost() {
|
|
6214
6311
|
const remoteDocument = this.targetForWrapper.getInitiatedRemoteDocument();
|
|
6215
6312
|
if (remoteDocument) {
|
|
@@ -9349,95 +9446,6 @@
|
|
|
9349
9446
|
this.iframe.remove();
|
|
9350
9447
|
}
|
|
9351
9448
|
};
|
|
9352
|
-
MMLNetworkSource = class _MMLNetworkSource {
|
|
9353
|
-
constructor(options) {
|
|
9354
|
-
this.options = options;
|
|
9355
|
-
this.websocket = null;
|
|
9356
|
-
}
|
|
9357
|
-
static create(options) {
|
|
9358
|
-
const mmlNetworkSource = new _MMLNetworkSource(options);
|
|
9359
|
-
mmlNetworkSource.init();
|
|
9360
|
-
return mmlNetworkSource;
|
|
9361
|
-
}
|
|
9362
|
-
init() {
|
|
9363
|
-
let overriddenHandler = null;
|
|
9364
|
-
const eventHandler = (element, event) => {
|
|
9365
|
-
if (!overriddenHandler) {
|
|
9366
|
-
throw new Error("overriddenHandler not set");
|
|
9367
|
-
}
|
|
9368
|
-
overriddenHandler(element, event);
|
|
9369
|
-
};
|
|
9370
|
-
const loadingProgressManager = new LoadingProgressManager();
|
|
9371
|
-
const wrappedScene = createWrappedScene(this.options.mmlScene, loadingProgressManager);
|
|
9372
|
-
const src = this.options.url;
|
|
9373
|
-
this.remoteDocumentWrapper = new RemoteDocumentWrapper(
|
|
9374
|
-
src,
|
|
9375
|
-
this.options.windowTarget,
|
|
9376
|
-
wrappedScene,
|
|
9377
|
-
eventHandler
|
|
9378
|
-
);
|
|
9379
|
-
this.options.targetForWrappers.append(this.remoteDocumentWrapper.remoteDocument);
|
|
9380
|
-
let sceneLoadingProgressManager = null;
|
|
9381
|
-
if (this.options.mmlScene.getLoadingProgressManager) {
|
|
9382
|
-
sceneLoadingProgressManager = this.options.mmlScene.getLoadingProgressManager();
|
|
9383
|
-
loadingProgressManager.addProgressCallback(() => {
|
|
9384
|
-
sceneLoadingProgressManager == null ? void 0 : sceneLoadingProgressManager.updateDocumentProgress(this);
|
|
9385
|
-
});
|
|
9386
|
-
}
|
|
9387
|
-
const isWebsocket = src.startsWith("ws://") || src.startsWith("wss://");
|
|
9388
|
-
if (isWebsocket) {
|
|
9389
|
-
const websocket = new NetworkedDOMWebsocket(
|
|
9390
|
-
this.options.url,
|
|
9391
|
-
NetworkedDOMWebsocket.createWebSocket,
|
|
9392
|
-
this.remoteDocumentWrapper.remoteDocument,
|
|
9393
|
-
(time2) => {
|
|
9394
|
-
this.remoteDocumentWrapper.setDocumentTime(time2);
|
|
9395
|
-
},
|
|
9396
|
-
(status) => {
|
|
9397
|
-
if (status === NetworkedDOMWebsocketStatus.Reconnecting) {
|
|
9398
|
-
this.remoteDocumentWrapper.remoteDocument.showError(true);
|
|
9399
|
-
loadingProgressManager.setInitialLoad(new Error("Failed to connect"));
|
|
9400
|
-
} else if (status === NetworkedDOMWebsocketStatus.Connected) {
|
|
9401
|
-
this.remoteDocumentWrapper.remoteDocument.showError(false);
|
|
9402
|
-
loadingProgressManager.setInitialLoad(true);
|
|
9403
|
-
} else {
|
|
9404
|
-
this.remoteDocumentWrapper.remoteDocument.showError(false);
|
|
9405
|
-
}
|
|
9406
|
-
this.options.statusUpdated(status);
|
|
9407
|
-
},
|
|
9408
|
-
{
|
|
9409
|
-
tagPrefix: "m-",
|
|
9410
|
-
// If overlays are allowed, allow SVG elements to populate them
|
|
9411
|
-
allowSVGElements: this.options.allowOverlay,
|
|
9412
|
-
connectionToken: this.options.connectionToken ?? null
|
|
9413
|
-
}
|
|
9414
|
-
);
|
|
9415
|
-
this.websocket = websocket;
|
|
9416
|
-
overriddenHandler = (element, event) => {
|
|
9417
|
-
websocket.handleEvent(element, event);
|
|
9418
|
-
};
|
|
9419
|
-
} else {
|
|
9420
|
-
fetchRemoteStaticMML(this.options.url).then((remoteDocumentBody) => {
|
|
9421
|
-
this.remoteDocumentWrapper.remoteDocument.append(remoteDocumentBody);
|
|
9422
|
-
loadingProgressManager == null ? void 0 : loadingProgressManager.setInitialLoad(true);
|
|
9423
|
-
}).catch((err2) => {
|
|
9424
|
-
loadingProgressManager == null ? void 0 : loadingProgressManager.setInitialLoad(err2);
|
|
9425
|
-
});
|
|
9426
|
-
overriddenHandler = () => {
|
|
9427
|
-
};
|
|
9428
|
-
}
|
|
9429
|
-
sceneLoadingProgressManager == null ? void 0 : sceneLoadingProgressManager.addLoadingDocument(this, this.options.url, loadingProgressManager);
|
|
9430
|
-
}
|
|
9431
|
-
dispose() {
|
|
9432
|
-
var _a2, _b2, _c;
|
|
9433
|
-
if (this.websocket) {
|
|
9434
|
-
this.websocket.stop();
|
|
9435
|
-
this.websocket = null;
|
|
9436
|
-
}
|
|
9437
|
-
(_c = (_b2 = (_a2 = this.options.mmlScene).getLoadingProgressManager) == null ? void 0 : _b2.call(_a2)) == null ? void 0 : _c.removeLoadingDocument(this);
|
|
9438
|
-
this.remoteDocumentWrapper.remoteDocument.remove();
|
|
9439
|
-
}
|
|
9440
|
-
};
|
|
9441
9449
|
StatusUI = class {
|
|
9442
9450
|
constructor() {
|
|
9443
9451
|
this.element = document.createElement("div");
|