@kolkrabbi/design-editor 0.23.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-B4SRaN9h.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 +11 -9
  28. package/dist/RuleRow-BXkjpTyN.js +0 -650
  29. package/dist/TreePicker-DLmMl0aU.js +0 -68
  30. package/dist/core-CTI1YRJD.js +0 -12335
  31. package/dist/effectCategories-BcaQSD_V.js +0 -4216
  32. package/dist/effects-pCd8YTdQ.js +0 -469
  33. package/dist/generators-B8_StNAy.js +0 -2517
  34. package/dist/motion-DFnAar_2.js +0 -2263
@@ -0,0 +1,83 @@
1
+ import { Ht as e, T as t, Tt as n, Y as r, f as i, p as a, v as o, w as s } from "./OrbitControls-DVpLgmKv.js";
2
+ //#region ../../node_modules/.pnpm/three@0.185.1/node_modules/three/examples/jsm/loaders/STLLoader.js
3
+ var c = class extends r {
4
+ constructor(e) {
5
+ super(e);
6
+ }
7
+ load(e, t, n, r) {
8
+ let i = this, a = new s(this.manager);
9
+ a.setPath(this.path), a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(n) {
10
+ try {
11
+ t(i.parse(n));
12
+ } catch (t) {
13
+ r ? r(t) : console.error(t), i.manager.itemError(e);
14
+ }
15
+ }, n, r);
16
+ }
17
+ parse(r) {
18
+ function s(e) {
19
+ let t = new DataView(e);
20
+ if (84 + t.getUint32(80, !0) * 50 === t.byteLength) return !0;
21
+ let n = [
22
+ 115,
23
+ 111,
24
+ 108,
25
+ 105,
26
+ 100
27
+ ];
28
+ for (let e = 0; e < 5; e++) if (c(n, t, e)) return !1;
29
+ return !0;
30
+ }
31
+ function c(e, t, n) {
32
+ for (let r = 0, i = e.length; r < i; r++) if (e[r] !== t.getUint8(n + r)) return !1;
33
+ return !0;
34
+ }
35
+ function l(e) {
36
+ let t = new DataView(e), r = t.getUint32(80, !0), s, c, l, u = !1, d, f, p, m, h;
37
+ for (let e = 0; e < 70; e++) t.getUint32(e, !1) == 1129270351 && t.getUint8(e + 4) == 82 && t.getUint8(e + 5) == 61 && (u = !0, d = new Float32Array(r * 3 * 3), f = t.getUint8(e + 6) / 255, p = t.getUint8(e + 7) / 255, m = t.getUint8(e + 8) / 255, h = t.getUint8(e + 9) / 255);
38
+ let g = new a(), _ = new Float32Array(r * 3 * 3), v = new Float32Array(r * 3 * 3), y = new o();
39
+ for (let e = 0; e < r; e++) {
40
+ let r = 84 + e * 50, i = t.getFloat32(r, !0), a = t.getFloat32(r + 4, !0), o = t.getFloat32(r + 8, !0);
41
+ if (u) {
42
+ let e = t.getUint16(r + 48, !0);
43
+ e & 32768 ? (s = f, c = p, l = m) : (s = (e & 31) / 31, c = (e >> 5 & 31) / 31, l = (e >> 10 & 31) / 31);
44
+ }
45
+ for (let f = 1; f <= 3; f++) {
46
+ let p = r + f * 12, m = e * 3 * 3 + (f - 1) * 3;
47
+ _[m] = t.getFloat32(p, !0), _[m + 1] = t.getFloat32(p + 4, !0), _[m + 2] = t.getFloat32(p + 8, !0), v[m] = i, v[m + 1] = a, v[m + 2] = o, u && (y.setRGB(s, c, l, n), d[m] = y.r, d[m + 1] = y.g, d[m + 2] = y.b);
48
+ }
49
+ }
50
+ return g.setAttribute("position", new i(_, 3)), g.setAttribute("normal", new i(v, 3)), u && (g.setAttribute("color", new i(d, 3)), g.hasColors = !0, g.alpha = h), g;
51
+ }
52
+ function u(n) {
53
+ let r = new a(), i = /solid([\s\S]*?)endsolid/g, o = /facet([\s\S]*?)endfacet/g, s = /solid\s(.+)/, c = 0, l = /* @__PURE__ */ RegExp("vertex[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)", "g"), u = /* @__PURE__ */ RegExp("normal[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)", "g"), d = [], f = [], p = [], m = new e(), h, g = 0, _ = 0, v = 0;
54
+ for (; (h = i.exec(n)) !== null;) {
55
+ _ = v;
56
+ let e = h[0], t = (h = s.exec(e)) === null ? "" : h[1];
57
+ for (p.push(t); (h = o.exec(e)) !== null;) {
58
+ let e = 0, t = 0, n = h[0];
59
+ for (; (h = u.exec(n)) !== null;) m.x = parseFloat(h[1]), m.y = parseFloat(h[2]), m.z = parseFloat(h[3]), t++;
60
+ for (; (h = l.exec(n)) !== null;) d.push(parseFloat(h[1]), parseFloat(h[2]), parseFloat(h[3])), f.push(m.x, m.y, m.z), e++, v++;
61
+ t !== 1 && console.error("THREE.STLLoader: Something isn't right with the normal of face number " + c), e !== 3 && console.error("THREE.STLLoader: Something isn't right with the vertices of face number " + c), c++;
62
+ }
63
+ let n = _, i = v - _;
64
+ r.userData.groupNames = p, r.addGroup(n, i, g), g++;
65
+ }
66
+ return r.setAttribute("position", new t(d, 3)), r.setAttribute("normal", new t(f, 3)), r;
67
+ }
68
+ function d(e) {
69
+ return typeof e == "string" ? e : new TextDecoder().decode(e);
70
+ }
71
+ function f(e) {
72
+ if (typeof e == "string") {
73
+ let t = new Uint8Array(e.length);
74
+ for (let n = 0; n < e.length; n++) t[n] = e.charCodeAt(n) & 255;
75
+ return t.buffer || t;
76
+ } else return e;
77
+ }
78
+ let p = f(r);
79
+ return s(p) ? l(p) : u(d(r));
80
+ }
81
+ };
82
+ //#endregion
83
+ export { c as STLLoader };
@@ -0,0 +1,68 @@
1
+ import { F as e, L as t } from "./rolls-BGtqxVYq.js";
2
+ import { Dropdown as n, LabeledControl as r, SettingsRow as i } from "@kolkrabbi/kol-component";
3
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
4
+ //#region src/editor/compose/inspectors/TreePicker.jsx
5
+ function c(e) {
6
+ return /* @__PURE__ */ o(n, {
7
+ variant: "subtle",
8
+ size: t(),
9
+ className: "w-full",
10
+ ...e
11
+ });
12
+ }
13
+ function l({ label: t, options: n, value: a, onChange: s, children: l, inline: u = !0 }) {
14
+ let d = l ?? /* @__PURE__ */ o(c, {
15
+ options: n,
16
+ value: a,
17
+ onChange: s
18
+ });
19
+ return u ? /* @__PURE__ */ o(i, {
20
+ label: t,
21
+ align: "fill",
22
+ labelWidth: e,
23
+ children: d
24
+ }) : /* @__PURE__ */ o(r, {
25
+ label: t,
26
+ children: d
27
+ });
28
+ }
29
+ function u({ tree: e, presets: t, current: n, onPick: r, inline: i = !0, subLabel: c = (e) => e }) {
30
+ let u = e.find((e) => e.label === n.typeLabel) ?? e.find((e) => e.subs.includes(n.sub)) ?? e[0], d = t.filter((e) => e.sub === n.sub), f = (e) => t.find((t) => t.sub === e);
31
+ return /* @__PURE__ */ s(a, { children: [
32
+ /* @__PURE__ */ o(l, {
33
+ inline: i,
34
+ label: "Type",
35
+ options: e.map((e) => ({
36
+ value: e.label,
37
+ label: e.label
38
+ })),
39
+ value: u.label,
40
+ onChange: (t) => {
41
+ let n = e.find((e) => e.label === t);
42
+ n && r(f(n.subs[0]));
43
+ }
44
+ }),
45
+ /* @__PURE__ */ o(l, {
46
+ inline: i,
47
+ label: "Category",
48
+ options: u.subs.map((e) => ({
49
+ value: e,
50
+ label: c(e)
51
+ })),
52
+ value: n.sub,
53
+ onChange: (e) => r(f(e))
54
+ }),
55
+ /* @__PURE__ */ o(l, {
56
+ inline: i,
57
+ label: "Preset",
58
+ options: d.map((e) => ({
59
+ value: e.id,
60
+ label: e.label
61
+ })),
62
+ value: n.id,
63
+ onChange: (e) => r(t.find((t) => t.id === e))
64
+ })
65
+ ] });
66
+ }
67
+ //#endregion
68
+ export { l as n, u as r, c as t };