@smplrspace/smplr-loader 2.11.3-beta.0 → 2.11.3-beta.2
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/dist/generated/smplr.d.ts +4 -1
- package/dist/index.js +11 -11
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -482,6 +482,9 @@ declare interface SpaceOptions {
|
|
|
482
482
|
internal?: boolean;
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
+
declare const toString_2: () => string;
|
|
486
|
+
export { toString_2 as toString }
|
|
487
|
+
|
|
485
488
|
declare type UnknownData = Record<string, unknown>;
|
|
486
489
|
|
|
487
490
|
declare const useEventEmitter: () => {
|
|
@@ -503,7 +506,7 @@ declare interface Vector3Coord extends Vector2Coord {
|
|
|
503
506
|
z: number;
|
|
504
507
|
}
|
|
505
508
|
|
|
506
|
-
export declare const version = "2.11.3-beta.
|
|
509
|
+
export declare const version = "2.11.3-beta.2";
|
|
507
510
|
|
|
508
511
|
declare interface ViewerOptions {
|
|
509
512
|
mode?: CameraMode;
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const c = (r) => new Promise((
|
|
1
|
+
const c = (r) => new Promise((t, s) => {
|
|
2
2
|
try {
|
|
3
3
|
const e = document.createElement("script");
|
|
4
4
|
e.type = "text/javascript", e.async = !0, e.src = r, e.addEventListener("load", () => {
|
|
5
|
-
|
|
5
|
+
t("ok");
|
|
6
6
|
}), e.addEventListener("error", () => {
|
|
7
7
|
s(`Failed to load the script from ${r}`);
|
|
8
8
|
}), document.body.appendChild(e);
|
|
@@ -12,11 +12,11 @@ const c = (r) => new Promise((o, s) => {
|
|
|
12
12
|
}), p = (r) => import(
|
|
13
13
|
r
|
|
14
14
|
/* @vite-ignore */
|
|
15
|
-
), a = (r) => new Promise((
|
|
15
|
+
), a = (r) => new Promise((t, s) => {
|
|
16
16
|
try {
|
|
17
17
|
const e = document.createElement("link");
|
|
18
18
|
e.type = "text/css", e.href = r, e.rel = "stylesheet", e.addEventListener("load", () => {
|
|
19
|
-
|
|
19
|
+
t("ok");
|
|
20
20
|
}), e.addEventListener("error", () => {
|
|
21
21
|
const l = new Error(`Failed to load the stylesheet from ${r}`);
|
|
22
22
|
console.error(l), s(l);
|
|
@@ -24,7 +24,7 @@ const c = (r) => new Promise((o, s) => {
|
|
|
24
24
|
} catch (e) {
|
|
25
25
|
console.error(e), s(e);
|
|
26
26
|
}
|
|
27
|
-
}),
|
|
27
|
+
}), o = {
|
|
28
28
|
umd: {
|
|
29
29
|
prod: "https://app.smplrspace.com/lib/smplr.js",
|
|
30
30
|
dev: "https://dev.smplrspace.com/lib/smplr.js",
|
|
@@ -41,22 +41,22 @@ const c = (r) => new Promise((o, s) => {
|
|
|
41
41
|
local: "http://localhost:3000/lib/style.css"
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
async function d(r = "esm",
|
|
44
|
+
async function d(r = "esm", t = "prod") {
|
|
45
45
|
try {
|
|
46
|
-
a(
|
|
46
|
+
a(o.css[t]);
|
|
47
47
|
} catch {
|
|
48
48
|
console.warn("oops");
|
|
49
49
|
}
|
|
50
50
|
try {
|
|
51
51
|
if (r === "esm") {
|
|
52
|
-
const s = await p(
|
|
53
|
-
return console.log("loaded esm", s), s;
|
|
52
|
+
const s = await p(o.esm[t]);
|
|
53
|
+
return console.log("loaded esm", s.toString()), s;
|
|
54
54
|
} else {
|
|
55
|
-
await c(
|
|
55
|
+
await c(o.umd[t]);
|
|
56
56
|
const s = window.smplr;
|
|
57
57
|
if (!s)
|
|
58
58
|
throw new Error("Failed to load smplr.js");
|
|
59
|
-
return console.log("loaded umd", s), s;
|
|
59
|
+
return console.log("loaded umd", s.toString()), s;
|
|
60
60
|
}
|
|
61
61
|
} catch (s) {
|
|
62
62
|
throw console.error(s), new Error("Failed to load smplr.js");
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(r,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(r=typeof globalThis<"u"?globalThis:r||self,l(r.SmplrLoader={}))})(this,function(r){"use strict";const l=o=>new Promise((t
|
|
1
|
+
(function(r,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(r=typeof globalThis<"u"?globalThis:r||self,l(r.SmplrLoader={}))})(this,function(r){"use strict";const l=o=>new Promise((s,t)=>{try{const e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=o,e.addEventListener("load",()=>{s("ok")}),e.addEventListener("error",()=>{t(`Failed to load the script from ${o}`)}),document.body.appendChild(e)}catch(e){t(e)}}),n=o=>import(o),c=o=>new Promise((s,t)=>{try{const e=document.createElement("link");e.type="text/css",e.href=o,e.rel="stylesheet",e.addEventListener("load",()=>{s("ok")}),e.addEventListener("error",()=>{const d=new Error(`Failed to load the stylesheet from ${o}`);console.error(d),t(d)}),document.head.appendChild(e)}catch(e){console.error(e),t(e)}}),p={umd:{prod:"https://app.smplrspace.com/lib/smplr.js",dev:"https://dev.smplrspace.com/lib/smplr.js",local:"http://localhost:3000/lib/smplr.umd.js"},esm:{prod:"https://app.smplrspace.com/lib/smplr.mjs",dev:"https://dev.smplrspace.com/lib/smplr.mjs",local:"http://localhost:3000/lib/smplr.mjs"},css:{prod:"https://app.smplrspace.com/lib/smplr.css",dev:"https://dev.smplrspace.com/lib/smplr.css",local:"http://localhost:3000/lib/style.css"}};async function m(o="esm",s="prod"){try{c(p.css[s])}catch{console.warn("oops")}try{if(o==="esm"){const t=await n(p.esm[s]);return console.log("loaded esm",t.toString()),t}else{await l(p.umd[s]);const t=window.smplr;if(!t)throw new Error("Failed to load smplr.js");return console.log("loaded umd",t.toString()),t}}catch(t){throw console.error(t),new Error("Failed to load smplr.js")}}r.loadSmplrJs=m,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|