@kolkrabbi/design-editor 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +2 -2
  2. package/dist/BindDot-CMUtpJPX.js +84 -0
  3. package/dist/BufferGeometryUtils-Cc8LNd5v.js +150 -0
  4. package/dist/ColorModesWindow-CWhL6nfm.js +1493 -0
  5. package/dist/GLTFLoader-BFir8PCc.js +1361 -0
  6. package/dist/OBJLoader-BgqC_-Jn.js +287 -0
  7. package/dist/{OrbitControls-Cql8Rn2i.js → OrbitControls-DVpLgmKv.js} +2755 -2202
  8. package/dist/STLLoader-C6DGLf6r.js +83 -0
  9. package/dist/TreePicker-nMf17QGH.js +68 -0
  10. package/dist/core-CfGqY4VB.js +17504 -0
  11. package/dist/core.js +4 -3
  12. package/dist/design-editor.css +1 -1
  13. package/dist/design-editor.js +2114 -916
  14. package/dist/effects-DZEmfY7a.js +444 -0
  15. package/dist/effects.js +1 -1
  16. package/dist/generators-D1tFSZgG.js +2961 -0
  17. package/dist/generators.js +1 -1
  18. package/dist/{host-qtFVROOD.js → host-CRsCCafL.js} +429 -370
  19. package/dist/{host-be1CWhN1.js → host-ZLJKCZ54.js} +137 -136
  20. package/dist/motion-BJ8xqUKI.js +3096 -0
  21. package/dist/motion.js +1 -1
  22. package/dist/previewScale-BMkeLc6w.js +26 -0
  23. package/dist/{rolls-Bg1XHuvJ.js → rolls-BGtqxVYq.js} +2621 -1522
  24. package/dist/{src-B5fQgAVE.js → src-BpTckTDZ.js} +1 -1
  25. package/dist/{labels-B5qkocWy.js → timelinePinned-BwYq1Msi.js} +321 -164
  26. package/dist/{useLayerEdit-ieOjHx6x.js → useLayerEdit-BFcZhiNX.js} +20992 -12580
  27. package/package.json +10 -8
  28. package/dist/RuleRow-DIbuUt37.js +0 -650
  29. package/dist/TreePicker-DLmMl0aU.js +0 -68
  30. package/dist/core-CNI8b_83.js +0 -12314
  31. package/dist/effectCategories-0PnGZvjd.js +0 -4210
  32. package/dist/effects-BujxwoNY.js +0 -469
  33. package/dist/generators-SpRHQDMq.js +0 -2517
  34. package/dist/motion-Bn3FVkCS.js +0 -2260
@@ -0,0 +1,287 @@
1
+ import { D as e, H as t, Ht as n, T as r, Tt as i, W as a, Y as o, Z as s, bt as c, et as l, it as u, p as d, v as f, w as p, yt as m } from "./OrbitControls-DVpLgmKv.js";
2
+ //#region ../../node_modules/.pnpm/three@0.185.1/node_modules/three/examples/jsm/loaders/OBJLoader.js
3
+ var h = /^[og]\s*(.+)?/, g = /^mtllib /, _ = /^usemtl /, v = /^usemap /, y = /\s+/, b = new n(), x = new n(), S = new n(), C = new n(), w = new n(), T = new f();
4
+ function E() {
5
+ let e = {
6
+ objects: [],
7
+ object: {},
8
+ vertices: [],
9
+ normals: [],
10
+ colors: [],
11
+ uvs: [],
12
+ materials: {},
13
+ materialLibraries: [],
14
+ startObject: function(e, t) {
15
+ if (this.object && this.object.fromDeclaration === !1) {
16
+ this.object.name = e, this.object.fromDeclaration = t !== !1;
17
+ return;
18
+ }
19
+ let n = this.object && typeof this.object.currentMaterial == "function" ? this.object.currentMaterial() : void 0;
20
+ if (this.object && typeof this.object._finalize == "function" && this.object._finalize(!0), this.object = {
21
+ name: e || "",
22
+ fromDeclaration: t !== !1,
23
+ geometry: {
24
+ vertices: [],
25
+ normals: [],
26
+ colors: [],
27
+ uvs: [],
28
+ hasUVIndices: !1
29
+ },
30
+ materials: [],
31
+ smooth: !0,
32
+ startMaterial: function(e, t) {
33
+ let n = this._finalize(!1);
34
+ n && (n.inherited || n.groupCount <= 0) && this.materials.splice(n.index, 1);
35
+ let r = {
36
+ index: this.materials.length,
37
+ name: e || "",
38
+ mtllib: Array.isArray(t) && t.length > 0 ? t[t.length - 1] : "",
39
+ smooth: n === void 0 ? this.smooth : n.smooth,
40
+ groupStart: n === void 0 ? 0 : n.groupEnd,
41
+ groupEnd: -1,
42
+ groupCount: -1,
43
+ inherited: !1,
44
+ clone: function(e) {
45
+ let t = {
46
+ index: typeof e == "number" ? e : this.index,
47
+ name: this.name,
48
+ mtllib: this.mtllib,
49
+ smooth: this.smooth,
50
+ groupStart: 0,
51
+ groupEnd: -1,
52
+ groupCount: -1,
53
+ inherited: !1
54
+ };
55
+ return t.clone = this.clone.bind(t), t;
56
+ }
57
+ };
58
+ return this.materials.push(r), r;
59
+ },
60
+ currentMaterial: function() {
61
+ if (this.materials.length > 0) return this.materials[this.materials.length - 1];
62
+ },
63
+ _finalize: function(e) {
64
+ let t = this.currentMaterial();
65
+ if (t && t.groupEnd === -1 && (t.groupEnd = this.geometry.vertices.length / 3, t.groupCount = t.groupEnd - t.groupStart, t.inherited = !1), e && this.materials.length > 1) for (let e = this.materials.length - 1; e >= 0; e--) this.materials[e].groupCount <= 0 && this.materials.splice(e, 1);
66
+ return e && this.materials.length === 0 && this.materials.push({
67
+ name: "",
68
+ smooth: this.smooth
69
+ }), t;
70
+ }
71
+ }, n && n.name && typeof n.clone == "function") {
72
+ let e = n.clone(0);
73
+ e.inherited = !0, this.object.materials.push(e);
74
+ }
75
+ this.objects.push(this.object);
76
+ },
77
+ finalize: function() {
78
+ this.object && typeof this.object._finalize == "function" && this.object._finalize(!0);
79
+ },
80
+ parseVertexIndex: function(e, t) {
81
+ let n = parseInt(e, 10);
82
+ return (n >= 0 ? n - 1 : n + t / 3) * 3;
83
+ },
84
+ parseNormalIndex: function(e, t) {
85
+ let n = parseInt(e, 10);
86
+ return (n >= 0 ? n - 1 : n + t / 3) * 3;
87
+ },
88
+ parseUVIndex: function(e, t) {
89
+ let n = parseInt(e, 10);
90
+ return (n >= 0 ? n - 1 : n + t / 2) * 2;
91
+ },
92
+ addVertex: function(e, t, n) {
93
+ let r = this.vertices, i = this.object.geometry.vertices;
94
+ i.push(r[e + 0], r[e + 1], r[e + 2]), i.push(r[t + 0], r[t + 1], r[t + 2]), i.push(r[n + 0], r[n + 1], r[n + 2]);
95
+ },
96
+ addVertexPoint: function(e) {
97
+ let t = this.vertices;
98
+ this.object.geometry.vertices.push(t[e + 0], t[e + 1], t[e + 2]);
99
+ },
100
+ addVertexLine: function(e) {
101
+ let t = this.vertices;
102
+ this.object.geometry.vertices.push(t[e + 0], t[e + 1], t[e + 2]);
103
+ },
104
+ addNormal: function(e, t, n) {
105
+ let r = this.normals, i = this.object.geometry.normals;
106
+ i.push(r[e + 0], r[e + 1], r[e + 2]), i.push(r[t + 0], r[t + 1], r[t + 2]), i.push(r[n + 0], r[n + 1], r[n + 2]);
107
+ },
108
+ addFaceNormal: function(e, t, n) {
109
+ let r = this.vertices, i = this.object.geometry.normals;
110
+ b.fromArray(r, e), x.fromArray(r, t), S.fromArray(r, n), w.subVectors(S, x), C.subVectors(b, x), w.cross(C), w.normalize(), i.push(w.x, w.y, w.z), i.push(w.x, w.y, w.z), i.push(w.x, w.y, w.z);
111
+ },
112
+ addColor: function(e, t, n) {
113
+ let r = this.colors, i = this.object.geometry.colors;
114
+ r[e] !== void 0 && i.push(r[e + 0], r[e + 1], r[e + 2]), r[t] !== void 0 && i.push(r[t + 0], r[t + 1], r[t + 2]), r[n] !== void 0 && i.push(r[n + 0], r[n + 1], r[n + 2]);
115
+ },
116
+ addUV: function(e, t, n) {
117
+ let r = this.uvs, i = this.object.geometry.uvs;
118
+ i.push(r[e + 0], r[e + 1]), i.push(r[t + 0], r[t + 1]), i.push(r[n + 0], r[n + 1]);
119
+ },
120
+ addDefaultUV: function() {
121
+ let e = this.object.geometry.uvs;
122
+ e.push(0, 0), e.push(0, 0), e.push(0, 0);
123
+ },
124
+ addUVLine: function(e) {
125
+ let t = this.uvs;
126
+ this.object.geometry.uvs.push(t[e + 0], t[e + 1]);
127
+ },
128
+ addFace: function(e, t, n, r, i, a, o, s, c) {
129
+ let l = this.vertices.length, u = this.parseVertexIndex(e, l), d = this.parseVertexIndex(t, l), f = this.parseVertexIndex(n, l);
130
+ if (this.addVertex(u, d, f), this.addColor(u, d, f), o !== void 0 && o !== "") {
131
+ let e = this.normals.length;
132
+ u = this.parseNormalIndex(o, e), d = this.parseNormalIndex(s, e), f = this.parseNormalIndex(c, e), this.addNormal(u, d, f);
133
+ } else this.addFaceNormal(u, d, f);
134
+ if (r !== void 0 && r !== "") {
135
+ let e = this.uvs.length;
136
+ u = this.parseUVIndex(r, e), d = this.parseUVIndex(i, e), f = this.parseUVIndex(a, e), this.addUV(u, d, f), this.object.geometry.hasUVIndices = !0;
137
+ } else this.addDefaultUV();
138
+ },
139
+ addPointGeometry: function(e) {
140
+ this.object.geometry.type = "Points";
141
+ let t = this.vertices.length;
142
+ for (let n = 0, r = e.length; n < r; n++) {
143
+ let r = this.parseVertexIndex(e[n], t);
144
+ this.addVertexPoint(r), this.addColor(r);
145
+ }
146
+ },
147
+ addLineGeometry: function(e, t) {
148
+ this.object.geometry.type = "Line";
149
+ let n = this.vertices.length, r = this.uvs.length;
150
+ for (let t = 0, r = e.length; t < r; t++) this.addVertexLine(this.parseVertexIndex(e[t], n));
151
+ for (let e = 0, n = t.length; e < n; e++) this.addUVLine(this.parseUVIndex(t[e], r));
152
+ }
153
+ };
154
+ return e.startObject("", !1), e;
155
+ }
156
+ var D = class extends o {
157
+ constructor(e) {
158
+ super(e), this.materials = null;
159
+ }
160
+ load(e, t, n, r) {
161
+ let i = this, a = new p(this.manager);
162
+ a.setPath(this.path), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(n) {
163
+ try {
164
+ t(i.parse(n));
165
+ } catch (t) {
166
+ r ? r(t) : console.error(t), i.manager.itemError(e);
167
+ }
168
+ }, n, r);
169
+ }
170
+ setMaterials(e) {
171
+ return this.materials = e, this;
172
+ }
173
+ parse(n) {
174
+ let o = new E();
175
+ n.indexOf("\r\n") !== -1 && (n = n.replace(/\r\n/g, "\n")), n.indexOf("\\\n") !== -1 && (n = n.replace(/\\\n/g, ""));
176
+ let f = n.split("\n"), p = [];
177
+ for (let e = 0, t = f.length; e < t; e++) {
178
+ let t = f[e].trimStart();
179
+ if (t.length === 0) continue;
180
+ let n = t.charAt(0);
181
+ if (n !== "#") if (n === "v") {
182
+ let e = t.split(y);
183
+ switch (e[0]) {
184
+ case "v":
185
+ o.vertices.push(parseFloat(e[1]), parseFloat(e[2]), parseFloat(e[3])), e.length >= 7 ? (T.setRGB(parseFloat(e[4]), parseFloat(e[5]), parseFloat(e[6]), i), o.colors.push(T.r, T.g, T.b)) : o.colors.push(void 0, void 0, void 0);
186
+ break;
187
+ case "vn":
188
+ o.normals.push(parseFloat(e[1]), parseFloat(e[2]), parseFloat(e[3]));
189
+ break;
190
+ case "vt":
191
+ o.uvs.push(parseFloat(e[1]), parseFloat(e[2]));
192
+ break;
193
+ }
194
+ } else if (n === "f") {
195
+ let e = t.slice(1).trim().split(y), n = [];
196
+ for (let t = 0, r = e.length; t < r; t++) {
197
+ let r = e[t];
198
+ if (r.length > 0) {
199
+ let e = r.split("/");
200
+ n.push(e);
201
+ }
202
+ }
203
+ let r = n[0];
204
+ for (let e = 1, t = n.length - 1; e < t; e++) {
205
+ let t = n[e], i = n[e + 1];
206
+ o.addFace(r[0], t[0], i[0], r[1], t[1], i[1], r[2], t[2], i[2]);
207
+ }
208
+ } else if (n === "l") {
209
+ let e = t.substring(1).trim().split(" "), n = [], r = [];
210
+ if (t.indexOf("/") === -1) n = e;
211
+ else for (let t = 0, i = e.length; t < i; t++) {
212
+ let i = e[t].split("/");
213
+ i[0] !== "" && n.push(i[0]), i[1] !== "" && r.push(i[1]);
214
+ }
215
+ o.addLineGeometry(n, r);
216
+ } else if (n === "p") {
217
+ let e = t.slice(1).trim().split(" ");
218
+ o.addPointGeometry(e);
219
+ } else if ((p = h.exec(t)) !== null) {
220
+ let e = (" " + p[0].slice(1).trim()).slice(1);
221
+ o.startObject(e);
222
+ } else if (_.test(t)) o.object.startMaterial(t.substring(7).trim(), o.materialLibraries);
223
+ else if (g.test(t)) o.materialLibraries.push(t.substring(7).trim());
224
+ else if (v.test(t)) console.warn("THREE.OBJLoader: Rendering identifier \"usemap\" not supported. Textures must be defined in MTL files.");
225
+ else if (n === "s") {
226
+ if (p = t.split(" "), p.length > 1) {
227
+ let e = p[1].trim().toLowerCase();
228
+ o.object.smooth = e !== "0" && e !== "off";
229
+ } else o.object.smooth = !0;
230
+ let e = o.object.currentMaterial();
231
+ e && (e.smooth = o.object.smooth);
232
+ } else {
233
+ if (t === "\0") continue;
234
+ console.warn("THREE.OBJLoader: Unexpected line: \"" + t + "\"");
235
+ }
236
+ }
237
+ o.finalize();
238
+ let b = new e();
239
+ if (b.materialLibraries = [].concat(o.materialLibraries), !(o.objects.length === 1 && o.objects[0].geometry.vertices.length === 0)) for (let e = 0, n = o.objects.length; e < n; e++) {
240
+ let n = o.objects[e], i = n.geometry, f = n.materials, p = i.type === "Line", h = i.type === "Points", g = !1;
241
+ if (i.vertices.length === 0) continue;
242
+ let _ = new d();
243
+ _.setAttribute("position", new r(i.vertices, 3)), i.normals.length > 0 && _.setAttribute("normal", new r(i.normals, 3)), i.colors.length > 0 && (g = !0, _.setAttribute("color", new r(i.colors, 3))), i.hasUVIndices === !0 && _.setAttribute("uv", new r(i.uvs, 2));
244
+ let v = [];
245
+ for (let e = 0, n = f.length; e < n; e++) {
246
+ let n = f[e], r = n.name + "_" + n.smooth + "_" + g, i = o.materials[r];
247
+ if (this.materials !== null) {
248
+ if (i = this.materials.create(n.name), p && i && !(i instanceof t)) {
249
+ let e = new t();
250
+ s.prototype.copy.call(e, i), e.color.copy(i.color), i = e;
251
+ } else if (h && i && !(i instanceof c)) {
252
+ let e = new c({
253
+ size: 10,
254
+ sizeAttenuation: !1
255
+ });
256
+ s.prototype.copy.call(e, i), e.color.copy(i.color), e.map = i.map, i = e;
257
+ }
258
+ }
259
+ i === void 0 && (i = p ? new t() : h ? new c({
260
+ size: 1,
261
+ sizeAttenuation: !1
262
+ }) : new u(), i.name = n.name, i.flatShading = !n.smooth, i.vertexColors = g, o.materials[r] = i), v.push(i);
263
+ }
264
+ let y;
265
+ if (v.length > 1) {
266
+ for (let e = 0, t = f.length; e < t; e++) {
267
+ let t = f[e];
268
+ _.addGroup(t.groupStart, t.groupCount, e);
269
+ }
270
+ y = p ? new a(_, v) : h ? new m(_, v) : new l(_, v);
271
+ } else y = p ? new a(_, v[0]) : h ? new m(_, v[0]) : new l(_, v[0]);
272
+ y.name = n.name, b.add(y);
273
+ }
274
+ else if (o.vertices.length > 0) {
275
+ let e = new c({
276
+ size: 1,
277
+ sizeAttenuation: !1
278
+ }), t = new d();
279
+ t.setAttribute("position", new r(o.vertices, 3)), o.colors.length > 0 && o.colors[0] !== void 0 && (t.setAttribute("color", new r(o.colors, 3)), e.vertexColors = !0);
280
+ let n = new m(t, e);
281
+ b.add(n);
282
+ }
283
+ return b;
284
+ }
285
+ };
286
+ //#endregion
287
+ export { D as OBJLoader };