mage-engine 3.23.27 → 3.23.29

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.
Files changed (2) hide show
  1. package/dist/mage.js +80 -20
  2. package/package.json +1 -1
package/dist/mage.js CHANGED
@@ -55792,10 +55792,10 @@ var TAGS = {
55792
55792
  var isLevelName = function isLevelName(level) {
55793
55793
  return level.startsWith(DIVIDER);
55794
55794
  };/**
55795
- * Checks if a path is an absolute URL.
55795
+ * Checks if a path is an absolute URL (with protocol).
55796
55796
  */
55797
55797
 
55798
- var isURL$2 = function isURL(path) {
55798
+ var isAbsoluteURL$3 = function isAbsoluteURL(path) {
55799
55799
  try {
55800
55800
  new URL(path);
55801
55801
  return true;
@@ -55804,12 +55804,23 @@ var isURL$2 = function isURL(path) {
55804
55804
  }
55805
55805
  };
55806
55806
  /**
55807
- * Resolves an asset path to a full URL using MAGE_ASSETS_BASE_URL.
55807
+ * Checks if a path is already a fully resolved URL.
55808
+ * The engine is agnostic about asset locations - it just needs to know
55809
+ * if the path is absolute (use as-is) or relative (prepend base URL).
55808
55810
  */
55809
55811
 
55810
55812
 
55811
- var resolveAssetPath$2 = function resolveAssetPath(path) {
55812
- if (isURL$2(path)) {
55813
+ var isAlreadyResolved$2 = function isAlreadyResolved(path) {
55814
+ return path && isAbsoluteURL$3(path);
55815
+ };
55816
+ /**
55817
+ * Resolves a single asset path to a full URL using MAGE_ASSETS_BASE_URL.
55818
+ */
55819
+
55820
+
55821
+ var resolveSinglePath = function resolveSinglePath(path) {
55822
+ // If already a full URL or already contains the API path, return as-is
55823
+ if (isAlreadyResolved$2(path)) {
55813
55824
  return path;
55814
55825
  }
55815
55826
 
@@ -55822,6 +55833,21 @@ var resolveAssetPath$2 = function resolveAssetPath(path) {
55822
55833
 
55823
55834
  return path;
55824
55835
  };
55836
+ /**
55837
+ * Resolves asset path(s) to full URL(s) using MAGE_ASSETS_BASE_URL.
55838
+ * Handles both single paths (string) and arrays of paths (for cube textures).
55839
+ */
55840
+
55841
+
55842
+ var resolveAssetPath$2 = function resolveAssetPath(pathOrPaths) {
55843
+ if (Array.isArray(pathOrPaths)) {
55844
+ return pathOrPaths.map(function (p) {
55845
+ return resolveSinglePath(p);
55846
+ });
55847
+ }
55848
+
55849
+ return resolveSinglePath(pathOrPaths);
55850
+ };
55825
55851
 
55826
55852
  var Images = /*#__PURE__*/function () {
55827
55853
  function Images() {
@@ -58400,7 +58426,7 @@ function applyMiddleware() {
58400
58426
 
58401
58427
  var thunk = createThunkMiddleware();
58402
58428
  thunk.withExtraArgument = createThunkMiddleware;var name = "mage-engine";
58403
- var version$1 = "3.23.27";
58429
+ var version$1 = "3.23.29";
58404
58430
  var description = "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.";
58405
58431
  var main = "dist/mage.js";
58406
58432
  var author$1 = {
@@ -70327,12 +70353,10 @@ var AUDIO_RAMPS = {
70327
70353
  EXPONENTIAL: "EXPONENTIAL"
70328
70354
  };
70329
70355
  /**
70330
- * Checks if a path is an absolute URL.
70331
- * @param {string} path - The path to check
70332
- * @returns {boolean} - True if path is an absolute URL
70356
+ * Checks if a path is an absolute URL (with protocol).
70333
70357
  */
70334
70358
 
70335
- var isURL$1 = function isURL(path) {
70359
+ var isAbsoluteURL$2 = function isAbsoluteURL(path) {
70336
70360
  try {
70337
70361
  new URL(path);
70338
70362
  return true;
@@ -70340,9 +70364,19 @@ var isURL$1 = function isURL(path) {
70340
70364
  return false;
70341
70365
  }
70342
70366
  };
70367
+ /**
70368
+ * Checks if a path is already a fully resolved URL.
70369
+ * The engine is agnostic about asset locations - it just needs to know
70370
+ * if the path is absolute (use as-is) or relative (prepend base URL).
70371
+ */
70372
+
70373
+
70374
+ var isAlreadyResolved$1 = function isAlreadyResolved(path) {
70375
+ return path && isAbsoluteURL$2(path);
70376
+ };
70343
70377
  /**
70344
70378
  * Resolves an asset path to a full URL.
70345
- * If path is already an absolute URL, returns it as-is.
70379
+ * If path is already an absolute URL or contains the API path, returns it as-is.
70346
70380
  * If path is relative and MAGE_ASSETS_BASE_URL is set, prepends the base URL.
70347
70381
  * @param {string} path - The asset path (relative or absolute)
70348
70382
  * @returns {string} - The resolved full URL
@@ -70350,8 +70384,8 @@ var isURL$1 = function isURL(path) {
70350
70384
 
70351
70385
 
70352
70386
  var resolveAssetPath$1 = function resolveAssetPath(path) {
70353
- // If it's already an absolute URL, use it as-is
70354
- if (isURL$1(path)) {
70387
+ // If already a full URL or already contains the API path, return as-is
70388
+ if (isAlreadyResolved$1(path)) {
70355
70389
  return path;
70356
70390
  } // If MAGE_ASSETS_BASE_URL is set, prepend it to the relative path
70357
70391
 
@@ -76265,7 +76299,7 @@ var NURBSCurve = /*#__PURE__*/function (_Curve) {
76265
76299
  }]);
76266
76300
 
76267
76301
  return NURBSCurve;
76268
- }(Curve);var isAbsoluteURL = function isAbsoluteURL(url) {
76302
+ }(Curve);var isAbsoluteURL$1 = function isAbsoluteURL(url) {
76269
76303
  return /^(?:\w+:)\/\//.test(url);
76270
76304
  };/**
76271
76305
  * Loader loads FBX file and generates Group representing FBX scene.
@@ -76361,7 +76395,7 @@ var buildFBXLoader = function buildFBXLoader() {
76361
76395
  var texturePath = LoaderUtils.extractUrlBase(texture);
76362
76396
  var textureLoader = new TextureLoader(this.manager).setCrossOrigin(this.crossOrigin);
76363
76397
 
76364
- if (!isAbsoluteURL(texture)) {
76398
+ if (!isAbsoluteURL$1(texture)) {
76365
76399
  textureLoader.setPath(this.resourcePath || texturePath || path);
76366
76400
  }
76367
76401
 
@@ -80902,18 +80936,44 @@ var DEFAULTbuildObjectLoader = function DEFAULTbuildObjectLoader() {
80902
80936
  };
80903
80937
 
80904
80938
  var loaders = (_loaders = {}, _defineProperty$1(_loaders, EXTENSIONS.JSON, DEFAULTbuildObjectLoader), _defineProperty$1(_loaders, EXTENSIONS.GLB, buildGLTFLoader), _defineProperty$1(_loaders, EXTENSIONS.GLTF, buildGLTFLoader), _defineProperty$1(_loaders, EXTENSIONS.FBX, buildFBXLoader), _defineProperty$1(_loaders, EXTENSIONS.OBJ, buildOBJMTLLoader), _loaders);
80939
+ /**
80940
+ * Checks if a path is an absolute URL (with protocol).
80941
+ */
80942
+
80943
+ var isAbsoluteURL = function isAbsoluteURL(path) {
80944
+ try {
80945
+ new URL(path);
80946
+ return true;
80947
+ } catch (_) {
80948
+ return false;
80949
+ }
80950
+ };
80951
+ /**
80952
+ * Parses a URL and returns the URL object, or false if not a valid URL.
80953
+ * Used by extractExtension to get the pathname.
80954
+ */
80955
+
80905
80956
 
80906
80957
  var isURL = function isURL(path) {
80907
80958
  try {
80908
- var url = new URL(path);
80909
- return url;
80959
+ return new URL(path);
80910
80960
  } catch (_) {
80911
80961
  return false;
80912
80962
  }
80913
80963
  };
80964
+ /**
80965
+ * Checks if a path is already a fully resolved URL.
80966
+ * The engine is agnostic about asset locations - it just needs to know
80967
+ * if the path is absolute (use as-is) or relative (prepend base URL).
80968
+ */
80969
+
80970
+
80971
+ var isAlreadyResolved = function isAlreadyResolved(path) {
80972
+ return path && isAbsoluteURL(path);
80973
+ };
80914
80974
  /**
80915
80975
  * Resolves an asset path to a full URL.
80916
- * If path is already an absolute URL, returns it as-is.
80976
+ * If path is already an absolute URL or contains the API path, returns it as-is.
80917
80977
  * If path is relative and MAGE_ASSETS_BASE_URL is set, prepends the base URL.
80918
80978
  * @param {string} path - The asset path (relative or absolute)
80919
80979
  * @returns {string} - The resolved full URL
@@ -80921,8 +80981,8 @@ var isURL = function isURL(path) {
80921
80981
 
80922
80982
 
80923
80983
  var resolveAssetPath = function resolveAssetPath(path) {
80924
- // If it's already an absolute URL, use it as-is
80925
- if (isURL(path)) {
80984
+ // If already a full URL or already contains the API path, return as-is
80985
+ if (isAlreadyResolved(path)) {
80926
80986
  return path;
80927
80987
  } // If MAGE_ASSETS_BASE_URL is set, prepend it to the relative path
80928
80988
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mage-engine",
3
- "version": "3.23.27",
3
+ "version": "3.23.29",
4
4
  "description": "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.",
5
5
  "main": "dist/mage.js",
6
6
  "author": {