@gui-chat-plugin/present3d 0.0.2 → 0.0.3
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/core/samples.d.ts.map +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/index-B8W7aPbA.js +27687 -0
- package/dist/index-CIaq2DFf.cjs +4175 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/vue/Preview.vue.d.ts +2 -1
- package/dist/vue/Preview.vue.d.ts.map +1 -1
- package/dist/vue/View.vue.d.ts +2 -1
- package/dist/vue/View.vue.d.ts.map +1 -1
- package/dist/vue.cjs +2 -2
- package/dist/vue.js +222 -202
- package/package.json +19 -9
- package/dist/index-BXHIfuts.js +0 -20881
- package/dist/index-BrL881Mh.cjs +0 -3971
package/dist/vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { h as
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
const
|
|
1
|
+
import { C as yt, V as w, M as x, T as O, Q as X, S as G, a as y, R as wt, P as Pt, b as Et, c as $, d as J, e as tt, W as et, A as it, D as st, G as Dt, p as z, f as Y, s as St, g as Tt } from "./index-B8W7aPbA.js";
|
|
2
|
+
import { h as pe, i as de } from "./index-B8W7aPbA.js";
|
|
3
|
+
import { defineComponent as ot, ref as M, computed as at, onMounted as nt, nextTick as q, onUnmounted as rt, watch as R, createElementBlock as Z, openBlock as K, createElementVNode as _, createCommentVNode as vt, toDisplayString as C, createTextVNode as k, withDirectives as Mt, vModelText as Rt } from "vue";
|
|
4
|
+
const B = { type: "change" }, F = { type: "start" }, ht = { type: "end" }, j = new wt(), Q = new Pt(), Ot = Math.cos(70 * Et.DEG2RAD), d = new w(), f = 2 * Math.PI, h = {
|
|
5
5
|
NONE: -1,
|
|
6
6
|
ROTATE: 0,
|
|
7
7
|
DOLLY: 1,
|
|
@@ -11,74 +11,111 @@ const Q = { type: "change" }, F = { type: "start" }, lt = { type: "end" }, j = n
|
|
|
11
11
|
TOUCH_DOLLY_PAN: 5,
|
|
12
12
|
TOUCH_DOLLY_ROTATE: 6
|
|
13
13
|
}, U = 1e-6;
|
|
14
|
-
class
|
|
14
|
+
class xt extends yt {
|
|
15
|
+
/**
|
|
16
|
+
* Constructs a new controls instance.
|
|
17
|
+
*
|
|
18
|
+
* @param {Object3D} object - The object that is managed by the controls.
|
|
19
|
+
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
20
|
+
*/
|
|
15
21
|
constructor(t, e = null) {
|
|
16
|
-
super(t, e), this.state =
|
|
22
|
+
super(t, e), this.state = h.NONE, this.target = new w(), this.cursor = new w(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: x.ROTATE, MIDDLE: x.DOLLY, RIGHT: x.PAN }, this.touches = { ONE: O.ROTATE, TWO: O.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new w(), this._lastQuaternion = new X(), this._lastTargetPosition = new w(), this._quat = new X().setFromUnitVectors(t.up, new w(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new G(), this._sphericalDelta = new G(), this._scale = 1, this._panOffset = new w(), this._rotateStart = new y(), this._rotateEnd = new y(), this._rotateDelta = new y(), this._panStart = new y(), this._panEnd = new y(), this._panDelta = new y(), this._dollyStart = new y(), this._dollyEnd = new y(), this._dollyDelta = new y(), this._dollyDirection = new w(), this._mouse = new y(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Lt.bind(this), this._onPointerDown = Ct.bind(this), this._onPointerUp = At.bind(this), this._onContextMenu = Yt.bind(this), this._onMouseWheel = zt.bind(this), this._onKeyDown = Nt.bind(this), this._onTouchStart = It.bind(this), this._onTouchMove = Ut.bind(this), this._onMouseDown = kt.bind(this), this._onMouseMove = jt.bind(this), this._interceptControlDown = Zt.bind(this), this._interceptControlUp = Kt.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
17
23
|
}
|
|
18
|
-
connect() {
|
|
19
|
-
this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
|
24
|
+
connect(t) {
|
|
25
|
+
super.connect(t), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
|
20
26
|
}
|
|
21
27
|
disconnect() {
|
|
22
|
-
this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointercancel", this._onPointerUp), this.domElement.removeEventListener("wheel", this._onMouseWheel), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.stopListenToKeyEvents(), this.domElement.getRootNode().removeEventListener("keydown", this._interceptControlDown, { capture: !0 }), this.domElement.style.touchAction = "auto";
|
|
28
|
+
this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointercancel", this._onPointerUp), this.domElement.removeEventListener("wheel", this._onMouseWheel), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.stopListenToKeyEvents(), this.domElement.getRootNode().removeEventListener("keydown", this._interceptControlDown, { capture: !0 }), this.domElement.style.touchAction = "auto";
|
|
23
29
|
}
|
|
24
30
|
dispose() {
|
|
25
31
|
this.disconnect();
|
|
26
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the current vertical rotation, in radians.
|
|
35
|
+
*
|
|
36
|
+
* @return {number} The current vertical rotation, in radians.
|
|
37
|
+
*/
|
|
27
38
|
getPolarAngle() {
|
|
28
39
|
return this._spherical.phi;
|
|
29
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Get the current horizontal rotation, in radians.
|
|
43
|
+
*
|
|
44
|
+
* @return {number} The current horizontal rotation, in radians.
|
|
45
|
+
*/
|
|
30
46
|
getAzimuthalAngle() {
|
|
31
47
|
return this._spherical.theta;
|
|
32
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns the distance from the camera to the target.
|
|
51
|
+
*
|
|
52
|
+
* @return {number} The distance from the camera to the target.
|
|
53
|
+
*/
|
|
33
54
|
getDistance() {
|
|
34
55
|
return this.object.position.distanceTo(this.target);
|
|
35
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Adds key event listeners to the given DOM element.
|
|
59
|
+
* `window` is a recommended argument for using this method.
|
|
60
|
+
*
|
|
61
|
+
* @param {HTMLElement} domElement - The DOM element
|
|
62
|
+
*/
|
|
36
63
|
listenToKeyEvents(t) {
|
|
37
64
|
t.addEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = t;
|
|
38
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Removes the key event listener previously defined with `listenToKeyEvents()`.
|
|
68
|
+
*/
|
|
39
69
|
stopListenToKeyEvents() {
|
|
40
70
|
this._domElementKeyEvents !== null && (this._domElementKeyEvents.removeEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = null);
|
|
41
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Save the current state of the controls. This can later be recovered with `reset()`.
|
|
74
|
+
*/
|
|
42
75
|
saveState() {
|
|
43
76
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
|
44
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Reset the controls to their state from either the last time the `saveState()`
|
|
80
|
+
* was called, or the initial state.
|
|
81
|
+
*/
|
|
45
82
|
reset() {
|
|
46
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
83
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(B), this.update(), this.state = h.NONE;
|
|
47
84
|
}
|
|
48
85
|
update(t = null) {
|
|
49
86
|
const e = this.object.position;
|
|
50
|
-
d.copy(e).sub(this.target), d.applyQuaternion(this._quat), this._spherical.setFromVector3(d), this.autoRotate && this.state ===
|
|
87
|
+
d.copy(e).sub(this.target), d.applyQuaternion(this._quat), this._spherical.setFromVector3(d), this.autoRotate && this.state === h.NONE && this._rotateLeft(this._getAutoRotationAngle(t)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
|
51
88
|
let s = this.minAzimuthAngle, o = this.maxAzimuthAngle;
|
|
52
89
|
isFinite(s) && isFinite(o) && (s < -Math.PI ? s += f : s > Math.PI && (s -= f), o < -Math.PI ? o += f : o > Math.PI && (o -= f), s <= o ? this._spherical.theta = Math.max(s, Math.min(o, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + o) / 2 ? Math.max(s, this._spherical.theta) : Math.min(o, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
|
|
53
90
|
let n = !1;
|
|
54
91
|
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
|
|
55
92
|
this._spherical.radius = this._clampDistance(this._spherical.radius);
|
|
56
93
|
else {
|
|
57
|
-
const
|
|
58
|
-
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), n =
|
|
94
|
+
const l = this._spherical.radius;
|
|
95
|
+
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), n = l != this._spherical.radius;
|
|
59
96
|
}
|
|
60
97
|
if (d.setFromSpherical(this._spherical), d.applyQuaternion(this._quatInverse), e.copy(this.target).add(d), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
|
|
61
|
-
let
|
|
98
|
+
let l = null;
|
|
62
99
|
if (this.object.isPerspectiveCamera) {
|
|
63
100
|
const p = d.length();
|
|
64
|
-
|
|
65
|
-
const u = p -
|
|
101
|
+
l = this._clampDistance(p * this._scale);
|
|
102
|
+
const u = p - l;
|
|
66
103
|
this.object.position.addScaledVector(this._dollyDirection, u), this.object.updateMatrixWorld(), n = !!u;
|
|
67
104
|
} else if (this.object.isOrthographicCamera) {
|
|
68
|
-
const p = new
|
|
105
|
+
const p = new w(this._mouse.x, this._mouse.y, 0);
|
|
69
106
|
p.unproject(this.object);
|
|
70
107
|
const u = this.object.zoom;
|
|
71
108
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), n = u !== this.object.zoom;
|
|
72
|
-
const
|
|
73
|
-
|
|
109
|
+
const S = new w(this._mouse.x, this._mouse.y, 0);
|
|
110
|
+
S.unproject(this.object), this.object.position.sub(S).add(p), this.object.updateMatrixWorld(), l = d.length();
|
|
74
111
|
} else
|
|
75
112
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
76
|
-
|
|
113
|
+
l !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(l).add(this.object.position) : (j.origin.copy(this.object.position), j.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(j.direction)) < Ot ? this.object.lookAt(this.target) : (Q.setFromNormalAndCoplanarPoint(this.object.up, this.target), j.intersectPlane(Q, this.target))));
|
|
77
114
|
} else if (this.object.isOrthographicCamera) {
|
|
78
|
-
const
|
|
79
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)),
|
|
115
|
+
const l = this.object.zoom;
|
|
116
|
+
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), l !== this.object.zoom && (this.object.updateProjectionMatrix(), n = !0);
|
|
80
117
|
}
|
|
81
|
-
return this._scale = 1, this._performCursorZoom = !1, n || this._lastPosition.distanceToSquared(this.object.position) > U || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > U || this._lastTargetPosition.distanceToSquared(this.target) > U ? (this.dispatchEvent(
|
|
118
|
+
return this._scale = 1, this._performCursorZoom = !1, n || this._lastPosition.distanceToSquared(this.object.position) > U || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > U || this._lastTargetPosition.distanceToSquared(this.target) > U ? (this.dispatchEvent(B), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
82
119
|
}
|
|
83
120
|
_getAutoRotationAngle(t) {
|
|
84
121
|
return t !== null ? f / 60 * this.autoRotateSpeed * t : f / 60 / 60 * this.autoRotateSpeed;
|
|
@@ -119,8 +156,8 @@ class Lt extends Pt {
|
|
|
119
156
|
if (!this.zoomToCursor)
|
|
120
157
|
return;
|
|
121
158
|
this._performCursorZoom = !0;
|
|
122
|
-
const s = this.domElement.getBoundingClientRect(), o = t - s.left, n = e - s.top,
|
|
123
|
-
this._mouse.x = o /
|
|
159
|
+
const s = this.domElement.getBoundingClientRect(), o = t - s.left, n = e - s.top, l = s.width, p = s.height;
|
|
160
|
+
this._mouse.x = o / l * 2 - 1, this._mouse.y = -(n / p) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
|
|
124
161
|
}
|
|
125
162
|
_clampDistance(t) {
|
|
126
163
|
return Math.max(this.minDistance, Math.min(this.maxDistance, t));
|
|
@@ -218,8 +255,8 @@ class Lt extends Pt {
|
|
|
218
255
|
_handleTouchMoveDolly(t) {
|
|
219
256
|
const e = this._getSecondPointerPosition(t), s = t.pageX - e.x, o = t.pageY - e.y, n = Math.sqrt(s * s + o * o);
|
|
220
257
|
this._dollyEnd.set(0, n), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
|
|
221
|
-
const
|
|
222
|
-
this._updateZoomParameters(
|
|
258
|
+
const l = (t.pageX + e.x) * 0.5, p = (t.pageY + e.y) * 0.5;
|
|
259
|
+
this._updateZoomParameters(l, p);
|
|
223
260
|
}
|
|
224
261
|
_handleTouchMoveDollyPan(t) {
|
|
225
262
|
this.enableZoom && this._handleTouchMoveDolly(t), this.enablePan && this._handleTouchMovePan(t);
|
|
@@ -246,7 +283,7 @@ class Lt extends Pt {
|
|
|
246
283
|
}
|
|
247
284
|
_trackPointer(t) {
|
|
248
285
|
let e = this._pointerPositions[t.pointerId];
|
|
249
|
-
e === void 0 && (e = new
|
|
286
|
+
e === void 0 && (e = new y(), this._pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
|
|
250
287
|
}
|
|
251
288
|
_getSecondPointerPosition(t) {
|
|
252
289
|
const e = t.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
@@ -270,16 +307,16 @@ class Lt extends Pt {
|
|
|
270
307
|
return t.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
|
|
271
308
|
}
|
|
272
309
|
}
|
|
273
|
-
function
|
|
274
|
-
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
|
|
310
|
+
function Ct(i) {
|
|
311
|
+
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.ownerDocument.addEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
|
|
275
312
|
}
|
|
276
|
-
function
|
|
313
|
+
function Lt(i) {
|
|
277
314
|
this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
|
|
278
315
|
}
|
|
279
|
-
function
|
|
316
|
+
function At(i) {
|
|
280
317
|
switch (this._removePointer(i), this._pointers.length) {
|
|
281
318
|
case 0:
|
|
282
|
-
this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
319
|
+
this.domElement.releasePointerCapture(i.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ht), this.state = h.NONE;
|
|
283
320
|
break;
|
|
284
321
|
case 1:
|
|
285
322
|
const t = this._pointers[0], e = this._pointerPositions[t];
|
|
@@ -287,7 +324,7 @@ function jt(i) {
|
|
|
287
324
|
break;
|
|
288
325
|
}
|
|
289
326
|
}
|
|
290
|
-
function
|
|
327
|
+
function kt(i) {
|
|
291
328
|
let t;
|
|
292
329
|
switch (i.button) {
|
|
293
330
|
case 0:
|
|
@@ -305,146 +342,139 @@ function zt(i) {
|
|
|
305
342
|
switch (t) {
|
|
306
343
|
case x.DOLLY:
|
|
307
344
|
if (this.enableZoom === !1) return;
|
|
308
|
-
this._handleMouseDownDolly(i), this.state =
|
|
345
|
+
this._handleMouseDownDolly(i), this.state = h.DOLLY;
|
|
309
346
|
break;
|
|
310
347
|
case x.ROTATE:
|
|
311
348
|
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
|
312
349
|
if (this.enablePan === !1) return;
|
|
313
|
-
this._handleMouseDownPan(i), this.state =
|
|
350
|
+
this._handleMouseDownPan(i), this.state = h.PAN;
|
|
314
351
|
} else {
|
|
315
352
|
if (this.enableRotate === !1) return;
|
|
316
|
-
this._handleMouseDownRotate(i), this.state =
|
|
353
|
+
this._handleMouseDownRotate(i), this.state = h.ROTATE;
|
|
317
354
|
}
|
|
318
355
|
break;
|
|
319
356
|
case x.PAN:
|
|
320
357
|
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
|
321
358
|
if (this.enableRotate === !1) return;
|
|
322
|
-
this._handleMouseDownRotate(i), this.state =
|
|
359
|
+
this._handleMouseDownRotate(i), this.state = h.ROTATE;
|
|
323
360
|
} else {
|
|
324
361
|
if (this.enablePan === !1) return;
|
|
325
|
-
this._handleMouseDownPan(i), this.state =
|
|
362
|
+
this._handleMouseDownPan(i), this.state = h.PAN;
|
|
326
363
|
}
|
|
327
364
|
break;
|
|
328
365
|
default:
|
|
329
|
-
this.state =
|
|
366
|
+
this.state = h.NONE;
|
|
330
367
|
}
|
|
331
|
-
this.state !==
|
|
368
|
+
this.state !== h.NONE && this.dispatchEvent(F);
|
|
332
369
|
}
|
|
333
|
-
function
|
|
370
|
+
function jt(i) {
|
|
334
371
|
switch (this.state) {
|
|
335
|
-
case
|
|
372
|
+
case h.ROTATE:
|
|
336
373
|
if (this.enableRotate === !1) return;
|
|
337
374
|
this._handleMouseMoveRotate(i);
|
|
338
375
|
break;
|
|
339
|
-
case
|
|
376
|
+
case h.DOLLY:
|
|
340
377
|
if (this.enableZoom === !1) return;
|
|
341
378
|
this._handleMouseMoveDolly(i);
|
|
342
379
|
break;
|
|
343
|
-
case
|
|
380
|
+
case h.PAN:
|
|
344
381
|
if (this.enablePan === !1) return;
|
|
345
382
|
this._handleMouseMovePan(i);
|
|
346
383
|
break;
|
|
347
384
|
}
|
|
348
385
|
}
|
|
349
|
-
function
|
|
350
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !==
|
|
386
|
+
function zt(i) {
|
|
387
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== h.NONE || (i.preventDefault(), this.dispatchEvent(F), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(ht));
|
|
351
388
|
}
|
|
352
|
-
function
|
|
389
|
+
function Nt(i) {
|
|
353
390
|
this.enabled !== !1 && this._handleKeyDown(i);
|
|
354
391
|
}
|
|
355
|
-
function
|
|
392
|
+
function It(i) {
|
|
356
393
|
switch (this._trackPointer(i), this._pointers.length) {
|
|
357
394
|
case 1:
|
|
358
395
|
switch (this.touches.ONE) {
|
|
359
396
|
case O.ROTATE:
|
|
360
397
|
if (this.enableRotate === !1) return;
|
|
361
|
-
this._handleTouchStartRotate(i), this.state =
|
|
398
|
+
this._handleTouchStartRotate(i), this.state = h.TOUCH_ROTATE;
|
|
362
399
|
break;
|
|
363
400
|
case O.PAN:
|
|
364
401
|
if (this.enablePan === !1) return;
|
|
365
|
-
this._handleTouchStartPan(i), this.state =
|
|
402
|
+
this._handleTouchStartPan(i), this.state = h.TOUCH_PAN;
|
|
366
403
|
break;
|
|
367
404
|
default:
|
|
368
|
-
this.state =
|
|
405
|
+
this.state = h.NONE;
|
|
369
406
|
}
|
|
370
407
|
break;
|
|
371
408
|
case 2:
|
|
372
409
|
switch (this.touches.TWO) {
|
|
373
410
|
case O.DOLLY_PAN:
|
|
374
411
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
375
|
-
this._handleTouchStartDollyPan(i), this.state =
|
|
412
|
+
this._handleTouchStartDollyPan(i), this.state = h.TOUCH_DOLLY_PAN;
|
|
376
413
|
break;
|
|
377
414
|
case O.DOLLY_ROTATE:
|
|
378
415
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
379
|
-
this._handleTouchStartDollyRotate(i), this.state =
|
|
416
|
+
this._handleTouchStartDollyRotate(i), this.state = h.TOUCH_DOLLY_ROTATE;
|
|
380
417
|
break;
|
|
381
418
|
default:
|
|
382
|
-
this.state =
|
|
419
|
+
this.state = h.NONE;
|
|
383
420
|
}
|
|
384
421
|
break;
|
|
385
422
|
default:
|
|
386
|
-
this.state =
|
|
423
|
+
this.state = h.NONE;
|
|
387
424
|
}
|
|
388
|
-
this.state !==
|
|
425
|
+
this.state !== h.NONE && this.dispatchEvent(F);
|
|
389
426
|
}
|
|
390
|
-
function
|
|
427
|
+
function Ut(i) {
|
|
391
428
|
switch (this._trackPointer(i), this.state) {
|
|
392
|
-
case
|
|
429
|
+
case h.TOUCH_ROTATE:
|
|
393
430
|
if (this.enableRotate === !1) return;
|
|
394
431
|
this._handleTouchMoveRotate(i), this.update();
|
|
395
432
|
break;
|
|
396
|
-
case
|
|
433
|
+
case h.TOUCH_PAN:
|
|
397
434
|
if (this.enablePan === !1) return;
|
|
398
435
|
this._handleTouchMovePan(i), this.update();
|
|
399
436
|
break;
|
|
400
|
-
case
|
|
437
|
+
case h.TOUCH_DOLLY_PAN:
|
|
401
438
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
402
439
|
this._handleTouchMoveDollyPan(i), this.update();
|
|
403
440
|
break;
|
|
404
|
-
case
|
|
441
|
+
case h.TOUCH_DOLLY_ROTATE:
|
|
405
442
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
406
443
|
this._handleTouchMoveDollyRotate(i), this.update();
|
|
407
444
|
break;
|
|
408
445
|
default:
|
|
409
|
-
this.state =
|
|
446
|
+
this.state = h.NONE;
|
|
410
447
|
}
|
|
411
448
|
}
|
|
412
|
-
function
|
|
449
|
+
function Yt(i) {
|
|
413
450
|
this.enabled !== !1 && i.preventDefault();
|
|
414
451
|
}
|
|
415
|
-
function
|
|
452
|
+
function Zt(i) {
|
|
416
453
|
i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
417
454
|
}
|
|
418
|
-
function
|
|
455
|
+
function Kt(i) {
|
|
419
456
|
i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
420
457
|
}
|
|
421
|
-
const
|
|
458
|
+
const Ft = { class: "present3d-container" }, Ht = { class: "header" }, Vt = { class: "controls" }, Wt = { class: "material-icons" }, Xt = { class: "material-icons" }, Gt = {
|
|
422
459
|
key: 0,
|
|
423
460
|
class: "error"
|
|
424
|
-
},
|
|
461
|
+
}, qt = { class: "script-source" }, Bt = ["disabled"], Qt = /* @__PURE__ */ ot({
|
|
425
462
|
__name: "View",
|
|
426
463
|
props: {
|
|
427
464
|
selectedResult: {}
|
|
428
465
|
},
|
|
429
466
|
emits: ["updateResult"],
|
|
430
467
|
setup(i, { emit: t }) {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
});
|
|
436
|
-
let g, m, y, r, b, E, C = [], S = null, v = null;
|
|
437
|
-
rt(() => {
|
|
438
|
-
pt(), I(), H(), B(() => {
|
|
468
|
+
const e = i, s = t, o = M(e.selectedResult.data?.script ?? ""), n = M(null), l = M(null), p = M(!1), u = M(!0), S = at(() => o.value !== e.selectedResult.data?.script);
|
|
469
|
+
let b, m, g, r, P, E, T = [], D = null, L = null;
|
|
470
|
+
nt(() => {
|
|
471
|
+
ct(), I(), H(), q(() => {
|
|
439
472
|
V();
|
|
440
473
|
});
|
|
441
|
-
}),
|
|
442
|
-
|
|
474
|
+
}), rt(() => {
|
|
475
|
+
ft();
|
|
443
476
|
}), R(
|
|
444
|
-
() =>
|
|
445
|
-
var a;
|
|
446
|
-
return (a = e.selectedResult.data) == null ? void 0 : a.script;
|
|
447
|
-
},
|
|
477
|
+
() => e.selectedResult.data?.script,
|
|
448
478
|
() => {
|
|
449
479
|
I();
|
|
450
480
|
}
|
|
@@ -453,49 +483,47 @@ const Vt = { class: "present3d-container" }, Wt = { class: "header" }, Xt = { cl
|
|
|
453
483
|
}), R(u, (a) => {
|
|
454
484
|
E && (E.visible = a);
|
|
455
485
|
});
|
|
456
|
-
function
|
|
486
|
+
function ct() {
|
|
457
487
|
if (!n.value) return;
|
|
458
|
-
|
|
459
|
-
const a = n.value.clientWidth,
|
|
460
|
-
m = new
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
|
|
488
|
+
b = new $(), b.background = new J(1710618);
|
|
489
|
+
const a = n.value.clientWidth, c = n.value.clientHeight;
|
|
490
|
+
m = new tt(50, a / c, 0.1, 1e3), m.position.set(5, 5, 10), m.lookAt(0, 0, 0), g = new et({ antialias: !0 }), g.setSize(a, c), g.setPixelRatio(window.devicePixelRatio), n.value.appendChild(g.domElement), r = new xt(m, g.domElement), r.enableDamping = !0, r.dampingFactor = 0.05, r.addEventListener("change", W);
|
|
491
|
+
const v = new it(16777215, 0.6);
|
|
492
|
+
b.add(v);
|
|
493
|
+
const A = new st(16777215, 0.8);
|
|
494
|
+
A.position.set(10, 10, 10), b.add(A), E = new Dt(20, 20, 4473924, 2236962), E.visible = u.value, b.add(E), window.addEventListener("resize", N), L = new ResizeObserver(() => {
|
|
465
495
|
N();
|
|
466
|
-
}),
|
|
496
|
+
}), L.observe(n.value);
|
|
467
497
|
}
|
|
468
498
|
function N() {
|
|
469
499
|
if (!n.value) return;
|
|
470
|
-
const a = n.value.clientWidth,
|
|
471
|
-
m.aspect = a /
|
|
500
|
+
const a = n.value.clientWidth, c = n.value.clientHeight;
|
|
501
|
+
m.aspect = a / c, m.updateProjectionMatrix(), g.setSize(a, c);
|
|
472
502
|
}
|
|
473
503
|
function I() {
|
|
474
|
-
var a;
|
|
475
504
|
try {
|
|
476
|
-
|
|
477
|
-
const
|
|
478
|
-
if (!
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
} catch (
|
|
482
|
-
|
|
505
|
+
T.forEach((A) => b.remove(A)), T = [];
|
|
506
|
+
const a = e.selectedResult.data?.script;
|
|
507
|
+
if (!a) return;
|
|
508
|
+
const c = z(a), v = Y(c, { wireframe: p.value });
|
|
509
|
+
b.add(v), T.push(v), l.value = null;
|
|
510
|
+
} catch (a) {
|
|
511
|
+
l.value = a instanceof Error ? a.message : "Unknown error", console.error("ShapeScript parse error:", a);
|
|
483
512
|
}
|
|
484
513
|
}
|
|
485
514
|
function H() {
|
|
486
|
-
|
|
515
|
+
P = requestAnimationFrame(H), r.update(), g.render(b, m);
|
|
487
516
|
}
|
|
488
|
-
function
|
|
517
|
+
function pt() {
|
|
489
518
|
m.position.set(5, 5, 10), m.lookAt(0, 0, 0), r.reset();
|
|
490
519
|
}
|
|
491
520
|
function V() {
|
|
492
|
-
|
|
493
|
-
if (!m || !r || !((D = (h = e.selectedResult) == null ? void 0 : h.viewState) != null && D.cameraState))
|
|
521
|
+
if (!m || !r || !e.selectedResult?.viewState?.cameraState)
|
|
494
522
|
return;
|
|
495
523
|
const a = e.selectedResult.viewState.cameraState;
|
|
496
524
|
a.position && m.position.set(a.position.x, a.position.y, a.position.z), a.target && r.target.set(a.target.x, a.target.y, a.target.z), m.updateProjectionMatrix(), r.update();
|
|
497
525
|
}
|
|
498
|
-
function
|
|
526
|
+
function dt() {
|
|
499
527
|
return {
|
|
500
528
|
position: {
|
|
501
529
|
x: m.position.x,
|
|
@@ -510,31 +538,31 @@ const Vt = { class: "present3d-container" }, Wt = { class: "header" }, Xt = { cl
|
|
|
510
538
|
};
|
|
511
539
|
}
|
|
512
540
|
function W() {
|
|
513
|
-
|
|
514
|
-
|
|
541
|
+
D !== null && clearTimeout(D), D = window.setTimeout(() => {
|
|
542
|
+
ut();
|
|
515
543
|
}, 500);
|
|
516
544
|
}
|
|
517
|
-
function
|
|
545
|
+
function ut() {
|
|
518
546
|
const a = {
|
|
519
547
|
...e.selectedResult,
|
|
520
548
|
viewState: {
|
|
521
|
-
cameraState:
|
|
549
|
+
cameraState: dt()
|
|
522
550
|
}
|
|
523
551
|
};
|
|
524
552
|
s("updateResult", a);
|
|
525
553
|
}
|
|
526
|
-
function
|
|
554
|
+
function mt() {
|
|
527
555
|
p.value = !p.value;
|
|
528
556
|
}
|
|
529
|
-
function
|
|
557
|
+
function _t() {
|
|
530
558
|
u.value = !u.value;
|
|
531
559
|
}
|
|
560
|
+
function ft() {
|
|
561
|
+
D !== null && clearTimeout(D), P && cancelAnimationFrame(P), g && g.dispose(), r && (r.removeEventListener("change", W), r.dispose()), L && L.disconnect(), window.removeEventListener("resize", N);
|
|
562
|
+
}
|
|
532
563
|
function bt() {
|
|
533
|
-
S !== null && clearTimeout(S), b && cancelAnimationFrame(b), y && y.dispose(), r && (r.removeEventListener("change", W), r.dispose()), v && v.disconnect(), window.removeEventListener("resize", N);
|
|
534
564
|
}
|
|
535
565
|
function gt() {
|
|
536
|
-
}
|
|
537
|
-
function yt() {
|
|
538
566
|
try {
|
|
539
567
|
z(o.value);
|
|
540
568
|
const a = {
|
|
@@ -545,150 +573,142 @@ const Vt = { class: "present3d-container" }, Wt = { class: "header" }, Xt = { cl
|
|
|
545
573
|
};
|
|
546
574
|
s("updateResult", a);
|
|
547
575
|
} catch (a) {
|
|
548
|
-
|
|
576
|
+
l.value = a instanceof Error ? a.message : "Invalid ShapeScript", console.error("Script validation failed:", a);
|
|
549
577
|
}
|
|
550
578
|
}
|
|
551
579
|
return R(
|
|
552
|
-
() =>
|
|
553
|
-
var a;
|
|
554
|
-
return (a = e.selectedResult.data) == null ? void 0 : a.script;
|
|
555
|
-
},
|
|
580
|
+
() => e.selectedResult.data?.script,
|
|
556
581
|
(a) => {
|
|
557
582
|
a && (o.value = a);
|
|
558
583
|
}
|
|
559
584
|
), R(
|
|
560
585
|
() => e.selectedResult,
|
|
561
586
|
() => {
|
|
562
|
-
|
|
587
|
+
q(() => {
|
|
563
588
|
V();
|
|
564
589
|
});
|
|
565
590
|
}
|
|
566
|
-
), (a,
|
|
567
|
-
_("div",
|
|
568
|
-
_("h1", null,
|
|
569
|
-
_("div",
|
|
591
|
+
), (a, c) => (K(), Z("div", Ft, [
|
|
592
|
+
_("div", Ht, [
|
|
593
|
+
_("h1", null, C(i.selectedResult.title || "3D Visualization"), 1),
|
|
594
|
+
_("div", Vt, [
|
|
570
595
|
_("button", {
|
|
571
|
-
onClick:
|
|
596
|
+
onClick: pt,
|
|
572
597
|
class: "control-btn"
|
|
573
|
-
}, [...
|
|
598
|
+
}, [...c[1] || (c[1] = [
|
|
574
599
|
_("span", { class: "material-icons" }, "refresh", -1),
|
|
575
600
|
k(" Reset Camera ", -1)
|
|
576
601
|
])]),
|
|
577
602
|
_("button", {
|
|
578
|
-
onClick:
|
|
603
|
+
onClick: mt,
|
|
579
604
|
class: "control-btn"
|
|
580
605
|
}, [
|
|
581
|
-
_("span",
|
|
582
|
-
|
|
606
|
+
_("span", Wt, C(p.value ? "grid_off" : "grid_on"), 1),
|
|
607
|
+
c[2] || (c[2] = k(" Wireframe ", -1))
|
|
583
608
|
]),
|
|
584
609
|
_("button", {
|
|
585
|
-
onClick:
|
|
610
|
+
onClick: _t,
|
|
586
611
|
class: "control-btn"
|
|
587
612
|
}, [
|
|
588
|
-
_("span",
|
|
589
|
-
|
|
613
|
+
_("span", Xt, C(u.value ? "visibility_off" : "visibility"), 1),
|
|
614
|
+
c[3] || (c[3] = k(" Grid ", -1))
|
|
590
615
|
])
|
|
591
616
|
])
|
|
592
617
|
]),
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
k(" " +
|
|
596
|
-
])) :
|
|
618
|
+
l.value ? (K(), Z("div", Gt, [
|
|
619
|
+
c[4] || (c[4] = _("strong", null, "Parse Error:", -1)),
|
|
620
|
+
k(" " + C(l.value), 1)
|
|
621
|
+
])) : vt("", !0),
|
|
597
622
|
_("div", {
|
|
598
623
|
class: "viewport",
|
|
599
624
|
ref_key: "viewport",
|
|
600
625
|
ref: n
|
|
601
626
|
}, null, 512),
|
|
602
|
-
_("details",
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
"onUpdate:modelValue":
|
|
606
|
-
onInput:
|
|
627
|
+
_("details", qt, [
|
|
628
|
+
c[5] || (c[5] = _("summary", null, "Edit ShapeScript Source", -1)),
|
|
629
|
+
Mt(_("textarea", {
|
|
630
|
+
"onUpdate:modelValue": c[0] || (c[0] = (v) => o.value = v),
|
|
631
|
+
onInput: bt,
|
|
607
632
|
class: "script-editor",
|
|
608
633
|
spellcheck: "false"
|
|
609
634
|
}, null, 544), [
|
|
610
|
-
[
|
|
635
|
+
[Rt, o.value]
|
|
611
636
|
]),
|
|
612
637
|
_("button", {
|
|
613
|
-
onClick:
|
|
638
|
+
onClick: gt,
|
|
614
639
|
class: "apply-btn",
|
|
615
|
-
disabled: !
|
|
616
|
-
}, " Apply Changes ", 8,
|
|
640
|
+
disabled: !S.value
|
|
641
|
+
}, " Apply Changes ", 8, Bt)
|
|
617
642
|
])
|
|
618
643
|
]));
|
|
619
644
|
}
|
|
620
|
-
}),
|
|
645
|
+
}), lt = (i, t) => {
|
|
621
646
|
const e = i.__vccOpts || i;
|
|
622
647
|
for (const [s, o] of t)
|
|
623
648
|
e[s] = o;
|
|
624
649
|
return e;
|
|
625
|
-
},
|
|
650
|
+
}, $t = /* @__PURE__ */ lt(Qt, [["__scopeId", "data-v-daa337a0"]]), Jt = { class: "preview-container" }, te = { class: "preview-title" }, ee = /* @__PURE__ */ ot({
|
|
626
651
|
__name: "Preview",
|
|
627
652
|
props: {
|
|
628
653
|
result: {}
|
|
629
654
|
},
|
|
630
655
|
setup(i) {
|
|
631
|
-
const t = i, e =
|
|
632
|
-
let o, n,
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}),
|
|
636
|
-
|
|
656
|
+
const t = i, e = at(() => t.result.title || "3D Visualization"), s = M(null);
|
|
657
|
+
let o, n, l, p, u = null;
|
|
658
|
+
nt(() => {
|
|
659
|
+
S();
|
|
660
|
+
}), rt(() => {
|
|
661
|
+
g();
|
|
637
662
|
}), R(
|
|
638
|
-
() =>
|
|
639
|
-
var r;
|
|
640
|
-
return (r = t.result.data) == null ? void 0 : r.script;
|
|
641
|
-
},
|
|
663
|
+
() => t.result.data?.script,
|
|
642
664
|
() => {
|
|
643
665
|
m();
|
|
644
666
|
}
|
|
645
667
|
);
|
|
646
|
-
function
|
|
647
|
-
var r;
|
|
668
|
+
function S() {
|
|
648
669
|
if (s.value)
|
|
649
670
|
try {
|
|
650
|
-
o = new
|
|
651
|
-
const
|
|
652
|
-
n = new
|
|
653
|
-
const
|
|
654
|
-
o.add(
|
|
655
|
-
const
|
|
656
|
-
if (
|
|
657
|
-
const
|
|
658
|
-
u = Y(
|
|
659
|
-
} catch (
|
|
660
|
-
console.error("Preview render error:",
|
|
671
|
+
o = new $(), o.background = new J(2763322);
|
|
672
|
+
const r = s.value.clientWidth || 200, P = s.value.clientHeight || 150;
|
|
673
|
+
n = new tt(50, r / P, 0.1, 1e3), n.position.set(4, 4, 8), n.lookAt(0, 0, 0), l = new et({ antialias: !0, alpha: !1 }), l.setSize(r, P), l.setPixelRatio(Math.min(window.devicePixelRatio, 2)), s.value.appendChild(l.domElement);
|
|
674
|
+
const E = new it(16777215, 0.6);
|
|
675
|
+
o.add(E);
|
|
676
|
+
const T = new st(16777215, 0.8);
|
|
677
|
+
if (T.position.set(5, 5, 5), o.add(T), !t.result.data?.script) return;
|
|
678
|
+
const D = z(t.result.data.script);
|
|
679
|
+
u = Y(D, { wireframe: !1 }), o.add(u), b();
|
|
680
|
+
} catch (r) {
|
|
681
|
+
console.error("Preview render error:", r);
|
|
661
682
|
}
|
|
662
683
|
}
|
|
663
|
-
function
|
|
664
|
-
p = requestAnimationFrame(
|
|
684
|
+
function b() {
|
|
685
|
+
p = requestAnimationFrame(b);
|
|
665
686
|
const r = Date.now() * 5e-4;
|
|
666
|
-
n.position.x = Math.cos(r) * 8, n.position.z = Math.sin(r) * 8, n.lookAt(0, 0, 0),
|
|
687
|
+
n.position.x = Math.cos(r) * 8, n.position.z = Math.sin(r) * 8, n.lookAt(0, 0, 0), l.render(o, n);
|
|
667
688
|
}
|
|
668
689
|
function m() {
|
|
669
|
-
|
|
670
|
-
if (!(!o || !((r = t.result.data) != null && r.script)))
|
|
690
|
+
if (!(!o || !t.result.data?.script))
|
|
671
691
|
try {
|
|
672
692
|
u && o.remove(u);
|
|
673
|
-
const
|
|
674
|
-
u = Y(
|
|
675
|
-
} catch (
|
|
676
|
-
console.error("Preview reload error:",
|
|
693
|
+
const r = z(t.result.data.script);
|
|
694
|
+
u = Y(r, { wireframe: !1 }), o.add(u);
|
|
695
|
+
} catch (r) {
|
|
696
|
+
console.error("Preview reload error:", r);
|
|
677
697
|
}
|
|
678
698
|
}
|
|
679
|
-
function
|
|
680
|
-
p && cancelAnimationFrame(p),
|
|
699
|
+
function g() {
|
|
700
|
+
p && cancelAnimationFrame(p), l && l.dispose();
|
|
681
701
|
}
|
|
682
|
-
return (r,
|
|
702
|
+
return (r, P) => (K(), Z("div", Jt, [
|
|
683
703
|
_("div", {
|
|
684
704
|
ref_key: "previewViewport",
|
|
685
705
|
ref: s,
|
|
686
706
|
class: "preview-viewport"
|
|
687
707
|
}, null, 512),
|
|
688
|
-
_("div",
|
|
708
|
+
_("div", te, C(e.value), 1)
|
|
689
709
|
]));
|
|
690
710
|
}
|
|
691
|
-
}),
|
|
711
|
+
}), ie = /* @__PURE__ */ lt(ee, [["__scopeId", "data-v-75941188"]]), se = "present3D", oe = `Use the ${se} tool to create interactive 3D visualizations when the user requests:
|
|
692
712
|
- 3D models or shapes
|
|
693
713
|
- Mathematical visualizations (surfaces, functions, geometric patterns)
|
|
694
714
|
- Molecular or atomic structures
|
|
@@ -769,24 +789,24 @@ Shapes: cube, sphere, cylinder, cone, torus
|
|
|
769
789
|
CSG: union, difference, intersection, xor, stencil
|
|
770
790
|
Properties: position, rotation, size, color, opacity
|
|
771
791
|
|
|
772
|
-
Keep visualizations clear, well-organized, and leverage the full power of expressions and control flow.`,
|
|
773
|
-
...
|
|
774
|
-
viewComponent:
|
|
775
|
-
previewComponent:
|
|
776
|
-
samples:
|
|
777
|
-
systemPrompt:
|
|
778
|
-
},
|
|
792
|
+
Keep visualizations clear, well-organized, and leverage the full power of expressions and control flow.`, ae = {
|
|
793
|
+
...Tt,
|
|
794
|
+
viewComponent: $t,
|
|
795
|
+
previewComponent: ie,
|
|
796
|
+
samples: St,
|
|
797
|
+
systemPrompt: oe
|
|
798
|
+
}, he = { plugin: ae };
|
|
779
799
|
export {
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
800
|
+
ie as Preview,
|
|
801
|
+
oe as SYSTEM_PROMPT,
|
|
802
|
+
pe as TOOL_DEFINITION,
|
|
803
|
+
se as TOOL_NAME,
|
|
804
|
+
$t as View,
|
|
785
805
|
Y as astToThreeJS,
|
|
786
|
-
|
|
787
|
-
|
|
806
|
+
he as default,
|
|
807
|
+
de as executePresent3D,
|
|
788
808
|
z as parseShapeScript,
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
809
|
+
ae as plugin,
|
|
810
|
+
Tt as pluginCore,
|
|
811
|
+
St as samples
|
|
792
812
|
};
|