view3d-core 1.0.0 → 1.0.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/{SerializationPlugin-CBr1GY5q.js → SerializationPlugin-D418fw5V.js} +443 -436
- package/dist/SerializationPlugin-D418fw5V.js.map +1 -0
- package/dist/{SerializationPlugin-Cxn2UjuS.cjs → SerializationPlugin-DJVOx3pd.cjs} +377 -370
- package/dist/SerializationPlugin-DJVOx3pd.cjs.map +1 -0
- package/dist/index.cjs +108 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/plugins/index.cjs +1 -1
- package/dist/plugins/index.js +1 -1
- package/package.json +8 -7
- package/dist/SerializationPlugin-CBr1GY5q.js.map +0 -1
- package/dist/SerializationPlugin-Cxn2UjuS.cjs.map +0 -1
- package/dist/plugins/index.d.ts +0 -1
|
@@ -194,10 +194,10 @@ class L extends k {
|
|
|
194
194
|
this._controls.reset();
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
const
|
|
198
|
-
class
|
|
197
|
+
const H = { mode: "translate", space: "world", showX: true, showY: true, showZ: true, translationSnap: null, rotationSnap: null, scaleSnap: null };
|
|
198
|
+
class O extends k {
|
|
199
199
|
constructor(e4) {
|
|
200
|
-
super({ ...
|
|
200
|
+
super({ ...H, ...e4 }), this.name = "transform-controller", this.dependencies = ["orbit-controller"], this.box3Helper = null;
|
|
201
201
|
}
|
|
202
202
|
get controls() {
|
|
203
203
|
return this._controls;
|
|
@@ -495,20 +495,27 @@ function U(e4, n2) {
|
|
|
495
495
|
const s2 = n2.getBoundingClientRect();
|
|
496
496
|
return new t.Vector2((e4.clientX - s2.left) / s2.width * 2 - 1, -(e4.clientY - s2.top) / s2.height * 2 + 1);
|
|
497
497
|
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
498
|
+
const I = new t.Raycaster(), V = new t.Box3();
|
|
499
|
+
function N(e4, t2, n2) {
|
|
500
|
+
I.setFromCamera(e4, t2);
|
|
501
|
+
const s2 = [];
|
|
502
|
+
for (const e5 of n2) {
|
|
503
|
+
if (!e5.visible) continue;
|
|
504
|
+
const t3 = e5;
|
|
505
|
+
t3.isTransformControls || (t3.isHelper || "GridHelper" !== e5.type && "AxesHelper" !== e5.type && "AmbientLight" !== e5.type && "DirectionalLight" !== e5.type && "PointLight" !== e5.type && "SpotLight" !== e5.type && "HemisphereLight" !== e5.type && "TransformControls" !== e5.name && (V.setFromObject(e5), !V.isEmpty() && I.ray.intersectsBox(V) && s2.push(e5)));
|
|
506
|
+
}
|
|
507
|
+
if (0 === s2.length) return [];
|
|
508
|
+
return I.intersectObjects(s2, true).filter((e5) => {
|
|
509
|
+
const t3 = e5.object;
|
|
510
|
+
return !(t3.isTransformControls || "TransformControls" === t3.text) && t3.isMesh && t3.visible;
|
|
504
511
|
});
|
|
505
512
|
}
|
|
506
|
-
function
|
|
513
|
+
function X(e4) {
|
|
507
514
|
let t2 = e4;
|
|
508
515
|
for (; t2.parent && "Scene" !== t2.parent.type; ) t2 = t2.parent;
|
|
509
516
|
return t2;
|
|
510
517
|
}
|
|
511
|
-
function
|
|
518
|
+
function W(e4) {
|
|
512
519
|
const n2 = new t.Raycaster();
|
|
513
520
|
return { raycaster: n2, getIntersects(t2, s2) {
|
|
514
521
|
const i2 = G(t2);
|
|
@@ -517,10 +524,10 @@ function N(e4) {
|
|
|
517
524
|
n2.near = e5, n2.far = t2;
|
|
518
525
|
} };
|
|
519
526
|
}
|
|
520
|
-
const
|
|
521
|
-
class
|
|
527
|
+
const J = { modes: ["选择", "根选择", "变换", "场景绘制", "点击信息"], defaultMode: "变换", isTransformChildren: false, enableKeyboard: false };
|
|
528
|
+
class Y extends k {
|
|
522
529
|
constructor(e4) {
|
|
523
|
-
super({ ...
|
|
530
|
+
super({ ...J, ...e4 }), this.name = "editor", this.dependencies = ["transform-controller", "composer"], this._currentInfo = null, this.keydownHandler = null, this._mode = this.config.defaultMode || "变换";
|
|
524
531
|
}
|
|
525
532
|
get mode() {
|
|
526
533
|
return this._mode;
|
|
@@ -549,13 +556,13 @@ class W extends k {
|
|
|
549
556
|
const n2 = this.getPlugin("transform-controller"), s2 = this.getPlugin("composer");
|
|
550
557
|
if (!n2 || !s2) return null;
|
|
551
558
|
n2.detach();
|
|
552
|
-
const i2 = this.renderer.domElement.getBoundingClientRect(), o2 =
|
|
559
|
+
const i2 = this.renderer.domElement.getBoundingClientRect(), o2 = N(new t.Vector2((e4.clientX - i2.left) / i2.width * 2 - 1, -(e4.clientY - i2.top) / i2.height * 2 + 1), this.camera, this.scene.children).find((e5) => {
|
|
553
560
|
e5.object;
|
|
554
|
-
const t2 =
|
|
561
|
+
const t2 = X(e5.object);
|
|
555
562
|
return e5.object.visible && t2.visible;
|
|
556
563
|
});
|
|
557
564
|
if (!o2) return this._currentInfo = null, this.events.emit("click", { event: e4, info: null }), null;
|
|
558
|
-
const { object: r2, point: a2 } = o2, l2 =
|
|
565
|
+
const { object: r2, point: a2 } = o2, l2 = X(r2);
|
|
559
566
|
switch (this._mode) {
|
|
560
567
|
case "变换":
|
|
561
568
|
s2.clearOutlineObjects(), this.config.isTransformChildren ? n2.attach(r2) : n2.attach(l2);
|
|
@@ -617,7 +624,7 @@ class W extends k {
|
|
|
617
624
|
return (_a = this.pluginManager) == null ? void 0 : _a.get(e4);
|
|
618
625
|
}
|
|
619
626
|
}
|
|
620
|
-
function
|
|
627
|
+
function K(e4, t2) {
|
|
621
628
|
var n2 = e4.__state.conversionName.toString(), s2 = Math.round(e4.r), i2 = Math.round(e4.g), o2 = Math.round(e4.b), r2 = e4.a, a2 = Math.round(e4.h), l2 = e4.s.toFixed(1), d2 = e4.v.toFixed(1);
|
|
622
629
|
if (t2 || "THREE_CHAR_HEX" === n2 || "SIX_CHAR_HEX" === n2) {
|
|
623
630
|
for (var c2 = e4.hex.toString(16); c2.length < 6; ) c2 = "0" + c2;
|
|
@@ -625,27 +632,27 @@ function J(e4, t2) {
|
|
|
625
632
|
}
|
|
626
633
|
return "CSS_RGB" === n2 ? "rgb(" + s2 + "," + i2 + "," + o2 + ")" : "CSS_RGBA" === n2 ? "rgba(" + s2 + "," + i2 + "," + o2 + "," + r2 + ")" : "HEX" === n2 ? "0x" + e4.hex.toString(16) : "RGB_ARRAY" === n2 ? "[" + s2 + "," + i2 + "," + o2 + "]" : "RGBA_ARRAY" === n2 ? "[" + s2 + "," + i2 + "," + o2 + "," + r2 + "]" : "RGB_OBJ" === n2 ? "{r:" + s2 + ",g:" + i2 + ",b:" + o2 + "}" : "RGBA_OBJ" === n2 ? "{r:" + s2 + ",g:" + i2 + ",b:" + o2 + ",a:" + r2 + "}" : "HSV_OBJ" === n2 ? "{h:" + a2 + ",s:" + l2 + ",v:" + d2 + "}" : "HSVA_OBJ" === n2 ? "{h:" + a2 + ",s:" + l2 + ",v:" + d2 + ",a:" + r2 + "}" : "unknown format";
|
|
627
634
|
}
|
|
628
|
-
var
|
|
629
|
-
return this.each(
|
|
635
|
+
var Z = Array.prototype.forEach, q = Array.prototype.slice, Q = { BREAK: {}, extend: function(e4) {
|
|
636
|
+
return this.each(q.call(arguments, 1), function(t2) {
|
|
630
637
|
(this.isObject(t2) ? Object.keys(t2) : []).forEach((function(n2) {
|
|
631
638
|
this.isUndefined(t2[n2]) || (e4[n2] = t2[n2]);
|
|
632
639
|
}).bind(this));
|
|
633
640
|
}, this), e4;
|
|
634
641
|
}, defaults: function(e4) {
|
|
635
|
-
return this.each(
|
|
642
|
+
return this.each(q.call(arguments, 1), function(t2) {
|
|
636
643
|
(this.isObject(t2) ? Object.keys(t2) : []).forEach((function(n2) {
|
|
637
644
|
this.isUndefined(e4[n2]) && (e4[n2] = t2[n2]);
|
|
638
645
|
}).bind(this));
|
|
639
646
|
}, this), e4;
|
|
640
647
|
}, compose: function() {
|
|
641
|
-
var e4 =
|
|
648
|
+
var e4 = q.call(arguments);
|
|
642
649
|
return function() {
|
|
643
|
-
for (var t2 =
|
|
650
|
+
for (var t2 = q.call(arguments), n2 = e4.length - 1; n2 >= 0; n2--) t2 = [e4[n2].apply(this, t2)];
|
|
644
651
|
return t2[0];
|
|
645
652
|
};
|
|
646
653
|
}, each: function(e4, t2, n2) {
|
|
647
654
|
if (e4) {
|
|
648
|
-
if (
|
|
655
|
+
if (Z && e4.forEach && e4.forEach === Z) e4.forEach(t2, n2);
|
|
649
656
|
else if (e4.length === e4.length + 0) {
|
|
650
657
|
var s2, i2 = void 0;
|
|
651
658
|
for (i2 = 0, s2 = e4.length; i2 < s2; i2++) if (i2 in e4 && t2.call(n2, e4[i2], i2) === this.BREAK) return;
|
|
@@ -663,7 +670,7 @@ var Y = Array.prototype.forEach, K = Array.prototype.slice, Z = { BREAK: {}, ext
|
|
|
663
670
|
}, t2), r2 && e4.apply(i2, o2);
|
|
664
671
|
};
|
|
665
672
|
}, toArray: function(e4) {
|
|
666
|
-
return e4.toArray ? e4.toArray() :
|
|
673
|
+
return e4.toArray ? e4.toArray() : q.call(e4);
|
|
667
674
|
}, isUndefined: function(e4) {
|
|
668
675
|
return void 0 === e4;
|
|
669
676
|
}, isNull: function(e4) {
|
|
@@ -689,23 +696,23 @@ var Y = Array.prototype.forEach, K = Array.prototype.slice, Z = { BREAK: {}, ext
|
|
|
689
696
|
return false === e4 || true === e4;
|
|
690
697
|
}, isFunction: function(e4) {
|
|
691
698
|
return e4 instanceof Function;
|
|
692
|
-
} },
|
|
699
|
+
} }, $ = [{ litmus: Q.isString, conversions: { THREE_CHAR_HEX: { read: function(e4) {
|
|
693
700
|
var t2 = e4.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
|
|
694
701
|
return null !== t2 && { space: "HEX", hex: parseInt("0x" + t2[1].toString() + t2[1].toString() + t2[2].toString() + t2[2].toString() + t2[3].toString() + t2[3].toString(), 0) };
|
|
695
|
-
}, write:
|
|
702
|
+
}, write: K }, SIX_CHAR_HEX: { read: function(e4) {
|
|
696
703
|
var t2 = e4.match(/^#([A-F0-9]{6})$/i);
|
|
697
704
|
return null !== t2 && { space: "HEX", hex: parseInt("0x" + t2[1].toString(), 0) };
|
|
698
|
-
}, write:
|
|
705
|
+
}, write: K }, CSS_RGB: { read: function(e4) {
|
|
699
706
|
var t2 = e4.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);
|
|
700
707
|
return null !== t2 && { space: "RGB", r: parseFloat(t2[1]), g: parseFloat(t2[2]), b: parseFloat(t2[3]) };
|
|
701
|
-
}, write:
|
|
708
|
+
}, write: K }, CSS_RGBA: { read: function(e4) {
|
|
702
709
|
var t2 = e4.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);
|
|
703
710
|
return null !== t2 && { space: "RGB", r: parseFloat(t2[1]), g: parseFloat(t2[2]), b: parseFloat(t2[3]), a: parseFloat(t2[4]) };
|
|
704
|
-
}, write:
|
|
711
|
+
}, write: K } } }, { litmus: Q.isNumber, conversions: { HEX: { read: function(e4) {
|
|
705
712
|
return { space: "HEX", hex: e4, conversionName: "HEX" };
|
|
706
713
|
}, write: function(e4) {
|
|
707
714
|
return e4.hex;
|
|
708
|
-
} } } }, { litmus:
|
|
715
|
+
} } } }, { litmus: Q.isArray, conversions: { RGB_ARRAY: { read: function(e4) {
|
|
709
716
|
return 3 === e4.length && { space: "RGB", r: e4[0], g: e4[1], b: e4[2] };
|
|
710
717
|
}, write: function(e4) {
|
|
711
718
|
return [e4.r, e4.g, e4.b];
|
|
@@ -713,31 +720,31 @@ var Y = Array.prototype.forEach, K = Array.prototype.slice, Z = { BREAK: {}, ext
|
|
|
713
720
|
return 4 === e4.length && { space: "RGB", r: e4[0], g: e4[1], b: e4[2], a: e4[3] };
|
|
714
721
|
}, write: function(e4) {
|
|
715
722
|
return [e4.r, e4.g, e4.b, e4.a];
|
|
716
|
-
} } } }, { litmus:
|
|
717
|
-
return !!(
|
|
723
|
+
} } } }, { litmus: Q.isObject, conversions: { RGBA_OBJ: { read: function(e4) {
|
|
724
|
+
return !!(Q.isNumber(e4.r) && Q.isNumber(e4.g) && Q.isNumber(e4.b) && Q.isNumber(e4.a)) && { space: "RGB", r: e4.r, g: e4.g, b: e4.b, a: e4.a };
|
|
718
725
|
}, write: function(e4) {
|
|
719
726
|
return { r: e4.r, g: e4.g, b: e4.b, a: e4.a };
|
|
720
727
|
} }, RGB_OBJ: { read: function(e4) {
|
|
721
|
-
return !!(
|
|
728
|
+
return !!(Q.isNumber(e4.r) && Q.isNumber(e4.g) && Q.isNumber(e4.b)) && { space: "RGB", r: e4.r, g: e4.g, b: e4.b };
|
|
722
729
|
}, write: function(e4) {
|
|
723
730
|
return { r: e4.r, g: e4.g, b: e4.b };
|
|
724
731
|
} }, HSVA_OBJ: { read: function(e4) {
|
|
725
|
-
return !!(
|
|
732
|
+
return !!(Q.isNumber(e4.h) && Q.isNumber(e4.s) && Q.isNumber(e4.v) && Q.isNumber(e4.a)) && { space: "HSV", h: e4.h, s: e4.s, v: e4.v, a: e4.a };
|
|
726
733
|
}, write: function(e4) {
|
|
727
734
|
return { h: e4.h, s: e4.s, v: e4.v, a: e4.a };
|
|
728
735
|
} }, HSV_OBJ: { read: function(e4) {
|
|
729
|
-
return !!(
|
|
736
|
+
return !!(Q.isNumber(e4.h) && Q.isNumber(e4.s) && Q.isNumber(e4.v)) && { space: "HSV", h: e4.h, s: e4.s, v: e4.v };
|
|
730
737
|
}, write: function(e4) {
|
|
731
738
|
return { h: e4.h, s: e4.s, v: e4.v };
|
|
732
|
-
} } } }],
|
|
733
|
-
|
|
734
|
-
var e4 = arguments.length > 1 ?
|
|
735
|
-
return
|
|
736
|
-
if (t2.litmus(e4)) return
|
|
737
|
-
if (
|
|
738
|
-
}),
|
|
739
|
-
}),
|
|
740
|
-
},
|
|
739
|
+
} } } }], ee = void 0, te = void 0, ne = function() {
|
|
740
|
+
te = false;
|
|
741
|
+
var e4 = arguments.length > 1 ? Q.toArray(arguments) : arguments[0];
|
|
742
|
+
return Q.each($, function(t2) {
|
|
743
|
+
if (t2.litmus(e4)) return Q.each(t2.conversions, function(t3, n2) {
|
|
744
|
+
if (ee = t3.read(e4), false === te && false !== ee) return te = ee, ee.conversionName = n2, ee.conversion = t3, Q.BREAK;
|
|
745
|
+
}), Q.BREAK;
|
|
746
|
+
}), te;
|
|
747
|
+
}, se = void 0, ie = { hsv_to_rgb: function(e4, t2, n2) {
|
|
741
748
|
var s2 = Math.floor(e4 / 60) % 6, i2 = e4 / 60 - Math.floor(e4 / 60), o2 = n2 * (1 - t2), r2 = n2 * (1 - i2 * t2), a2 = n2 * (1 - (1 - i2) * t2), l2 = [[n2, a2, o2], [r2, n2, o2], [o2, n2, a2], [o2, r2, n2], [a2, o2, n2], [n2, o2, r2]][s2];
|
|
742
749
|
return { r: 255 * l2[0], g: 255 * l2[1], b: 255 * l2[2] };
|
|
743
750
|
}, rgb_to_hsv: function(e4, t2, n2) {
|
|
@@ -749,14 +756,14 @@ var Y = Array.prototype.forEach, K = Array.prototype.slice, Z = { BREAK: {}, ext
|
|
|
749
756
|
}, component_from_hex: function(e4, t2) {
|
|
750
757
|
return e4 >> 8 * t2 & 255;
|
|
751
758
|
}, hex_with_component: function(e4, t2, n2) {
|
|
752
|
-
return n2 << (
|
|
753
|
-
} },
|
|
759
|
+
return n2 << (se = 8 * t2) | e4 & ~(255 << se);
|
|
760
|
+
} }, oe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e4) {
|
|
754
761
|
return typeof e4;
|
|
755
762
|
} : function(e4) {
|
|
756
763
|
return e4 && "function" == typeof Symbol && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
|
|
757
|
-
},
|
|
764
|
+
}, re = function(e4, t2) {
|
|
758
765
|
if (!(e4 instanceof t2)) throw new TypeError("Cannot call a class as a function");
|
|
759
|
-
},
|
|
766
|
+
}, ae = /* @__PURE__ */ function() {
|
|
760
767
|
function e4(e5, t2) {
|
|
761
768
|
for (var n2 = 0; n2 < t2.length; n2++) {
|
|
762
769
|
var s2 = t2[n2];
|
|
@@ -766,7 +773,7 @@ var Y = Array.prototype.forEach, K = Array.prototype.slice, Z = { BREAK: {}, ext
|
|
|
766
773
|
return function(t2, n2, s2) {
|
|
767
774
|
return n2 && e4(t2.prototype, n2), s2 && e4(t2, s2), t2;
|
|
768
775
|
};
|
|
769
|
-
}(),
|
|
776
|
+
}(), le = function e2(t2, n2, s2) {
|
|
770
777
|
null === t2 && (t2 = Function.prototype);
|
|
771
778
|
var i2 = Object.getOwnPropertyDescriptor(t2, n2);
|
|
772
779
|
if (void 0 === i2) {
|
|
@@ -776,62 +783,62 @@ var Y = Array.prototype.forEach, K = Array.prototype.slice, Z = { BREAK: {}, ext
|
|
|
776
783
|
if ("value" in i2) return i2.value;
|
|
777
784
|
var r2 = i2.get;
|
|
778
785
|
return void 0 !== r2 ? r2.call(s2) : void 0;
|
|
779
|
-
},
|
|
786
|
+
}, de = function(e4, t2) {
|
|
780
787
|
if ("function" != typeof t2 && null !== t2) throw new TypeError("Super expression must either be null or a function, not " + typeof t2);
|
|
781
788
|
e4.prototype = Object.create(t2 && t2.prototype, { constructor: { value: e4, enumerable: false, writable: true, configurable: true } }), t2 && (Object.setPrototypeOf ? Object.setPrototypeOf(e4, t2) : e4.__proto__ = t2);
|
|
782
|
-
},
|
|
789
|
+
}, ce = function(e4, t2) {
|
|
783
790
|
if (!e4) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
784
791
|
return !t2 || "object" != typeof t2 && "function" != typeof t2 ? e4 : t2;
|
|
785
|
-
},
|
|
792
|
+
}, he = function() {
|
|
786
793
|
function e4() {
|
|
787
|
-
if (
|
|
794
|
+
if (re(this, e4), this.__state = ne.apply(this, arguments), false === this.__state) throw new Error("Failed to interpret color arguments");
|
|
788
795
|
this.__state.a = this.__state.a || 1;
|
|
789
796
|
}
|
|
790
|
-
return
|
|
791
|
-
return
|
|
797
|
+
return ae(e4, [{ key: "toString", value: function() {
|
|
798
|
+
return K(this);
|
|
792
799
|
} }, { key: "toHexString", value: function() {
|
|
793
|
-
return
|
|
800
|
+
return K(this, true);
|
|
794
801
|
} }, { key: "toOriginal", value: function() {
|
|
795
802
|
return this.__state.conversion.write(this);
|
|
796
803
|
} }]), e4;
|
|
797
804
|
}();
|
|
798
|
-
function
|
|
805
|
+
function ue(e4, t2, n2) {
|
|
799
806
|
Object.defineProperty(e4, t2, { get: function() {
|
|
800
|
-
return "RGB" === this.__state.space ||
|
|
807
|
+
return "RGB" === this.__state.space || he.recalculateRGB(this, t2, n2), this.__state[t2];
|
|
801
808
|
}, set: function(e5) {
|
|
802
|
-
"RGB" !== this.__state.space && (
|
|
809
|
+
"RGB" !== this.__state.space && (he.recalculateRGB(this, t2, n2), this.__state.space = "RGB"), this.__state[t2] = e5;
|
|
803
810
|
} });
|
|
804
811
|
}
|
|
805
|
-
function
|
|
812
|
+
function me(e4, t2) {
|
|
806
813
|
Object.defineProperty(e4, t2, { get: function() {
|
|
807
|
-
return "HSV" === this.__state.space ||
|
|
814
|
+
return "HSV" === this.__state.space || he.recalculateHSV(this), this.__state[t2];
|
|
808
815
|
}, set: function(e5) {
|
|
809
|
-
"HSV" !== this.__state.space && (
|
|
816
|
+
"HSV" !== this.__state.space && (he.recalculateHSV(this), this.__state.space = "HSV"), this.__state[t2] = e5;
|
|
810
817
|
} });
|
|
811
818
|
}
|
|
812
|
-
|
|
813
|
-
if ("HEX" === e4.__state.space) e4.__state[t2] =
|
|
819
|
+
he.recalculateRGB = function(e4, t2, n2) {
|
|
820
|
+
if ("HEX" === e4.__state.space) e4.__state[t2] = ie.component_from_hex(e4.__state.hex, n2);
|
|
814
821
|
else {
|
|
815
822
|
if ("HSV" !== e4.__state.space) throw new Error("Corrupted color state");
|
|
816
|
-
|
|
823
|
+
Q.extend(e4.__state, ie.hsv_to_rgb(e4.__state.h, e4.__state.s, e4.__state.v));
|
|
817
824
|
}
|
|
818
|
-
},
|
|
819
|
-
var t2 =
|
|
820
|
-
|
|
821
|
-
},
|
|
825
|
+
}, he.recalculateHSV = function(e4) {
|
|
826
|
+
var t2 = ie.rgb_to_hsv(e4.r, e4.g, e4.b);
|
|
827
|
+
Q.extend(e4.__state, { s: t2.s, v: t2.v }), Q.isNaN(t2.h) ? Q.isUndefined(e4.__state.h) && (e4.__state.h = 0) : e4.__state.h = t2.h;
|
|
828
|
+
}, he.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"], ue(he.prototype, "r", 2), ue(he.prototype, "g", 1), ue(he.prototype, "b", 0), me(he.prototype, "h"), me(he.prototype, "s"), me(he.prototype, "v"), Object.defineProperty(he.prototype, "a", { get: function() {
|
|
822
829
|
return this.__state.a;
|
|
823
830
|
}, set: function(e4) {
|
|
824
831
|
this.__state.a = e4;
|
|
825
|
-
} }), Object.defineProperty(
|
|
826
|
-
return "HEX" !== this.__state.space && (this.__state.hex =
|
|
832
|
+
} }), Object.defineProperty(he.prototype, "hex", { get: function() {
|
|
833
|
+
return "HEX" !== this.__state.space && (this.__state.hex = ie.rgb_to_hex(this.r, this.g, this.b), this.__state.space = "HEX"), this.__state.hex;
|
|
827
834
|
}, set: function(e4) {
|
|
828
835
|
this.__state.space = "HEX", this.__state.hex = e4;
|
|
829
836
|
} });
|
|
830
|
-
var
|
|
837
|
+
var pe = function() {
|
|
831
838
|
function e4(t2, n2) {
|
|
832
|
-
|
|
839
|
+
re(this, e4), this.initialValue = t2[n2], this.domElement = document.createElement("div"), this.object = t2, this.property = n2, this.__onChange = void 0, this.__onFinishChange = void 0;
|
|
833
840
|
}
|
|
834
|
-
return
|
|
841
|
+
return ae(e4, [{ key: "onChange", value: function(e5) {
|
|
835
842
|
return this.__onChange = e5, this;
|
|
836
843
|
} }, { key: "onFinishChange", value: function(e5) {
|
|
837
844
|
return this.__onFinishChange = e5, this;
|
|
@@ -844,28 +851,28 @@ var ue = function() {
|
|
|
844
851
|
} }, { key: "isModified", value: function() {
|
|
845
852
|
return this.initialValue !== this.getValue();
|
|
846
853
|
} }]), e4;
|
|
847
|
-
}(),
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
854
|
+
}(), fe = {};
|
|
855
|
+
Q.each({ HTMLEvents: ["change"], MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"], KeyboardEvents: ["keydown"] }, function(e4, t2) {
|
|
856
|
+
Q.each(e4, function(e5) {
|
|
857
|
+
fe[e5] = t2;
|
|
851
858
|
});
|
|
852
859
|
});
|
|
853
|
-
var
|
|
854
|
-
function
|
|
855
|
-
if ("0" === e4 ||
|
|
856
|
-
var t2 = e4.match(
|
|
857
|
-
return
|
|
860
|
+
var ge = /(\d+(\.\d+)?)px/;
|
|
861
|
+
function _e(e4) {
|
|
862
|
+
if ("0" === e4 || Q.isUndefined(e4)) return 0;
|
|
863
|
+
var t2 = e4.match(ge);
|
|
864
|
+
return Q.isNull(t2) ? 0 : parseFloat(t2[1]);
|
|
858
865
|
}
|
|
859
|
-
var
|
|
866
|
+
var ve = { makeSelectable: function(e4, t2) {
|
|
860
867
|
void 0 !== e4 && void 0 !== e4.style && (e4.onselectstart = t2 ? function() {
|
|
861
868
|
return false;
|
|
862
869
|
} : function() {
|
|
863
870
|
}, e4.style.MozUserSelect = t2 ? "auto" : "none", e4.style.KhtmlUserSelect = t2 ? "auto" : "none", e4.unselectable = t2 ? "on" : "off");
|
|
864
871
|
}, makeFullscreen: function(e4, t2, n2) {
|
|
865
872
|
var s2 = n2, i2 = t2;
|
|
866
|
-
|
|
873
|
+
Q.isUndefined(i2) && (i2 = true), Q.isUndefined(s2) && (s2 = true), e4.style.position = "absolute", i2 && (e4.style.left = 0, e4.style.right = 0), s2 && (e4.style.top = 0, e4.style.bottom = 0);
|
|
867
874
|
}, fakeEvent: function(e4, t2, n2, s2) {
|
|
868
|
-
var i2 = n2 || {}, o2 =
|
|
875
|
+
var i2 = n2 || {}, o2 = fe[t2];
|
|
869
876
|
if (!o2) throw new Error("Event type " + t2 + " not supported.");
|
|
870
877
|
var r2 = document.createEvent(o2);
|
|
871
878
|
switch (o2) {
|
|
@@ -875,25 +882,25 @@ var ge = { makeSelectable: function(e4, t2) {
|
|
|
875
882
|
break;
|
|
876
883
|
case "KeyboardEvents":
|
|
877
884
|
var d2 = r2.initKeyboardEvent || r2.initKeyEvent;
|
|
878
|
-
|
|
885
|
+
Q.defaults(i2, { cancelable: true, ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, keyCode: void 0, charCode: void 0 }), d2(t2, i2.bubbles || false, i2.cancelable, window, i2.ctrlKey, i2.altKey, i2.shiftKey, i2.metaKey, i2.keyCode, i2.charCode);
|
|
879
886
|
break;
|
|
880
887
|
default:
|
|
881
888
|
r2.initEvent(t2, i2.bubbles || false, i2.cancelable || true);
|
|
882
889
|
}
|
|
883
|
-
|
|
890
|
+
Q.defaults(r2, s2), e4.dispatchEvent(r2);
|
|
884
891
|
}, bind: function(e4, t2, n2, s2) {
|
|
885
892
|
var i2 = s2 || false;
|
|
886
|
-
return e4.addEventListener ? e4.addEventListener(t2, n2, i2) : e4.attachEvent && e4.attachEvent("on" + t2, n2),
|
|
893
|
+
return e4.addEventListener ? e4.addEventListener(t2, n2, i2) : e4.attachEvent && e4.attachEvent("on" + t2, n2), ve;
|
|
887
894
|
}, unbind: function(e4, t2, n2, s2) {
|
|
888
895
|
var i2 = s2 || false;
|
|
889
|
-
return e4.removeEventListener ? e4.removeEventListener(t2, n2, i2) : e4.detachEvent && e4.detachEvent("on" + t2, n2),
|
|
896
|
+
return e4.removeEventListener ? e4.removeEventListener(t2, n2, i2) : e4.detachEvent && e4.detachEvent("on" + t2, n2), ve;
|
|
890
897
|
}, addClass: function(e4, t2) {
|
|
891
898
|
if (void 0 === e4.className) e4.className = t2;
|
|
892
899
|
else if (e4.className !== t2) {
|
|
893
900
|
var n2 = e4.className.split(/ +/);
|
|
894
901
|
-1 === n2.indexOf(t2) && (n2.push(t2), e4.className = n2.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""));
|
|
895
902
|
}
|
|
896
|
-
return
|
|
903
|
+
return ve;
|
|
897
904
|
}, removeClass: function(e4, t2) {
|
|
898
905
|
if (t2) if (e4.className === t2) e4.removeAttribute("class");
|
|
899
906
|
else {
|
|
@@ -901,15 +908,15 @@ var ge = { makeSelectable: function(e4, t2) {
|
|
|
901
908
|
-1 !== s2 && (n2.splice(s2, 1), e4.className = n2.join(" "));
|
|
902
909
|
}
|
|
903
910
|
else e4.className = void 0;
|
|
904
|
-
return
|
|
911
|
+
return ve;
|
|
905
912
|
}, hasClass: function(e4, t2) {
|
|
906
913
|
return new RegExp("(?:^|\\s+)" + t2 + "(?:\\s+|$)").test(e4.className) || false;
|
|
907
914
|
}, getWidth: function(e4) {
|
|
908
915
|
var t2 = getComputedStyle(e4);
|
|
909
|
-
return
|
|
916
|
+
return _e(t2["border-left-width"]) + _e(t2["border-right-width"]) + _e(t2["padding-left"]) + _e(t2["padding-right"]) + _e(t2.width);
|
|
910
917
|
}, getHeight: function(e4) {
|
|
911
918
|
var t2 = getComputedStyle(e4);
|
|
912
|
-
return
|
|
919
|
+
return _e(t2["border-top-width"]) + _e(t2["border-bottom-width"]) + _e(t2["padding-top"]) + _e(t2["padding-bottom"]) + _e(t2.height);
|
|
913
920
|
}, getOffset: function(e4) {
|
|
914
921
|
var t2 = e4, n2 = { left: 0, top: 0 };
|
|
915
922
|
if (t2.offsetParent) do {
|
|
@@ -918,86 +925,86 @@ var ge = { makeSelectable: function(e4, t2) {
|
|
|
918
925
|
return n2;
|
|
919
926
|
}, isActive: function(e4) {
|
|
920
927
|
return e4 === document.activeElement && (e4.type || e4.href);
|
|
921
|
-
} },
|
|
928
|
+
} }, be = function() {
|
|
922
929
|
function e4(t2, n2) {
|
|
923
|
-
|
|
924
|
-
var s2 =
|
|
925
|
-
return s2.__prev = s2.getValue(), s2.__checkbox = document.createElement("input"), s2.__checkbox.setAttribute("type", "checkbox"),
|
|
930
|
+
re(this, e4);
|
|
931
|
+
var s2 = ce(this, (e4.__proto__ || Object.getPrototypeOf(e4)).call(this, t2, n2)), i2 = s2;
|
|
932
|
+
return s2.__prev = s2.getValue(), s2.__checkbox = document.createElement("input"), s2.__checkbox.setAttribute("type", "checkbox"), ve.bind(s2.__checkbox, "change", function() {
|
|
926
933
|
i2.setValue(!i2.__prev);
|
|
927
934
|
}, false), s2.domElement.appendChild(s2.__checkbox), s2.updateDisplay(), s2;
|
|
928
935
|
}
|
|
929
|
-
return
|
|
930
|
-
var n2 =
|
|
936
|
+
return de(e4, pe), ae(e4, [{ key: "setValue", value: function(t2) {
|
|
937
|
+
var n2 = le(e4.prototype.__proto__ || Object.getPrototypeOf(e4.prototype), "setValue", this).call(this, t2);
|
|
931
938
|
return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.__prev = this.getValue(), n2;
|
|
932
939
|
} }, { key: "updateDisplay", value: function() {
|
|
933
|
-
return true === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"), this.__checkbox.checked = true, this.__prev = true) : (this.__checkbox.checked = false, this.__prev = false),
|
|
940
|
+
return true === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"), this.__checkbox.checked = true, this.__prev = true) : (this.__checkbox.checked = false, this.__prev = false), le(e4.prototype.__proto__ || Object.getPrototypeOf(e4.prototype), "updateDisplay", this).call(this);
|
|
934
941
|
} }]), e4;
|
|
935
|
-
}(),
|
|
942
|
+
}(), ye = function() {
|
|
936
943
|
function e4(t2, n2, s2) {
|
|
937
|
-
|
|
938
|
-
var i2 =
|
|
939
|
-
if (i2.__select = document.createElement("select"),
|
|
944
|
+
re(this, e4);
|
|
945
|
+
var i2 = ce(this, (e4.__proto__ || Object.getPrototypeOf(e4)).call(this, t2, n2)), o2 = s2, r2 = i2;
|
|
946
|
+
if (i2.__select = document.createElement("select"), Q.isArray(o2)) {
|
|
940
947
|
var a2 = {};
|
|
941
|
-
|
|
948
|
+
Q.each(o2, function(e5) {
|
|
942
949
|
a2[e5] = e5;
|
|
943
950
|
}), o2 = a2;
|
|
944
951
|
}
|
|
945
|
-
return
|
|
952
|
+
return Q.each(o2, function(e5, t3) {
|
|
946
953
|
var n3 = document.createElement("option");
|
|
947
954
|
n3.innerHTML = t3, n3.setAttribute("value", e5), r2.__select.appendChild(n3);
|
|
948
|
-
}), i2.updateDisplay(),
|
|
955
|
+
}), i2.updateDisplay(), ve.bind(i2.__select, "change", function() {
|
|
949
956
|
var e5 = this.options[this.selectedIndex].value;
|
|
950
957
|
r2.setValue(e5);
|
|
951
958
|
}), i2.domElement.appendChild(i2.__select), i2;
|
|
952
959
|
}
|
|
953
|
-
return
|
|
954
|
-
var n2 =
|
|
960
|
+
return de(e4, pe), ae(e4, [{ key: "setValue", value: function(t2) {
|
|
961
|
+
var n2 = le(e4.prototype.__proto__ || Object.getPrototypeOf(e4.prototype), "setValue", this).call(this, t2);
|
|
955
962
|
return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), n2;
|
|
956
963
|
} }, { key: "updateDisplay", value: function() {
|
|
957
|
-
return
|
|
964
|
+
return ve.isActive(this.__select) ? this : (this.__select.value = this.getValue(), le(e4.prototype.__proto__ || Object.getPrototypeOf(e4.prototype), "updateDisplay", this).call(this));
|
|
958
965
|
} }]), e4;
|
|
959
|
-
}(),
|
|
966
|
+
}(), we = function() {
|
|
960
967
|
function e4(t2, n2) {
|
|
961
|
-
|
|
962
|
-
var s2 =
|
|
968
|
+
re(this, e4);
|
|
969
|
+
var s2 = ce(this, (e4.__proto__ || Object.getPrototypeOf(e4)).call(this, t2, n2)), i2 = s2;
|
|
963
970
|
function o2() {
|
|
964
971
|
i2.setValue(i2.__input.value);
|
|
965
972
|
}
|
|
966
|
-
return s2.__input = document.createElement("input"), s2.__input.setAttribute("type", "text"),
|
|
973
|
+
return s2.__input = document.createElement("input"), s2.__input.setAttribute("type", "text"), ve.bind(s2.__input, "keyup", o2), ve.bind(s2.__input, "change", o2), ve.bind(s2.__input, "blur", function() {
|
|
967
974
|
i2.__onFinishChange && i2.__onFinishChange.call(i2, i2.getValue());
|
|
968
|
-
}),
|
|
975
|
+
}), ve.bind(s2.__input, "keydown", function(e5) {
|
|
969
976
|
13 === e5.keyCode && this.blur();
|
|
970
977
|
}), s2.updateDisplay(), s2.domElement.appendChild(s2.__input), s2;
|
|
971
978
|
}
|
|
972
|
-
return
|
|
973
|
-
return
|
|
979
|
+
return de(e4, pe), ae(e4, [{ key: "updateDisplay", value: function() {
|
|
980
|
+
return ve.isActive(this.__input) || (this.__input.value = this.getValue()), le(e4.prototype.__proto__ || Object.getPrototypeOf(e4.prototype), "updateDisplay", this).call(this);
|
|
974
981
|
} }]), e4;
|
|
975
982
|
}();
|
|
976
|
-
function
|
|
983
|
+
function xe(e4) {
|
|
977
984
|
var t2 = e4.toString();
|
|
978
985
|
return t2.indexOf(".") > -1 ? t2.length - t2.indexOf(".") - 1 : 0;
|
|
979
986
|
}
|
|
980
|
-
var
|
|
987
|
+
var Ce = function() {
|
|
981
988
|
function e4(t2, n2, s2) {
|
|
982
|
-
|
|
983
|
-
var i2 =
|
|
984
|
-
return i2.__min = o2.min, i2.__max = o2.max, i2.__step = o2.step,
|
|
989
|
+
re(this, e4);
|
|
990
|
+
var i2 = ce(this, (e4.__proto__ || Object.getPrototypeOf(e4)).call(this, t2, n2)), o2 = s2 || {};
|
|
991
|
+
return i2.__min = o2.min, i2.__max = o2.max, i2.__step = o2.step, Q.isUndefined(i2.__step) ? 0 === i2.initialValue ? i2.__impliedStep = 1 : i2.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(i2.initialValue)) / Math.LN10)) / 10 : i2.__impliedStep = i2.__step, i2.__precision = xe(i2.__impliedStep), i2;
|
|
985
992
|
}
|
|
986
|
-
return
|
|
993
|
+
return de(e4, pe), ae(e4, [{ key: "setValue", value: function(t2) {
|
|
987
994
|
var n2 = t2;
|
|
988
|
-
return void 0 !== this.__min && n2 < this.__min ? n2 = this.__min : void 0 !== this.__max && n2 > this.__max && (n2 = this.__max), void 0 !== this.__step && n2 % this.__step !== 0 && (n2 = Math.round(n2 / this.__step) * this.__step),
|
|
995
|
+
return void 0 !== this.__min && n2 < this.__min ? n2 = this.__min : void 0 !== this.__max && n2 > this.__max && (n2 = this.__max), void 0 !== this.__step && n2 % this.__step !== 0 && (n2 = Math.round(n2 / this.__step) * this.__step), le(e4.prototype.__proto__ || Object.getPrototypeOf(e4.prototype), "setValue", this).call(this, n2);
|
|
989
996
|
} }, { key: "min", value: function(e5) {
|
|
990
997
|
return this.__min = e5, this;
|
|
991
998
|
} }, { key: "max", value: function(e5) {
|
|
992
999
|
return this.__max = e5, this;
|
|
993
1000
|
} }, { key: "step", value: function(e5) {
|
|
994
|
-
return this.__step = e5, this.__impliedStep = e5, this.__precision =
|
|
1001
|
+
return this.__step = e5, this.__impliedStep = e5, this.__precision = xe(e5), this;
|
|
995
1002
|
} }]), e4;
|
|
996
1003
|
}();
|
|
997
|
-
var
|
|
1004
|
+
var Me = function() {
|
|
998
1005
|
function e4(t2, n2, s2) {
|
|
999
|
-
|
|
1000
|
-
var i2 =
|
|
1006
|
+
re(this, e4);
|
|
1007
|
+
var i2 = ce(this, (e4.__proto__ || Object.getPrototypeOf(e4)).call(this, t2, n2, s2));
|
|
1001
1008
|
i2.__truncationSuspended = false;
|
|
1002
1009
|
var o2 = i2, r2 = void 0;
|
|
1003
1010
|
function a2() {
|
|
@@ -1008,100 +1015,100 @@ var xe = function() {
|
|
|
1008
1015
|
o2.setValue(o2.getValue() + t3 * o2.__impliedStep), r2 = e5.clientY;
|
|
1009
1016
|
}
|
|
1010
1017
|
function d2() {
|
|
1011
|
-
|
|
1018
|
+
ve.unbind(window, "mousemove", l2), ve.unbind(window, "mouseup", d2), a2();
|
|
1012
1019
|
}
|
|
1013
|
-
return i2.__input = document.createElement("input"), i2.__input.setAttribute("type", "text"),
|
|
1020
|
+
return i2.__input = document.createElement("input"), i2.__input.setAttribute("type", "text"), ve.bind(i2.__input, "change", function() {
|
|
1014
1021
|
var e5 = parseFloat(o2.__input.value);
|
|
1015
|
-
|
|
1016
|
-
}),
|
|
1022
|
+
Q.isNaN(e5) || o2.setValue(e5);
|
|
1023
|
+
}), ve.bind(i2.__input, "blur", function() {
|
|
1017
1024
|
a2();
|
|
1018
|
-
}),
|
|
1019
|
-
|
|
1020
|
-
}),
|
|
1025
|
+
}), ve.bind(i2.__input, "mousedown", function(e5) {
|
|
1026
|
+
ve.bind(window, "mousemove", l2), ve.bind(window, "mouseup", d2), r2 = e5.clientY;
|
|
1027
|
+
}), ve.bind(i2.__input, "keydown", function(e5) {
|
|
1021
1028
|
13 === e5.keyCode && (o2.__truncationSuspended = true, this.blur(), o2.__truncationSuspended = false, a2());
|
|
1022
1029
|
}), i2.updateDisplay(), i2.domElement.appendChild(i2.__input), i2;
|
|
1023
1030
|
}
|
|
1024
|
-
return
|
|
1031
|
+
return de(e4, Ce), ae(e4, [{ key: "updateDisplay", value: function() {
|
|
1025
1032
|
var t2, n2, s2;
|
|
1026
|
-
return this.__input.value = this.__truncationSuspended ? this.getValue() : (t2 = this.getValue(), n2 = this.__precision, s2 = Math.pow(10, n2), Math.round(t2 * s2) / s2),
|
|
1033
|
+
return this.__input.value = this.__truncationSuspended ? this.getValue() : (t2 = this.getValue(), n2 = this.__precision, s2 = Math.pow(10, n2), Math.round(t2 * s2) / s2), le(e4.prototype.__proto__ || Object.getPrototypeOf(e4.prototype), "updateDisplay", this).call(this);
|
|
1027
1034
|
} }]), e4;
|
|
1028
1035
|
}();
|
|
1029
|
-
function
|
|
1036
|
+
function Pe(e4, t2, n2, s2, i2) {
|
|
1030
1037
|
return s2 + (e4 - t2) / (n2 - t2) * (i2 - s2);
|
|
1031
1038
|
}
|
|
1032
|
-
var
|
|
1039
|
+
var Se = function() {
|
|
1033
1040
|
function e4(t2, n2, s2, i2, o2) {
|
|
1034
|
-
|
|
1035
|
-
var r2 =
|
|
1041
|
+
re(this, e4);
|
|
1042
|
+
var r2 = ce(this, (e4.__proto__ || Object.getPrototypeOf(e4)).call(this, t2, n2, { min: s2, max: i2, step: o2 })), a2 = r2;
|
|
1036
1043
|
function l2(e5) {
|
|
1037
1044
|
e5.preventDefault();
|
|
1038
1045
|
var t3 = a2.__background.getBoundingClientRect();
|
|
1039
|
-
return a2.setValue(
|
|
1046
|
+
return a2.setValue(Pe(e5.clientX, t3.left, t3.right, a2.__min, a2.__max)), false;
|
|
1040
1047
|
}
|
|
1041
1048
|
function d2() {
|
|
1042
|
-
|
|
1049
|
+
ve.unbind(window, "mousemove", l2), ve.unbind(window, "mouseup", d2), a2.__onFinishChange && a2.__onFinishChange.call(a2, a2.getValue());
|
|
1043
1050
|
}
|
|
1044
1051
|
function c2(e5) {
|
|
1045
1052
|
var t3 = e5.touches[0].clientX, n3 = a2.__background.getBoundingClientRect();
|
|
1046
|
-
a2.setValue(
|
|
1053
|
+
a2.setValue(Pe(t3, n3.left, n3.right, a2.__min, a2.__max));
|
|
1047
1054
|
}
|
|
1048
1055
|
function h2() {
|
|
1049
|
-
|
|
1056
|
+
ve.unbind(window, "touchmove", c2), ve.unbind(window, "touchend", h2), a2.__onFinishChange && a2.__onFinishChange.call(a2, a2.getValue());
|
|
1050
1057
|
}
|
|
1051
|
-
return r2.__background = document.createElement("div"), r2.__foreground = document.createElement("div"),
|
|
1052
|
-
document.activeElement.blur(),
|
|
1053
|
-
}),
|
|
1058
|
+
return r2.__background = document.createElement("div"), r2.__foreground = document.createElement("div"), ve.bind(r2.__background, "mousedown", function(e5) {
|
|
1059
|
+
document.activeElement.blur(), ve.bind(window, "mousemove", l2), ve.bind(window, "mouseup", d2), l2(e5);
|
|
1060
|
+
}), ve.bind(r2.__background, "touchstart", function(e5) {
|
|
1054
1061
|
if (1 !== e5.touches.length) return;
|
|
1055
|
-
|
|
1056
|
-
}),
|
|
1062
|
+
ve.bind(window, "touchmove", c2), ve.bind(window, "touchend", h2), c2(e5);
|
|
1063
|
+
}), ve.addClass(r2.__background, "slider"), ve.addClass(r2.__foreground, "slider-fg"), r2.updateDisplay(), r2.__background.appendChild(r2.__foreground), r2.domElement.appendChild(r2.__background), r2;
|
|
1057
1064
|
}
|
|
1058
|
-
return
|
|
1065
|
+
return de(e4, Ce), ae(e4, [{ key: "updateDisplay", value: function() {
|
|
1059
1066
|
var t2 = (this.getValue() - this.__min) / (this.__max - this.__min);
|
|
1060
|
-
return this.__foreground.style.width = 100 * t2 + "%",
|
|
1067
|
+
return this.__foreground.style.width = 100 * t2 + "%", le(e4.prototype.__proto__ || Object.getPrototypeOf(e4.prototype), "updateDisplay", this).call(this);
|
|
1061
1068
|
} }]), e4;
|
|
1062
|
-
}(),
|
|
1069
|
+
}(), Fe = function() {
|
|
1063
1070
|
function e4(t2, n2, s2) {
|
|
1064
|
-
|
|
1065
|
-
var i2 =
|
|
1066
|
-
return i2.__button = document.createElement("div"), i2.__button.innerHTML = void 0 === s2 ? "Fire" : s2,
|
|
1071
|
+
re(this, e4);
|
|
1072
|
+
var i2 = ce(this, (e4.__proto__ || Object.getPrototypeOf(e4)).call(this, t2, n2)), o2 = i2;
|
|
1073
|
+
return i2.__button = document.createElement("div"), i2.__button.innerHTML = void 0 === s2 ? "Fire" : s2, ve.bind(i2.__button, "click", function(e5) {
|
|
1067
1074
|
return e5.preventDefault(), o2.fire(), false;
|
|
1068
|
-
}),
|
|
1075
|
+
}), ve.addClass(i2.__button, "button"), i2.domElement.appendChild(i2.__button), i2;
|
|
1069
1076
|
}
|
|
1070
|
-
return
|
|
1077
|
+
return de(e4, pe), ae(e4, [{ key: "fire", value: function() {
|
|
1071
1078
|
this.__onChange && this.__onChange.call(this), this.getValue().call(this.object), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue());
|
|
1072
1079
|
} }]), e4;
|
|
1073
|
-
}(),
|
|
1080
|
+
}(), Ee = function() {
|
|
1074
1081
|
function e4(t2, n2) {
|
|
1075
|
-
|
|
1076
|
-
var s2 =
|
|
1077
|
-
s2.__color = new
|
|
1082
|
+
re(this, e4);
|
|
1083
|
+
var s2 = ce(this, (e4.__proto__ || Object.getPrototypeOf(e4)).call(this, t2, n2));
|
|
1084
|
+
s2.__color = new he(s2.getValue()), s2.__temp = new he(0);
|
|
1078
1085
|
var i2 = s2;
|
|
1079
|
-
s2.domElement = document.createElement("div"),
|
|
1086
|
+
s2.domElement = document.createElement("div"), ve.makeSelectable(s2.domElement, false), s2.__selector = document.createElement("div"), s2.__selector.className = "selector", s2.__saturation_field = document.createElement("div"), s2.__saturation_field.className = "saturation-field", s2.__field_knob = document.createElement("div"), s2.__field_knob.className = "field-knob", s2.__field_knob_border = "2px solid ", s2.__hue_knob = document.createElement("div"), s2.__hue_knob.className = "hue-knob", s2.__hue_field = document.createElement("div"), s2.__hue_field.className = "hue-field", s2.__input = document.createElement("input"), s2.__input.type = "text", s2.__input_textShadow = "0 1px 1px ", ve.bind(s2.__input, "keydown", function(e5) {
|
|
1080
1087
|
13 === e5.keyCode && h2.call(this);
|
|
1081
|
-
}),
|
|
1082
|
-
|
|
1083
|
-
|
|
1088
|
+
}), ve.bind(s2.__input, "blur", h2), ve.bind(s2.__selector, "mousedown", function() {
|
|
1089
|
+
ve.addClass(this, "drag").bind(window, "mouseup", function() {
|
|
1090
|
+
ve.removeClass(i2.__selector, "drag");
|
|
1084
1091
|
});
|
|
1085
|
-
}),
|
|
1086
|
-
|
|
1087
|
-
|
|
1092
|
+
}), ve.bind(s2.__selector, "touchstart", function() {
|
|
1093
|
+
ve.addClass(this, "drag").bind(window, "touchend", function() {
|
|
1094
|
+
ve.removeClass(i2.__selector, "drag");
|
|
1088
1095
|
});
|
|
1089
1096
|
});
|
|
1090
1097
|
var o2, r2 = document.createElement("div");
|
|
1091
1098
|
function a2(e5) {
|
|
1092
|
-
m2(e5),
|
|
1099
|
+
m2(e5), ve.bind(window, "mousemove", m2), ve.bind(window, "touchmove", m2), ve.bind(window, "mouseup", d2), ve.bind(window, "touchend", d2);
|
|
1093
1100
|
}
|
|
1094
1101
|
function l2(e5) {
|
|
1095
|
-
p2(e5),
|
|
1102
|
+
p2(e5), ve.bind(window, "mousemove", p2), ve.bind(window, "touchmove", p2), ve.bind(window, "mouseup", c2), ve.bind(window, "touchend", c2);
|
|
1096
1103
|
}
|
|
1097
1104
|
function d2() {
|
|
1098
|
-
|
|
1105
|
+
ve.unbind(window, "mousemove", m2), ve.unbind(window, "touchmove", m2), ve.unbind(window, "mouseup", d2), ve.unbind(window, "touchend", d2), u2();
|
|
1099
1106
|
}
|
|
1100
1107
|
function c2() {
|
|
1101
|
-
|
|
1108
|
+
ve.unbind(window, "mousemove", p2), ve.unbind(window, "touchmove", p2), ve.unbind(window, "mouseup", c2), ve.unbind(window, "touchend", c2), u2();
|
|
1102
1109
|
}
|
|
1103
1110
|
function h2() {
|
|
1104
|
-
var e5 =
|
|
1111
|
+
var e5 = ne(this.value);
|
|
1105
1112
|
false !== e5 ? (i2.__color.__state = e5, i2.setValue(i2.__color.toOriginal())) : this.value = i2.__color.toString();
|
|
1106
1113
|
}
|
|
1107
1114
|
function u2() {
|
|
@@ -1117,27 +1124,27 @@ var Me = function() {
|
|
|
1117
1124
|
var t3 = i2.__hue_field.getBoundingClientRect(), n3 = 1 - ((e5.touches && e5.touches[0] || e5).clientY - t3.top) / (t3.bottom - t3.top);
|
|
1118
1125
|
return n3 > 1 ? n3 = 1 : n3 < 0 && (n3 = 0), i2.__color.h = 360 * n3, i2.setValue(i2.__color.toOriginal()), false;
|
|
1119
1126
|
}
|
|
1120
|
-
return
|
|
1127
|
+
return Q.extend(s2.__selector.style, { width: "122px", height: "102px", padding: "3px", backgroundColor: "#222", boxShadow: "0px 1px 3px rgba(0,0,0,0.3)" }), Q.extend(s2.__field_knob.style, { position: "absolute", width: "12px", height: "12px", border: s2.__field_knob_border + (s2.__color.v < 0.5 ? "#fff" : "#000"), boxShadow: "0px 1px 3px rgba(0,0,0,0.5)", borderRadius: "12px", zIndex: 1 }), Q.extend(s2.__hue_knob.style, { position: "absolute", width: "15px", height: "2px", borderRight: "4px solid #fff", zIndex: 1 }), Q.extend(s2.__saturation_field.style, { width: "100px", height: "100px", border: "1px solid #555", marginRight: "3px", display: "inline-block", cursor: "pointer" }), Q.extend(r2.style, { width: "100%", height: "100%", background: "none" }), ke(r2, "top", "rgba(0,0,0,0)", "#000"), Q.extend(s2.__hue_field.style, { width: "15px", height: "100px", border: "1px solid #555", cursor: "ns-resize", position: "absolute", top: "3px", right: "3px" }), (o2 = s2.__hue_field).style.background = "", o2.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);", o2.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", o2.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", o2.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", o2.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", Q.extend(s2.__input.style, { outline: "none", textAlign: "center", color: "#fff", border: 0, fontWeight: "bold", textShadow: s2.__input_textShadow + "rgba(0,0,0,0.7)" }), ve.bind(s2.__saturation_field, "mousedown", a2), ve.bind(s2.__saturation_field, "touchstart", a2), ve.bind(s2.__field_knob, "mousedown", a2), ve.bind(s2.__field_knob, "touchstart", a2), ve.bind(s2.__hue_field, "mousedown", l2), ve.bind(s2.__hue_field, "touchstart", l2), s2.__saturation_field.appendChild(r2), s2.__selector.appendChild(s2.__field_knob), s2.__selector.appendChild(s2.__saturation_field), s2.__selector.appendChild(s2.__hue_field), s2.__hue_field.appendChild(s2.__hue_knob), s2.domElement.appendChild(s2.__input), s2.domElement.appendChild(s2.__selector), s2.updateDisplay(), s2;
|
|
1121
1128
|
}
|
|
1122
|
-
return
|
|
1123
|
-
var e5 =
|
|
1129
|
+
return de(e4, pe), ae(e4, [{ key: "updateDisplay", value: function() {
|
|
1130
|
+
var e5 = ne(this.getValue());
|
|
1124
1131
|
if (false !== e5) {
|
|
1125
1132
|
var t2 = false;
|
|
1126
|
-
|
|
1127
|
-
if (!
|
|
1128
|
-
}, this), t2 &&
|
|
1133
|
+
Q.each(he.COMPONENTS, function(n3) {
|
|
1134
|
+
if (!Q.isUndefined(e5[n3]) && !Q.isUndefined(this.__color.__state[n3]) && e5[n3] !== this.__color.__state[n3]) return t2 = true, {};
|
|
1135
|
+
}, this), t2 && Q.extend(this.__color.__state, e5);
|
|
1129
1136
|
}
|
|
1130
|
-
|
|
1137
|
+
Q.extend(this.__temp.__state, this.__color.__state), this.__temp.a = 1;
|
|
1131
1138
|
var n2 = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0, s2 = 255 - n2;
|
|
1132
|
-
|
|
1139
|
+
Q.extend(this.__field_knob.style, { marginLeft: 100 * this.__color.s - 7 + "px", marginTop: 100 * (1 - this.__color.v) - 7 + "px", backgroundColor: this.__temp.toHexString(), border: this.__field_knob_border + "rgb(" + n2 + "," + n2 + "," + n2 + ")" }), this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px", this.__temp.s = 1, this.__temp.v = 1, ke(this.__saturation_field, "left", "#fff", this.__temp.toHexString()), this.__input.value = this.__color.toString(), Q.extend(this.__input.style, { backgroundColor: this.__color.toHexString(), color: "rgb(" + n2 + "," + n2 + "," + n2 + ")", textShadow: this.__input_textShadow + "rgba(" + s2 + "," + s2 + "," + s2 + ",.7)" });
|
|
1133
1140
|
} }]), e4;
|
|
1134
|
-
}(),
|
|
1135
|
-
function
|
|
1136
|
-
e4.style.background = "",
|
|
1141
|
+
}(), Ae = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
|
|
1142
|
+
function ke(e4, t2, n2, s2) {
|
|
1143
|
+
e4.style.background = "", Q.each(Ae, function(i2) {
|
|
1137
1144
|
e4.style.cssText += "background: " + i2 + "linear-gradient(" + t2 + ", " + n2 + " 0%, " + s2 + " 100%); ";
|
|
1138
1145
|
});
|
|
1139
1146
|
}
|
|
1140
|
-
var
|
|
1147
|
+
var Te = function(e4, t2) {
|
|
1141
1148
|
var n2 = t2 || document, s2 = document.createElement("style");
|
|
1142
1149
|
s2.type = "text/css", s2.innerHTML = e4;
|
|
1143
1150
|
var i2 = n2.getElementsByTagName("head")[0];
|
|
@@ -1145,50 +1152,50 @@ var Ae = function(e4, t2) {
|
|
|
1145
1152
|
i2.appendChild(s2);
|
|
1146
1153
|
} catch (e5) {
|
|
1147
1154
|
}
|
|
1148
|
-
},
|
|
1155
|
+
}, Le = function(e4, t2) {
|
|
1149
1156
|
var n2 = e4[t2];
|
|
1150
|
-
return
|
|
1157
|
+
return Q.isArray(arguments[2]) || Q.isObject(arguments[2]) ? new ye(e4, t2, arguments[2]) : Q.isNumber(n2) ? Q.isNumber(arguments[2]) && Q.isNumber(arguments[3]) ? Q.isNumber(arguments[4]) ? new Se(e4, t2, arguments[2], arguments[3], arguments[4]) : new Se(e4, t2, arguments[2], arguments[3]) : Q.isNumber(arguments[4]) ? new Me(e4, t2, { min: arguments[2], max: arguments[3], step: arguments[4] }) : new Me(e4, t2, { min: arguments[2], max: arguments[3] }) : Q.isString(n2) ? new we(e4, t2) : Q.isFunction(n2) ? new Fe(e4, t2, "") : Q.isBoolean(n2) ? new be(e4, t2) : null;
|
|
1151
1158
|
};
|
|
1152
|
-
var
|
|
1159
|
+
var He = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e4) {
|
|
1153
1160
|
setTimeout(e4, 1e3 / 60);
|
|
1154
|
-
},
|
|
1161
|
+
}, Oe = function() {
|
|
1155
1162
|
function e4() {
|
|
1156
|
-
|
|
1163
|
+
re(this, e4), this.backgroundElement = document.createElement("div"), Q.extend(this.backgroundElement.style, { backgroundColor: "rgba(0,0,0,0.8)", top: 0, left: 0, display: "none", zIndex: "1000", opacity: 0, WebkitTransition: "opacity 0.2s linear", transition: "opacity 0.2s linear" }), ve.makeFullscreen(this.backgroundElement), this.backgroundElement.style.position = "fixed", this.domElement = document.createElement("div"), Q.extend(this.domElement.style, { position: "fixed", display: "none", zIndex: "1001", opacity: 0, WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear", transition: "transform 0.2s ease-out, opacity 0.2s linear" }), document.body.appendChild(this.backgroundElement), document.body.appendChild(this.domElement);
|
|
1157
1164
|
var t2 = this;
|
|
1158
|
-
|
|
1165
|
+
ve.bind(this.backgroundElement, "click", function() {
|
|
1159
1166
|
t2.hide();
|
|
1160
1167
|
});
|
|
1161
1168
|
}
|
|
1162
|
-
return
|
|
1169
|
+
return ae(e4, [{ key: "show", value: function() {
|
|
1163
1170
|
var e5 = this;
|
|
1164
|
-
this.backgroundElement.style.display = "block", this.domElement.style.display = "block", this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)", this.layout(),
|
|
1171
|
+
this.backgroundElement.style.display = "block", this.domElement.style.display = "block", this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)", this.layout(), Q.defer(function() {
|
|
1165
1172
|
e5.backgroundElement.style.opacity = 1, e5.domElement.style.opacity = 1, e5.domElement.style.webkitTransform = "scale(1)";
|
|
1166
1173
|
});
|
|
1167
1174
|
} }, { key: "hide", value: function() {
|
|
1168
1175
|
var e5 = this, t2 = function t3() {
|
|
1169
|
-
e5.domElement.style.display = "none", e5.backgroundElement.style.display = "none",
|
|
1176
|
+
e5.domElement.style.display = "none", e5.backgroundElement.style.display = "none", ve.unbind(e5.domElement, "webkitTransitionEnd", t3), ve.unbind(e5.domElement, "transitionend", t3), ve.unbind(e5.domElement, "oTransitionEnd", t3);
|
|
1170
1177
|
};
|
|
1171
|
-
|
|
1178
|
+
ve.bind(this.domElement, "webkitTransitionEnd", t2), ve.bind(this.domElement, "transitionend", t2), ve.bind(this.domElement, "oTransitionEnd", t2), this.backgroundElement.style.opacity = 0, this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)";
|
|
1172
1179
|
} }, { key: "layout", value: function() {
|
|
1173
|
-
this.domElement.style.left = window.innerWidth / 2 -
|
|
1180
|
+
this.domElement.style.left = window.innerWidth / 2 - ve.getWidth(this.domElement) / 2 + "px", this.domElement.style.top = window.innerHeight / 2 - ve.getHeight(this.domElement) / 2 + "px";
|
|
1174
1181
|
} }]), e4;
|
|
1175
|
-
}(),
|
|
1182
|
+
}(), Be = function(e4) {
|
|
1176
1183
|
if ("undefined" != typeof window) {
|
|
1177
1184
|
var t2 = document.createElement("style");
|
|
1178
1185
|
return t2.setAttribute("type", "text/css"), t2.innerHTML = e4, document.head.appendChild(t2), e4;
|
|
1179
1186
|
}
|
|
1180
1187
|
}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n");
|
|
1181
|
-
|
|
1182
|
-
var
|
|
1188
|
+
Te(Be);
|
|
1189
|
+
var je = "Default", Re = function() {
|
|
1183
1190
|
try {
|
|
1184
1191
|
return !!window.localStorage;
|
|
1185
1192
|
} catch (e4) {
|
|
1186
1193
|
return false;
|
|
1187
1194
|
}
|
|
1188
|
-
}(),
|
|
1195
|
+
}(), ze = void 0, De = true, Ge = void 0, Ue = false, Ie = [], Ve = function e3(t2) {
|
|
1189
1196
|
var n2 = this, s2 = t2 || {};
|
|
1190
|
-
this.domElement = document.createElement("div"), this.__ul = document.createElement("ul"), this.domElement.appendChild(this.__ul),
|
|
1191
|
-
var i2, o2 =
|
|
1197
|
+
this.domElement = document.createElement("div"), this.__ul = document.createElement("ul"), this.domElement.appendChild(this.__ul), ve.addClass(this.domElement, "dg"), this.__folders = {}, this.__controllers = [], this.__rememberedObjects = [], this.__rememberedObjectIndecesToControllers = [], this.__listening = [], s2 = Q.defaults(s2, { closeOnTop: false, autoPlace: true, width: e3.DEFAULT_WIDTH }), s2 = Q.defaults(s2, { resizable: s2.autoPlace, hideable: s2.autoPlace }), Q.isUndefined(s2.load) ? s2.load = { preset: je } : s2.preset && (s2.load.preset = s2.preset), Q.isUndefined(s2.parent) && s2.hideable && Ie.push(this), s2.resizable = Q.isUndefined(s2.parent) && s2.resizable, s2.autoPlace && Q.isUndefined(s2.scrollable) && (s2.scrollable = true);
|
|
1198
|
+
var i2, o2 = Re && "true" === localStorage.getItem(Ke(this, "isLocal")), r2 = void 0, a2 = void 0;
|
|
1192
1199
|
if (Object.defineProperties(this, { parent: { get: function() {
|
|
1193
1200
|
return s2.parent;
|
|
1194
1201
|
} }, scrollable: { get: function() {
|
|
@@ -1206,7 +1213,7 @@ var He = "Default", Be = function() {
|
|
|
1206
1213
|
} }, width: { get: function() {
|
|
1207
1214
|
return s2.width;
|
|
1208
1215
|
}, set: function(e4) {
|
|
1209
|
-
s2.width = e4,
|
|
1216
|
+
s2.width = e4, $e(n2, e4);
|
|
1210
1217
|
} }, name: { get: function() {
|
|
1211
1218
|
return s2.name;
|
|
1212
1219
|
}, set: function(e4) {
|
|
@@ -1214,50 +1221,50 @@ var He = "Default", Be = function() {
|
|
|
1214
1221
|
} }, closed: { get: function() {
|
|
1215
1222
|
return s2.closed;
|
|
1216
1223
|
}, set: function(t3) {
|
|
1217
|
-
s2.closed = t3, s2.closed ?
|
|
1224
|
+
s2.closed = t3, s2.closed ? ve.addClass(n2.__ul, e3.CLASS_CLOSED) : ve.removeClass(n2.__ul, e3.CLASS_CLOSED), this.onResize(), n2.__closeButton && (n2.__closeButton.innerHTML = t3 ? e3.TEXT_OPEN : e3.TEXT_CLOSED);
|
|
1218
1225
|
} }, load: { get: function() {
|
|
1219
1226
|
return s2.load;
|
|
1220
1227
|
} }, useLocalStorage: { get: function() {
|
|
1221
1228
|
return o2;
|
|
1222
1229
|
}, set: function(e4) {
|
|
1223
|
-
|
|
1224
|
-
} } }),
|
|
1225
|
-
if (this.closed = s2.closed || false,
|
|
1230
|
+
Re && (o2 = e4, e4 ? ve.bind(window, "unload", r2) : ve.unbind(window, "unload", r2), localStorage.setItem(Ke(n2, "isLocal"), e4));
|
|
1231
|
+
} } }), Q.isUndefined(s2.parent)) {
|
|
1232
|
+
if (this.closed = s2.closed || false, ve.addClass(this.domElement, e3.CLASS_MAIN), ve.makeSelectable(this.domElement, false), Re && o2) {
|
|
1226
1233
|
n2.useLocalStorage = true;
|
|
1227
|
-
var l2 = localStorage.getItem(
|
|
1234
|
+
var l2 = localStorage.getItem(Ke(this, "gui"));
|
|
1228
1235
|
l2 && (s2.load = JSON.parse(l2));
|
|
1229
1236
|
}
|
|
1230
|
-
this.__closeButton = document.createElement("div"), this.__closeButton.innerHTML = e3.TEXT_CLOSED,
|
|
1237
|
+
this.__closeButton = document.createElement("div"), this.__closeButton.innerHTML = e3.TEXT_CLOSED, ve.addClass(this.__closeButton, e3.CLASS_CLOSE_BUTTON), s2.closeOnTop ? (ve.addClass(this.__closeButton, e3.CLASS_CLOSE_TOP), this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0])) : (ve.addClass(this.__closeButton, e3.CLASS_CLOSE_BOTTOM), this.domElement.appendChild(this.__closeButton)), ve.bind(this.__closeButton, "click", function() {
|
|
1231
1238
|
n2.closed = !n2.closed;
|
|
1232
1239
|
});
|
|
1233
1240
|
} else {
|
|
1234
1241
|
void 0 === s2.closed && (s2.closed = true);
|
|
1235
1242
|
var d2 = document.createTextNode(s2.name);
|
|
1236
|
-
|
|
1237
|
-
|
|
1243
|
+
ve.addClass(d2, "controller-name"), a2 = Ne(n2, d2);
|
|
1244
|
+
ve.addClass(this.__ul, e3.CLASS_CLOSED), ve.addClass(a2, "title"), ve.bind(a2, "click", function(e4) {
|
|
1238
1245
|
return e4.preventDefault(), n2.closed = !n2.closed, false;
|
|
1239
1246
|
}), s2.closed || (this.closed = false);
|
|
1240
1247
|
}
|
|
1241
|
-
s2.autoPlace && (
|
|
1248
|
+
s2.autoPlace && (Q.isUndefined(s2.parent) && (De && (Ge = document.createElement("div"), ve.addClass(Ge, "dg"), ve.addClass(Ge, e3.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(Ge), De = false), Ge.appendChild(this.domElement), ve.addClass(this.domElement, e3.CLASS_AUTO_PLACE)), this.parent || $e(n2, s2.width)), this.__resizeHandler = function() {
|
|
1242
1249
|
n2.onResizeDebounced();
|
|
1243
|
-
},
|
|
1244
|
-
|
|
1245
|
-
}, this.saveToLocalStorageIfPossible = r2, s2.parent || ((i2 = n2.getRoot()).width += 1,
|
|
1250
|
+
}, ve.bind(window, "resize", this.__resizeHandler), ve.bind(this.__ul, "webkitTransitionEnd", this.__resizeHandler), ve.bind(this.__ul, "transitionend", this.__resizeHandler), ve.bind(this.__ul, "oTransitionEnd", this.__resizeHandler), this.onResize(), s2.resizable && Qe(this), r2 = function() {
|
|
1251
|
+
Re && "true" === localStorage.getItem(Ke(n2, "isLocal")) && localStorage.setItem(Ke(n2, "gui"), JSON.stringify(n2.getSaveObject()));
|
|
1252
|
+
}, this.saveToLocalStorageIfPossible = r2, s2.parent || ((i2 = n2.getRoot()).width += 1, Q.defer(function() {
|
|
1246
1253
|
i2.width -= 1;
|
|
1247
1254
|
}));
|
|
1248
1255
|
};
|
|
1249
|
-
function
|
|
1256
|
+
function Ne(e4, t2, n2) {
|
|
1250
1257
|
var s2 = document.createElement("li");
|
|
1251
1258
|
return t2 && s2.appendChild(t2), n2 ? e4.__ul.insertBefore(s2, n2) : e4.__ul.appendChild(s2), e4.onResize(), s2;
|
|
1252
1259
|
}
|
|
1253
|
-
function
|
|
1254
|
-
|
|
1260
|
+
function Xe(e4) {
|
|
1261
|
+
ve.unbind(window, "resize", e4.__resizeHandler), e4.saveToLocalStorageIfPossible && ve.unbind(window, "unload", e4.saveToLocalStorageIfPossible);
|
|
1255
1262
|
}
|
|
1256
|
-
function
|
|
1263
|
+
function We(e4, t2) {
|
|
1257
1264
|
var n2 = e4.__preset_select[e4.__preset_select.selectedIndex];
|
|
1258
1265
|
n2.innerHTML = t2 ? n2.value + "*" : n2.value;
|
|
1259
1266
|
}
|
|
1260
|
-
function
|
|
1267
|
+
function Je(e4, t2) {
|
|
1261
1268
|
var n2 = e4.getRoot(), s2 = n2.__rememberedObjects.indexOf(t2.object);
|
|
1262
1269
|
if (-1 !== s2) {
|
|
1263
1270
|
var i2 = n2.__rememberedObjectIndecesToControllers[s2];
|
|
@@ -1265,8 +1272,8 @@ function Xe(e4, t2) {
|
|
|
1265
1272
|
var o2 = n2.load.remembered, r2 = void 0;
|
|
1266
1273
|
if (o2[e4.preset]) r2 = o2[e4.preset];
|
|
1267
1274
|
else {
|
|
1268
|
-
if (!o2[
|
|
1269
|
-
r2 = o2[
|
|
1275
|
+
if (!o2[je]) return;
|
|
1276
|
+
r2 = o2[je];
|
|
1270
1277
|
}
|
|
1271
1278
|
if (r2[s2] && void 0 !== r2[s2][t2.property]) {
|
|
1272
1279
|
var a2 = r2[s2][t2.property];
|
|
@@ -1275,29 +1282,29 @@ function Xe(e4, t2) {
|
|
|
1275
1282
|
}
|
|
1276
1283
|
}
|
|
1277
1284
|
}
|
|
1278
|
-
function
|
|
1285
|
+
function Ye(e4, t2, n2, s2) {
|
|
1279
1286
|
if (void 0 === t2[n2]) throw new Error('Object "' + t2 + '" has no property "' + n2 + '"');
|
|
1280
1287
|
var i2 = void 0;
|
|
1281
|
-
if (s2.color) i2 = new
|
|
1288
|
+
if (s2.color) i2 = new Ee(t2, n2);
|
|
1282
1289
|
else {
|
|
1283
1290
|
var o2 = [t2, n2].concat(s2.factoryArgs);
|
|
1284
|
-
i2 =
|
|
1291
|
+
i2 = Le.apply(e4, o2);
|
|
1285
1292
|
}
|
|
1286
|
-
s2.before instanceof
|
|
1293
|
+
s2.before instanceof pe && (s2.before = s2.before.__li), Je(e4, i2), ve.addClass(i2.domElement, "c");
|
|
1287
1294
|
var r2 = document.createElement("span");
|
|
1288
|
-
|
|
1295
|
+
ve.addClass(r2, "property-name"), r2.innerHTML = i2.property;
|
|
1289
1296
|
var a2 = document.createElement("div");
|
|
1290
1297
|
a2.appendChild(r2), a2.appendChild(i2.domElement);
|
|
1291
|
-
var l2 =
|
|
1292
|
-
return
|
|
1293
|
-
if (n3.__li = t3, n3.__gui = e5,
|
|
1298
|
+
var l2 = Ne(e4, a2, s2.before);
|
|
1299
|
+
return ve.addClass(l2, Ve.CLASS_CONTROLLER_ROW), i2 instanceof Ee ? ve.addClass(l2, "color") : ve.addClass(l2, oe(i2.getValue())), function(e5, t3, n3) {
|
|
1300
|
+
if (n3.__li = t3, n3.__gui = e5, Q.extend(n3, { options: function(t4) {
|
|
1294
1301
|
if (arguments.length > 1) {
|
|
1295
1302
|
var s4 = n3.__li.nextElementSibling;
|
|
1296
|
-
return n3.remove(),
|
|
1303
|
+
return n3.remove(), Ye(e5, n3.object, n3.property, { before: s4, factoryArgs: [Q.toArray(arguments)] });
|
|
1297
1304
|
}
|
|
1298
|
-
if (
|
|
1305
|
+
if (Q.isArray(t4) || Q.isObject(t4)) {
|
|
1299
1306
|
var i4 = n3.__li.nextElementSibling;
|
|
1300
|
-
return n3.remove(),
|
|
1307
|
+
return n3.remove(), Ye(e5, n3.object, n3.property, { before: i4, factoryArgs: [t4] });
|
|
1301
1308
|
}
|
|
1302
1309
|
}, name: function(e6) {
|
|
1303
1310
|
return n3.__li.firstElementChild.firstElementChild.innerHTML = e6, n3;
|
|
@@ -1305,123 +1312,123 @@ function We(e4, t2, n2, s2) {
|
|
|
1305
1312
|
return n3.__gui.listen(n3), n3;
|
|
1306
1313
|
}, remove: function() {
|
|
1307
1314
|
return n3.__gui.remove(n3), n3;
|
|
1308
|
-
} }), n3 instanceof
|
|
1309
|
-
var s3 = new
|
|
1310
|
-
|
|
1315
|
+
} }), n3 instanceof Se) {
|
|
1316
|
+
var s3 = new Me(n3.object, n3.property, { min: n3.__min, max: n3.__max, step: n3.__step });
|
|
1317
|
+
Q.each(["updateDisplay", "onChange", "onFinishChange", "step", "min", "max"], function(e6) {
|
|
1311
1318
|
var t4 = n3[e6], i4 = s3[e6];
|
|
1312
1319
|
n3[e6] = s3[e6] = function() {
|
|
1313
1320
|
var e7 = Array.prototype.slice.call(arguments);
|
|
1314
1321
|
return i4.apply(s3, e7), t4.apply(n3, e7);
|
|
1315
1322
|
};
|
|
1316
|
-
}),
|
|
1317
|
-
} else if (n3 instanceof
|
|
1323
|
+
}), ve.addClass(t3, "has-slider"), n3.domElement.insertBefore(s3.domElement, n3.domElement.firstElementChild);
|
|
1324
|
+
} else if (n3 instanceof Me) {
|
|
1318
1325
|
var i3 = function(t4) {
|
|
1319
|
-
if (
|
|
1326
|
+
if (Q.isNumber(n3.__min) && Q.isNumber(n3.__max)) {
|
|
1320
1327
|
var s4 = n3.__li.firstElementChild.firstElementChild.innerHTML, i4 = n3.__gui.__listening.indexOf(n3) > -1;
|
|
1321
1328
|
n3.remove();
|
|
1322
|
-
var o3 =
|
|
1329
|
+
var o3 = Ye(e5, n3.object, n3.property, { before: n3.__li.nextElementSibling, factoryArgs: [n3.__min, n3.__max, n3.__step] });
|
|
1323
1330
|
return o3.name(s4), i4 && o3.listen(), o3;
|
|
1324
1331
|
}
|
|
1325
1332
|
return t4;
|
|
1326
1333
|
};
|
|
1327
|
-
n3.min =
|
|
1328
|
-
} else n3 instanceof
|
|
1329
|
-
|
|
1330
|
-
}),
|
|
1334
|
+
n3.min = Q.compose(i3, n3.min), n3.max = Q.compose(i3, n3.max);
|
|
1335
|
+
} else n3 instanceof be ? (ve.bind(t3, "click", function() {
|
|
1336
|
+
ve.fakeEvent(n3.__checkbox, "click");
|
|
1337
|
+
}), ve.bind(n3.__checkbox, "click", function(e6) {
|
|
1331
1338
|
e6.stopPropagation();
|
|
1332
|
-
})) : n3 instanceof
|
|
1333
|
-
|
|
1334
|
-
}),
|
|
1335
|
-
|
|
1336
|
-
}),
|
|
1337
|
-
|
|
1338
|
-
})) : n3 instanceof
|
|
1339
|
+
})) : n3 instanceof Fe ? (ve.bind(t3, "click", function() {
|
|
1340
|
+
ve.fakeEvent(n3.__button, "click");
|
|
1341
|
+
}), ve.bind(t3, "mouseover", function() {
|
|
1342
|
+
ve.addClass(n3.__button, "hover");
|
|
1343
|
+
}), ve.bind(t3, "mouseout", function() {
|
|
1344
|
+
ve.removeClass(n3.__button, "hover");
|
|
1345
|
+
})) : n3 instanceof Ee && (ve.addClass(t3, "color"), n3.updateDisplay = Q.compose(function(e6) {
|
|
1339
1346
|
return t3.style.borderLeftColor = n3.__color.toString(), e6;
|
|
1340
1347
|
}, n3.updateDisplay), n3.updateDisplay());
|
|
1341
|
-
n3.setValue =
|
|
1342
|
-
return e5.getRoot().__preset_select && n3.isModified() &&
|
|
1348
|
+
n3.setValue = Q.compose(function(t4) {
|
|
1349
|
+
return e5.getRoot().__preset_select && n3.isModified() && We(e5.getRoot(), true), t4;
|
|
1343
1350
|
}, n3.setValue);
|
|
1344
1351
|
}(e4, l2, i2), e4.__controllers.push(i2), i2;
|
|
1345
1352
|
}
|
|
1346
|
-
function
|
|
1353
|
+
function Ke(e4, t2) {
|
|
1347
1354
|
return document.location.href + "." + t2;
|
|
1348
1355
|
}
|
|
1349
|
-
function
|
|
1356
|
+
function Ze(e4, t2, n2) {
|
|
1350
1357
|
var s2 = document.createElement("option");
|
|
1351
1358
|
s2.innerHTML = t2, s2.value = t2, e4.__preset_select.appendChild(s2), n2 && (e4.__preset_select.selectedIndex = e4.__preset_select.length - 1);
|
|
1352
1359
|
}
|
|
1353
|
-
function
|
|
1360
|
+
function qe(e4, t2) {
|
|
1354
1361
|
t2.style.display = e4.useLocalStorage ? "block" : "none";
|
|
1355
1362
|
}
|
|
1356
|
-
function
|
|
1363
|
+
function Qe(e4) {
|
|
1357
1364
|
var t2 = void 0;
|
|
1358
1365
|
function n2(n3) {
|
|
1359
1366
|
return n3.preventDefault(), e4.width += t2 - n3.clientX, e4.onResize(), t2 = n3.clientX, false;
|
|
1360
1367
|
}
|
|
1361
1368
|
function s2() {
|
|
1362
|
-
|
|
1369
|
+
ve.removeClass(e4.__closeButton, Ve.CLASS_DRAG), ve.unbind(window, "mousemove", n2), ve.unbind(window, "mouseup", s2);
|
|
1363
1370
|
}
|
|
1364
1371
|
function i2(i3) {
|
|
1365
|
-
return i3.preventDefault(), t2 = i3.clientX,
|
|
1372
|
+
return i3.preventDefault(), t2 = i3.clientX, ve.addClass(e4.__closeButton, Ve.CLASS_DRAG), ve.bind(window, "mousemove", n2), ve.bind(window, "mouseup", s2), false;
|
|
1366
1373
|
}
|
|
1367
|
-
e4.__resize_handle = document.createElement("div"),
|
|
1374
|
+
e4.__resize_handle = document.createElement("div"), Q.extend(e4.__resize_handle.style, { width: "6px", marginLeft: "-3px", height: "200px", cursor: "ew-resize", position: "absolute" }), ve.bind(e4.__resize_handle, "mousedown", i2), ve.bind(e4.__closeButton, "mousedown", i2), e4.domElement.insertBefore(e4.__resize_handle, e4.domElement.firstElementChild);
|
|
1368
1375
|
}
|
|
1369
|
-
function
|
|
1376
|
+
function $e(e4, t2) {
|
|
1370
1377
|
e4.domElement.style.width = t2 + "px", e4.__save_row && e4.autoPlace && (e4.__save_row.style.width = t2 + "px"), e4.__closeButton && (e4.__closeButton.style.width = t2 + "px");
|
|
1371
1378
|
}
|
|
1372
|
-
function
|
|
1379
|
+
function et(e4, t2) {
|
|
1373
1380
|
var n2 = {};
|
|
1374
|
-
return
|
|
1381
|
+
return Q.each(e4.__rememberedObjects, function(s2, i2) {
|
|
1375
1382
|
var o2 = {}, r2 = e4.__rememberedObjectIndecesToControllers[i2];
|
|
1376
|
-
|
|
1383
|
+
Q.each(r2, function(e5, n3) {
|
|
1377
1384
|
o2[n3] = t2 ? e5.initialValue : e5.getValue();
|
|
1378
1385
|
}), n2[i2] = o2;
|
|
1379
1386
|
}), n2;
|
|
1380
1387
|
}
|
|
1381
|
-
function
|
|
1382
|
-
0 !== e4.length &&
|
|
1383
|
-
|
|
1384
|
-
}),
|
|
1388
|
+
function tt(e4) {
|
|
1389
|
+
0 !== e4.length && He.call(window, function() {
|
|
1390
|
+
tt(e4);
|
|
1391
|
+
}), Q.each(e4, function(e5) {
|
|
1385
1392
|
e5.updateDisplay();
|
|
1386
1393
|
});
|
|
1387
1394
|
}
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
e4.domElement.style.display =
|
|
1395
|
+
Ve.toggleHide = function() {
|
|
1396
|
+
Ue = !Ue, Q.each(Ie, function(e4) {
|
|
1397
|
+
e4.domElement.style.display = Ue ? "none" : "";
|
|
1391
1398
|
});
|
|
1392
|
-
},
|
|
1393
|
-
"text" === document.activeElement.type || 72 !== e4.which && 72 !== e4.keyCode ||
|
|
1394
|
-
},
|
|
1395
|
-
return
|
|
1399
|
+
}, Ve.CLASS_AUTO_PLACE = "a", Ve.CLASS_AUTO_PLACE_CONTAINER = "ac", Ve.CLASS_MAIN = "main", Ve.CLASS_CONTROLLER_ROW = "cr", Ve.CLASS_TOO_TALL = "taller-than-window", Ve.CLASS_CLOSED = "closed", Ve.CLASS_CLOSE_BUTTON = "close-button", Ve.CLASS_CLOSE_TOP = "close-top", Ve.CLASS_CLOSE_BOTTOM = "close-bottom", Ve.CLASS_DRAG = "drag", Ve.DEFAULT_WIDTH = 245, Ve.TEXT_CLOSED = "Close Controls", Ve.TEXT_OPEN = "Open Controls", Ve._keydownHandler = function(e4) {
|
|
1400
|
+
"text" === document.activeElement.type || 72 !== e4.which && 72 !== e4.keyCode || Ve.toggleHide();
|
|
1401
|
+
}, ve.bind(window, "keydown", Ve._keydownHandler, false), Q.extend(Ve.prototype, { add: function(e4, t2) {
|
|
1402
|
+
return Ye(this, e4, t2, { factoryArgs: Array.prototype.slice.call(arguments, 2) });
|
|
1396
1403
|
}, addColor: function(e4, t2) {
|
|
1397
|
-
return
|
|
1404
|
+
return Ye(this, e4, t2, { color: true });
|
|
1398
1405
|
}, remove: function(e4) {
|
|
1399
1406
|
this.__ul.removeChild(e4.__li), this.__controllers.splice(this.__controllers.indexOf(e4), 1);
|
|
1400
1407
|
var t2 = this;
|
|
1401
|
-
|
|
1408
|
+
Q.defer(function() {
|
|
1402
1409
|
t2.onResize();
|
|
1403
1410
|
});
|
|
1404
1411
|
}, destroy: function() {
|
|
1405
1412
|
if (this.parent) throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");
|
|
1406
|
-
this.autoPlace &&
|
|
1413
|
+
this.autoPlace && Ge.removeChild(this.domElement);
|
|
1407
1414
|
var e4 = this;
|
|
1408
|
-
|
|
1415
|
+
Q.each(this.__folders, function(t2) {
|
|
1409
1416
|
e4.removeFolder(t2);
|
|
1410
|
-
}),
|
|
1417
|
+
}), ve.unbind(window, "keydown", Ve._keydownHandler, false), Xe(this);
|
|
1411
1418
|
}, addFolder: function(e4) {
|
|
1412
1419
|
if (void 0 !== this.__folders[e4]) throw new Error('You already have a folder in this GUI by the name "' + e4 + '"');
|
|
1413
1420
|
var t2 = { name: e4, parent: this };
|
|
1414
1421
|
t2.autoPlace = this.autoPlace, this.load && this.load.folders && this.load.folders[e4] && (t2.closed = this.load.folders[e4].closed, t2.load = this.load.folders[e4]);
|
|
1415
|
-
var n2 = new
|
|
1422
|
+
var n2 = new Ve(t2);
|
|
1416
1423
|
this.__folders[e4] = n2;
|
|
1417
|
-
var s2 =
|
|
1418
|
-
return
|
|
1424
|
+
var s2 = Ne(this, n2.domElement);
|
|
1425
|
+
return ve.addClass(s2, "folder"), n2;
|
|
1419
1426
|
}, removeFolder: function(e4) {
|
|
1420
|
-
this.__ul.removeChild(e4.domElement.parentElement), delete this.__folders[e4.name], this.load && this.load.folders && this.load.folders[e4.name] && delete this.load.folders[e4.name],
|
|
1427
|
+
this.__ul.removeChild(e4.domElement.parentElement), delete this.__folders[e4.name], this.load && this.load.folders && this.load.folders[e4.name] && delete this.load.folders[e4.name], Xe(e4);
|
|
1421
1428
|
var t2 = this;
|
|
1422
|
-
|
|
1429
|
+
Q.each(e4.__folders, function(t3) {
|
|
1423
1430
|
e4.removeFolder(t3);
|
|
1424
|
-
}),
|
|
1431
|
+
}), Q.defer(function() {
|
|
1425
1432
|
t2.onResize();
|
|
1426
1433
|
});
|
|
1427
1434
|
}, open: function() {
|
|
@@ -1435,18 +1442,18 @@ Ue.toggleHide = function() {
|
|
|
1435
1442
|
}, onResize: function() {
|
|
1436
1443
|
var e4 = this.getRoot();
|
|
1437
1444
|
if (e4.scrollable) {
|
|
1438
|
-
var t2 =
|
|
1439
|
-
|
|
1440
|
-
e4.autoPlace && t3 === e4.__save_row || (n2 +=
|
|
1441
|
-
}), window.innerHeight - t2 - 20 < n2 ? (
|
|
1445
|
+
var t2 = ve.getOffset(e4.__ul).top, n2 = 0;
|
|
1446
|
+
Q.each(e4.__ul.childNodes, function(t3) {
|
|
1447
|
+
e4.autoPlace && t3 === e4.__save_row || (n2 += ve.getHeight(t3));
|
|
1448
|
+
}), window.innerHeight - t2 - 20 < n2 ? (ve.addClass(e4.domElement, Ve.CLASS_TOO_TALL), e4.__ul.style.height = window.innerHeight - t2 - 20 + "px") : (ve.removeClass(e4.domElement, Ve.CLASS_TOO_TALL), e4.__ul.style.height = "auto");
|
|
1442
1449
|
}
|
|
1443
|
-
e4.__resize_handle &&
|
|
1450
|
+
e4.__resize_handle && Q.defer(function() {
|
|
1444
1451
|
e4.__resize_handle.style.height = e4.__ul.offsetHeight + "px";
|
|
1445
1452
|
}), e4.__closeButton && (e4.__closeButton.style.width = e4.width + "px");
|
|
1446
|
-
}, onResizeDebounced:
|
|
1453
|
+
}, onResizeDebounced: Q.debounce(function() {
|
|
1447
1454
|
this.onResize();
|
|
1448
1455
|
}, 50), remember: function() {
|
|
1449
|
-
if (
|
|
1456
|
+
if (Q.isUndefined(ze) && ((ze = new Oe()).domElement.innerHTML = `<div id="dg-save" class="dg dialogue">
|
|
1450
1457
|
|
|
1451
1458
|
Here's the new load parameter for your <code>GUI</code>'s constructor:
|
|
1452
1459
|
|
|
@@ -1468,79 +1475,79 @@ Ue.toggleHide = function() {
|
|
|
1468
1475
|
|
|
1469
1476
|
</div>`), this.parent) throw new Error("You can only call remember on a top level GUI.");
|
|
1470
1477
|
var e4 = this;
|
|
1471
|
-
|
|
1478
|
+
Q.each(Array.prototype.slice.call(arguments), function(t2) {
|
|
1472
1479
|
0 === e4.__rememberedObjects.length && function(e5) {
|
|
1473
1480
|
var t3 = e5.__save_row = document.createElement("li");
|
|
1474
|
-
|
|
1481
|
+
ve.addClass(e5.domElement, "has-save"), e5.__ul.insertBefore(t3, e5.__ul.firstChild), ve.addClass(t3, "save-row");
|
|
1475
1482
|
var n2 = document.createElement("span");
|
|
1476
|
-
n2.innerHTML = " ",
|
|
1483
|
+
n2.innerHTML = " ", ve.addClass(n2, "button gears");
|
|
1477
1484
|
var s2 = document.createElement("span");
|
|
1478
|
-
s2.innerHTML = "Save",
|
|
1485
|
+
s2.innerHTML = "Save", ve.addClass(s2, "button"), ve.addClass(s2, "save");
|
|
1479
1486
|
var i2 = document.createElement("span");
|
|
1480
|
-
i2.innerHTML = "New",
|
|
1487
|
+
i2.innerHTML = "New", ve.addClass(i2, "button"), ve.addClass(i2, "save-as");
|
|
1481
1488
|
var o2 = document.createElement("span");
|
|
1482
|
-
o2.innerHTML = "Revert",
|
|
1489
|
+
o2.innerHTML = "Revert", ve.addClass(o2, "button"), ve.addClass(o2, "revert");
|
|
1483
1490
|
var r2 = e5.__preset_select = document.createElement("select");
|
|
1484
|
-
e5.load && e5.load.remembered ?
|
|
1485
|
-
|
|
1486
|
-
}) :
|
|
1487
|
-
if (
|
|
1491
|
+
e5.load && e5.load.remembered ? Q.each(e5.load.remembered, function(t4, n3) {
|
|
1492
|
+
Ze(e5, n3, n3 === e5.preset);
|
|
1493
|
+
}) : Ze(e5, je, false);
|
|
1494
|
+
if (ve.bind(r2, "change", function() {
|
|
1488
1495
|
for (var t4 = 0; t4 < e5.__preset_select.length; t4++) e5.__preset_select[t4].innerHTML = e5.__preset_select[t4].value;
|
|
1489
1496
|
e5.preset = this.value;
|
|
1490
|
-
}), t3.appendChild(r2), t3.appendChild(n2), t3.appendChild(s2), t3.appendChild(i2), t3.appendChild(o2),
|
|
1497
|
+
}), t3.appendChild(r2), t3.appendChild(n2), t3.appendChild(s2), t3.appendChild(i2), t3.appendChild(o2), Re) {
|
|
1491
1498
|
var a2 = document.getElementById("dg-local-explain"), l2 = document.getElementById("dg-local-storage");
|
|
1492
|
-
document.getElementById("dg-save-locally").style.display = "block", "true" === localStorage.getItem(
|
|
1493
|
-
e5.useLocalStorage = !e5.useLocalStorage,
|
|
1499
|
+
document.getElementById("dg-save-locally").style.display = "block", "true" === localStorage.getItem(Ke(e5, "isLocal")) && l2.setAttribute("checked", "checked"), qe(e5, a2), ve.bind(l2, "change", function() {
|
|
1500
|
+
e5.useLocalStorage = !e5.useLocalStorage, qe(e5, a2);
|
|
1494
1501
|
});
|
|
1495
1502
|
}
|
|
1496
1503
|
var d2 = document.getElementById("dg-new-constructor");
|
|
1497
|
-
|
|
1498
|
-
!e6.metaKey || 67 !== e6.which && 67 !== e6.keyCode ||
|
|
1499
|
-
}),
|
|
1500
|
-
d2.innerHTML = JSON.stringify(e5.getSaveObject(), void 0, 2),
|
|
1501
|
-
}),
|
|
1504
|
+
ve.bind(d2, "keydown", function(e6) {
|
|
1505
|
+
!e6.metaKey || 67 !== e6.which && 67 !== e6.keyCode || ze.hide();
|
|
1506
|
+
}), ve.bind(n2, "click", function() {
|
|
1507
|
+
d2.innerHTML = JSON.stringify(e5.getSaveObject(), void 0, 2), ze.show(), d2.focus(), d2.select();
|
|
1508
|
+
}), ve.bind(s2, "click", function() {
|
|
1502
1509
|
e5.save();
|
|
1503
|
-
}),
|
|
1510
|
+
}), ve.bind(i2, "click", function() {
|
|
1504
1511
|
var t4 = prompt("Enter a new preset name.");
|
|
1505
1512
|
t4 && e5.saveAs(t4);
|
|
1506
|
-
}),
|
|
1513
|
+
}), ve.bind(o2, "click", function() {
|
|
1507
1514
|
e5.revert();
|
|
1508
1515
|
});
|
|
1509
1516
|
}(e4), -1 === e4.__rememberedObjects.indexOf(t2) && e4.__rememberedObjects.push(t2);
|
|
1510
|
-
}), this.autoPlace &&
|
|
1517
|
+
}), this.autoPlace && $e(this, this.width);
|
|
1511
1518
|
}, getRoot: function() {
|
|
1512
1519
|
for (var e4 = this; e4.parent; ) e4 = e4.parent;
|
|
1513
1520
|
return e4;
|
|
1514
1521
|
}, getSaveObject: function() {
|
|
1515
1522
|
var e4 = this.load;
|
|
1516
|
-
return e4.closed = this.closed, this.__rememberedObjects.length > 0 && (e4.preset = this.preset, e4.remembered || (e4.remembered = {}), e4.remembered[this.preset] =
|
|
1523
|
+
return e4.closed = this.closed, this.__rememberedObjects.length > 0 && (e4.preset = this.preset, e4.remembered || (e4.remembered = {}), e4.remembered[this.preset] = et(this)), e4.folders = {}, Q.each(this.__folders, function(t2, n2) {
|
|
1517
1524
|
e4.folders[n2] = t2.getSaveObject();
|
|
1518
1525
|
}), e4;
|
|
1519
1526
|
}, save: function() {
|
|
1520
|
-
this.load.remembered || (this.load.remembered = {}), this.load.remembered[this.preset] =
|
|
1527
|
+
this.load.remembered || (this.load.remembered = {}), this.load.remembered[this.preset] = et(this), We(this, false), this.saveToLocalStorageIfPossible();
|
|
1521
1528
|
}, saveAs: function(e4) {
|
|
1522
|
-
this.load.remembered || (this.load.remembered = {}, this.load.remembered[
|
|
1529
|
+
this.load.remembered || (this.load.remembered = {}, this.load.remembered[je] = et(this, true)), this.load.remembered[e4] = et(this), this.preset = e4, Ze(this, e4, true), this.saveToLocalStorageIfPossible();
|
|
1523
1530
|
}, revert: function(e4) {
|
|
1524
|
-
|
|
1525
|
-
this.getRoot().load.remembered ?
|
|
1526
|
-
}, this),
|
|
1531
|
+
Q.each(this.__controllers, function(t2) {
|
|
1532
|
+
this.getRoot().load.remembered ? Je(e4 || this.getRoot(), t2) : t2.setValue(t2.initialValue), t2.__onFinishChange && t2.__onFinishChange.call(t2, t2.getValue());
|
|
1533
|
+
}, this), Q.each(this.__folders, function(e5) {
|
|
1527
1534
|
e5.revert(e5);
|
|
1528
|
-
}), e4 ||
|
|
1535
|
+
}), e4 || We(this.getRoot(), false);
|
|
1529
1536
|
}, listen: function(e4) {
|
|
1530
1537
|
var t2 = 0 === this.__listening.length;
|
|
1531
|
-
this.__listening.push(e4), t2 &&
|
|
1538
|
+
this.__listening.push(e4), t2 && tt(this.__listening);
|
|
1532
1539
|
}, updateDisplay: function() {
|
|
1533
|
-
|
|
1540
|
+
Q.each(this.__controllers, function(e4) {
|
|
1534
1541
|
e4.updateDisplay();
|
|
1535
|
-
}),
|
|
1542
|
+
}), Q.each(this.__folders, function(e4) {
|
|
1536
1543
|
e4.updateDisplay();
|
|
1537
1544
|
});
|
|
1538
1545
|
} });
|
|
1539
|
-
var
|
|
1540
|
-
const
|
|
1541
|
-
class
|
|
1546
|
+
var nt = Ve;
|
|
1547
|
+
const st = { autoPlace: true, width: 300, useProxy: false, closed: false }, it = ["立方体", "球体", "圆柱体", "圆锥体", "圆环", "平面", "圆环结", "十二面体", "二十面体", "八面体", "四面体"], ot = ["基础材质", "标准材质", "Lambert材质", "Phong材质", "物理材质", "Toon材质"], rt = ["AmbientLight", "DirectionalLight", "PointLight", "SpotLight", "HemisphereLight", "RectAreaLight"], at = ["围栏物体", "平面绘制", "曲线路径", "直线路径"], lt = ["场景交点", "地图区域中心", "地图行政中心"];
|
|
1548
|
+
class dt extends k {
|
|
1542
1549
|
constructor(e4) {
|
|
1543
|
-
super({ ...
|
|
1550
|
+
super({ ...st, ...e4 }), this.name = "gui", this._gui = null, this.sceneFolder = null, this.controlFolder = null, this.meshFolder = null, this.animationFolder = null, this.selectPanel = null, this.modelListFolder = null, this.innerMeshListFolder = null, this.drawMeshListFolder = null, this.geoMapListFolder = null, this.particleListFolder = null, this.borderGroupListFolder = null, this.textMeshListFolder = null, this.designMeshListFolder = null, this.lightListFolder = null, this.handlerParams = { mode: "变换", isTransformChildren: false, openKey: false }, this.innerMeshParams = { geometryType: "立方体", materialType: "标准材质" }, this.drawParams = { mode: "围栏物体", pointMode: "场景交点", materialType: "标准材质" }, this.geoMapParams = { url: "", materialType: "标准材质" }, this.particleParams = { particlesSum: 1e5, inner: 0, outer: 2e3, maxVelocity: 50, mapUrl: "https://z2586300277.github.io/three-editor/dist/files/channels/snow.png", sportType: "全随机", shaderCodeName: "水波纹" }, this.borderGroupParams = { url: "https://geo.datav.aliyun.com/areas_v3/bound/100000.json", materialType: "基础材质", dlength: 0 }, this.textMeshParams = { fontLink: "https://z2586300277.github.io/three-editor/dist/files/font/cn1.json", text: "", materialType: "标准材质" }, this.designMeshParams = { type: "镜面" }, this.lightParams = { lightType: "AmbientLight" };
|
|
1544
1551
|
}
|
|
1545
1552
|
onInstall() {
|
|
1546
1553
|
this.createGUI();
|
|
@@ -1556,7 +1563,7 @@ class at extends k {
|
|
|
1556
1563
|
return ((_a = this._gui) == null ? void 0 : _a.domElement) ?? null;
|
|
1557
1564
|
}
|
|
1558
1565
|
createGUI() {
|
|
1559
|
-
this.config.useProxy || (this._gui = new
|
|
1566
|
+
this.config.useProxy || (this._gui = new nt({ autoPlace: this.config.autoPlace, width: this.config.width }), this.createSceneFolder(), this.createControlFolder(), this.createMeshFolder(), this.createAnimationFolder());
|
|
1560
1567
|
}
|
|
1561
1568
|
createSceneFolder() {
|
|
1562
1569
|
this._gui && (this.sceneFolder = this._gui.addFolder("场景配置"), this.createRendererFolder(), this.createCameraFolder(), this.createOrbitControlsFolder(), this.createEnvironmentFolder(), this.createLightGroupFolder(), this.createComposerFolder(), this.config.closed || this.sceneFolder.open());
|
|
@@ -1615,7 +1622,7 @@ class at extends k {
|
|
|
1615
1622
|
createLightGroupFolder() {
|
|
1616
1623
|
if (!this.sceneFolder) return;
|
|
1617
1624
|
const e4 = this.sceneFolder.addFolder("灯光配置");
|
|
1618
|
-
this.lightListFolder = e4.addFolder("灯光列表"), e4.add(this.lightParams, "lightType",
|
|
1625
|
+
this.lightListFolder = e4.addFolder("灯光列表"), e4.add(this.lightParams, "lightType", rt).name("光源类型"), e4.add({ fn: () => {
|
|
1619
1626
|
const e5 = this.createLight(this.lightParams.lightType);
|
|
1620
1627
|
this.scene.add(e5), this.addLightPanel(e5), this.events.emit("light:add", { light: e5 });
|
|
1621
1628
|
} }, "fn").name("添加光源"), this.scene.children.forEach((e5) => {
|
|
@@ -1819,7 +1826,7 @@ class at extends k {
|
|
|
1819
1826
|
createDrawFolder() {
|
|
1820
1827
|
if (!this.meshFolder) return;
|
|
1821
1828
|
const e4 = this.meshFolder.addFolder("绘制配置");
|
|
1822
|
-
this.drawMeshListFolder = e4.addFolder("已有列表"), e4.add(this.drawParams, "mode",
|
|
1829
|
+
this.drawMeshListFolder = e4.addFolder("已有列表"), e4.add(this.drawParams, "mode", at).name("绘制模式"), e4.add(this.drawParams, "pointMode", lt).name("点模式"), e4.add(this.drawParams, "materialType", ot).name("材质"), e4.add({ fn: () => {
|
|
1823
1830
|
this.events.emit("draw:start", { mode: this.drawParams.mode, pointMode: this.drawParams.pointMode, materialType: this.drawParams.materialType });
|
|
1824
1831
|
} }, "fn").name("添加绘制组");
|
|
1825
1832
|
}
|
|
@@ -1837,7 +1844,7 @@ class at extends k {
|
|
|
1837
1844
|
createInnerMeshFolder() {
|
|
1838
1845
|
if (!this.meshFolder) return;
|
|
1839
1846
|
const e4 = this.meshFolder.addFolder("内置物体");
|
|
1840
|
-
this.innerMeshListFolder = e4.addFolder("已有列表"), e4.add(this.innerMeshParams, "geometryType",
|
|
1847
|
+
this.innerMeshListFolder = e4.addFolder("已有列表"), e4.add(this.innerMeshParams, "geometryType", it).name("几何体"), e4.add(this.innerMeshParams, "materialType", ot).name("材质"), e4.add({ fn: () => {
|
|
1841
1848
|
var _a;
|
|
1842
1849
|
const e5 = this.createGeometry(this.innerMeshParams.geometryType), n2 = this.createMaterial(this.innerMeshParams.materialType), s2 = new t.Mesh(e5, n2);
|
|
1843
1850
|
s2.isInnerMesh = true, s2.geometryType = this.innerMeshParams.geometryType, s2.materialType = this.innerMeshParams.materialType, this.scene.add(s2), this.addInnerMeshPanel(s2);
|
|
@@ -1876,7 +1883,7 @@ class at extends k {
|
|
|
1876
1883
|
createGeoMapFolder() {
|
|
1877
1884
|
if (!this.meshFolder) return;
|
|
1878
1885
|
const e4 = this.meshFolder.addFolder("三维地图");
|
|
1879
|
-
this.geoMapListFolder = e4.addFolder("地图列表"), e4.add(this.geoMapParams, "url").name("地图数据地址"), e4.add(this.geoMapParams, "materialType",
|
|
1886
|
+
this.geoMapListFolder = e4.addFolder("地图列表"), e4.add(this.geoMapParams, "url").name("地图数据地址"), e4.add(this.geoMapParams, "materialType", ot).name("地图材质类型"), e4.add({ fn: () => {
|
|
1880
1887
|
const e5 = this.geoMapParams.url || "https://z2586300277.github.io/3d-file-server/files/json/guangdong.json";
|
|
1881
1888
|
this.events.emit("geomap:load", { url: e5, materialType: this.geoMapParams.materialType });
|
|
1882
1889
|
} }, "fn").name("添加地图");
|
|
@@ -1915,7 +1922,7 @@ class at extends k {
|
|
|
1915
1922
|
createBorderGroupFolder() {
|
|
1916
1923
|
if (!this.meshFolder) return;
|
|
1917
1924
|
const e4 = this.meshFolder.addFolder("边界物体");
|
|
1918
|
-
this.borderGroupListFolder = e4.addFolder("列表"), e4.add(this.borderGroupParams, "url").name("边界物体数据源"), e4.add(this.borderGroupParams, "materialType",
|
|
1925
|
+
this.borderGroupListFolder = e4.addFolder("列表"), e4.add(this.borderGroupParams, "url").name("边界物体数据源"), e4.add(this.borderGroupParams, "materialType", ot).name("材质类型"), e4.add(this.borderGroupParams, "dlength", 0).name("低于点数舍弃"), e4.add({ fn: () => {
|
|
1919
1926
|
this.events.emit("bordergroup:create", { ...this.borderGroupParams });
|
|
1920
1927
|
} }, "fn").name("添加边界物体");
|
|
1921
1928
|
}
|
|
@@ -1933,7 +1940,7 @@ class at extends k {
|
|
|
1933
1940
|
createTextMeshFolder() {
|
|
1934
1941
|
if (!this.meshFolder) return;
|
|
1935
1942
|
const e4 = this.meshFolder.addFolder("文本物体");
|
|
1936
|
-
this.textMeshListFolder = e4.addFolder("列表"), e4.add(this.textMeshParams, "fontLink").name("字体链接"), e4.add(this.textMeshParams, "materialType",
|
|
1943
|
+
this.textMeshListFolder = e4.addFolder("列表"), e4.add(this.textMeshParams, "fontLink").name("字体链接"), e4.add(this.textMeshParams, "materialType", ot).name("材质类型"), e4.add(this.textMeshParams, "text").name("文本内容"), e4.add({ fn: () => {
|
|
1937
1944
|
this.textMeshParams.text && this.events.emit("textmesh:create", { ...this.textMeshParams });
|
|
1938
1945
|
} }, "fn").name("添加文本物体");
|
|
1939
1946
|
}
|
|
@@ -2133,10 +2140,10 @@ class at extends k {
|
|
|
2133
2140
|
return this.handlerParams.mode;
|
|
2134
2141
|
}
|
|
2135
2142
|
}
|
|
2136
|
-
const
|
|
2137
|
-
class
|
|
2143
|
+
const ct = { grid: { enabled: true, size: 100, divisions: 100, colorCenterLine: 4473924, colorGrid: 8947848 }, axes: { enabled: true, size: 5 }, stats: { enabled: false, mode: 0 }, viewHelper: { enabled: false, size: 128, position: "bottom-right" }, box3Helper: { enabled: false, color: 16776960 } };
|
|
2144
|
+
class ht extends k {
|
|
2138
2145
|
constructor(e4) {
|
|
2139
|
-
super({ ...
|
|
2146
|
+
super({ ...ct, ...e4 }), this.name = "gizmo", this.gridHelper = null, this.axesHelper = null, this.stats = null, this.viewHelper = null, this.box3Helper = null, this.currentBox3 = null;
|
|
2140
2147
|
}
|
|
2141
2148
|
onInstall() {
|
|
2142
2149
|
this.config.grid.enabled && this.createGridHelper(), this.config.axes.enabled && this.createAxesHelper(), this.config.stats.enabled && this.createStats(), this.config.viewHelper.enabled && this.createViewHelper(), this.subscribe("object:selected", (e4) => {
|
|
@@ -2244,50 +2251,50 @@ class dt extends k {
|
|
|
2244
2251
|
return { ...this.config };
|
|
2245
2252
|
}
|
|
2246
2253
|
}
|
|
2247
|
-
function
|
|
2254
|
+
function ut(e4, n2, s2 = 0.9) {
|
|
2248
2255
|
const i2 = e4.distanceTo(n2);
|
|
2249
2256
|
return new t.Vector3().subVectors(n2, e4).normalize().multiplyScalar(i2 * s2).add(e4);
|
|
2250
2257
|
}
|
|
2251
|
-
function
|
|
2258
|
+
function mt(e4, n2, s2) {
|
|
2252
2259
|
return new t.Vector3().subVectors(n2, e4).normalize().multiplyScalar(s2).add(e4);
|
|
2253
2260
|
}
|
|
2254
|
-
function
|
|
2261
|
+
function pt(e4) {
|
|
2255
2262
|
return e4 * (Math.PI / 180);
|
|
2256
2263
|
}
|
|
2257
|
-
function
|
|
2264
|
+
function ft(e4) {
|
|
2258
2265
|
return e4 * (180 / Math.PI);
|
|
2259
2266
|
}
|
|
2260
|
-
function
|
|
2267
|
+
function gt(e4, t2, n2) {
|
|
2261
2268
|
return Math.max(t2, Math.min(n2, e4));
|
|
2262
2269
|
}
|
|
2263
|
-
function
|
|
2270
|
+
function _t(e4, t2, n2) {
|
|
2264
2271
|
return e4 + (t2 - e4) * n2;
|
|
2265
2272
|
}
|
|
2266
|
-
function
|
|
2267
|
-
const s2 =
|
|
2273
|
+
function vt(e4, t2, n2) {
|
|
2274
|
+
const s2 = gt((n2 - e4) / (t2 - e4), 0, 1);
|
|
2268
2275
|
return s2 * s2 * (3 - 2 * s2);
|
|
2269
2276
|
}
|
|
2270
|
-
function
|
|
2277
|
+
function bt(e4) {
|
|
2271
2278
|
const n2 = new t.Box3().setFromObject(e4), { max: s2, min: i2 } = n2, o2 = new t.Vector3();
|
|
2272
2279
|
n2.getCenter(o2);
|
|
2273
2280
|
return { max: s2, min: i2, center: o2, radius: new t.Vector3().subVectors(s2, i2).length() / 2 };
|
|
2274
2281
|
}
|
|
2275
|
-
function
|
|
2276
|
-
const { center: s2, max: i2 } =
|
|
2277
|
-
return { position:
|
|
2282
|
+
function yt(e4, n2 = 2.5) {
|
|
2283
|
+
const { center: s2, max: i2 } = bt(e4);
|
|
2284
|
+
return { position: mt(s2, i2, new t.Vector3().subVectors(i2, s2).length() * n2), target: s2 };
|
|
2278
2285
|
}
|
|
2279
|
-
function
|
|
2280
|
-
const { center: s2, max: i2, min: o2, radius: r2 } =
|
|
2286
|
+
function wt(e4, n2 = 50) {
|
|
2287
|
+
const { center: s2, max: i2, min: o2, radius: r2 } = bt(e4), a2 = r2 / Math.tan(n2 * Math.PI / 360);
|
|
2281
2288
|
return { frontView: new t.Vector3(s2.x, s2.y, i2.z + a2), backView: new t.Vector3(s2.x, s2.y, o2.z - a2), leftView: new t.Vector3(o2.x - a2, s2.y, s2.z), rightView: new t.Vector3(i2.x + a2, s2.y, s2.z), topView: new t.Vector3(s2.x, i2.y + a2, s2.z), bottomView: new t.Vector3(s2.x, o2.y - a2, s2.z), target: s2 };
|
|
2282
2289
|
}
|
|
2283
|
-
function
|
|
2290
|
+
function xt(e4 = 16776960) {
|
|
2284
2291
|
const n2 = new t.Box3(), s2 = new t.Box3Helper(n2, e4);
|
|
2285
2292
|
return s2.name = "Box3Helper", s2.visible = false, s2;
|
|
2286
2293
|
}
|
|
2287
|
-
const
|
|
2288
|
-
class
|
|
2294
|
+
const Ct = { speed: 0.01, mixRatio: 0.5 };
|
|
2295
|
+
class Mt extends k {
|
|
2289
2296
|
constructor(e4) {
|
|
2290
|
-
super({ ...
|
|
2297
|
+
super({ ...Ct, ...e4 }), this.name = "shader", this.presets = /* @__PURE__ */ new Map(), this.appliedObjects = /* @__PURE__ */ new Map(), this.shaderAnimations = [];
|
|
2291
2298
|
}
|
|
2292
2299
|
onInstall() {
|
|
2293
2300
|
this.registerBuiltinPresets();
|
|
@@ -2394,10 +2401,10 @@ ${n2.fragFunc || ""}`), e5.fragmentShader = e5.fragmentShader.replace("vec4 diff
|
|
|
2394
2401
|
}), [...new Set(t2)];
|
|
2395
2402
|
}
|
|
2396
2403
|
}
|
|
2397
|
-
const
|
|
2398
|
-
class
|
|
2404
|
+
const Pt = { defaultDuration: 2, defaultEase: "power2.inOut" };
|
|
2405
|
+
class St extends k {
|
|
2399
2406
|
constructor(e4) {
|
|
2400
|
-
super({ ...
|
|
2407
|
+
super({ ...Pt, ...e4 }), this.name = "animation", this.mixers = [], this.curveAnimations = [], this.tweens = [];
|
|
2401
2408
|
}
|
|
2402
2409
|
onUninstall() {
|
|
2403
2410
|
this.stopAll();
|
|
@@ -2510,10 +2517,10 @@ class Mt extends k {
|
|
|
2510
2517
|
for (const e4 of this.tweens) e4.resume();
|
|
2511
2518
|
}
|
|
2512
2519
|
}
|
|
2513
|
-
const
|
|
2514
|
-
class
|
|
2520
|
+
const Ft = { defaultMode: "围栏物体", defaultPointMode: "场景交点", defaultMaterialType: "标准材质", fenceHeight: 5, lineWidth: 0.01 };
|
|
2521
|
+
class Et extends k {
|
|
2515
2522
|
constructor(e4) {
|
|
2516
|
-
super({ ...
|
|
2523
|
+
super({ ...Ft, ...e4 }), this.name = "drawing", this.currentPoints = [], this.previewMesh = null, this._isDrawing = false, this.drawnObjects = [], this._mode = this.config.defaultMode, this._pointMode = this.config.defaultPointMode;
|
|
2517
2524
|
}
|
|
2518
2525
|
get mode() {
|
|
2519
2526
|
return this._mode;
|
|
@@ -2657,10 +2664,10 @@ class St extends k {
|
|
|
2657
2664
|
return this.scene.children.filter((e4) => e4.isCurveMesh).map((e4) => ({ path: e4.curvePath, mesh: e4 }));
|
|
2658
2665
|
}
|
|
2659
2666
|
}
|
|
2660
|
-
const
|
|
2661
|
-
class
|
|
2667
|
+
const At = { materialType: "标准材质", coordinateScale: 1e4 };
|
|
2668
|
+
class kt extends k {
|
|
2662
2669
|
constructor(e4) {
|
|
2663
|
-
super({ ...
|
|
2670
|
+
super({ ...At, ...e4 }), this.name = "geomap", this.geoGroups = [];
|
|
2664
2671
|
}
|
|
2665
2672
|
onUninstall() {
|
|
2666
2673
|
this.clearAll();
|
|
@@ -2755,10 +2762,10 @@ class Et extends k {
|
|
|
2755
2762
|
e4.material instanceof t.MeshStandardMaterial && (e4.material.emissiveIntensity = 0);
|
|
2756
2763
|
}
|
|
2757
2764
|
}
|
|
2758
|
-
const
|
|
2759
|
-
class
|
|
2765
|
+
const Tt = { defaultSize: 1 };
|
|
2766
|
+
class Lt extends k {
|
|
2760
2767
|
constructor(e4) {
|
|
2761
|
-
super({ ...
|
|
2768
|
+
super({ ...Tt, ...e4 }), this.name = "geometry", this.geometryTypes = ["立方体", "球体", "圆柱体", "圆锥体", "平面", "圆环", "圆环结", "十二面体", "二十面体", "八面体", "四面体", "胶囊体"], this.innerMeshes = [];
|
|
2762
2769
|
}
|
|
2763
2770
|
onUninstall() {
|
|
2764
2771
|
this.clearAll();
|
|
@@ -2824,10 +2831,10 @@ class kt extends k {
|
|
|
2824
2831
|
e4.geometry = this.createGeometry(t2, n2), e4.geometry.geometryType = t2, s2.dispose();
|
|
2825
2832
|
}
|
|
2826
2833
|
}
|
|
2827
|
-
const
|
|
2828
|
-
class
|
|
2834
|
+
const Ht = { defaultType: "标准材质", defaultColor: 8421504 };
|
|
2835
|
+
class Ot extends k {
|
|
2829
2836
|
constructor(e4) {
|
|
2830
|
-
super({ ...
|
|
2837
|
+
super({ ...Ht, ...e4 }), this.name = "material", this.materialTypes = ["基础材质", "标准材质", "物理材质", "Lambert材质", "Phong材质", "Toon材质", "法线材质", "深度材质"];
|
|
2831
2838
|
}
|
|
2832
2839
|
createMaterial(e4, n2) {
|
|
2833
2840
|
const s2 = n2 || {}, i2 = { color: s2.color ?? this.config.defaultColor, opacity: s2.opacity ?? 1, transparent: s2.transparent ?? false, side: s2.side ?? t.FrontSide, wireframe: s2.wireframe ?? false };
|
|
@@ -2899,10 +2906,10 @@ class Lt extends k {
|
|
|
2899
2906
|
}), [...new Set(t2)];
|
|
2900
2907
|
}
|
|
2901
2908
|
}
|
|
2902
|
-
const
|
|
2903
|
-
class
|
|
2909
|
+
const Bt = { particlesSum: 1e4, inner: 0, outer: 100, maxVelocity: 10, mapUrl: "", shaderCodeName: "雪片着色", sportType: "全随机" };
|
|
2910
|
+
class jt extends k {
|
|
2904
2911
|
constructor(e4) {
|
|
2905
|
-
super({ ...
|
|
2912
|
+
super({ ...Bt, ...e4 }), this.name = "particle", this.sportTypes = ["全随机", "随机向下", "随机向上", "直线匀速向上", "直线匀速向下"], this.particleSystems = [], this.textureLoader = new t.TextureLoader();
|
|
2906
2913
|
}
|
|
2907
2914
|
onUninstall() {
|
|
2908
2915
|
this.clearAll();
|
|
@@ -2972,10 +2979,10 @@ class Ht extends k {
|
|
|
2972
2979
|
e4.visible = t2;
|
|
2973
2980
|
}
|
|
2974
2981
|
}
|
|
2975
|
-
const
|
|
2976
|
-
class
|
|
2982
|
+
const Rt = { gravity: { x: 0, y: -9.82, z: 0 }, defaultMass: 1 };
|
|
2983
|
+
class zt extends k {
|
|
2977
2984
|
constructor(e4) {
|
|
2978
|
-
super({ ...
|
|
2985
|
+
super({ ...Rt, ...e4 }), this.name = "physics", this.bodies = [], this._enabled = true;
|
|
2979
2986
|
}
|
|
2980
2987
|
get physicsWorld() {
|
|
2981
2988
|
return this.world;
|
|
@@ -3002,7 +3009,7 @@ class jt extends k {
|
|
|
3002
3009
|
this.world.gravity.set(e4, t2, n2), this.config.gravity = { x: e4, y: t2, z: n2 };
|
|
3003
3010
|
}
|
|
3004
3011
|
addBody(e4, t2) {
|
|
3005
|
-
const { center: n2, max: s2, min: i2, radius: o2 } =
|
|
3012
|
+
const { center: n2, max: s2, min: i2, radius: o2 } = bt(e4), r2 = (t2 == null ? void 0 : t2.isStatic) ? 0 : (t2 == null ? void 0 : t2.mass) ?? this.config.defaultMass;
|
|
3006
3013
|
let a2;
|
|
3007
3014
|
switch (t2 == null ? void 0 : t2.shape) {
|
|
3008
3015
|
case "sphere":
|
|
@@ -3075,10 +3082,10 @@ class jt extends k {
|
|
|
3075
3082
|
return this.bodies;
|
|
3076
3083
|
}
|
|
3077
3084
|
}
|
|
3078
|
-
const
|
|
3079
|
-
class
|
|
3085
|
+
const Dt = { defaultFontUrl: "https://z2586300277.github.io/three-editor/dist/files/font/cn1.json", defaultSize: 1, defaultHeight: 0.2 };
|
|
3086
|
+
class Gt extends k {
|
|
3080
3087
|
constructor(e4) {
|
|
3081
|
-
super({ ...
|
|
3088
|
+
super({ ...Dt, ...e4 }), this.name = "text", this.fontLoader = new l(), this.fontCache = /* @__PURE__ */ new Map(), this.textMeshes = [];
|
|
3082
3089
|
}
|
|
3083
3090
|
onUninstall() {
|
|
3084
3091
|
this.clearAll(), this.fontCache.clear();
|
|
@@ -3131,10 +3138,10 @@ class zt extends k {
|
|
|
3131
3138
|
this.textMeshes = [];
|
|
3132
3139
|
}
|
|
3133
3140
|
}
|
|
3134
|
-
const
|
|
3135
|
-
class
|
|
3141
|
+
const Ut = { fog: { enabled: false, type: "linear", color: 13421772, near: 1, far: 1e3, density: 25e-5 }, skybox: null, environmentMap: null, environmentIntensity: 1, backgroundBlurriness: 0, backgroundIntensity: 1 };
|
|
3142
|
+
class It extends k {
|
|
3136
3143
|
constructor(e4) {
|
|
3137
|
-
super({ ...
|
|
3144
|
+
super({ ...Ut, ...e4 }), this.name = "environment", this.rgbeLoader = new E(), this.cubeTextureLoader = new t.CubeTextureLoader(), this.textureLoader = new t.TextureLoader(), this.currentEnvMap = null, this.currentBackground = null;
|
|
3138
3145
|
}
|
|
3139
3146
|
onInstall() {
|
|
3140
3147
|
this.config.fog.enabled && this.setFog(this.config.fog), this.config.skybox && this.setSkybox(this.config.skybox), this.config.environmentMap && this.setEnvironmentMap(this.config.environmentMap);
|
|
@@ -3244,10 +3251,10 @@ class Gt extends k {
|
|
|
3244
3251
|
return { ...this.config };
|
|
3245
3252
|
}
|
|
3246
3253
|
}
|
|
3247
|
-
const
|
|
3248
|
-
class
|
|
3254
|
+
const Vt = { version: "1.0.0", includeGeometry: false, includeMaterial: true, includeUserData: true, excludeHelpers: true };
|
|
3255
|
+
class Nt extends k {
|
|
3249
3256
|
constructor(e4) {
|
|
3250
|
-
super({ ...
|
|
3257
|
+
super({ ...Vt, ...e4 }), this.name = "serialization";
|
|
3251
3258
|
}
|
|
3252
3259
|
serialize() {
|
|
3253
3260
|
const e4 = this.scene, t2 = this.camera;
|
|
@@ -3351,61 +3358,61 @@ class It extends k {
|
|
|
3351
3358
|
}
|
|
3352
3359
|
}
|
|
3353
3360
|
export {
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3361
|
+
vt as $,
|
|
3362
|
+
St as A,
|
|
3363
|
+
rt as B,
|
|
3357
3364
|
z as C,
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3365
|
+
J as D,
|
|
3366
|
+
Y as E,
|
|
3367
|
+
at as F,
|
|
3368
|
+
Lt as G,
|
|
3369
|
+
lt as H,
|
|
3370
|
+
ut as I,
|
|
3371
|
+
yt as J,
|
|
3372
|
+
wt as K,
|
|
3366
3373
|
j as L,
|
|
3367
|
-
|
|
3374
|
+
Ot as M,
|
|
3368
3375
|
G as N,
|
|
3369
3376
|
L as O,
|
|
3370
3377
|
k as P,
|
|
3371
3378
|
U as Q,
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3379
|
+
N as R,
|
|
3380
|
+
Mt as S,
|
|
3381
|
+
O as T,
|
|
3382
|
+
X as U,
|
|
3383
|
+
W as V,
|
|
3384
|
+
mt as W,
|
|
3385
|
+
pt as X,
|
|
3386
|
+
ft as Y,
|
|
3387
|
+
gt as Z,
|
|
3388
|
+
_t as _,
|
|
3382
3389
|
A as a,
|
|
3383
|
-
|
|
3384
|
-
|
|
3390
|
+
bt as a0,
|
|
3391
|
+
xt as a1,
|
|
3385
3392
|
T as b,
|
|
3386
|
-
|
|
3393
|
+
H as c,
|
|
3387
3394
|
B as d,
|
|
3388
3395
|
R as e,
|
|
3389
3396
|
D as f,
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3397
|
+
Tt as g,
|
|
3398
|
+
Ht as h,
|
|
3399
|
+
Ct as i,
|
|
3400
|
+
Pt as j,
|
|
3401
|
+
Et as k,
|
|
3402
|
+
Ft as l,
|
|
3403
|
+
kt as m,
|
|
3404
|
+
At as n,
|
|
3405
|
+
jt as o,
|
|
3406
|
+
Bt as p,
|
|
3407
|
+
zt as q,
|
|
3408
|
+
Rt as r,
|
|
3409
|
+
Gt as s,
|
|
3410
|
+
ht as t,
|
|
3411
|
+
It as u,
|
|
3412
|
+
Nt as v,
|
|
3413
|
+
dt as w,
|
|
3414
|
+
st as x,
|
|
3415
|
+
it as y,
|
|
3416
|
+
ot as z
|
|
3410
3417
|
};
|
|
3411
|
-
//# sourceMappingURL=SerializationPlugin-
|
|
3418
|
+
//# sourceMappingURL=SerializationPlugin-D418fw5V.js.map
|