@mml-io/mml-web-client 0.0.0-experimental-f410cae-20250908 → 0.0.0-experimental-9ed5b0c-20250916
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 +621 -116
- package/build/index.js.map +4 -4
- package/package.json +5 -5
package/build/index.js
CHANGED
|
@@ -546,6 +546,56 @@
|
|
|
546
546
|
});
|
|
547
547
|
|
|
548
548
|
// ../networked-dom-web/build/index.js
|
|
549
|
+
function remapAttributeName(attrName) {
|
|
550
|
+
const remapped = SVG_ATTRS_ADJUSTMENT_MAP.get(attrName.toLowerCase());
|
|
551
|
+
if (remapped) {
|
|
552
|
+
return remapped;
|
|
553
|
+
}
|
|
554
|
+
return attrName;
|
|
555
|
+
}
|
|
556
|
+
function createElementWithSVGSupport(tag, options = {}) {
|
|
557
|
+
let filteredTag = tag.toLowerCase();
|
|
558
|
+
if (ALWAYS_DISALLOWED_TAGS.has(filteredTag.toLowerCase())) {
|
|
559
|
+
console.error("Disallowing tag", filteredTag);
|
|
560
|
+
filteredTag = options.replacementTagPrefix ? options.replacementTagPrefix + tag : `x-${tag}`;
|
|
561
|
+
}
|
|
562
|
+
let svgTagMapping;
|
|
563
|
+
if (options.allowSVGElements) {
|
|
564
|
+
svgTagMapping = SVG_TAG_NAMES_ADJUSTMENT_MAP.get(filteredTag);
|
|
565
|
+
}
|
|
566
|
+
if (svgTagMapping) {
|
|
567
|
+
filteredTag = svgTagMapping;
|
|
568
|
+
const xmlns = "http://www.w3.org/2000/svg";
|
|
569
|
+
return document.createElementNS(xmlns, filteredTag);
|
|
570
|
+
} else {
|
|
571
|
+
if (options.tagPrefix) {
|
|
572
|
+
if (!tag.toLowerCase().startsWith(options.tagPrefix.toLowerCase())) {
|
|
573
|
+
filteredTag = options.replacementTagPrefix ? options.replacementTagPrefix + tag : `x-${tag}`;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
return document.createElement(filteredTag);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
function setElementAttribute(element, key, value) {
|
|
580
|
+
if (DOMSanitizer.shouldAcceptAttribute(key)) {
|
|
581
|
+
const remappedKey = remapAttributeName(key);
|
|
582
|
+
element.setAttribute(remappedKey, value);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
function getChildrenTarget(parent) {
|
|
586
|
+
let targetForChildren = parent;
|
|
587
|
+
if (parent.getPortalElement) {
|
|
588
|
+
targetForChildren = parent.getPortalElement();
|
|
589
|
+
}
|
|
590
|
+
return targetForChildren;
|
|
591
|
+
}
|
|
592
|
+
function getRemovalTarget(parent) {
|
|
593
|
+
let targetForRemoval = parent;
|
|
594
|
+
if (parent.getPortalElement) {
|
|
595
|
+
targetForRemoval = parent.getPortalElement();
|
|
596
|
+
}
|
|
597
|
+
return targetForRemoval;
|
|
598
|
+
}
|
|
549
599
|
function NetworkedDOMWebsocketStatusToString(status) {
|
|
550
600
|
switch (status) {
|
|
551
601
|
case 0:
|
|
@@ -563,7 +613,7 @@
|
|
|
563
613
|
}
|
|
564
614
|
}
|
|
565
615
|
function isHTMLElement(node, rootNode) {
|
|
566
|
-
if (node instanceof HTMLElement) {
|
|
616
|
+
if (node instanceof HTMLElement || node instanceof Element) {
|
|
567
617
|
return true;
|
|
568
618
|
}
|
|
569
619
|
if (!rootNode.ownerDocument.defaultView) {
|
|
@@ -580,7 +630,7 @@
|
|
|
580
630
|
}
|
|
581
631
|
return node instanceof rootNode.ownerDocument.defaultView.Text;
|
|
582
632
|
}
|
|
583
|
-
var DOMSanitizer, NetworkedDOMWebsocketV01Adapter, connectionId, hiddenTag, NetworkedDOMWebsocketV02Adapter, startingBackoffTimeMilliseconds, maximumBackoffTimeMilliseconds, maximumWebsocketConnectionTimeout, NetworkedDOMWebsocketStatus, NetworkedDOMWebsocket;
|
|
633
|
+
var DOMSanitizer, ALWAYS_DISALLOWED_TAGS, SVG_TAG_NAMES_ADJUSTMENT_MAP, SVG_ATTRS_ADJUSTMENT_MAP, NetworkedDOMWebsocketV01Adapter, connectionId, hiddenTag, NetworkedDOMWebsocketV02Adapter, startingBackoffTimeMilliseconds, maximumBackoffTimeMilliseconds, maximumWebsocketConnectionTimeout, NetworkedDOMWebsocketStatus, NetworkedDOMWebsocket;
|
|
584
634
|
var init_build2 = __esm({
|
|
585
635
|
"../networked-dom-web/build/index.js"() {
|
|
586
636
|
init_build();
|
|
@@ -646,7 +696,7 @@
|
|
|
646
696
|
return c2 >= "0" && c2 <= "9";
|
|
647
697
|
}
|
|
648
698
|
static IsASCIIAlpha(c2) {
|
|
649
|
-
return c2 >= "a" && c2 <= "z";
|
|
699
|
+
return c2 >= "a" && c2 <= "z" || c2 >= "A" && c2 <= "Z";
|
|
650
700
|
}
|
|
651
701
|
static IsValidAttributeName(characters) {
|
|
652
702
|
const c2 = characters[0];
|
|
@@ -669,6 +719,122 @@
|
|
|
669
719
|
return !attribute.startsWith("on");
|
|
670
720
|
}
|
|
671
721
|
};
|
|
722
|
+
ALWAYS_DISALLOWED_TAGS = /* @__PURE__ */ new Set(["foreignobject", "iframe", "script"]);
|
|
723
|
+
SVG_TAG_NAMES_ADJUSTMENT_MAP = new Map(
|
|
724
|
+
[
|
|
725
|
+
"svg",
|
|
726
|
+
"defs",
|
|
727
|
+
"g",
|
|
728
|
+
"text",
|
|
729
|
+
"filter",
|
|
730
|
+
"stop",
|
|
731
|
+
"path",
|
|
732
|
+
"rect",
|
|
733
|
+
"line",
|
|
734
|
+
"circle",
|
|
735
|
+
"animate",
|
|
736
|
+
"altGlyph",
|
|
737
|
+
"altGlyphDef",
|
|
738
|
+
"altGlyphItem",
|
|
739
|
+
"animateColor",
|
|
740
|
+
"animateMotion",
|
|
741
|
+
"animateTransform",
|
|
742
|
+
"clipPath",
|
|
743
|
+
"feBlend",
|
|
744
|
+
"feDropShadow",
|
|
745
|
+
"feColorMatrix",
|
|
746
|
+
"feComponentTransfer",
|
|
747
|
+
"feComposite",
|
|
748
|
+
"feConvolveMatrix",
|
|
749
|
+
"feDiffuseLighting",
|
|
750
|
+
"feDisplacementMap",
|
|
751
|
+
"feDistantLight",
|
|
752
|
+
"feFlood",
|
|
753
|
+
"feFuncA",
|
|
754
|
+
"feFuncB",
|
|
755
|
+
"feFuncG",
|
|
756
|
+
"feFuncR",
|
|
757
|
+
"feGaussianBlur",
|
|
758
|
+
"feImage",
|
|
759
|
+
"feMerge",
|
|
760
|
+
"feMergeNode",
|
|
761
|
+
"feMorphology",
|
|
762
|
+
"feOffset",
|
|
763
|
+
"fePointLight",
|
|
764
|
+
"feSpecularLighting",
|
|
765
|
+
"feSpotLight",
|
|
766
|
+
"feTile",
|
|
767
|
+
"feTurbulence",
|
|
768
|
+
"glyphRef",
|
|
769
|
+
"linearGradient",
|
|
770
|
+
"radialGradient",
|
|
771
|
+
"textPath"
|
|
772
|
+
// `foreignObject` is explicitly disallowed because it allows injecting arbitrary HTML
|
|
773
|
+
// "foreignObject",
|
|
774
|
+
].map((tn) => [tn.toLowerCase(), tn])
|
|
775
|
+
);
|
|
776
|
+
SVG_ATTRS_ADJUSTMENT_MAP = new Map(
|
|
777
|
+
[
|
|
778
|
+
"attributeName",
|
|
779
|
+
"attributeType",
|
|
780
|
+
"baseFrequency",
|
|
781
|
+
"baseProfile",
|
|
782
|
+
"calcMode",
|
|
783
|
+
"clipPathUnits",
|
|
784
|
+
"diffuseConstant",
|
|
785
|
+
"edgeMode",
|
|
786
|
+
"filterUnits",
|
|
787
|
+
"glyphRef",
|
|
788
|
+
"gradientTransform",
|
|
789
|
+
"gradientUnits",
|
|
790
|
+
"kernelMatrix",
|
|
791
|
+
"kernelUnitLength",
|
|
792
|
+
"keyPoints",
|
|
793
|
+
"keySplines",
|
|
794
|
+
"keyTimes",
|
|
795
|
+
"lengthAdjust",
|
|
796
|
+
"limitingConeAngle",
|
|
797
|
+
"markerHeight",
|
|
798
|
+
"markerUnits",
|
|
799
|
+
"markerWidth",
|
|
800
|
+
"maskContentUnits",
|
|
801
|
+
"maskUnits",
|
|
802
|
+
"numOctaves",
|
|
803
|
+
"pathLength",
|
|
804
|
+
"patternContentUnits",
|
|
805
|
+
"patternTransform",
|
|
806
|
+
"patternUnits",
|
|
807
|
+
"pointsAtX",
|
|
808
|
+
"pointsAtY",
|
|
809
|
+
"pointsAtZ",
|
|
810
|
+
"preserveAlpha",
|
|
811
|
+
"preserveAspectRatio",
|
|
812
|
+
"primitiveUnits",
|
|
813
|
+
"refX",
|
|
814
|
+
"refY",
|
|
815
|
+
"repeatCount",
|
|
816
|
+
"repeatDur",
|
|
817
|
+
"requiredExtensions",
|
|
818
|
+
"requiredFeatures",
|
|
819
|
+
"specularConstant",
|
|
820
|
+
"specularExponent",
|
|
821
|
+
"spreadMethod",
|
|
822
|
+
"startOffset",
|
|
823
|
+
"stdDeviation",
|
|
824
|
+
"stitchTiles",
|
|
825
|
+
"surfaceScale",
|
|
826
|
+
"systemLanguage",
|
|
827
|
+
"tableValues",
|
|
828
|
+
"targetX",
|
|
829
|
+
"targetY",
|
|
830
|
+
"textLength",
|
|
831
|
+
"viewBox",
|
|
832
|
+
"viewTarget",
|
|
833
|
+
"xChannelSelector",
|
|
834
|
+
"yChannelSelector",
|
|
835
|
+
"zoomAndPan"
|
|
836
|
+
].map((attr) => [attr.toLowerCase(), attr])
|
|
837
|
+
);
|
|
672
838
|
NetworkedDOMWebsocketV01Adapter = class {
|
|
673
839
|
constructor(websocket, parentElement, connectedCallback, timeCallback, options = {}) {
|
|
674
840
|
this.websocket = websocket;
|
|
@@ -787,6 +953,7 @@
|
|
|
787
953
|
if (!isHTMLElement(parent, this.parentElement)) {
|
|
788
954
|
throw new Error("Parent is not an HTMLElement (that supports children)");
|
|
789
955
|
}
|
|
956
|
+
const targetForChildren = getChildrenTarget(parent);
|
|
790
957
|
let nextElement = null;
|
|
791
958
|
let previousElement = null;
|
|
792
959
|
if (previousNodeId) {
|
|
@@ -808,12 +975,12 @@
|
|
|
808
975
|
if (nextElement) {
|
|
809
976
|
const docFrag = new DocumentFragment();
|
|
810
977
|
docFrag.append(...elementsToAdd);
|
|
811
|
-
|
|
978
|
+
targetForChildren.insertBefore(docFrag, nextElement);
|
|
812
979
|
} else {
|
|
813
|
-
|
|
980
|
+
targetForChildren.append(...elementsToAdd);
|
|
814
981
|
}
|
|
815
982
|
} else {
|
|
816
|
-
|
|
983
|
+
targetForChildren.prepend(...elementsToAdd);
|
|
817
984
|
}
|
|
818
985
|
}
|
|
819
986
|
for (const removedNode of removedNodes) {
|
|
@@ -823,15 +990,20 @@
|
|
|
823
990
|
}
|
|
824
991
|
this.elementToId.delete(childElement);
|
|
825
992
|
this.idToElement.delete(removedNode);
|
|
826
|
-
parent
|
|
993
|
+
const targetForRemoval = getRemovalTarget(parent);
|
|
994
|
+
targetForRemoval.removeChild(childElement);
|
|
827
995
|
if (isHTMLElement(childElement, this.parentElement)) {
|
|
828
996
|
this.removeChildElementIds(childElement);
|
|
829
997
|
}
|
|
830
998
|
}
|
|
831
999
|
}
|
|
832
1000
|
removeChildElementIds(parent) {
|
|
833
|
-
|
|
834
|
-
|
|
1001
|
+
const portal = getChildrenTarget(parent);
|
|
1002
|
+
if (portal !== parent) {
|
|
1003
|
+
this.removeChildElementIds(portal);
|
|
1004
|
+
}
|
|
1005
|
+
for (let i = 0; i < parent.childNodes.length; i++) {
|
|
1006
|
+
const child = parent.childNodes[i];
|
|
835
1007
|
const childId = this.elementToId.get(child);
|
|
836
1008
|
if (!childId) {
|
|
837
1009
|
console.error("Inner child of removed element had no id", child);
|
|
@@ -871,9 +1043,7 @@
|
|
|
871
1043
|
if (newValue === null) {
|
|
872
1044
|
element.removeAttribute(attribute);
|
|
873
1045
|
} else {
|
|
874
|
-
|
|
875
|
-
element.setAttribute(attribute, newValue);
|
|
876
|
-
}
|
|
1046
|
+
setElementAttribute(element, attribute, newValue);
|
|
877
1047
|
}
|
|
878
1048
|
} else {
|
|
879
1049
|
console.error("Element is not an HTMLElement and cannot support attributes", element);
|
|
@@ -912,13 +1082,7 @@
|
|
|
912
1082
|
}
|
|
913
1083
|
let element;
|
|
914
1084
|
try {
|
|
915
|
-
|
|
916
|
-
if (this.options.tagPrefix) {
|
|
917
|
-
if (!tag.toLowerCase().startsWith(this.options.tagPrefix.toLowerCase())) {
|
|
918
|
-
filteredTag = this.options.replacementTagPrefix ? this.options.replacementTagPrefix + tag : `x-${tag}`;
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
element = document.createElement(filteredTag);
|
|
1085
|
+
element = createElementWithSVGSupport(tag, this.options);
|
|
922
1086
|
} catch (e) {
|
|
923
1087
|
console.error(`Error creating element: (${tag})`, e);
|
|
924
1088
|
element = document.createElement("x-div");
|
|
@@ -926,10 +1090,8 @@
|
|
|
926
1090
|
this.idToElement.set(nodeId, element);
|
|
927
1091
|
this.elementToId.set(element, nodeId);
|
|
928
1092
|
for (const key in attributes) {
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
element.setAttribute(key, value);
|
|
932
|
-
}
|
|
1093
|
+
const value = attributes[key];
|
|
1094
|
+
setElementAttribute(element, key, value);
|
|
933
1095
|
}
|
|
934
1096
|
if (children) {
|
|
935
1097
|
for (const child of children) {
|
|
@@ -1123,6 +1285,7 @@
|
|
|
1123
1285
|
if (!isHTMLElement(parent, this.parentElement)) {
|
|
1124
1286
|
throw new Error("Parent is not an HTMLElement (that supports children)");
|
|
1125
1287
|
}
|
|
1288
|
+
const targetForChildren = getChildrenTarget(parent);
|
|
1126
1289
|
let nextElement = null;
|
|
1127
1290
|
let previousElement = null;
|
|
1128
1291
|
if (previousNodeId) {
|
|
@@ -1144,12 +1307,12 @@
|
|
|
1144
1307
|
if (nextElement) {
|
|
1145
1308
|
const docFrag = new DocumentFragment();
|
|
1146
1309
|
docFrag.append(...elementsToAdd);
|
|
1147
|
-
|
|
1310
|
+
targetForChildren.insertBefore(docFrag, nextElement);
|
|
1148
1311
|
} else {
|
|
1149
|
-
|
|
1312
|
+
targetForChildren.append(...elementsToAdd);
|
|
1150
1313
|
}
|
|
1151
1314
|
} else {
|
|
1152
|
-
|
|
1315
|
+
targetForChildren.prepend(...elementsToAdd);
|
|
1153
1316
|
}
|
|
1154
1317
|
}
|
|
1155
1318
|
}
|
|
@@ -1177,15 +1340,20 @@
|
|
|
1177
1340
|
this.elementToId.delete(childElement);
|
|
1178
1341
|
this.idToElement.delete(removedNode);
|
|
1179
1342
|
this.hiddenPlaceholderElements.delete(removedNode);
|
|
1180
|
-
parent
|
|
1343
|
+
const targetForRemoval = getRemovalTarget(parent);
|
|
1344
|
+
targetForRemoval.removeChild(childElement);
|
|
1181
1345
|
if (isHTMLElement(childElement, this.parentElement)) {
|
|
1182
1346
|
this.removeChildElementIds(childElement);
|
|
1183
1347
|
}
|
|
1184
1348
|
}
|
|
1185
1349
|
}
|
|
1186
1350
|
removeChildElementIds(parent) {
|
|
1187
|
-
|
|
1188
|
-
|
|
1351
|
+
const portal = getChildrenTarget(parent);
|
|
1352
|
+
if (portal !== parent) {
|
|
1353
|
+
this.removeChildElementIds(portal);
|
|
1354
|
+
}
|
|
1355
|
+
for (let i = 0; i < parent.childNodes.length; i++) {
|
|
1356
|
+
const child = parent.childNodes[i];
|
|
1189
1357
|
const childId = this.elementToId.get(child);
|
|
1190
1358
|
if (!childId) {
|
|
1191
1359
|
console.error("Inner child of removed element had no id", child);
|
|
@@ -1237,9 +1405,7 @@
|
|
|
1237
1405
|
if (newValue === null) {
|
|
1238
1406
|
element.removeAttribute(key);
|
|
1239
1407
|
} else {
|
|
1240
|
-
|
|
1241
|
-
element.setAttribute(key, newValue);
|
|
1242
|
-
}
|
|
1408
|
+
setElementAttribute(element, key, newValue);
|
|
1243
1409
|
}
|
|
1244
1410
|
}
|
|
1245
1411
|
} else {
|
|
@@ -1276,22 +1442,14 @@
|
|
|
1276
1442
|
}
|
|
1277
1443
|
let element;
|
|
1278
1444
|
try {
|
|
1279
|
-
|
|
1280
|
-
if (this.options.tagPrefix) {
|
|
1281
|
-
if (!tag.toLowerCase().startsWith(this.options.tagPrefix.toLowerCase())) {
|
|
1282
|
-
filteredTag = this.options.replacementTagPrefix ? this.options.replacementTagPrefix + tag : `x-${tag}`;
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
element = document.createElement(filteredTag);
|
|
1445
|
+
element = createElementWithSVGSupport(tag, this.options);
|
|
1286
1446
|
} catch (e) {
|
|
1287
1447
|
console.error(`Error creating element: (${tag})`, e);
|
|
1288
1448
|
element = document.createElement("x-div");
|
|
1289
1449
|
}
|
|
1290
1450
|
for (const [key, value] of attributes) {
|
|
1291
1451
|
if (value !== null) {
|
|
1292
|
-
|
|
1293
|
-
element.setAttribute(key, value);
|
|
1294
|
-
}
|
|
1452
|
+
setElementAttribute(element, key, value);
|
|
1295
1453
|
}
|
|
1296
1454
|
}
|
|
1297
1455
|
if (children) {
|
|
@@ -2010,6 +2168,7 @@
|
|
|
2010
2168
|
targetWindow.customElements.define(Group.tagName, Group);
|
|
2011
2169
|
targetWindow.customElements.define(Prompt.tagName, Prompt);
|
|
2012
2170
|
targetWindow.customElements.define(Link.tagName, Link);
|
|
2171
|
+
targetWindow.customElements.define(Overlay.tagName, Overlay);
|
|
2013
2172
|
targetWindow.customElements.define(Sphere.tagName, Sphere);
|
|
2014
2173
|
targetWindow.customElements.define(Image2.tagName, Image2);
|
|
2015
2174
|
targetWindow.customElements.define(Video.tagName, Video);
|
|
@@ -2088,8 +2247,8 @@
|
|
|
2088
2247
|
interactionPrompt.innerHTML = "Press E to interact";
|
|
2089
2248
|
return interactionPrompt;
|
|
2090
2249
|
}
|
|
2091
|
-
function configureWindowForMML(window2, getGraphicsAdapter) {
|
|
2092
|
-
const fullScreenMMLScene = new FullScreenMMLScene();
|
|
2250
|
+
function configureWindowForMML(window2, getGraphicsAdapter, options) {
|
|
2251
|
+
const fullScreenMMLScene = new FullScreenMMLScene(options);
|
|
2093
2252
|
const mmlDocumentTimeManager = new MMLDocumentTimeManager();
|
|
2094
2253
|
setGlobalMMLScene(fullScreenMMLScene);
|
|
2095
2254
|
setGlobalDocumentTimeManager(mmlDocumentTimeManager);
|
|
@@ -2223,7 +2382,7 @@
|
|
|
2223
2382
|
peerConnection.onicegatheringstatechange = () => peerConnection.iceGatheringState === "complete" && resolve(peerConnection.localDescription);
|
|
2224
2383
|
});
|
|
2225
2384
|
}
|
|
2226
|
-
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, 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, 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, PlaneGraphics, PositionProbeGraphics, PromptGraphics, RemoteDocumentGraphics, SphereGraphics, TransformableGraphics, VideoGraphics, IframeWrapper, MMLNetworkSource, StatusUI, tagAdapterDefaultTheme, TagDebugAdapterDebugHelper, TagDebugAttribute, ignoredAttributes, TagDebugMElement, TagDebugAdapterGraphicsInterface, StandaloneTagDebugAdapter, StaticFileVideoSource, WHEPVideoSource;
|
|
2385
|
+
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, MMLNetworkSource, StatusUI, tagAdapterDefaultTheme, TagDebugAdapterDebugHelper, TagDebugAttribute, ignoredAttributes, TagDebugMElement, TagDebugAdapterGraphicsInterface, StandaloneTagDebugAdapter, StaticFileVideoSource, WHEPVideoSource;
|
|
2227
2386
|
var init_build3 = __esm({
|
|
2228
2387
|
"../mml-web/build/index.js"() {
|
|
2229
2388
|
init_build2();
|
|
@@ -3911,6 +4070,31 @@
|
|
|
3911
4070
|
});
|
|
3912
4071
|
_CollideableHelper.observedAttributes = _CollideableHelper.AttributeHandler.getAttributes();
|
|
3913
4072
|
CollideableHelper = _CollideableHelper;
|
|
4073
|
+
clickableAttributeName = "clickable";
|
|
4074
|
+
defaultClickable = true;
|
|
4075
|
+
_ClickableHelper = class _ClickableHelper2 {
|
|
4076
|
+
constructor() {
|
|
4077
|
+
this.props = {
|
|
4078
|
+
clickable: defaultClickable
|
|
4079
|
+
};
|
|
4080
|
+
}
|
|
4081
|
+
isClickable() {
|
|
4082
|
+
return this.props.clickable;
|
|
4083
|
+
}
|
|
4084
|
+
handle(name, newValue) {
|
|
4085
|
+
_ClickableHelper2.AttributeHandler.handle(this, name, newValue);
|
|
4086
|
+
}
|
|
4087
|
+
};
|
|
4088
|
+
_ClickableHelper.AttributeHandler = new AttributeHandler({
|
|
4089
|
+
[clickableAttributeName]: (instance, newValue) => {
|
|
4090
|
+
const clickable = parseBoolAttribute(newValue, defaultClickable);
|
|
4091
|
+
if (clickable !== instance.props.clickable) {
|
|
4092
|
+
instance.props.clickable = clickable;
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
4095
|
+
});
|
|
4096
|
+
_ClickableHelper.observedAttributes = _ClickableHelper.AttributeHandler.getAttributes();
|
|
4097
|
+
ClickableHelper = _ClickableHelper;
|
|
3914
4098
|
debugAttributeName = "debug";
|
|
3915
4099
|
DebugHelper = class {
|
|
3916
4100
|
constructor(element) {
|
|
@@ -4411,6 +4595,7 @@
|
|
|
4411
4595
|
debug: defaultModelDebug
|
|
4412
4596
|
};
|
|
4413
4597
|
this.collideableHelper = new CollideableHelper(this);
|
|
4598
|
+
this.clickableHelper = new ClickableHelper();
|
|
4414
4599
|
this.modelGraphics = null;
|
|
4415
4600
|
this.isModel = true;
|
|
4416
4601
|
}
|
|
@@ -4427,7 +4612,8 @@
|
|
|
4427
4612
|
return [
|
|
4428
4613
|
...TransformableElement.observedAttributes,
|
|
4429
4614
|
..._Model2.attributeHandler.getAttributes(),
|
|
4430
|
-
...CollideableHelper.observedAttributes
|
|
4615
|
+
...CollideableHelper.observedAttributes,
|
|
4616
|
+
...ClickableHelper.observedAttributes
|
|
4431
4617
|
];
|
|
4432
4618
|
}
|
|
4433
4619
|
getContentBounds() {
|
|
@@ -4451,7 +4637,7 @@
|
|
|
4451
4637
|
(_a2 = this.modelGraphics) == null ? void 0 : _a2.transformed();
|
|
4452
4638
|
}
|
|
4453
4639
|
isClickable() {
|
|
4454
|
-
return
|
|
4640
|
+
return this.clickableHelper.isClickable();
|
|
4455
4641
|
}
|
|
4456
4642
|
addSideEffectChild(child) {
|
|
4457
4643
|
if (Animation.isAnimation(child)) {
|
|
@@ -4478,6 +4664,7 @@
|
|
|
4478
4664
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
4479
4665
|
_Model2.attributeHandler.handle(this, name, newValue);
|
|
4480
4666
|
this.collideableHelper.handle(name, newValue);
|
|
4667
|
+
this.clickableHelper.handle(name, newValue);
|
|
4481
4668
|
if (TransformableElement.observedAttributes.includes(name)) {
|
|
4482
4669
|
this.modelGraphics.transformed();
|
|
4483
4670
|
}
|
|
@@ -4796,7 +4983,7 @@
|
|
|
4796
4983
|
parentTransformed() {
|
|
4797
4984
|
}
|
|
4798
4985
|
isClickable() {
|
|
4799
|
-
return
|
|
4986
|
+
return false;
|
|
4800
4987
|
}
|
|
4801
4988
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
4802
4989
|
if (!this.audioGraphics) {
|
|
@@ -4902,9 +5089,6 @@
|
|
|
4902
5089
|
parentTransformed() {
|
|
4903
5090
|
super.parentTransformed();
|
|
4904
5091
|
}
|
|
4905
|
-
isClickable() {
|
|
4906
|
-
return true;
|
|
4907
|
-
}
|
|
4908
5092
|
connectedCallback() {
|
|
4909
5093
|
super.connectedCallback();
|
|
4910
5094
|
}
|
|
@@ -5130,6 +5314,7 @@
|
|
|
5130
5314
|
]
|
|
5131
5315
|
});
|
|
5132
5316
|
this.collideableHelper = new CollideableHelper(this);
|
|
5317
|
+
this.clickableHelper = new ClickableHelper();
|
|
5133
5318
|
}
|
|
5134
5319
|
enable() {
|
|
5135
5320
|
this.collideableHelper.enable();
|
|
@@ -5150,7 +5335,8 @@
|
|
|
5150
5335
|
return [
|
|
5151
5336
|
...TransformableElement.observedAttributes,
|
|
5152
5337
|
..._Cube2.attributeHandler.getAttributes(),
|
|
5153
|
-
...CollideableHelper.observedAttributes
|
|
5338
|
+
...CollideableHelper.observedAttributes,
|
|
5339
|
+
...ClickableHelper.observedAttributes
|
|
5154
5340
|
];
|
|
5155
5341
|
}
|
|
5156
5342
|
addSideEffectChild(child) {
|
|
@@ -5165,7 +5351,7 @@
|
|
|
5165
5351
|
this.collideableHelper.parentTransformed();
|
|
5166
5352
|
}
|
|
5167
5353
|
isClickable() {
|
|
5168
|
-
return
|
|
5354
|
+
return this.clickableHelper.isClickable();
|
|
5169
5355
|
}
|
|
5170
5356
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
5171
5357
|
if (!this.cubeGraphics) {
|
|
@@ -5174,6 +5360,7 @@
|
|
|
5174
5360
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
5175
5361
|
_Cube2.attributeHandler.handle(this, name, newValue);
|
|
5176
5362
|
this.collideableHelper.handle(name, newValue);
|
|
5363
|
+
this.clickableHelper.handle(name, newValue);
|
|
5177
5364
|
}
|
|
5178
5365
|
connectedCallback() {
|
|
5179
5366
|
var _a2;
|
|
@@ -5298,6 +5485,7 @@
|
|
|
5298
5485
|
]
|
|
5299
5486
|
});
|
|
5300
5487
|
this.collideableHelper = new CollideableHelper(this);
|
|
5488
|
+
this.clickableHelper = new ClickableHelper();
|
|
5301
5489
|
}
|
|
5302
5490
|
enable() {
|
|
5303
5491
|
this.collideableHelper.enable();
|
|
@@ -5318,7 +5506,8 @@
|
|
|
5318
5506
|
return [
|
|
5319
5507
|
...TransformableElement.observedAttributes,
|
|
5320
5508
|
..._Cylinder2.attributeHandler.getAttributes(),
|
|
5321
|
-
...CollideableHelper.observedAttributes
|
|
5509
|
+
...CollideableHelper.observedAttributes,
|
|
5510
|
+
...ClickableHelper.observedAttributes
|
|
5322
5511
|
];
|
|
5323
5512
|
}
|
|
5324
5513
|
addSideEffectChild(child) {
|
|
@@ -5333,7 +5522,7 @@
|
|
|
5333
5522
|
this.collideableHelper.parentTransformed();
|
|
5334
5523
|
}
|
|
5335
5524
|
isClickable() {
|
|
5336
|
-
return
|
|
5525
|
+
return this.clickableHelper.isClickable();
|
|
5337
5526
|
}
|
|
5338
5527
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
5339
5528
|
if (!this.cylinderGraphics) {
|
|
@@ -5342,6 +5531,7 @@
|
|
|
5342
5531
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
5343
5532
|
_Cylinder2.attributeHandler.handle(this, name, newValue);
|
|
5344
5533
|
this.collideableHelper.handle(name, newValue);
|
|
5534
|
+
this.clickableHelper.handle(name, newValue);
|
|
5345
5535
|
}
|
|
5346
5536
|
connectedCallback() {
|
|
5347
5537
|
var _a2;
|
|
@@ -6077,7 +6267,7 @@
|
|
|
6077
6267
|
this.boundsUpdated();
|
|
6078
6268
|
}
|
|
6079
6269
|
isClickable() {
|
|
6080
|
-
return
|
|
6270
|
+
return false;
|
|
6081
6271
|
}
|
|
6082
6272
|
startEmitting() {
|
|
6083
6273
|
if (this.timer) {
|
|
@@ -6249,7 +6439,7 @@
|
|
|
6249
6439
|
parentTransformed() {
|
|
6250
6440
|
}
|
|
6251
6441
|
isClickable() {
|
|
6252
|
-
return
|
|
6442
|
+
return false;
|
|
6253
6443
|
}
|
|
6254
6444
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
6255
6445
|
if (!this.transformableElementGraphics) {
|
|
@@ -6328,6 +6518,7 @@
|
|
|
6328
6518
|
]
|
|
6329
6519
|
});
|
|
6330
6520
|
this.collideableHelper = new CollideableHelper(this);
|
|
6521
|
+
this.clickableHelper = new ClickableHelper();
|
|
6331
6522
|
}
|
|
6332
6523
|
enable() {
|
|
6333
6524
|
this.collideableHelper.enable();
|
|
@@ -6339,7 +6530,8 @@
|
|
|
6339
6530
|
return [
|
|
6340
6531
|
...TransformableElement.observedAttributes,
|
|
6341
6532
|
..._Image2.attributeHandler.getAttributes(),
|
|
6342
|
-
...CollideableHelper.observedAttributes
|
|
6533
|
+
...CollideableHelper.observedAttributes,
|
|
6534
|
+
...ClickableHelper.observedAttributes
|
|
6343
6535
|
];
|
|
6344
6536
|
}
|
|
6345
6537
|
getContentBounds() {
|
|
@@ -6365,7 +6557,7 @@
|
|
|
6365
6557
|
this.collideableHelper.parentTransformed();
|
|
6366
6558
|
}
|
|
6367
6559
|
isClickable() {
|
|
6368
|
-
return
|
|
6560
|
+
return this.clickableHelper.isClickable();
|
|
6369
6561
|
}
|
|
6370
6562
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
6371
6563
|
if (!this.imageGraphics) {
|
|
@@ -6374,6 +6566,7 @@
|
|
|
6374
6566
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
6375
6567
|
_Image2.attributeHandler.handle(this, name, newValue);
|
|
6376
6568
|
this.collideableHelper.handle(name, newValue);
|
|
6569
|
+
this.clickableHelper.handle(name, newValue);
|
|
6377
6570
|
}
|
|
6378
6571
|
connectedCallback() {
|
|
6379
6572
|
var _a2;
|
|
@@ -6610,6 +6803,7 @@
|
|
|
6610
6803
|
constructor() {
|
|
6611
6804
|
super();
|
|
6612
6805
|
this.collideableHelper = new CollideableHelper(this);
|
|
6806
|
+
this.clickableHelper = new ClickableHelper();
|
|
6613
6807
|
this.labelAnimatedAttributeHelper = new AnimatedAttributeHelper(this, {
|
|
6614
6808
|
color: [
|
|
6615
6809
|
2,
|
|
@@ -6689,7 +6883,8 @@
|
|
|
6689
6883
|
return [
|
|
6690
6884
|
...TransformableElement.observedAttributes,
|
|
6691
6885
|
..._Label2.attributeHandler.getAttributes(),
|
|
6692
|
-
...CollideableHelper.observedAttributes
|
|
6886
|
+
...CollideableHelper.observedAttributes,
|
|
6887
|
+
...ClickableHelper.observedAttributes
|
|
6693
6888
|
];
|
|
6694
6889
|
}
|
|
6695
6890
|
getContentBounds() {
|
|
@@ -6712,7 +6907,7 @@
|
|
|
6712
6907
|
parentTransformed() {
|
|
6713
6908
|
}
|
|
6714
6909
|
isClickable() {
|
|
6715
|
-
return
|
|
6910
|
+
return this.clickableHelper.isClickable();
|
|
6716
6911
|
}
|
|
6717
6912
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
6718
6913
|
if (!this.labelGraphics) {
|
|
@@ -6721,6 +6916,7 @@
|
|
|
6721
6916
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
6722
6917
|
_Label2.attributeHandler.handle(this, name, newValue);
|
|
6723
6918
|
this.collideableHelper.handle(name, newValue);
|
|
6919
|
+
this.clickableHelper.handle(name, newValue);
|
|
6724
6920
|
}
|
|
6725
6921
|
connectedCallback() {
|
|
6726
6922
|
var _a2;
|
|
@@ -7086,6 +7282,234 @@
|
|
|
7086
7282
|
}
|
|
7087
7283
|
});
|
|
7088
7284
|
Link = _Link;
|
|
7285
|
+
OverlayAnchor = /* @__PURE__ */ ((OverlayAnchor2) => {
|
|
7286
|
+
OverlayAnchor2["top-left"] = "top-left";
|
|
7287
|
+
OverlayAnchor2["top-center"] = "top-center";
|
|
7288
|
+
OverlayAnchor2["top-right"] = "top-right";
|
|
7289
|
+
OverlayAnchor2["center-left"] = "center-left";
|
|
7290
|
+
OverlayAnchor2["center"] = "center";
|
|
7291
|
+
OverlayAnchor2["center-right"] = "center-right";
|
|
7292
|
+
OverlayAnchor2["bottom-left"] = "bottom-left";
|
|
7293
|
+
OverlayAnchor2["bottom-center"] = "bottom-center";
|
|
7294
|
+
OverlayAnchor2["bottom-right"] = "bottom-right";
|
|
7295
|
+
return OverlayAnchor2;
|
|
7296
|
+
})(OverlayAnchor || {});
|
|
7297
|
+
_Overlay = class _Overlay2 extends TransformableElement {
|
|
7298
|
+
constructor() {
|
|
7299
|
+
super();
|
|
7300
|
+
this.overlayGraphics = null;
|
|
7301
|
+
this.overlayElement = null;
|
|
7302
|
+
this.mode = "pending";
|
|
7303
|
+
this.props = {
|
|
7304
|
+
href: null,
|
|
7305
|
+
target: null,
|
|
7306
|
+
anchor: "top-left",
|
|
7307
|
+
offsetX: 0,
|
|
7308
|
+
offsetY: 0
|
|
7309
|
+
};
|
|
7310
|
+
}
|
|
7311
|
+
static get observedAttributes() {
|
|
7312
|
+
return [
|
|
7313
|
+
...TransformableElement.observedAttributes,
|
|
7314
|
+
..._Overlay2.attributeHandler.getAttributes()
|
|
7315
|
+
];
|
|
7316
|
+
}
|
|
7317
|
+
updateOverlayElementPosition() {
|
|
7318
|
+
if (!this.overlayElement) {
|
|
7319
|
+
return;
|
|
7320
|
+
}
|
|
7321
|
+
this.overlayElement.style.position = "absolute";
|
|
7322
|
+
this.overlayElement.style.zIndex = "1000";
|
|
7323
|
+
switch (this.props.anchor) {
|
|
7324
|
+
case "top-left":
|
|
7325
|
+
this.overlayElement.style.top = `0`;
|
|
7326
|
+
this.overlayElement.style.left = `0`;
|
|
7327
|
+
this.overlayElement.style.right = ``;
|
|
7328
|
+
this.overlayElement.style.bottom = ``;
|
|
7329
|
+
this.overlayElement.style.transformOrigin = "top left";
|
|
7330
|
+
this.overlayElement.style.transform = `translateX(calc(${this.props.offsetX}px)) translateY(${this.props.offsetY}px)`;
|
|
7331
|
+
break;
|
|
7332
|
+
case "top-center":
|
|
7333
|
+
this.overlayElement.style.top = `0`;
|
|
7334
|
+
this.overlayElement.style.left = `50%`;
|
|
7335
|
+
this.overlayElement.style.right = ``;
|
|
7336
|
+
this.overlayElement.style.bottom = ``;
|
|
7337
|
+
this.overlayElement.style.transformOrigin = "top center";
|
|
7338
|
+
this.overlayElement.style.transform = `translateX(calc(-50% + ${this.props.offsetX}px)) translateY(${this.props.offsetY}px)`;
|
|
7339
|
+
break;
|
|
7340
|
+
case "top-right":
|
|
7341
|
+
this.overlayElement.style.top = `0`;
|
|
7342
|
+
this.overlayElement.style.right = `0`;
|
|
7343
|
+
this.overlayElement.style.left = ``;
|
|
7344
|
+
this.overlayElement.style.bottom = ``;
|
|
7345
|
+
this.overlayElement.style.transformOrigin = "top right";
|
|
7346
|
+
this.overlayElement.style.transform = `translateX(${this.props.offsetX}px) translateY(${this.props.offsetY}px)`;
|
|
7347
|
+
break;
|
|
7348
|
+
case "center-left":
|
|
7349
|
+
this.overlayElement.style.top = "50%";
|
|
7350
|
+
this.overlayElement.style.left = `0`;
|
|
7351
|
+
this.overlayElement.style.right = ``;
|
|
7352
|
+
this.overlayElement.style.bottom = ``;
|
|
7353
|
+
this.overlayElement.style.transformOrigin = "center left";
|
|
7354
|
+
this.overlayElement.style.transform = `translateX(calc(${this.props.offsetX}px)) translateY(calc(-50% + ${this.props.offsetY}px))`;
|
|
7355
|
+
break;
|
|
7356
|
+
case "center":
|
|
7357
|
+
this.overlayElement.style.top = "50%";
|
|
7358
|
+
this.overlayElement.style.left = "50%";
|
|
7359
|
+
this.overlayElement.style.right = ``;
|
|
7360
|
+
this.overlayElement.style.bottom = ``;
|
|
7361
|
+
this.overlayElement.style.transformOrigin = "center";
|
|
7362
|
+
this.overlayElement.style.transform = `translate(calc(-50% + ${this.props.offsetX}px), calc(-50% + ${this.props.offsetY}px))`;
|
|
7363
|
+
break;
|
|
7364
|
+
case "center-right":
|
|
7365
|
+
this.overlayElement.style.top = "50%";
|
|
7366
|
+
this.overlayElement.style.left = "100%";
|
|
7367
|
+
this.overlayElement.style.right = ``;
|
|
7368
|
+
this.overlayElement.style.bottom = ``;
|
|
7369
|
+
this.overlayElement.style.transformOrigin = "center right";
|
|
7370
|
+
this.overlayElement.style.transform = `translateX(calc(-100% + ${this.props.offsetX}px)) translateY(calc(-50% + ${this.props.offsetY}px))`;
|
|
7371
|
+
break;
|
|
7372
|
+
case "bottom-left":
|
|
7373
|
+
this.overlayElement.style.top = "100%";
|
|
7374
|
+
this.overlayElement.style.left = `${this.props.offsetX}px`;
|
|
7375
|
+
this.overlayElement.style.right = ``;
|
|
7376
|
+
this.overlayElement.style.bottom = ``;
|
|
7377
|
+
this.overlayElement.style.transformOrigin = "bottom left";
|
|
7378
|
+
this.overlayElement.style.transform = `translateX(${this.props.offsetX}px) translateY(calc(-100% + ${this.props.offsetY}px))`;
|
|
7379
|
+
break;
|
|
7380
|
+
case "bottom-center":
|
|
7381
|
+
this.overlayElement.style.top = "100%";
|
|
7382
|
+
this.overlayElement.style.left = "50%";
|
|
7383
|
+
this.overlayElement.style.right = ``;
|
|
7384
|
+
this.overlayElement.style.bottom = ``;
|
|
7385
|
+
this.overlayElement.style.transformOrigin = "bottom center";
|
|
7386
|
+
this.overlayElement.style.transform = `translateX(calc(-50% + ${this.props.offsetX}px)) translateY(calc(-100% + ${this.props.offsetY}px))`;
|
|
7387
|
+
break;
|
|
7388
|
+
case "bottom-right":
|
|
7389
|
+
this.overlayElement.style.top = "100%";
|
|
7390
|
+
this.overlayElement.style.left = "100%";
|
|
7391
|
+
this.overlayElement.style.right = ``;
|
|
7392
|
+
this.overlayElement.style.bottom = ``;
|
|
7393
|
+
this.overlayElement.style.transformOrigin = "bottom right";
|
|
7394
|
+
this.overlayElement.style.transform = `translateX(calc(-100% + ${this.props.offsetX}px)) translateY(calc(-100% + ${this.props.offsetY}px))`;
|
|
7395
|
+
break;
|
|
7396
|
+
default:
|
|
7397
|
+
throw new Error(`Unknown anchor: ${this.props.anchor}`);
|
|
7398
|
+
}
|
|
7399
|
+
}
|
|
7400
|
+
getPortalElement() {
|
|
7401
|
+
if (this.mode === "direct") {
|
|
7402
|
+
return this;
|
|
7403
|
+
} else if (this.mode === "portal") {
|
|
7404
|
+
if (!this.overlayElement) {
|
|
7405
|
+
throw new Error("Overlay element is not set");
|
|
7406
|
+
}
|
|
7407
|
+
return this.overlayElement;
|
|
7408
|
+
}
|
|
7409
|
+
throw new Error("Unknown overlay mode");
|
|
7410
|
+
}
|
|
7411
|
+
parentTransformed() {
|
|
7412
|
+
}
|
|
7413
|
+
isClickable() {
|
|
7414
|
+
return false;
|
|
7415
|
+
}
|
|
7416
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
7417
|
+
if (!this.transformableElementGraphics) {
|
|
7418
|
+
return;
|
|
7419
|
+
}
|
|
7420
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
7421
|
+
_Overlay2.attributeHandler.handle(this, name, newValue);
|
|
7422
|
+
}
|
|
7423
|
+
disable() {
|
|
7424
|
+
}
|
|
7425
|
+
enable() {
|
|
7426
|
+
}
|
|
7427
|
+
getContentBounds() {
|
|
7428
|
+
return null;
|
|
7429
|
+
}
|
|
7430
|
+
connectedCallback() {
|
|
7431
|
+
var _a2, _b2;
|
|
7432
|
+
super.connectedCallback();
|
|
7433
|
+
if (!this.getScene().hasGraphicsAdapter() || this.overlayGraphics) {
|
|
7434
|
+
return;
|
|
7435
|
+
}
|
|
7436
|
+
const remoteDocument = this.getInitiatedRemoteDocument();
|
|
7437
|
+
if (remoteDocument) {
|
|
7438
|
+
this.mode = "portal";
|
|
7439
|
+
this.overlayElement = document.createElement("div");
|
|
7440
|
+
this.overlayElement.addEventListener("click", (event) => {
|
|
7441
|
+
event.stopImmediatePropagation();
|
|
7442
|
+
event.preventDefault();
|
|
7443
|
+
const remoteDocument2 = this.getInitiatedRemoteDocument();
|
|
7444
|
+
if (remoteDocument2) {
|
|
7445
|
+
remoteDocument2.dispatchEvent(
|
|
7446
|
+
new CustomEvent(consumeEventEventName, {
|
|
7447
|
+
bubbles: false,
|
|
7448
|
+
detail: { element: event.target, originalEvent: event }
|
|
7449
|
+
})
|
|
7450
|
+
);
|
|
7451
|
+
}
|
|
7452
|
+
});
|
|
7453
|
+
const parentElement = (_b2 = (_a2 = this.getScene()).getOverlayElement) == null ? void 0 : _b2.call(_a2);
|
|
7454
|
+
if (parentElement) {
|
|
7455
|
+
parentElement.appendChild(this.overlayElement);
|
|
7456
|
+
} else {
|
|
7457
|
+
console.warn(
|
|
7458
|
+
"An m-overlay element was found but getOverlayElement was not provided by the scene"
|
|
7459
|
+
);
|
|
7460
|
+
}
|
|
7461
|
+
for (const child of Array.from(this.childNodes)) {
|
|
7462
|
+
this.overlayElement.appendChild(child);
|
|
7463
|
+
}
|
|
7464
|
+
} else {
|
|
7465
|
+
this.mode = "direct";
|
|
7466
|
+
this.overlayElement = this;
|
|
7467
|
+
}
|
|
7468
|
+
const graphicsAdapter = this.getScene().getGraphicsAdapter();
|
|
7469
|
+
this.overlayGraphics = graphicsAdapter.getGraphicsAdapterFactory().MMLOverlayGraphicsInterface(this);
|
|
7470
|
+
for (const name of _Overlay2.observedAttributes) {
|
|
7471
|
+
const value = this.getAttribute(name);
|
|
7472
|
+
if (value !== null) {
|
|
7473
|
+
this.attributeChangedCallback(name, null, value);
|
|
7474
|
+
}
|
|
7475
|
+
}
|
|
7476
|
+
this.updateOverlayElementPosition();
|
|
7477
|
+
}
|
|
7478
|
+
disconnectedCallback() {
|
|
7479
|
+
var _a2, _b2;
|
|
7480
|
+
(_a2 = this.overlayGraphics) == null ? void 0 : _a2.dispose();
|
|
7481
|
+
this.overlayGraphics = null;
|
|
7482
|
+
(_b2 = this.overlayElement) == null ? void 0 : _b2.remove();
|
|
7483
|
+
super.disconnectedCallback();
|
|
7484
|
+
}
|
|
7485
|
+
};
|
|
7486
|
+
_Overlay.tagName = "m-overlay";
|
|
7487
|
+
_Overlay.attributeHandler = new AttributeHandler({
|
|
7488
|
+
href: (instance, newValue) => {
|
|
7489
|
+
instance.props.href = newValue !== null ? newValue : null;
|
|
7490
|
+
},
|
|
7491
|
+
target: (instance, newValue) => {
|
|
7492
|
+
instance.props.target = newValue !== null ? newValue : null;
|
|
7493
|
+
},
|
|
7494
|
+
anchor: (instance, newValue) => {
|
|
7495
|
+
instance.props.anchor = parseEnumAttribute(
|
|
7496
|
+
newValue,
|
|
7497
|
+
OverlayAnchor,
|
|
7498
|
+
"top-left"
|
|
7499
|
+
/* top-left */
|
|
7500
|
+
);
|
|
7501
|
+
instance.updateOverlayElementPosition();
|
|
7502
|
+
},
|
|
7503
|
+
"offset-x": (instance, newValue) => {
|
|
7504
|
+
instance.props.offsetX = parseFloatAttribute(newValue, 0);
|
|
7505
|
+
instance.updateOverlayElementPosition();
|
|
7506
|
+
},
|
|
7507
|
+
"offset-y": (instance, newValue) => {
|
|
7508
|
+
instance.props.offsetY = parseFloatAttribute(newValue, 0);
|
|
7509
|
+
instance.updateOverlayElementPosition();
|
|
7510
|
+
}
|
|
7511
|
+
});
|
|
7512
|
+
Overlay = _Overlay;
|
|
7089
7513
|
defaultPlaneColor = { r: 1, g: 1, b: 1 };
|
|
7090
7514
|
defaultPlaneWidth = 1;
|
|
7091
7515
|
defaultPlaneHeight = 1;
|
|
@@ -7144,6 +7568,7 @@
|
|
|
7144
7568
|
]
|
|
7145
7569
|
});
|
|
7146
7570
|
this.collideableHelper = new CollideableHelper(this);
|
|
7571
|
+
this.clickableHelper = new ClickableHelper();
|
|
7147
7572
|
}
|
|
7148
7573
|
enable() {
|
|
7149
7574
|
this.collideableHelper.enable();
|
|
@@ -7164,7 +7589,8 @@
|
|
|
7164
7589
|
return [
|
|
7165
7590
|
...TransformableElement.observedAttributes,
|
|
7166
7591
|
..._Plane2.attributeHandler.getAttributes(),
|
|
7167
|
-
...CollideableHelper.observedAttributes
|
|
7592
|
+
...CollideableHelper.observedAttributes,
|
|
7593
|
+
...ClickableHelper.observedAttributes
|
|
7168
7594
|
];
|
|
7169
7595
|
}
|
|
7170
7596
|
addSideEffectChild(child) {
|
|
@@ -7179,7 +7605,7 @@
|
|
|
7179
7605
|
this.collideableHelper.parentTransformed();
|
|
7180
7606
|
}
|
|
7181
7607
|
isClickable() {
|
|
7182
|
-
return
|
|
7608
|
+
return this.clickableHelper.isClickable();
|
|
7183
7609
|
}
|
|
7184
7610
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
7185
7611
|
if (!this.planeGraphics) {
|
|
@@ -7188,6 +7614,7 @@
|
|
|
7188
7614
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
7189
7615
|
_Plane2.attributeHandler.handle(this, name, newValue);
|
|
7190
7616
|
this.collideableHelper.handle(name, newValue);
|
|
7617
|
+
this.clickableHelper.handle(name, newValue);
|
|
7191
7618
|
}
|
|
7192
7619
|
connectedCallback() {
|
|
7193
7620
|
var _a2;
|
|
@@ -7639,11 +8066,7 @@
|
|
|
7639
8066
|
super.disconnectedCallback();
|
|
7640
8067
|
}
|
|
7641
8068
|
dispatchEvent(event) {
|
|
7642
|
-
|
|
7643
|
-
return HTMLElement.prototype.dispatchEvent.call(this, event);
|
|
7644
|
-
} else {
|
|
7645
|
-
return false;
|
|
7646
|
-
}
|
|
8069
|
+
return HTMLElement.prototype.dispatchEvent.call(this, event);
|
|
7647
8070
|
}
|
|
7648
8071
|
init(mmlScene, documentAddress) {
|
|
7649
8072
|
if (this.scene) {
|
|
@@ -7715,6 +8138,7 @@
|
|
|
7715
8138
|
]
|
|
7716
8139
|
});
|
|
7717
8140
|
this.collideableHelper = new CollideableHelper(this);
|
|
8141
|
+
this.clickableHelper = new ClickableHelper();
|
|
7718
8142
|
}
|
|
7719
8143
|
enable() {
|
|
7720
8144
|
this.collideableHelper.enable();
|
|
@@ -7735,7 +8159,8 @@
|
|
|
7735
8159
|
return [
|
|
7736
8160
|
...TransformableElement.observedAttributes,
|
|
7737
8161
|
..._Sphere2.attributeHandler.getAttributes(),
|
|
7738
|
-
...CollideableHelper.observedAttributes
|
|
8162
|
+
...CollideableHelper.observedAttributes,
|
|
8163
|
+
...ClickableHelper.observedAttributes
|
|
7739
8164
|
];
|
|
7740
8165
|
}
|
|
7741
8166
|
addSideEffectChild(child) {
|
|
@@ -7750,7 +8175,7 @@
|
|
|
7750
8175
|
this.collideableHelper.parentTransformed();
|
|
7751
8176
|
}
|
|
7752
8177
|
isClickable() {
|
|
7753
|
-
return
|
|
8178
|
+
return this.clickableHelper.isClickable();
|
|
7754
8179
|
}
|
|
7755
8180
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
7756
8181
|
if (!this.sphereGraphics) {
|
|
@@ -7759,6 +8184,7 @@
|
|
|
7759
8184
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
7760
8185
|
_Sphere2.attributeHandler.handle(this, name, newValue);
|
|
7761
8186
|
this.collideableHelper.handle(name, newValue);
|
|
8187
|
+
this.clickableHelper.handle(name, newValue);
|
|
7762
8188
|
}
|
|
7763
8189
|
connectedCallback() {
|
|
7764
8190
|
super.connectedCallback();
|
|
@@ -7855,6 +8281,7 @@
|
|
|
7855
8281
|
]
|
|
7856
8282
|
});
|
|
7857
8283
|
this.collideableHelper = new CollideableHelper(this);
|
|
8284
|
+
this.clickableHelper = new ClickableHelper();
|
|
7858
8285
|
this.props = {
|
|
7859
8286
|
startTime: defaultVideoStartTime,
|
|
7860
8287
|
pauseTime: defaultVideoPauseTime,
|
|
@@ -7872,7 +8299,8 @@
|
|
|
7872
8299
|
return [
|
|
7873
8300
|
...TransformableElement.observedAttributes,
|
|
7874
8301
|
..._Video2.attributeHandler.getAttributes(),
|
|
7875
|
-
...CollideableHelper.observedAttributes
|
|
8302
|
+
...CollideableHelper.observedAttributes,
|
|
8303
|
+
...ClickableHelper.observedAttributes
|
|
7876
8304
|
];
|
|
7877
8305
|
}
|
|
7878
8306
|
enable() {
|
|
@@ -7905,7 +8333,7 @@
|
|
|
7905
8333
|
this.collideableHelper.parentTransformed();
|
|
7906
8334
|
}
|
|
7907
8335
|
isClickable() {
|
|
7908
|
-
return
|
|
8336
|
+
return this.clickableHelper.isClickable();
|
|
7909
8337
|
}
|
|
7910
8338
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
7911
8339
|
if (!this.videoGraphics) {
|
|
@@ -7914,6 +8342,7 @@
|
|
|
7914
8342
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
7915
8343
|
_Video2.attributeHandler.handle(this, name, newValue);
|
|
7916
8344
|
this.collideableHelper.handle(name, newValue);
|
|
8345
|
+
this.clickableHelper.handle(name, newValue);
|
|
7917
8346
|
}
|
|
7918
8347
|
documentTimeChanged() {
|
|
7919
8348
|
var _a2;
|
|
@@ -8687,6 +9116,12 @@
|
|
|
8687
9116
|
this.loadingProgressBar.dispose();
|
|
8688
9117
|
this.createLoadingProgressBar();
|
|
8689
9118
|
}
|
|
9119
|
+
getOverlayElement() {
|
|
9120
|
+
if (this.options.allowOverlay) {
|
|
9121
|
+
return this.element;
|
|
9122
|
+
}
|
|
9123
|
+
return null;
|
|
9124
|
+
}
|
|
8690
9125
|
configureWindowStyling() {
|
|
8691
9126
|
document.documentElement.style.width = "100%";
|
|
8692
9127
|
document.documentElement.style.height = "100%";
|
|
@@ -8780,6 +9215,11 @@
|
|
|
8780
9215
|
constructor(element, updateMeshCallback) {
|
|
8781
9216
|
}
|
|
8782
9217
|
};
|
|
9218
|
+
OverlayGraphics = class {
|
|
9219
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9220
|
+
constructor(element) {
|
|
9221
|
+
}
|
|
9222
|
+
};
|
|
8783
9223
|
PlaneGraphics = class {
|
|
8784
9224
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8785
9225
|
constructor(element) {
|
|
@@ -8902,7 +9342,9 @@
|
|
|
8902
9342
|
this.options.statusUpdated(status);
|
|
8903
9343
|
},
|
|
8904
9344
|
{
|
|
8905
|
-
tagPrefix: "m-"
|
|
9345
|
+
tagPrefix: "m-",
|
|
9346
|
+
// If overlays are allowed, allow SVG elements to populate them
|
|
9347
|
+
allowSVGElements: this.options.allowOverlay
|
|
8906
9348
|
}
|
|
8907
9349
|
);
|
|
8908
9350
|
this.websocket = websocket;
|
|
@@ -9475,6 +9917,17 @@
|
|
|
9475
9917
|
parentModelUpdated: () => {
|
|
9476
9918
|
}
|
|
9477
9919
|
}
|
|
9920
|
+
),
|
|
9921
|
+
MMLOverlayGraphicsInterface: TagDebugAdapterElement(
|
|
9922
|
+
{
|
|
9923
|
+
setAnchor: "anchor",
|
|
9924
|
+
setOffsetX: "offset-x",
|
|
9925
|
+
setOffsetY: "offset-y"
|
|
9926
|
+
},
|
|
9927
|
+
{
|
|
9928
|
+
dispose: () => {
|
|
9929
|
+
}
|
|
9930
|
+
}
|
|
9478
9931
|
)
|
|
9479
9932
|
};
|
|
9480
9933
|
StandaloneTagDebugAdapter = class _StandaloneTagDebugAdapter {
|
|
@@ -68199,7 +68652,7 @@ ${DracoWorker.toString()}
|
|
|
68199
68652
|
// w
|
|
68200
68653
|
];
|
|
68201
68654
|
}
|
|
68202
|
-
var mouseMovePixelsThreshold2, mouseMoveTimeThresholdMilliseconds2, PlayCanvasClickTrigger, PlayCanvasAnimation, _PlayCanvasAudio, PlayCanvasAudio, PlayCanvasChatProbe, PlayCanvasCube, PlayCanvasCylinder, PlayCanvasDebugHelper, PlayCanvasFrame, PlayCanvasImage, PlayCanvasInteraction, PlayCanvasLabel, lightIntensityFactor, lightLuminanceFactor, PlayCanvasLight, PlayCanvasLink, PlayCanvasMElement, PlayCanvasModel, PlayCanvasPlane, PlayCanvasPositionProbe, PlayCanvasPrompt, reconnectingStatus2, PlayCanvasRemoteDocument, PlayCanvasSphere, halfToRad, PlayCanvasTransformable, audioRefDistance3, audioRolloffFactor3, PlayCanvasVideo, PlayCanvasGraphicsInterface, PlayCanvasInteractionAdapter;
|
|
68655
|
+
var mouseMovePixelsThreshold2, mouseMoveTimeThresholdMilliseconds2, PlayCanvasClickTrigger, PlayCanvasAnimation, _PlayCanvasAudio, PlayCanvasAudio, PlayCanvasChatProbe, PlayCanvasCube, PlayCanvasCylinder, PlayCanvasDebugHelper, PlayCanvasFrame, PlayCanvasImage, PlayCanvasInteraction, PlayCanvasLabel, lightIntensityFactor, lightLuminanceFactor, PlayCanvasLight, PlayCanvasLink, PlayCanvasMElement, PlayCanvasModel, PlayCanvasOverlay, PlayCanvasPlane, PlayCanvasPositionProbe, PlayCanvasPrompt, reconnectingStatus2, PlayCanvasRemoteDocument, PlayCanvasSphere, halfToRad, PlayCanvasTransformable, audioRefDistance3, audioRolloffFactor3, PlayCanvasVideo, PlayCanvasGraphicsInterface, PlayCanvasInteractionAdapter;
|
|
68203
68656
|
var init_build4 = __esm({
|
|
68204
68657
|
"../mml-web-playcanvas/build/index.js"() {
|
|
68205
68658
|
init_build3();
|
|
@@ -68240,6 +68693,7 @@ ${DracoWorker.toString()}
|
|
|
68240
68693
|
init_src();
|
|
68241
68694
|
init_build3();
|
|
68242
68695
|
init_build3();
|
|
68696
|
+
init_build3();
|
|
68243
68697
|
init_src();
|
|
68244
68698
|
init_build3();
|
|
68245
68699
|
init_src();
|
|
@@ -68314,20 +68768,22 @@ ${DracoWorker.toString()}
|
|
|
68314
68768
|
console.warn("No rigidbody system found in the PlayCanvas app. Cannot raycast.");
|
|
68315
68769
|
return;
|
|
68316
68770
|
}
|
|
68317
|
-
const
|
|
68318
|
-
|
|
68319
|
-
|
|
68320
|
-
let
|
|
68321
|
-
|
|
68322
|
-
mElement = MElement.getMElementFromObject(
|
|
68323
|
-
if (mElement) {
|
|
68324
|
-
|
|
68771
|
+
const intersections = rigidbodySystem.raycastAll(from, to);
|
|
68772
|
+
intersections.sort((a, b) => a.point.distance(from) - b.point.distance(from));
|
|
68773
|
+
for (const intersection of intersections) {
|
|
68774
|
+
let obj = intersection.entity;
|
|
68775
|
+
currentIntersection: while (obj) {
|
|
68776
|
+
const mElement = MElement.getMElementFromObject(obj);
|
|
68777
|
+
if (!mElement) {
|
|
68778
|
+
obj = obj.parent;
|
|
68779
|
+
continue currentIntersection;
|
|
68780
|
+
}
|
|
68781
|
+
if (!mElement.isClickable()) {
|
|
68782
|
+
break currentIntersection;
|
|
68325
68783
|
}
|
|
68326
|
-
}
|
|
68327
|
-
if (mElement && TransformableElement.isTransformableElement(mElement) && mElement.isClickable()) {
|
|
68328
68784
|
const elementRelative = getRelativePositionAndRotationRelativeToObject(
|
|
68329
68785
|
{
|
|
68330
|
-
position:
|
|
68786
|
+
position: intersection.point,
|
|
68331
68787
|
rotation: {
|
|
68332
68788
|
x: 0,
|
|
68333
68789
|
y: 0,
|
|
@@ -70690,6 +71146,24 @@ ${DracoWorker.toString()}
|
|
|
70690
71146
|
}
|
|
70691
71147
|
}
|
|
70692
71148
|
};
|
|
71149
|
+
PlayCanvasOverlay = class extends OverlayGraphics {
|
|
71150
|
+
constructor(overlay) {
|
|
71151
|
+
super(overlay);
|
|
71152
|
+
this.overlay = overlay;
|
|
71153
|
+
}
|
|
71154
|
+
disable() {
|
|
71155
|
+
}
|
|
71156
|
+
enable() {
|
|
71157
|
+
}
|
|
71158
|
+
setAnchor() {
|
|
71159
|
+
}
|
|
71160
|
+
setOffsetX() {
|
|
71161
|
+
}
|
|
71162
|
+
setOffsetY() {
|
|
71163
|
+
}
|
|
71164
|
+
dispose() {
|
|
71165
|
+
}
|
|
71166
|
+
};
|
|
70693
71167
|
PlayCanvasPlane = class extends PlaneGraphics {
|
|
70694
71168
|
constructor(plane) {
|
|
70695
71169
|
super(plane);
|
|
@@ -71353,6 +71827,7 @@ ${DracoWorker.toString()}
|
|
|
71353
71827
|
MMLLabelGraphicsInterface: (element) => new PlayCanvasLabel(element),
|
|
71354
71828
|
MMLLightGraphicsInterface: (element) => new PlayCanvasLight(element),
|
|
71355
71829
|
MMLLinkGraphicsInterface: (element) => new PlayCanvasLink(element),
|
|
71830
|
+
MMLOverlayGraphicsInterface: (element) => new PlayCanvasOverlay(element),
|
|
71356
71831
|
MMLModelGraphicsInterface: (element, updateMeshCallback) => new PlayCanvasModel(element, updateMeshCallback),
|
|
71357
71832
|
MMLPlaneGraphicsInterface: (element) => new PlayCanvasPlane(element),
|
|
71358
71833
|
MMLPositionProbeGraphicsInterface: (element) => new PlayCanvasPositionProbe(element),
|
|
@@ -110233,6 +110708,7 @@ void main() {
|
|
|
110233
110708
|
init_build3();
|
|
110234
110709
|
init_build3();
|
|
110235
110710
|
init_build3();
|
|
110711
|
+
init_build3();
|
|
110236
110712
|
var _ThreeJSAnimation = class _ThreeJSAnimation2 extends AnimationGraphics {
|
|
110237
110713
|
constructor(animation) {
|
|
110238
110714
|
super(animation);
|
|
@@ -112443,6 +112919,24 @@ void main() {
|
|
|
112443
112919
|
opacity: 0.3
|
|
112444
112920
|
});
|
|
112445
112921
|
var ThreeJSModel = _ThreeJSModel;
|
|
112922
|
+
var ThreeJSOverlay = class extends OverlayGraphics {
|
|
112923
|
+
constructor(overlay) {
|
|
112924
|
+
super(overlay);
|
|
112925
|
+
this.overlay = overlay;
|
|
112926
|
+
}
|
|
112927
|
+
disable() {
|
|
112928
|
+
}
|
|
112929
|
+
enable() {
|
|
112930
|
+
}
|
|
112931
|
+
setAnchor() {
|
|
112932
|
+
}
|
|
112933
|
+
setOffsetX() {
|
|
112934
|
+
}
|
|
112935
|
+
setOffsetY() {
|
|
112936
|
+
}
|
|
112937
|
+
dispose() {
|
|
112938
|
+
}
|
|
112939
|
+
};
|
|
112446
112940
|
var _ThreeJSPlane = class _ThreeJSPlane2 extends PlaneGraphics {
|
|
112447
112941
|
constructor(plane) {
|
|
112448
112942
|
super(plane);
|
|
@@ -113031,36 +113525,40 @@ void main() {
|
|
|
113031
113525
|
if (intersections.length > 0) {
|
|
113032
113526
|
for (const intersection of intersections) {
|
|
113033
113527
|
let obj = intersection.object;
|
|
113034
|
-
while (obj) {
|
|
113528
|
+
currentIntersection: while (obj) {
|
|
113035
113529
|
if (this.isMaterialIgnored(obj)) {
|
|
113036
|
-
break;
|
|
113530
|
+
break currentIntersection;
|
|
113037
113531
|
}
|
|
113038
113532
|
const mElement = MElement.getMElementFromObject(obj);
|
|
113039
|
-
if (mElement
|
|
113040
|
-
|
|
113041
|
-
|
|
113042
|
-
|
|
113043
|
-
|
|
113044
|
-
|
|
113045
|
-
y: 0,
|
|
113046
|
-
z: 0
|
|
113047
|
-
}
|
|
113048
|
-
},
|
|
113049
|
-
mElement
|
|
113050
|
-
);
|
|
113051
|
-
mElement.dispatchEvent(
|
|
113052
|
-
new CustomEvent("click", {
|
|
113053
|
-
bubbles: true,
|
|
113054
|
-
detail: {
|
|
113055
|
-
position: {
|
|
113056
|
-
...elementRelative.position
|
|
113057
|
-
}
|
|
113058
|
-
}
|
|
113059
|
-
})
|
|
113060
|
-
);
|
|
113061
|
-
return;
|
|
113533
|
+
if (!mElement) {
|
|
113534
|
+
obj = obj.parent;
|
|
113535
|
+
continue currentIntersection;
|
|
113536
|
+
}
|
|
113537
|
+
if (!mElement.isClickable()) {
|
|
113538
|
+
break currentIntersection;
|
|
113062
113539
|
}
|
|
113063
|
-
|
|
113540
|
+
const elementRelative = getRelativePositionAndRotationRelativeToObject(
|
|
113541
|
+
{
|
|
113542
|
+
position: intersection.point,
|
|
113543
|
+
rotation: {
|
|
113544
|
+
x: 0,
|
|
113545
|
+
y: 0,
|
|
113546
|
+
z: 0
|
|
113547
|
+
}
|
|
113548
|
+
},
|
|
113549
|
+
mElement
|
|
113550
|
+
);
|
|
113551
|
+
mElement.dispatchEvent(
|
|
113552
|
+
new CustomEvent("click", {
|
|
113553
|
+
bubbles: true,
|
|
113554
|
+
detail: {
|
|
113555
|
+
position: {
|
|
113556
|
+
...elementRelative.position
|
|
113557
|
+
}
|
|
113558
|
+
}
|
|
113559
|
+
})
|
|
113560
|
+
);
|
|
113561
|
+
return;
|
|
113064
113562
|
}
|
|
113065
113563
|
}
|
|
113066
113564
|
}
|
|
@@ -113071,7 +113569,7 @@ void main() {
|
|
|
113071
113569
|
isMaterialIgnored(obj) {
|
|
113072
113570
|
const mesh = obj;
|
|
113073
113571
|
if (mesh) {
|
|
113074
|
-
if (mesh.material && mesh.material.
|
|
113572
|
+
if (mesh.material && mesh.material.wireframe || mesh.material && mesh.material.wireframe || mesh.material && mesh.material.wireframe || mesh.material && mesh.material.wireframe || mesh.material && mesh.material.isLineBasicMaterial) {
|
|
113075
113573
|
return true;
|
|
113076
113574
|
}
|
|
113077
113575
|
}
|
|
@@ -113090,6 +113588,7 @@ void main() {
|
|
|
113090
113588
|
MMLInteractionGraphicsInterface: (element) => new ThreeJSInteraction(element),
|
|
113091
113589
|
MMLLabelGraphicsInterface: (element) => new ThreeJSLabel(element),
|
|
113092
113590
|
MMLLightGraphicsInterface: (element) => new ThreeJSLight(element),
|
|
113591
|
+
MMLOverlayGraphicsInterface: (element) => new ThreeJSOverlay(element),
|
|
113093
113592
|
MMLLinkGraphicsInterface: (element) => new ThreeJSLink(element),
|
|
113094
113593
|
MMLModelGraphicsInterface: (element, updateMeshCallback) => new ThreeJSModel(element, updateMeshCallback),
|
|
113095
113594
|
MMLPlaneGraphicsInterface: (element) => new ThreeJSPlane(element),
|
|
@@ -113733,17 +114232,22 @@ void main() {
|
|
|
113733
114232
|
});
|
|
113734
114233
|
}
|
|
113735
114234
|
}
|
|
114235
|
+
const urlSearchParams = new URLSearchParams(window.location.search);
|
|
114236
|
+
const useIframe = scriptUrl.searchParams.get("iframe") === "true" || urlSearchParams.get("iframe") === "true";
|
|
114237
|
+
const allowOverlay = scriptUrl.searchParams.get("allowOverlay") === "true" || urlSearchParams.get("allowOverlay") === "true";
|
|
114238
|
+
const fullScreenMMLSceneOptions = {
|
|
114239
|
+
allowOverlay
|
|
114240
|
+
};
|
|
113736
114241
|
const url = scriptUrl.searchParams.get("url");
|
|
113737
114242
|
if (!url) {
|
|
113738
|
-
configureWindowForMML(window, getGraphicsAdapter);
|
|
114243
|
+
configureWindowForMML(window, getGraphicsAdapter, fullScreenMMLSceneOptions);
|
|
113739
114244
|
return;
|
|
113740
114245
|
}
|
|
113741
114246
|
window.addEventListener("load", async () => {
|
|
113742
|
-
const fullScreenMMLScene = new FullScreenMMLScene();
|
|
114247
|
+
const fullScreenMMLScene = new FullScreenMMLScene(fullScreenMMLSceneOptions);
|
|
113743
114248
|
document.body.append(fullScreenMMLScene.element);
|
|
113744
114249
|
const graphicsAdapter = await getGraphicsAdapter(fullScreenMMLScene.element);
|
|
113745
114250
|
fullScreenMMLScene.init(graphicsAdapter);
|
|
113746
|
-
const useIframe = new URL(window.location.href).searchParams.get("iframe") === "true";
|
|
113747
114251
|
let targetForWrappers;
|
|
113748
114252
|
let windowTarget;
|
|
113749
114253
|
if (useIframe) {
|
|
@@ -113768,7 +114272,8 @@ void main() {
|
|
|
113768
114272
|
}
|
|
113769
114273
|
},
|
|
113770
114274
|
windowTarget,
|
|
113771
|
-
targetForWrappers
|
|
114275
|
+
targetForWrappers,
|
|
114276
|
+
allowOverlay
|
|
113772
114277
|
});
|
|
113773
114278
|
const defineGlobals = scriptUrl.searchParams.get("defineGlobals") === "true";
|
|
113774
114279
|
if (defineGlobals) {
|