@speridlabs/visus 0.1.0
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/README.md +155 -0
- package/dist/index.d.ts +12 -0
- package/dist/main.es.js +12 -0
- package/dist/ply-CQ9dyX1o.mjs +1299 -0
- package/dist/react.es.js +308 -0
- package/package.json +93 -0
package/dist/react.es.js
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import te, { useRef as ne, useMemo as oe, useEffect as ae } from "react";
|
|
2
|
+
import { extend as se, useLoader as ue } from "@react-three/fiber";
|
|
3
|
+
import { b as L, P as le } from "./ply-CQ9dyX1o.mjs";
|
|
4
|
+
var _ = { exports: {} }, R = {};
|
|
5
|
+
/**
|
|
6
|
+
* @license React
|
|
7
|
+
* react-jsx-runtime.production.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
var F;
|
|
15
|
+
function ce() {
|
|
16
|
+
if (F) return R;
|
|
17
|
+
F = 1;
|
|
18
|
+
var c = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment");
|
|
19
|
+
function m(i, a, s) {
|
|
20
|
+
var u = null;
|
|
21
|
+
if (s !== void 0 && (u = "" + s), a.key !== void 0 && (u = "" + a.key), "key" in a) {
|
|
22
|
+
s = {};
|
|
23
|
+
for (var p in a)
|
|
24
|
+
p !== "key" && (s[p] = a[p]);
|
|
25
|
+
} else s = a;
|
|
26
|
+
return a = s.ref, {
|
|
27
|
+
$$typeof: c,
|
|
28
|
+
type: i,
|
|
29
|
+
key: u,
|
|
30
|
+
ref: a !== void 0 ? a : null,
|
|
31
|
+
props: s
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return R.Fragment = d, R.jsx = m, R.jsxs = m, R;
|
|
35
|
+
}
|
|
36
|
+
var b = {};
|
|
37
|
+
/**
|
|
38
|
+
* @license React
|
|
39
|
+
* react-jsx-runtime.development.js
|
|
40
|
+
*
|
|
41
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the MIT license found in the
|
|
44
|
+
* LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/
|
|
46
|
+
var I;
|
|
47
|
+
function ie() {
|
|
48
|
+
return I || (I = 1, process.env.NODE_ENV !== "production" && function() {
|
|
49
|
+
function c(e) {
|
|
50
|
+
if (e == null) return null;
|
|
51
|
+
if (typeof e == "function")
|
|
52
|
+
return e.$$typeof === K ? null : e.displayName || e.name || null;
|
|
53
|
+
if (typeof e == "string") return e;
|
|
54
|
+
switch (e) {
|
|
55
|
+
case T:
|
|
56
|
+
return "Fragment";
|
|
57
|
+
case V:
|
|
58
|
+
return "Profiler";
|
|
59
|
+
case J:
|
|
60
|
+
return "StrictMode";
|
|
61
|
+
case B:
|
|
62
|
+
return "Suspense";
|
|
63
|
+
case H:
|
|
64
|
+
return "SuspenseList";
|
|
65
|
+
case Q:
|
|
66
|
+
return "Activity";
|
|
67
|
+
}
|
|
68
|
+
if (typeof e == "object")
|
|
69
|
+
switch (typeof e.tag == "number" && console.error(
|
|
70
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
71
|
+
), e.$$typeof) {
|
|
72
|
+
case q:
|
|
73
|
+
return "Portal";
|
|
74
|
+
case G:
|
|
75
|
+
return (e.displayName || "Context") + ".Provider";
|
|
76
|
+
case z:
|
|
77
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
78
|
+
case X:
|
|
79
|
+
var r = e.render;
|
|
80
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
81
|
+
case Z:
|
|
82
|
+
return r = e.displayName || null, r !== null ? r : c(e.type) || "Memo";
|
|
83
|
+
case y:
|
|
84
|
+
r = e._payload, e = e._init;
|
|
85
|
+
try {
|
|
86
|
+
return c(e(r));
|
|
87
|
+
} catch {
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
function d(e) {
|
|
93
|
+
return "" + e;
|
|
94
|
+
}
|
|
95
|
+
function m(e) {
|
|
96
|
+
try {
|
|
97
|
+
d(e);
|
|
98
|
+
var r = !1;
|
|
99
|
+
} catch {
|
|
100
|
+
r = !0;
|
|
101
|
+
}
|
|
102
|
+
if (r) {
|
|
103
|
+
r = console;
|
|
104
|
+
var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
105
|
+
return t.call(
|
|
106
|
+
r,
|
|
107
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
108
|
+
n
|
|
109
|
+
), d(e);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function i(e) {
|
|
113
|
+
if (e === T) return "<>";
|
|
114
|
+
if (typeof e == "object" && e !== null && e.$$typeof === y)
|
|
115
|
+
return "<...>";
|
|
116
|
+
try {
|
|
117
|
+
var r = c(e);
|
|
118
|
+
return r ? "<" + r + ">" : "<...>";
|
|
119
|
+
} catch {
|
|
120
|
+
return "<...>";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function a() {
|
|
124
|
+
var e = k.A;
|
|
125
|
+
return e === null ? null : e.getOwner();
|
|
126
|
+
}
|
|
127
|
+
function s() {
|
|
128
|
+
return Error("react-stack-top-frame");
|
|
129
|
+
}
|
|
130
|
+
function u(e) {
|
|
131
|
+
if (j.call(e, "key")) {
|
|
132
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
133
|
+
if (r && r.isReactWarning) return !1;
|
|
134
|
+
}
|
|
135
|
+
return e.key !== void 0;
|
|
136
|
+
}
|
|
137
|
+
function p(e, r) {
|
|
138
|
+
function t() {
|
|
139
|
+
g || (g = !0, console.error(
|
|
140
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
141
|
+
r
|
|
142
|
+
));
|
|
143
|
+
}
|
|
144
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
145
|
+
get: t,
|
|
146
|
+
configurable: !0
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function W() {
|
|
150
|
+
var e = c(this.type);
|
|
151
|
+
return N[e] || (N[e] = !0, console.error(
|
|
152
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
153
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
154
|
+
}
|
|
155
|
+
function U(e, r, t, n, f, l, S, P) {
|
|
156
|
+
return t = l.ref, e = {
|
|
157
|
+
$$typeof: A,
|
|
158
|
+
type: e,
|
|
159
|
+
key: r,
|
|
160
|
+
props: l,
|
|
161
|
+
_owner: f
|
|
162
|
+
}, (t !== void 0 ? t : null) !== null ? Object.defineProperty(e, "ref", {
|
|
163
|
+
enumerable: !1,
|
|
164
|
+
get: W
|
|
165
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
166
|
+
configurable: !1,
|
|
167
|
+
enumerable: !1,
|
|
168
|
+
writable: !0,
|
|
169
|
+
value: 0
|
|
170
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
171
|
+
configurable: !1,
|
|
172
|
+
enumerable: !1,
|
|
173
|
+
writable: !0,
|
|
174
|
+
value: null
|
|
175
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
176
|
+
configurable: !1,
|
|
177
|
+
enumerable: !1,
|
|
178
|
+
writable: !0,
|
|
179
|
+
value: S
|
|
180
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
181
|
+
configurable: !1,
|
|
182
|
+
enumerable: !1,
|
|
183
|
+
writable: !0,
|
|
184
|
+
value: P
|
|
185
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
186
|
+
}
|
|
187
|
+
function O(e, r, t, n, f, l, S, P) {
|
|
188
|
+
var o = r.children;
|
|
189
|
+
if (o !== void 0)
|
|
190
|
+
if (n)
|
|
191
|
+
if (ee(o)) {
|
|
192
|
+
for (n = 0; n < o.length; n++)
|
|
193
|
+
x(o[n]);
|
|
194
|
+
Object.freeze && Object.freeze(o);
|
|
195
|
+
} else
|
|
196
|
+
console.error(
|
|
197
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
198
|
+
);
|
|
199
|
+
else x(o);
|
|
200
|
+
if (j.call(r, "key")) {
|
|
201
|
+
o = c(e);
|
|
202
|
+
var E = Object.keys(r).filter(function(re) {
|
|
203
|
+
return re !== "key";
|
|
204
|
+
});
|
|
205
|
+
n = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", M[o + n] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
207
|
+
let props = %s;
|
|
208
|
+
<%s {...props} />
|
|
209
|
+
React keys must be passed directly to JSX without using spread:
|
|
210
|
+
let props = %s;
|
|
211
|
+
<%s key={someKey} {...props} />`,
|
|
212
|
+
n,
|
|
213
|
+
o,
|
|
214
|
+
E,
|
|
215
|
+
o
|
|
216
|
+
), M[o + n] = !0);
|
|
217
|
+
}
|
|
218
|
+
if (o = null, t !== void 0 && (m(t), o = "" + t), u(r) && (m(r.key), o = "" + r.key), "key" in r) {
|
|
219
|
+
t = {};
|
|
220
|
+
for (var w in r)
|
|
221
|
+
w !== "key" && (t[w] = r[w]);
|
|
222
|
+
} else t = r;
|
|
223
|
+
return o && p(
|
|
224
|
+
t,
|
|
225
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
226
|
+
), U(
|
|
227
|
+
e,
|
|
228
|
+
o,
|
|
229
|
+
l,
|
|
230
|
+
f,
|
|
231
|
+
a(),
|
|
232
|
+
t,
|
|
233
|
+
S,
|
|
234
|
+
P
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
function x(e) {
|
|
238
|
+
typeof e == "object" && e !== null && e.$$typeof === A && e._store && (e._store.validated = 1);
|
|
239
|
+
}
|
|
240
|
+
var v = te, A = Symbol.for("react.transitional.element"), q = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), J = Symbol.for("react.strict_mode"), V = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), G = Symbol.for("react.context"), X = Symbol.for("react.forward_ref"), B = Symbol.for("react.suspense"), H = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), Q = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), k = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, ee = Array.isArray, h = console.createTask ? console.createTask : function() {
|
|
241
|
+
return null;
|
|
242
|
+
};
|
|
243
|
+
v = {
|
|
244
|
+
"react-stack-bottom-frame": function(e) {
|
|
245
|
+
return e();
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
var g, N = {}, C = v["react-stack-bottom-frame"].bind(
|
|
249
|
+
v,
|
|
250
|
+
s
|
|
251
|
+
)(), Y = h(i(s)), M = {};
|
|
252
|
+
b.Fragment = T, b.jsx = function(e, r, t, n, f) {
|
|
253
|
+
var l = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return O(
|
|
255
|
+
e,
|
|
256
|
+
r,
|
|
257
|
+
t,
|
|
258
|
+
!1,
|
|
259
|
+
n,
|
|
260
|
+
f,
|
|
261
|
+
l ? Error("react-stack-top-frame") : C,
|
|
262
|
+
l ? h(i(e)) : Y
|
|
263
|
+
);
|
|
264
|
+
}, b.jsxs = function(e, r, t, n, f) {
|
|
265
|
+
var l = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
266
|
+
return O(
|
|
267
|
+
e,
|
|
268
|
+
r,
|
|
269
|
+
t,
|
|
270
|
+
!0,
|
|
271
|
+
n,
|
|
272
|
+
f,
|
|
273
|
+
l ? Error("react-stack-top-frame") : C,
|
|
274
|
+
l ? h(i(e)) : Y
|
|
275
|
+
);
|
|
276
|
+
};
|
|
277
|
+
}()), b;
|
|
278
|
+
}
|
|
279
|
+
var $;
|
|
280
|
+
function fe() {
|
|
281
|
+
return $ || ($ = 1, process.env.NODE_ENV === "production" ? _.exports = ce() : _.exports = ie()), _.exports;
|
|
282
|
+
}
|
|
283
|
+
var de = fe();
|
|
284
|
+
let D = !1;
|
|
285
|
+
typeof window < "u" && !D && (se({ splatPrimitive: L }), D = !0);
|
|
286
|
+
const Re = ({
|
|
287
|
+
plyUrl: c,
|
|
288
|
+
splatOptions: d = {},
|
|
289
|
+
...m
|
|
290
|
+
}) => {
|
|
291
|
+
const i = ne(null), a = ue(le, c), s = oe(
|
|
292
|
+
() => [a, d || {}],
|
|
293
|
+
[a, d]
|
|
294
|
+
);
|
|
295
|
+
return ae(() => {
|
|
296
|
+
const u = i.current;
|
|
297
|
+
return u && !(u instanceof L) && console.warn(
|
|
298
|
+
"Visus: The 'Splat' component's internal mesh ref is not an instance of the core SplatMesh. This usually means `extend` was not called correctly. Please ensure you have called `extend({ splatPrimitive: SplatMesh })` in your R3F setup, where 'SplatMesh' is the class imported from 'visus' (or 'visus/react')."
|
|
299
|
+
), () => {
|
|
300
|
+
u && typeof u.dispose == "function" && u.dispose();
|
|
301
|
+
};
|
|
302
|
+
}, []), /* @__PURE__ */ de.jsx("splatPrimitive", { ref: i, args: s, ...m });
|
|
303
|
+
};
|
|
304
|
+
export {
|
|
305
|
+
le as PlyLoader,
|
|
306
|
+
Re as Splat,
|
|
307
|
+
L as SplatMesh
|
|
308
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@speridlabs/visus",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A web package for threejs that enables real time rendering of optimized 3DGS (Gaussian Splatting)",
|
|
5
|
+
"types": "dist/visus.d.ts",
|
|
6
|
+
"main": "dist/visus.umd.js",
|
|
7
|
+
"module": "dist/visus.es.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/main.d.ts",
|
|
11
|
+
"import": "./dist/main.es.js",
|
|
12
|
+
"require": "./dist/main.umd.js"
|
|
13
|
+
},
|
|
14
|
+
"./react": {
|
|
15
|
+
"types": "./dist/react.d.ts",
|
|
16
|
+
"import": "./dist/react.es.js",
|
|
17
|
+
"require": "./dist/react.umd.js"
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"dev": "vite",
|
|
26
|
+
"build": "pnpm lint && vite build",
|
|
27
|
+
"lint": "tsc --noEmit && eslint --max-warnings 0",
|
|
28
|
+
"lint:fix": "tsc --noEmit && eslint --fix",
|
|
29
|
+
"format": "prettier --check './**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc",
|
|
30
|
+
"format:fix": "prettier --write './**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc",
|
|
31
|
+
"prepare": "husky"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"threejs",
|
|
35
|
+
"react-three-fiber",
|
|
36
|
+
"r3f",
|
|
37
|
+
"3d",
|
|
38
|
+
"webgl",
|
|
39
|
+
"gaussian splatting",
|
|
40
|
+
"computer graphics"
|
|
41
|
+
],
|
|
42
|
+
"author": "Sperid Labs",
|
|
43
|
+
"license": "APACHE-2.0",
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@commitlint/cli": "^19.8.1",
|
|
46
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
47
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
48
|
+
"@eslint/js": "^9.23.0",
|
|
49
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
50
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
51
|
+
"@semantic-release/exec": "^7.0.3",
|
|
52
|
+
"@semantic-release/git": "^10.0.1",
|
|
53
|
+
"@semantic-release/github": "^11.0.2",
|
|
54
|
+
"@semantic-release/npm": "^12.0.1",
|
|
55
|
+
"@semantic-release/release-notes-generator": "^14.0.3",
|
|
56
|
+
"@types/node": "^22.13.14",
|
|
57
|
+
"@types/react": "^19.1.3",
|
|
58
|
+
"@types/three": "^0.175.0",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^8.28.0",
|
|
60
|
+
"@typescript-eslint/parser": "^8.28.0",
|
|
61
|
+
"conventional-changelog-conventionalcommits": "^8.0.0",
|
|
62
|
+
"eslint": "^9.23.0",
|
|
63
|
+
"eslint-config-prettier": "^10.1.1",
|
|
64
|
+
"eslint-plugin-prettier": "^5.2.5",
|
|
65
|
+
"eslint-plugin-react": "^7.37.5",
|
|
66
|
+
"globals": "^16.0.0",
|
|
67
|
+
"husky": "^9.1.7",
|
|
68
|
+
"lint-staged": "^15.5.1",
|
|
69
|
+
"prettier": "^3.5.3",
|
|
70
|
+
"semantic-release": "^24.2.3",
|
|
71
|
+
"typescript": "^5.8.2",
|
|
72
|
+
"vite": "^6.2.3",
|
|
73
|
+
"vite-plugin-dts": "^4.5.3"
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"@react-three/fiber": ">=8.0.0",
|
|
77
|
+
"react": ">=17.0.0",
|
|
78
|
+
"three": ">=0.160.0 <0.176.0"
|
|
79
|
+
},
|
|
80
|
+
"peerDependenciesMeta": {
|
|
81
|
+
"react": {
|
|
82
|
+
"optional": true
|
|
83
|
+
},
|
|
84
|
+
"@react-three/fiber": {
|
|
85
|
+
"optional": true
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"lint-staged": {
|
|
89
|
+
"{src,examples}/**/*.{ts,tsx,html,js,jsx,json,yml}": [
|
|
90
|
+
"prettier --write"
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
}
|