Files
MickaelK 71b14e6eaf feature (3d): embed 3d viewer anywhere
This contains a bunch of things packaged in 1:

1) UI improvements for the 3D viewer to support all sort of file types
   and create a nice rendering in a clean way with all sort of options

2) enable people to use Filestash as an SDK so we can embed the 3d viewer
   elsewhere
2024-12-23 18:50:23 +11:00

16 lines
419 B
JavaScript

// feature detection if we're using Filestash as a standalone app or as an SDK
// see: ../index.js
export function isSDK() {
const importURL = new URL(import.meta.url);
return location.origin !== importURL.origin;
}
export function urlSDK(url) {
const importURL = new URL(import.meta.url);
if (new RegExp("^/").test(url) === false) {
url = "/" + url
}
return importURL.origin + url;
}