@needle-tools/engine 5.1.13 → 5.1.14
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 +8 -1
- package/dist/{materialx-BBv-42Th.min.js → materialx-D3ZU4CP6.min.js} +1 -1
- package/dist/{materialx-0m1xlF5m.js → materialx-FhjQQgNu.js} +1 -1
- package/dist/{materialx-8OpPwNc7.umd.cjs → materialx-RxB3AN7d.umd.cjs} +2 -2
- package/dist/{needle-engine.bundle-DTvJ1zCJ.js → needle-engine.bundle-BEa7CABw.js} +2765 -2748
- package/dist/{needle-engine.bundle-DR967VjU.min.js → needle-engine.bundle-mkmiuKZB.min.js} +112 -112
- package/dist/{needle-engine.bundle-B_ZctaDt.umd.cjs → needle-engine.bundle-y1_E7Ovt.umd.cjs} +117 -117
- package/dist/needle-engine.d.ts +23 -23
- package/dist/needle-engine.js +64 -64
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{vendor-DiDMDryv.js → vendor-BVzQovzJ.js} +5161 -5161
- package/dist/{vendor-DE_m5MvL.umd.cjs → vendor-C5YVRzxf.umd.cjs} +5 -5
- package/dist/{vendor-B7IfFLrR.min.js → vendor-rvNvQ-IU.min.js} +5 -5
- package/lib/engine/api.d.ts +1 -1
- package/lib/engine/api.js +1 -1
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/engine_gameobject.js +1 -1
- package/lib/engine/engine_gameobject.js.map +1 -1
- package/lib/engine/engine_gltf_builtin_components.js +1 -1
- package/lib/engine/engine_gltf_builtin_components.js.map +1 -1
- package/lib/engine/engine_init.js +2 -2
- package/lib/engine/engine_init.js.map +1 -1
- package/lib/engine/engine_instantiate_resolve.js.map +1 -1
- package/lib/engine/engine_license.d.ts +7 -7
- package/lib/engine/engine_license.js +75 -75
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_materialpropertyblock.js +18 -0
- package/lib/engine/engine_materialpropertyblock.js.map +1 -1
- package/lib/engine/engine_networking.d.ts +1 -1
- package/lib/engine/engine_networking.js +1 -1
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_networking_blob.js +3 -3
- package/lib/engine/engine_networking_blob.js.map +1 -1
- package/lib/engine/engine_utils_qrcode.js +2 -2
- package/lib/engine/engine_utils_qrcode.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +2 -2
- package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.js +5 -5
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.js +2 -2
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.loading.js +2 -2
- package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
- package/lib/engine/xr/NeedleXRSession.js +11 -10
- package/lib/engine/xr/NeedleXRSession.js.map +1 -1
- package/lib/engine/xr/TempXRContext.js +2 -2
- package/lib/engine/xr/TempXRContext.js.map +1 -1
- package/lib/engine-components/AnimationBuilder.d.ts +1 -1
- package/lib/engine-components/AnimationBuilder.js.map +1 -1
- package/lib/engine-components/AnimatorController.builder.d.ts +2 -2
- package/lib/engine-components/AnimatorController.builder.js +2 -2
- package/lib/engine-components/AnimatorController.builder.js.map +1 -1
- package/lib/engine-components/Component.d.ts +1 -1
- package/lib/engine-components/Component.js +1 -1
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/DragControls.d.ts +2 -2
- package/lib/engine-components/DragControls.js +2 -2
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/DragControlsConstraints.js.map +1 -1
- package/lib/engine-components/Light.js +1 -1
- package/lib/engine-components/Light.js.map +1 -1
- package/lib/engine-components/api.d.ts +2 -2
- package/lib/engine-components/api.js +1 -1
- package/lib/engine-components/api.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.js +4 -4
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
- package/lib/engine-components/postprocessing/index.d.ts +1 -1
- package/lib/engine-components/postprocessing/index.js +1 -1
- package/lib/engine-components/postprocessing/index.js.map +1 -1
- package/lib/engine-components/timeline/TimelineBuilder.d.ts +4 -4
- package/lib/engine-components/timeline/TimelineBuilder.js +2 -2
- package/lib/engine-components/timeline/TimelineBuilder.js.map +1 -1
- package/lib/engine-components/timeline/TimelineTracks.js +24 -15
- package/lib/engine-components/timeline/TimelineTracks.js.map +1 -1
- package/lib/engine-components/webxr/WebXRImageTracking.utils.js.map +1 -1
- package/package.json +1 -1
- package/plugins/common/license.js +4 -4
- package/plugins/vite/license.js +4 -4
- package/src/engine/api.ts +1 -1
- package/src/engine/engine_gameobject.ts +2 -2
- package/src/engine/engine_gltf_builtin_components.ts +1 -1
- package/src/engine/engine_init.ts +2 -2
- package/src/engine/engine_instantiate_resolve.ts +1 -1
- package/src/engine/engine_license.ts +72 -72
- package/src/engine/engine_materialpropertyblock.ts +21 -0
- package/src/engine/engine_networking.ts +2 -2
- package/src/engine/engine_networking_blob.ts +3 -3
- package/src/engine/engine_utils_qrcode.ts +2 -2
- package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +2 -2
- package/src/engine/webcomponents/needle menu/needle-menu.ts +5 -5
- package/src/engine/webcomponents/needle-engine.loading.ts +6 -6
- package/src/engine/webcomponents/needle-engine.ts +2 -2
- package/src/engine/xr/NeedleXRSession.ts +11 -10
- package/src/engine/xr/TempXRContext.ts +2 -2
- package/src/engine-components/AnimationBuilder.ts +1 -1
- package/src/engine-components/AnimatorController.builder.ts +4 -4
- package/src/engine-components/Component.ts +1 -1
- package/src/engine-components/DragControls.ts +2 -3
- package/src/engine-components/DragControlsConstraints.ts +1 -2
- package/src/engine-components/Light.ts +1 -1
- package/src/engine-components/api.ts +2 -2
- package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
- package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +1 -1
- package/src/engine-components/postprocessing/index.ts +1 -1
- package/src/engine-components/timeline/TimelineBuilder.ts +5 -5
- package/src/engine-components/timeline/TimelineTracks.ts +25 -17
- package/src/engine-components/webxr/WebXRImageTracking.utils.ts +0 -1
|
@@ -41,19 +41,19 @@ function setLicenseTimeout(ctx: IContext, callback: () => void, delay: number) {
|
|
|
41
41
|
|
|
42
42
|
const debug = getParam("__debuglic__");
|
|
43
43
|
|
|
44
|
-
const
|
|
44
|
+
const hfq: ((result: boolean) => void)[] = [];
|
|
45
45
|
|
|
46
46
|
// DO NOT EDIT MANUALLY
|
|
47
|
-
let
|
|
47
|
+
let _QsjWa: string = "";
|
|
48
48
|
// eslint-disable-next-line prefer-const
|
|
49
|
-
let
|
|
49
|
+
let _puYWsjJC: string = "";
|
|
50
50
|
|
|
51
51
|
if (debug) {
|
|
52
|
-
console.log("License Type: " +
|
|
53
|
-
if (
|
|
54
|
-
console.log("License JWT: " +
|
|
52
|
+
console.log("License Type: " + _QsjWa);
|
|
53
|
+
if (_puYWsjJC) {
|
|
54
|
+
console.log("License JWT: " + _puYWsjJC);
|
|
55
55
|
try {
|
|
56
|
-
const payload = JSON.parse(atob(
|
|
56
|
+
const payload = JSON.parse(atob(_puYWsjJC.split(".")[1].replace(/-/g, '+').replace(/_/g, '/')));
|
|
57
57
|
console.log("License JWT payload:", payload);
|
|
58
58
|
}
|
|
59
59
|
catch { console.log("License JWT payload: (failed to decode)"); }
|
|
@@ -64,8 +64,8 @@ if (debug) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/** @internal */
|
|
67
|
-
export function
|
|
68
|
-
switch (
|
|
67
|
+
export function _$xBhfh() {
|
|
68
|
+
switch (_QsjWa) {
|
|
69
69
|
case "pro":
|
|
70
70
|
case "enterprise":
|
|
71
71
|
return true;
|
|
@@ -74,8 +74,8 @@ export function __csRKN() {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/** @internal */
|
|
77
|
-
export function
|
|
78
|
-
switch (
|
|
77
|
+
export function __YFTdTh() {
|
|
78
|
+
switch (_QsjWa) {
|
|
79
79
|
case "indie":
|
|
80
80
|
return true;
|
|
81
81
|
}
|
|
@@ -83,8 +83,8 @@ export function _qxvTsQJJ() {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/** @internal */
|
|
86
|
-
export function $
|
|
87
|
-
switch (
|
|
86
|
+
export function _$qEBaEKr() {
|
|
87
|
+
switch (_QsjWa) {
|
|
88
88
|
case "edu":
|
|
89
89
|
return true;
|
|
90
90
|
}
|
|
@@ -92,26 +92,26 @@ export function $yVfpT() {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
/** @internal */
|
|
95
|
-
export function
|
|
96
|
-
return
|
|
95
|
+
export function __alnviAJA() {
|
|
96
|
+
return _$xBhfh() || __YFTdTh() || _$qEBaEKr();
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
/** @internal */
|
|
101
|
-
export function
|
|
102
|
-
if (
|
|
101
|
+
export function dRcEhn(cb: (result: boolean) => void) {
|
|
102
|
+
if (_$xBhfh() || __YFTdTh() || _$qEBaEKr()) {
|
|
103
103
|
cb(true);
|
|
104
104
|
return () => {};
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
hfq.push(cb);
|
|
107
107
|
return () => {
|
|
108
|
-
const index =
|
|
109
|
-
if (index >= 0)
|
|
108
|
+
const index = hfq.indexOf(cb);
|
|
109
|
+
if (index >= 0) hfq.splice(index, 1);
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
function
|
|
114
|
-
for (const cb of
|
|
113
|
+
function $rpNGR(result: boolean) {
|
|
114
|
+
for (const cb of hfq) {
|
|
115
115
|
try {
|
|
116
116
|
cb(result);
|
|
117
117
|
}
|
|
@@ -126,7 +126,7 @@ function _SUQSFYGK(result: boolean) {
|
|
|
126
126
|
|
|
127
127
|
// ECDSA P-256 public key for verifying license JWTs (verification-only, safe to ship)
|
|
128
128
|
/* eslint-disable no-secrets/no-secrets -- public key, not a secret */
|
|
129
|
-
const
|
|
129
|
+
const $jkMSKnw = {
|
|
130
130
|
kty: "EC",
|
|
131
131
|
crv: "P-256",
|
|
132
132
|
x: "A34nyKMjhQYVgzeE4tyLUYdx34TAKogDa7v7PRaO9Lg",
|
|
@@ -150,7 +150,7 @@ function base64urlDecode(str: string): Uint8Array {
|
|
|
150
150
|
* Verify a JWT license token and return the `type` claim if valid.
|
|
151
151
|
* Returns null if the JWT is missing, malformed, or has an invalid signature.
|
|
152
152
|
*/
|
|
153
|
-
async function
|
|
153
|
+
async function Twm(jwt: string): Promise<string | null> {
|
|
154
154
|
if (!jwt) return null;
|
|
155
155
|
try {
|
|
156
156
|
const parts = jwt.split(".");
|
|
@@ -160,7 +160,7 @@ async function _$powD(jwt: string): Promise<string | null> {
|
|
|
160
160
|
|
|
161
161
|
const key = await crypto.subtle.importKey(
|
|
162
162
|
"jwk",
|
|
163
|
-
|
|
163
|
+
$jkMSKnw,
|
|
164
164
|
{ name: "ECDSA", namedCurve: "P-256" },
|
|
165
165
|
false,
|
|
166
166
|
["verify"]
|
|
@@ -220,24 +220,24 @@ async function _$powD(jwt: string): Promise<string | null> {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
/** Verify the injected JWT and update the license type if valid.
|
|
223
|
-
* The engine ONLY trusts the JWT — the plain
|
|
223
|
+
* The engine ONLY trusts the JWT — the plain _QsjWa string is ignored. */
|
|
224
224
|
let _jwtVerificationPromise: Promise<void> | undefined = undefined;
|
|
225
|
-
async function
|
|
226
|
-
// NOTE: do NOT add an `if (
|
|
225
|
+
async function _$qGmvPvr(): Promise<void> {
|
|
226
|
+
// NOTE: do NOT add an `if (!_puYWsjJC) return` guard here.
|
|
227
227
|
// esbuild (Vite dependency pre-bundling) would see the variable as constant ""
|
|
228
228
|
// and tree-shake the entire JWT verification code path.
|
|
229
|
-
const jwt =
|
|
229
|
+
const jwt = _puYWsjJC;
|
|
230
230
|
// Clear after reading — this reassignment also prevents esbuild from
|
|
231
231
|
// constant-folding the variable (it now has multiple assignment sites).
|
|
232
|
-
|
|
233
|
-
const verifiedType = await
|
|
232
|
+
_puYWsjJC = "";
|
|
233
|
+
const verifiedType = await Twm(jwt);
|
|
234
234
|
if (verifiedType) {
|
|
235
|
-
|
|
235
|
+
_QsjWa = verifiedType;
|
|
236
236
|
if (debug) console.log("License type set from verified JWT: " + verifiedType);
|
|
237
|
-
|
|
237
|
+
$rpNGR(__alnviAJA());
|
|
238
238
|
}
|
|
239
239
|
else {
|
|
240
|
-
|
|
240
|
+
_QsjWa = "basic";
|
|
241
241
|
if (debug && jwt) console.warn("JWT verification failed — license reset to basic");
|
|
242
242
|
}
|
|
243
243
|
}
|
|
@@ -356,11 +356,11 @@ export namespace Telemetry {
|
|
|
356
356
|
if (!domElement) domElement = document.querySelector<HTMLElement>("needle-engine");
|
|
357
357
|
if (!domElement && !context) return false;
|
|
358
358
|
|
|
359
|
-
// The no-telemetry attribute
|
|
359
|
+
// The no-telemetry attribute is available to PRO and Enterprise builds.
|
|
360
360
|
// NOTE: this does NOT affect license enforcement — the /check call, the "forbidden"
|
|
361
361
|
// overlay and the watermark/logo run on separate, ungated code paths.
|
|
362
362
|
const attribute = domElement?.getAttribute("no-telemetry");
|
|
363
|
-
if (attribute === "" || attribute === "true" || attribute === "1") {
|
|
363
|
+
if (_$xBhfh() && (attribute === "" || attribute === "true" || attribute === "1")) {
|
|
364
364
|
if (debug) console.debug("Telemetry is disabled via no-telemetry attribute");
|
|
365
365
|
return false;
|
|
366
366
|
}
|
|
@@ -688,18 +688,18 @@ export namespace Telemetry {
|
|
|
688
688
|
}
|
|
689
689
|
|
|
690
690
|
|
|
691
|
-
export function
|
|
691
|
+
export function $tbhNjEbR() {
|
|
692
692
|
|
|
693
|
-
if(
|
|
693
|
+
if(_QsjWa === "") _QsjWa = "basic";
|
|
694
694
|
|
|
695
695
|
// Start JWT verification — must be here (not top-level) to avoid tree-shaking
|
|
696
|
-
_jwtVerificationPromise =
|
|
696
|
+
_jwtVerificationPromise = _$qGmvPvr();
|
|
697
697
|
|
|
698
698
|
Telemetry.init();
|
|
699
699
|
ContextRegistry.registerCallback(ContextEvent.ContextRegistered, evt => {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
setLicenseTimeout(evt.context, () =>
|
|
700
|
+
_$toCs(evt.context);
|
|
701
|
+
$DAPYU(evt.context);
|
|
702
|
+
setLicenseTimeout(evt.context, () => _qzMSGyVj(evt.context), 2000);
|
|
703
703
|
});
|
|
704
704
|
// ContextCreated fires after the renderer exists, so the canvas is available for context-loss monitoring
|
|
705
705
|
ContextRegistry.registerCallback(ContextEvent.ContextCreated, evt => {
|
|
@@ -708,17 +708,17 @@ export function _$oLIu() {
|
|
|
708
708
|
});
|
|
709
709
|
}
|
|
710
710
|
|
|
711
|
-
export let _$
|
|
711
|
+
export let _$bDVSQf: Promise<void> | undefined = undefined;
|
|
712
712
|
let applicationIsForbidden = false;
|
|
713
713
|
let applicationForbiddenText = "";
|
|
714
|
-
async function
|
|
714
|
+
async function $TPLZ() {
|
|
715
715
|
// Only perform the runtime license check once
|
|
716
|
-
if (_$
|
|
716
|
+
if (_$bDVSQf) return _$bDVSQf;
|
|
717
717
|
// Wait for JWT verification to complete first (if running)
|
|
718
718
|
if (_jwtVerificationPromise) {
|
|
719
719
|
await _jwtVerificationPromise;
|
|
720
720
|
}
|
|
721
|
-
if (
|
|
721
|
+
if (_QsjWa === "basic") {
|
|
722
722
|
try {
|
|
723
723
|
const licenseUrl = "https://needle.tools/api/v1/needle-engine/check?location=" + encodeURIComponent(window.location.href) + "&version=" + VERSION + "&generator=" + encodeURIComponent(GENERATOR);
|
|
724
724
|
const res = await fetch(licenseUrl, {
|
|
@@ -730,29 +730,29 @@ async function _kAPEtsE() {
|
|
|
730
730
|
if (res?.status === 200) {
|
|
731
731
|
applicationIsForbidden = false;
|
|
732
732
|
if (debug) console.log("License check succeeded");
|
|
733
|
-
|
|
734
|
-
|
|
733
|
+
_QsjWa = "pro";
|
|
734
|
+
$rpNGR(true);
|
|
735
735
|
}
|
|
736
736
|
else if (res?.status === 403) {
|
|
737
|
-
|
|
737
|
+
$rpNGR(false);
|
|
738
738
|
applicationIsForbidden = true;
|
|
739
739
|
applicationForbiddenText = await res.text();
|
|
740
740
|
}
|
|
741
741
|
else {
|
|
742
|
-
|
|
742
|
+
$rpNGR(false);
|
|
743
743
|
if (debug) console.log("License check failed with status " + res?.status);
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
catch (err) {
|
|
747
|
-
|
|
747
|
+
$rpNGR(false);
|
|
748
748
|
if (debug) console.error("License check failed", err);
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
else if (debug) console.log("Runtime license check is skipped because license is already applied as \"" +
|
|
751
|
+
else if (debug) console.log("Runtime license check is skipped because license is already applied as \"" + _QsjWa + "\"");
|
|
752
752
|
}
|
|
753
|
-
_$
|
|
753
|
+
_$bDVSQf = $TPLZ();
|
|
754
754
|
|
|
755
|
-
async function
|
|
755
|
+
async function $DAPYU(ctx: IContext) {
|
|
756
756
|
function createForbiddenElement() {
|
|
757
757
|
const div = document.createElement("div");
|
|
758
758
|
div.className = "needle-forbidden";
|
|
@@ -817,40 +817,40 @@ async function _$TNE(ctx: IContext) {
|
|
|
817
817
|
}, 500)
|
|
818
818
|
}
|
|
819
819
|
|
|
820
|
-
async function
|
|
820
|
+
async function _$toCs(ctx: IContext) {
|
|
821
821
|
try {
|
|
822
|
-
if (!
|
|
823
|
-
return $
|
|
822
|
+
if (!_$xBhfh() && !__YFTdTh()) {
|
|
823
|
+
return $BkPUwzsT(ctx);
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
826
|
catch (err) {
|
|
827
827
|
if (debug) console.log("License check failed", err)
|
|
828
|
-
return $
|
|
828
|
+
return $BkPUwzsT(ctx)
|
|
829
829
|
}
|
|
830
|
-
if (debug) $
|
|
830
|
+
if (debug) $BkPUwzsT(ctx)
|
|
831
831
|
}
|
|
832
832
|
|
|
833
833
|
|
|
834
834
|
|
|
835
|
-
async function $
|
|
835
|
+
async function $BkPUwzsT(ctx: IContext) {
|
|
836
836
|
|
|
837
837
|
// if the engine loads faster than the license check, we need to capture the ready event here
|
|
838
838
|
let isReady = false;
|
|
839
839
|
ctx.domElement.addEventListener("ready", () => isReady = true);
|
|
840
840
|
|
|
841
|
-
await _$
|
|
841
|
+
await _$bDVSQf?.catch(() => { });
|
|
842
842
|
|
|
843
843
|
|
|
844
|
-
if (
|
|
845
|
-
if (
|
|
844
|
+
if (_$xBhfh() || __YFTdTh()) return;
|
|
845
|
+
if (__alnviAJA() === false) EyGW();
|
|
846
846
|
|
|
847
847
|
// check if the engine is already ready (meaning has finished loading)
|
|
848
848
|
if (isReady) {
|
|
849
|
-
|
|
849
|
+
__vrAZI(ctx);
|
|
850
850
|
}
|
|
851
851
|
else {
|
|
852
852
|
ctx.domElement.addEventListener("ready", () => {
|
|
853
|
-
|
|
853
|
+
__vrAZI(ctx);
|
|
854
854
|
});
|
|
855
855
|
}
|
|
856
856
|
}
|
|
@@ -858,7 +858,7 @@ async function $zQrLfV(ctx: IContext) {
|
|
|
858
858
|
// const licenseElementIdentifier = "needle-license-element";
|
|
859
859
|
// const licenseDuration = 10000;
|
|
860
860
|
// const licenseDelay = 1200;
|
|
861
|
-
function
|
|
861
|
+
function __vrAZI(ctx: IContext) {
|
|
862
862
|
|
|
863
863
|
const style = `
|
|
864
864
|
position: relative;
|
|
@@ -871,7 +871,7 @@ function __HBEW(ctx: IContext) {
|
|
|
871
871
|
padding: 10px;
|
|
872
872
|
padding-left: 30px;
|
|
873
873
|
`;
|
|
874
|
-
if (
|
|
874
|
+
if (_QsjWa === "edu") {
|
|
875
875
|
if (navigator.webdriver) {
|
|
876
876
|
console.log("This project is supported by Needle for Education – https://needle.tools");
|
|
877
877
|
}
|
|
@@ -928,7 +928,7 @@ function __HBEW(ctx: IContext) {
|
|
|
928
928
|
}
|
|
929
929
|
}, 1000);
|
|
930
930
|
|
|
931
|
-
if ($
|
|
931
|
+
if (_$qEBaEKr()) {
|
|
932
932
|
const removeDelay = 20_000;
|
|
933
933
|
setLicenseTimeout(ctx, () => {
|
|
934
934
|
clearInterval(interval);
|
|
@@ -937,7 +937,7 @@ function __HBEW(ctx: IContext) {
|
|
|
937
937
|
const intervalInMinutes = 5;
|
|
938
938
|
setLicenseTimeout(ctx, () => {
|
|
939
939
|
if (ctx.domElement.parentNode)
|
|
940
|
-
|
|
940
|
+
__vrAZI(ctx);
|
|
941
941
|
}, 1000 * 60 * intervalInMinutes)
|
|
942
942
|
}, removeDelay);
|
|
943
943
|
}
|
|
@@ -948,7 +948,7 @@ function __HBEW(ctx: IContext) {
|
|
|
948
948
|
const base64Logo = "data:image/webp;base64,UklGRrABAABXRUJQVlA4WAoAAAAQAAAAHwAAHwAAQUxQSKEAAAARN6CmbSM4WR7vdARON11EBDq3fLiNbVtVzpMCPlKAEzsx0Y/x+Ovuv4dn0EFE/ydAvz6YggXzgh5sVgXM/zOC/4sii7qgGvB5N7hmuQYwkvazWAu1JPW41FXSHq6pnaQWvqYH18Fc0j1hO/BFTtIeSBlJi5w6qIIO7IOrwhFsB2Yxukif0FTRLpXswHR8MxbslKe9VZsn/Ub5C7YFOpqSTABWUDgg6AAAAFAGAJ0BKiAAIAA+7VyoTqmkpCI3+qgBMB2JbACdMt69DwMIQBLhkTO6XwY00UEDK6cNIDnuNibPf0EgAP7Y1myuiQHLDsF/0h5unrGh6WAbv7aegg2ZMd3uRKfT/3SJztcaujYfTvMXspfCTmYcoO6a+vhC3ss4M8uM58t4siiu59I4aOl59e9Sr6xoxYlHf2v+NnBNpJYeJf8jABQAId/PXuBkLEFkiCucgSGEcfhvajql/j3reCGl0M5/9gQWy7ayNPs+wlvIxFnNfSlfuND4CZOCyxOHhRqOmHN4ULHo3tCSrUNvgAA=";
|
|
949
949
|
|
|
950
950
|
let lastLogTime = 0;
|
|
951
|
-
async function
|
|
951
|
+
async function EyGW(_logo?: string) {
|
|
952
952
|
const now = Date.now();
|
|
953
953
|
if (now - lastLogTime < 2000) return;
|
|
954
954
|
lastLogTime = now;
|
|
@@ -981,7 +981,7 @@ async function _$Obysw(_logo?: string) {
|
|
|
981
981
|
}
|
|
982
982
|
|
|
983
983
|
|
|
984
|
-
async function
|
|
984
|
+
async function _qzMSGyVj(context: IContext) {
|
|
985
985
|
// isAllowed() now also covers cross-origin-isolated pages (where beacons can't be sent)
|
|
986
986
|
// and Do Not Track / GPC.
|
|
987
987
|
if (!Telemetry.isAllowed(context)) {
|
|
@@ -995,7 +995,7 @@ async function cVal(context: IContext) {
|
|
|
995
995
|
|
|
996
996
|
// current url without query parameters
|
|
997
997
|
const currentUrl = window.location.href.split("?")[0];
|
|
998
|
-
const license =
|
|
998
|
+
const license = _QsjWa;
|
|
999
999
|
|
|
1000
1000
|
const beaconData = {
|
|
1001
1001
|
license,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BufferGeometry, Camera, Color, Euler,Group, Material, Object3D, Scene, Texture, Vector2, Vector3, Vector4, WebGLRenderer } from "three";
|
|
2
2
|
|
|
3
|
+
import { isDevEnvironment } from "./debug/index.js";
|
|
4
|
+
import { getParam } from "./engine_utils.js";
|
|
5
|
+
|
|
3
6
|
|
|
4
7
|
// @TODO: we need to detect objects with materials both transparent and NOT transparent. These need to be updated in scene.onBeforeRender to have correct renderlists
|
|
5
8
|
|
|
@@ -657,6 +660,13 @@ const onAfterRenderListPush = function (this: Object3D, _object: Object3D, _geom
|
|
|
657
660
|
}
|
|
658
661
|
|
|
659
662
|
// #region OnBeforeRender
|
|
663
|
+
/**
|
|
664
|
+
* Set once the "envMap on MeshBasicMaterial is not supported" warning has been logged, so it only appears once.
|
|
665
|
+
* @internal
|
|
666
|
+
*/
|
|
667
|
+
let didWarnBasicMaterialEnvMap = false;
|
|
668
|
+
const debugReflectionProbe = getParam("debugreflectionprobe");
|
|
669
|
+
|
|
660
670
|
/**
|
|
661
671
|
* Main callback invoked before rendering an object.
|
|
662
672
|
* Applies property block overrides and defines to the material.
|
|
@@ -726,6 +736,17 @@ const onBeforeRender_MaterialBlock: ObjectRenderCallback = function (this: Objec
|
|
|
726
736
|
for (const override of overrides) {
|
|
727
737
|
if (override.value === null) continue;
|
|
728
738
|
|
|
739
|
+
// Reflection probe overrides on MeshBasicMaterial cause rendering glitches, so none are applied.
|
|
740
|
+
// No original values are recorded, so onAfterRender leaves these properties untouched.
|
|
741
|
+
if (mat.isMeshBasicMaterial === true &&
|
|
742
|
+
(override.name === "envMap" || override.name === "envMapRotation" || override.name === "envMapIntensity")) {
|
|
743
|
+
if (override.name === "envMap" && !didWarnBasicMaterialEnvMap && (isDevEnvironment() || debugReflectionProbe)) {
|
|
744
|
+
didWarnBasicMaterialEnvMap = true;
|
|
745
|
+
console.warn(`MaterialPropertyBlock: Ignoring envMap override on MeshBasicMaterial (object: "${this.name}", material: "${material.name}"). Use a lit material such as MeshStandardMaterial if reflection probes are intended.`);
|
|
746
|
+
}
|
|
747
|
+
continue;
|
|
748
|
+
}
|
|
749
|
+
|
|
729
750
|
const currentValue = mat[override.name];
|
|
730
751
|
|
|
731
752
|
const existingOriginal = originalValues.find((o: OriginalValue) => o.name === override.name);
|
|
@@ -7,13 +7,13 @@ import type { Networking } from "../engine-components/Networking.js";
|
|
|
7
7
|
import type { SyncedRoom } from "../engine-components/SyncedRoom.js";
|
|
8
8
|
import * as schemes from "../engine-schemes/schemes.js";
|
|
9
9
|
import { isDevEnvironment } from './debug/index.js';
|
|
10
|
+
import type { DisposeFn } from "./engine_disposable.js";
|
|
10
11
|
import { Telemetry } from './engine_license.js';
|
|
12
|
+
import { WebsocketTransport } from './engine_networking.transport.websocket.js';
|
|
11
13
|
import { PeerNetworking } from './engine_networking_peer.js';
|
|
12
14
|
import { type IModel, type INetworkConnection, type INetworkTransport, SendQueue } from './engine_networking_types.js';
|
|
13
|
-
import { WebsocketTransport } from './engine_networking.transport.websocket.js';
|
|
14
15
|
import { isHostedOnGlitch } from './engine_networking_utils.js';
|
|
15
16
|
import { Context } from './engine_setup.js';
|
|
16
|
-
import type { DisposeFn } from "./engine_disposable.js";
|
|
17
17
|
import * as utils from "./engine_utils.js";
|
|
18
18
|
|
|
19
19
|
/** @internal Symbol used to attach the original callback to unsubscribe functions returned by beginListen/beginListenBinary */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FileLoader } from "three";
|
|
2
2
|
|
|
3
3
|
import { showBalloonWarning } from "./debug/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { __alnviAJA } from "./engine_license.js";
|
|
5
5
|
import { delay } from "./engine_utils.js";
|
|
6
6
|
import { md5AsBytes, md5Hex, sha256Base64 } from "./engine_utils_hash.js";
|
|
7
7
|
|
|
@@ -45,7 +45,7 @@ export namespace BlobStorage {
|
|
|
45
45
|
*/
|
|
46
46
|
export function canUpload(info: { filesize: number }) {
|
|
47
47
|
const sizeInMB = info.filesize / 1024 / 1024;
|
|
48
|
-
if (
|
|
48
|
+
if (__alnviAJA()) {
|
|
49
49
|
return sizeInMB < maxSizeInMB;
|
|
50
50
|
}
|
|
51
51
|
return sizeInMB < maxFreeSizeInMB;
|
|
@@ -100,7 +100,7 @@ export namespace BlobStorage {
|
|
|
100
100
|
console.warn(`Your file is too large for uploading (${filesizeInMB.toFixed(1)}MB). Max allowed size is ${maxSizeInMB}MB`);
|
|
101
101
|
return null;
|
|
102
102
|
}
|
|
103
|
-
else if (!
|
|
103
|
+
else if (!__alnviAJA() && filesizeInMB > maxFreeSizeInMB) {
|
|
104
104
|
if (opts?.silent !== true) showBalloonWarning(`File is too large for uploading. Please get a <a href=\"https://needle.tools/pricing\" target=\"_blank\">commercial license</a> to upload files larger than 5MB`);
|
|
105
105
|
console.warn(`Your file is too large for uploading (${filesizeInMB.toFixed(1)}MB). Max size is 5MB for non-commercial users. Please get a commercial license at https://needle.tools/pricing for larger files (up to 50MB)`);
|
|
106
106
|
return null;
|
|
@@ -4,7 +4,7 @@ import { Quaternion, Vector2, Vector3, Vector4 } from "three";
|
|
|
4
4
|
|
|
5
5
|
import { needleLogoOnlySVG } from "./assets/index.js";
|
|
6
6
|
import { isDevEnvironment } from "./debug/debug.js";
|
|
7
|
-
import {
|
|
7
|
+
import { __alnviAJA } from "./engine_license.js";
|
|
8
8
|
import { InternalAttributeUtils } from "./engine_utils_attributes.js";
|
|
9
9
|
import type { NeedleEngineWebComponent } from "./webcomponents/needle-engine.js";
|
|
10
10
|
|
|
@@ -135,7 +135,7 @@ async function internalRenderQRCodeOverlays(canvas: HTMLCanvasElement, args: { s
|
|
|
135
135
|
console.debug("[QR Code] No web component found")
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
const canUseCustomLogo =
|
|
138
|
+
const canUseCustomLogo = __alnviAJA();
|
|
139
139
|
|
|
140
140
|
// Query logo src from needle-engine attribute.
|
|
141
141
|
// For any supported attribute it's possible to use "falsey" values (e.g. "0" or "false" to disable the logo in the QR code)
|
|
@@ -2,7 +2,7 @@ import { Mesh, Object3D, TextureLoader, Vector4 } from "three";
|
|
|
2
2
|
import ThreeMeshUI from "three-mesh-ui";
|
|
3
3
|
|
|
4
4
|
import { addNewComponent } from "../../engine_components.js";
|
|
5
|
-
import {
|
|
5
|
+
import { __alnviAJA } from "../../engine_license.js";
|
|
6
6
|
import { OneEuroFilterXYZ } from "../../engine_math.js";
|
|
7
7
|
import type { Context } from "../../engine_setup.js";
|
|
8
8
|
import { lookAtObject } from "../../engine_three_utils.js";
|
|
@@ -321,7 +321,7 @@ export class NeedleSpatialMenu {
|
|
|
321
321
|
}
|
|
322
322
|
if (this.menu) {
|
|
323
323
|
const index = this.menu.children.indexOf(this._poweredByNeedleElement as any);
|
|
324
|
-
if (!this._showNeedleLogo &&
|
|
324
|
+
if (!this._showNeedleLogo && __alnviAJA()) {
|
|
325
325
|
if (index >= 0) {
|
|
326
326
|
this._poweredByNeedleElement.removeFromParent();
|
|
327
327
|
this.markDirty();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { showBalloonMessage } from "../../debug/debug.js";
|
|
2
2
|
import type { Context } from "../../engine_context.js";
|
|
3
|
-
import {
|
|
3
|
+
import { __alnviAJA, dRcEhn, Telemetry } from "../../engine_license.js";
|
|
4
4
|
import { isLocalNetwork } from "../../engine_networking_utils.js";
|
|
5
5
|
import { HTMLElementBase } from "../../engine_ssr.js";
|
|
6
6
|
import { DeviceUtilities, getParam } from "../../engine_utils.js";
|
|
@@ -801,8 +801,8 @@ export class NeedleMenuElement extends HTMLElementBase {
|
|
|
801
801
|
// calling this method immediately will cause an issue with vite bundling tho
|
|
802
802
|
this._licenseFrame = window.requestAnimationFrame(() => {
|
|
803
803
|
this._licenseFrame = undefined;
|
|
804
|
-
this._unsubscribeLicense =
|
|
805
|
-
if (res == true &&
|
|
804
|
+
this._unsubscribeLicense = dRcEhn(res => {
|
|
805
|
+
if (res == true && __alnviAJA() && !debugNonCommercial) {
|
|
806
806
|
let visible = this._userRequestedLogoVisible;
|
|
807
807
|
if (visible === undefined) visible = false;
|
|
808
808
|
this.___onSetLogoVisible(visible);
|
|
@@ -854,7 +854,7 @@ export class NeedleMenuElement extends HTMLElementBase {
|
|
|
854
854
|
// ensure the menu is not hidden or removed
|
|
855
855
|
const requiredParent = this?.parentNode;
|
|
856
856
|
if (this.style.display != "flex" || this.style.visibility != "visible" || this.style.opacity != "1" || requiredParent != this._domElement?.shadowRoot) {
|
|
857
|
-
if (!
|
|
857
|
+
if (!__alnviAJA()) {
|
|
858
858
|
const change = changeEventCounter++;
|
|
859
859
|
// if a user doesn't have a local pro license *but* for development the menu is hidden then we show a warning
|
|
860
860
|
if (isLocalNetwork() && this._userRequestedMenuVisible === false) {
|
|
@@ -950,7 +950,7 @@ export class NeedleMenuElement extends HTMLElementBase {
|
|
|
950
950
|
showNeedleLogo(visible: boolean) {
|
|
951
951
|
this._userRequestedLogoVisible = visible;
|
|
952
952
|
if (!visible) {
|
|
953
|
-
if (!
|
|
953
|
+
if (!__alnviAJA() || debugNonCommercial) {
|
|
954
954
|
console.warn("[Needle Engine] You need a commercial license to hide the Needle Engine logo in production.");
|
|
955
955
|
const localNetwork = isLocalNetwork()
|
|
956
956
|
if (!localNetwork) return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { needleLogoOnlySVG } from "../assets/index.js"
|
|
2
2
|
import { isDevEnvironment, showBalloonWarning } from "../debug/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { __alnviAJA, _$xBhfh, _$bDVSQf } from "../engine_license.js";
|
|
4
4
|
import { Mathf } from "../engine_math.js";
|
|
5
5
|
import { LoadingProgressArgs } from "../engine_setup.js";
|
|
6
6
|
import { getParam } from "../engine_utils.js";
|
|
@@ -217,7 +217,7 @@ export class EngineLoadingView implements ILoadingViewHandler {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
|
|
220
|
-
const hasLicense =
|
|
220
|
+
const hasLicense = _$xBhfh();
|
|
221
221
|
if (!existing) {
|
|
222
222
|
this._loadingElement.style.position = "absolute";
|
|
223
223
|
this._loadingElement.style.width = "100%";
|
|
@@ -385,7 +385,7 @@ export class EngineLoadingView implements ILoadingViewHandler {
|
|
|
385
385
|
|
|
386
386
|
// private async handleRuntimeLicense(loadingElement: HTMLElement) {
|
|
387
387
|
// // First check if we have a commercial license
|
|
388
|
-
// let commercialLicense =
|
|
388
|
+
// let commercialLicense = __alnviAJA();
|
|
389
389
|
// // if it's the case then we don't need to perform a runtime check
|
|
390
390
|
// if (commercialLicense) return;
|
|
391
391
|
|
|
@@ -405,10 +405,10 @@ export class EngineLoadingView implements ILoadingViewHandler {
|
|
|
405
405
|
// loadingElement.appendChild(nonCommercialContainer);
|
|
406
406
|
|
|
407
407
|
// // Use the runtime license check
|
|
408
|
-
// if (!isDevEnvironment() && _$
|
|
408
|
+
// if (!isDevEnvironment() && _$bDVSQf) {
|
|
409
409
|
// if (debugLicense) console.log("Waiting for runtime license check");
|
|
410
|
-
// await _$
|
|
411
|
-
// commercialLicense =
|
|
410
|
+
// await _$bDVSQf;
|
|
411
|
+
// commercialLicense = __alnviAJA();
|
|
412
412
|
// }
|
|
413
413
|
// if (commercialLicense) return;
|
|
414
414
|
// nonCommercialContainer.style.transition = "opacity .5s ease-in-out";
|
|
@@ -3,7 +3,7 @@ import type { Texture } from "three";
|
|
|
3
3
|
import { isDevEnvironment, showBalloonWarning } from "../debug/index.js";
|
|
4
4
|
import { PUBLIC_KEY, VERSION } from "../engine_constants.js";
|
|
5
5
|
import { ContextEvent, ContextRegistry } from "../engine_context_registry.js";
|
|
6
|
-
import {
|
|
6
|
+
import { __alnviAJA, Telemetry } from "../engine_license.js";
|
|
7
7
|
import { onStart } from "../engine_lifecycle_api.js";
|
|
8
8
|
import { setDracoDecoderPath, setDracoDecoderType, setKtx2TranscoderPath } from "../engine_loaders.gltf.js";
|
|
9
9
|
import { Context, ContextCreateArgs } from "../engine_setup.js";
|
|
@@ -583,7 +583,7 @@ export class NeedleEngineWebComponent extends HTMLElementBase implements INeedle
|
|
|
583
583
|
|
|
584
584
|
|
|
585
585
|
// Loading start events
|
|
586
|
-
const allowOverridingDefaultLoading =
|
|
586
|
+
const allowOverridingDefaultLoading = __alnviAJA();
|
|
587
587
|
// default loading can be overriden by calling preventDefault in the onload start event
|
|
588
588
|
this.ensureLoadStartIsRegistered();
|
|
589
589
|
let useDefaultLoading = this.dispatchEvent(new CustomEvent("loadstart", {
|
|
@@ -111,19 +111,20 @@ async function handleSessionGranted() {
|
|
|
111
111
|
// wasn't granted it), XR can't run here — skip the probe so we don't log a
|
|
112
112
|
// Permissions-Policy violation on load.
|
|
113
113
|
if (!isXrSpatialTrackingAllowed()) return;
|
|
114
|
-
//
|
|
114
|
+
// An App Clip has already granted AR. Register its sessiongranted listener
|
|
115
|
+
// synchronously: awaiting a support probe here can miss the native event.
|
|
115
116
|
if (DeviceUtilities.isNeedleAppClip()) {
|
|
116
117
|
defaultMode = "immersive-ar";
|
|
117
118
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
else {
|
|
120
|
+
// Check if VR is even supported, otherwise try AR.
|
|
121
|
+
if (!(await navigator.xr?.isSessionSupported("immersive-vr"))) {
|
|
122
|
+
defaultMode = "immersive-ar";
|
|
123
|
+
}
|
|
124
|
+
// Check if AR is supported, otherwise we can't do anything.
|
|
125
|
+
if (defaultMode === "immersive-ar" && !(await navigator.xr?.isSessionSupported("immersive-ar"))) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
127
128
|
}
|
|
128
129
|
} catch (e) {
|
|
129
130
|
console.debug("[NeedleXRSession:granted] Error while checking XR support:", e);
|
|
@@ -3,7 +3,7 @@ import { ArrayCamera, AxesHelper, Camera, Color, DirectionalLight, Fog, GridHelp
|
|
|
3
3
|
import { needleLogoOnlySVG } from "../assets/index.js";
|
|
4
4
|
import { isDevEnvironment } from "../debug/index.js";
|
|
5
5
|
import { ObjectUtils, PrimitiveType } from "../engine_create_objects.js";
|
|
6
|
-
import {
|
|
6
|
+
import { __alnviAJA } from "../engine_license.js";
|
|
7
7
|
import { Mathf } from "../engine_math.js";
|
|
8
8
|
import { delay, DeviceUtilities } from "../engine_utils.js";
|
|
9
9
|
|
|
@@ -215,7 +215,7 @@ export class TemporaryXRContext {
|
|
|
215
215
|
this._scene.background = new Color(0x000000);
|
|
216
216
|
|
|
217
217
|
let logoSrc = needleLogoOnlySVG;
|
|
218
|
-
if (
|
|
218
|
+
if (__alnviAJA()) {
|
|
219
219
|
const htmlComponent = document.querySelector("needle-engine");
|
|
220
220
|
if (htmlComponent) {
|
|
221
221
|
const licenseLogo = htmlComponent.getAttribute("logo-src");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { Camera, InterpolationModes, Light, Material, PerspectiveCamera } from "three";
|
|
1
2
|
import { AnimationClip, BooleanKeyframeTrack, Color, ColorKeyframeTrack, Euler,
|
|
2
3
|
InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, KeyframeTrack,
|
|
3
4
|
NumberKeyframeTrack, Object3D, Quaternion, QuaternionKeyframeTrack,
|
|
4
5
|
Vector3, VectorKeyframeTrack } from "three";
|
|
5
|
-
import type { Camera, InterpolationModes, Light, Material, PerspectiveCamera } from "three";
|
|
6
6
|
|
|
7
7
|
import { isDevEnvironment } from "../engine/debug/index.js";
|
|
8
8
|
|