@needle-tools/engine 3.36.3-beta → 3.36.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [3.36.3-beta.1] - 2023-04-04
8
+ - Fix: Needle Menu not visible in AR overlay
9
+ - Fix: Contact Shadows should not render transparent objects
10
+ - Fix: API docs warnings (internal)
11
+
7
12
  ## [3.36.3-beta] - 2023-04-04
8
13
  - Add: More API documentation for progressive loading, USDZExporter, getComponent methods etc
9
14
  - Add: Needle Menu CSS for disabled buttons
@@ -30221,13 +30221,13 @@ class tw {
30221
30221
  }
30222
30222
  r(tw, "eventListeners", /* @__PURE__ */ new Map());
30223
30223
  const pT = IA("debugdefines");
30224
- xE('if(!globalThis[""3.36.3-beta""]) globalThis[""3.36.3-beta""] = "0.0.0";');
30224
+ xE('if(!globalThis[""3.36.3-beta.1""]) globalThis[""3.36.3-beta.1""] = "0.0.0";');
30225
30225
  xE('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
30226
- xE('if(!globalThis[""Thu Apr 04 2024 16:21:31 GMT+0200 (Central European Summer Time)""]) globalThis[""Thu Apr 04 2024 16:21:31 GMT+0200 (Central European Summer Time)""] = "unknown";');
30227
- xE('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.36.3-beta";');
30226
+ xE('if(!globalThis[""Thu Apr 04 2024 21:19:21 GMT+0200 (Central European Summer Time)""]) globalThis[""Thu Apr 04 2024 21:19:21 GMT+0200 (Central European Summer Time)""] = "unknown";');
30227
+ xE('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.36.3-beta.1";');
30228
30228
  xE('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
30229
- xE('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Apr 04 2024 16:21:31 GMT+0200 (Central European Summer Time)";');
30230
- const BC = "3.36.3-beta", eU = "undefined", fT = "Thu Apr 04 2024 16:21:31 GMT+0200 (Central European Summer Time)";
30229
+ xE('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Apr 04 2024 21:19:21 GMT+0200 (Central European Summer Time)";');
30230
+ const BC = "3.36.3-beta.1", eU = "undefined", fT = "Thu Apr 04 2024 21:19:21 GMT+0200 (Central European Summer Time)";
30231
30231
  pT && console.log(`Engine version: ${BC} (generator: ${eU})
30232
30232
  Project built at ${fT}`);
30233
30233
  const ma = "needle_isActiveInHierarchy", DQ = "builtin_components", of = "needle_editor_guid";
@@ -51042,31 +51042,38 @@ async function pAA(g) {
51042
51042
  height: 100%;
51043
51043
  pointer-events: all;
51044
51044
  zIndex: 2147483647;
51045
- background-color: rgba(0,0,0,0.3);
51046
- backdrop-filter: blur(10px);
51047
- webkitBackdropFilter: blur(10px);
51048
51045
  line-height: 1.5;
51046
+ backdrop-filter: blur(15px);
51049
51047
  `;
51050
- const I = document.createElement("div");
51051
- i.appendChild(I), I.style.cssText = `
51048
+ const I = i.style.cssText, o = document.createElement("div");
51049
+ i.appendChild(o), o.style.cssText = `
51052
51050
  position: absolute;
51053
- top: 50%;
51054
- left: 50%;
51055
- transform: translate(-50%, -50%);
51051
+ left: 0;
51052
+ right: 0;
51053
+ top:0;
51054
+ bottom: 0;
51055
+ padding: 10%;
51056
51056
  color: white;
51057
- font-size: 24px;
51057
+ font-size: 20px;
51058
51058
  font-family: sans-serif;
51059
51059
  text-align: center;
51060
- user-select: none;
51060
+ pointer-events: all;
51061
+ display: flex;
51062
+ justify-content: center;
51063
+ align-items: center;
51064
+ background-color: rgba(0,0,0,.3);
51065
+ text-shadow: 0 0 2px black;
51061
51066
  `;
51062
- const o = (dh == null ? void 0 : dh.length) > 1 ? dh : "Needle Engine<br/>This application is not allowed to run on this domain!";
51063
- return I.innerHTML = o, i;
51067
+ const s = o.style.cssText, n = (dh == null ? void 0 : dh.length) > 1 ? dh : "This web application has been blacklisted. You might be in violation of the Needle Engine terms of use.<br/>Please contact the Needle support if you think this is a mistake.";
51068
+ return o.innerHTML = n, setInterval(() => {
51069
+ o.innerHTML !== n && (o.innerHTML = n), o.parentNode !== i && i.appendChild(o), i.style.cssText !== I && (i.style.cssText = I), o.style.cssText !== s && (o.style.cssText = s);
51070
+ }, 500), i;
51064
51071
  }
51065
51072
  let e = A();
51066
51073
  const t = e.style.cssText;
51067
51074
  setInterval(() => {
51068
51075
  var i;
51069
- YG === !0 && (e.style.cssText !== t && (e = A()), "isPaused" in g && (g.isPaused = !0), e.parentNode !== g.domElement.shadowRoot && ((i = g.domElement.shadowRoot) == null || i.appendChild(e)));
51076
+ YG === !0 && (e.style.cssText !== t && (e = A()), g.domElement.shadowRoot ? e.parentNode !== g.domElement.shadowRoot && ((i = g.domElement.shadowRoot) == null || i.appendChild(e)) : e.parentNode != document.body && document.body.appendChild(e));
51070
51077
  }, 500);
51071
51078
  }
51072
51079
  async function fAA(g) {
@@ -51684,7 +51691,7 @@ let vAA = class {
51684
51691
  });
51685
51692
  r(this, "_muteButton");
51686
51693
  r(this, "_fullscreenButton");
51687
- this._menu = aw.getOrCreate(A.domElement), this._context = A, this._spatialMenu = new JAA(A, this._menu), window.addEventListener("message", this.onPostMessage), CU(this.onStartXR);
51694
+ this._menu = aw.getOrCreate(A.domElement, A), this._context = A, this._spatialMenu = new JAA(A, this._menu), window.addEventListener("message", this.onPostMessage), CU(this.onStartXR);
51688
51695
  }
51689
51696
  /** @ignore internal method */
51690
51697
  onDestroy() {
@@ -51730,9 +51737,10 @@ let vAA = class {
51730
51737
  };
51731
51738
  class aw extends HTMLElement {
51732
51739
  constructor() {
51733
- var n, C, a, B;
51740
+ var C, a, B, Q;
51734
51741
  super();
51735
51742
  r(this, "_domElement", null);
51743
+ r(this, "_context", null);
51736
51744
  r(this, "_sizeChangeInterval");
51737
51745
  r(this, "_userRequestedLogoVisible");
51738
51746
  // private _root: ShadowRoot | null = null;
@@ -51964,30 +51972,32 @@ class aw extends HTMLElement {
51964
51972
  this.handleSizeChange();
51965
51973
  } }), TG("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block", { element: t });
51966
51974
  const i = e.content.cloneNode(!0);
51967
- t == null || t.appendChild(i), this.root = t.querySelector("#root"), this.wrapper = (n = this.root) == null ? void 0 : n.querySelector(".wrapper"), this.options = (C = this.root) == null ? void 0 : C.querySelector(".options"), this.logoContainer = (a = this.root) == null ? void 0 : a.querySelector(".logo"), (B = this.root) == null || B.appendChild(this.wrapper), this.wrapper.classList.add("wrapper");
51975
+ t == null || t.appendChild(i), this.root = t.querySelector("#root"), this.wrapper = (C = this.root) == null ? void 0 : C.querySelector(".wrapper"), this.options = (a = this.root) == null ? void 0 : a.querySelector(".options"), this.logoContainer = (B = this.root) == null ? void 0 : B.querySelector(".logo"), (Q = this.root) == null || Q.appendChild(this.wrapper), this.wrapper.classList.add("wrapper");
51968
51976
  const I = g2.create();
51969
51977
  I.style.minHeight = "1rem", this.logoContainer.append(I), this.logoContainer.addEventListener("click", () => {
51970
51978
  globalThis.open("https://needle.tools", "_blank");
51971
- }), lAA((Q) => {
51972
- Q == !0 && rn() && !_q && (this.logoContainer.style.display = this._userRequestedLogoVisible ? "" : "none");
51979
+ }), lAA((E) => {
51980
+ E == !0 && rn() && !_q && (this.logoContainer.style.display = this._userRequestedLogoVisible ? "" : "none");
51973
51981
  });
51974
- let o = -1;
51975
- new MutationObserver((Q) => {
51976
- var c;
51977
- this.onChangeDetected(Q);
51978
- const E = this == null ? void 0 : this.parentNode;
51979
- (this.style.display != "flex" || this.style.visibility != "visible" || this.style.opacity != "1" || E != ((c = this._domElement) == null ? void 0 : c.shadowRoot)) && (rn() || (clearInterval(o), o = setInterval(() => {
51980
- var d, l, h;
51981
- E != ((d = this._domElement) == null ? void 0 : d.shadowRoot) && ((h = (l = this._domElement) == null ? void 0 : l.shadowRoot) == null || h.appendChild(this)), this.style.display = "flex", this.style.visibility = "visible", this.style.opacity = "1";
51982
+ let o = this._context;
51983
+ setTimeout(() => o = this._context);
51984
+ let s = -1;
51985
+ new MutationObserver((E) => {
51986
+ var d;
51987
+ this.onChangeDetected(E);
51988
+ const c = this == null ? void 0 : this.parentNode;
51989
+ (this.style.display != "flex" || this.style.visibility != "visible" || this.style.opacity != "1" || c != ((d = this._domElement) == null ? void 0 : d.shadowRoot)) && (rn() || (clearInterval(s), s = setInterval(() => {
51990
+ var l, h, p;
51991
+ o != null && o.isInAR && o.arOverlayElement ? c != o.arOverlayElement && o.arOverlayElement.appendChild(this) : c != ((l = this._domElement) == null ? void 0 : l.shadowRoot) && ((p = (h = this._domElement) == null ? void 0 : h.shadowRoot) == null || p.appendChild(this)), this.style.display = "flex", this.style.visibility = "visible", this.style.opacity = "1";
51982
51992
  }, 5)));
51983
51993
  }).observe(this.root, { childList: !0, subtree: !0, attributes: !0 }), DD && this.___insertDebugOptions();
51984
51994
  }
51985
51995
  static create() {
51986
51996
  return document.createElement(LQ, { is: LQ });
51987
51997
  }
51988
- static getOrCreate(e) {
51989
- let t = e.querySelector(LQ);
51990
- return !t && e.shadowRoot && (t = e.shadowRoot.querySelector(LQ)), t || (t = aw.create(), t._domElement = e, e.shadowRoot ? e.shadowRoot.appendChild(t) : e.appendChild(t)), t;
51998
+ static getOrCreate(e, t) {
51999
+ let i = e.querySelector(LQ);
52000
+ return !i && e.shadowRoot && (i = e.shadowRoot.querySelector(LQ)), i || (i = aw.create(), i._domElement = e, i._context = t, e.shadowRoot ? e.shadowRoot.appendChild(i) : e.appendChild(i)), i;
51991
52001
  }
51992
52002
  connectedCallback() {
51993
52003
  var e;
@@ -73798,7 +73808,9 @@ class UB extends UA {
73798
73808
  const n = i.getClearAlpha();
73799
73809
  i.setClearAlpha(0);
73800
73810
  const C = i.xr.enabled;
73801
- i.xr.enabled = !1, i.setRenderTarget(this.renderTarget), i.render(t, this.shadowCamera), t.overrideMaterial = null, this.blurShadow(this.blur), this.blurShadow(this.blur * 0.4), this.shadowGroup.visible = !1, this.occluderMesh && (this.occluderMesh.visible = !0), this.plane.visible = o, i.setRenderTarget(I), i.setClearAlpha(n), t.background = s, i.xr.enabled = C;
73811
+ i.xr.enabled = !1;
73812
+ const a = i.renderLists.get(t, 0), B = a.transparent;
73813
+ a.transparent = [], i.setRenderTarget(this.renderTarget), i.clear(), i.render(t, this.shadowCamera), a.transparent = B, t.overrideMaterial = null, this.blurShadow(this.blur), this.blurShadow(this.blur * 0.4), this.shadowGroup.visible = !1, this.occluderMesh && (this.occluderMesh.visible = !0), this.plane.visible = o, i.setRenderTarget(I), i.setClearAlpha(n), t.background = s, i.xr.enabled = C;
73802
73814
  }
73803
73815
  // renderTarget --> blurPlane (horizontalBlur) --> renderTargetBlur --> blurPlane (verticalBlur) --> renderTarget
73804
73816
  blurShadow(e) {