@dstackai/sqircle 0.1.1 → 0.1.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/README.md +20 -1
- package/dist/index.d.ts +3 -2
- package/dist/palettes.d.ts +1 -0
- package/dist/sqircle.js +826 -358
- package/dist/sqircle.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -0
- package/docs/design/README.md +2 -1
- package/docs/design/colors.md +11 -21
- package/docs/design/rendering.md +54 -0
- package/docs/examples/README.md +2 -2
- package/docs/react/README.md +7 -2
- package/docs/react/editor.md +5 -2
- package/package.json +1 -1
- package/dist/assets/ConstructorPage-BZYA63EF.js +0 -2
- package/dist/assets/ConstructorPage-BthtTZhb.css +0 -1
- package/dist/assets/PageShell-CjHSnST7.js +0 -1
- package/dist/assets/demo-C2Ri3G4a.js +0 -1
- package/dist/assets/index-CYKmiCSm.js +0 -1
- package/dist/assets/pages-DQf07DWd.js +0 -9
- package/dist/assets/pages-hENaA-mA.css +0 -1
- package/dist/constructor.html +0 -15
- package/dist/demo.html +0 -15
- package/dist/index.html +0 -15
- package/dist/react.html +0 -15
- package/dist/static/styles.css +0 -883
package/dist/sqircle.js
CHANGED
|
@@ -14,7 +14,7 @@ function c(e = {}) {
|
|
|
14
14
|
let t = e.exponent ?? s.exponent, n = e.samples ?? s.samples, r = e.width ?? s.width, i = e.viewBoxHeight ?? s.viewBoxHeight, a = e.prismHeight ?? s.prismHeight, o = e.angleDegrees ?? s.angleDegrees, c = e.inlayScale ?? s.inlayScale, l = o * Math.PI / 180, u = Math.cos(l), d = Math.sin(l), p = f(1, t, n).map((e) => (e.x - e.y) * u), b = Math.max(...p) - Math.min(...p), x = e.halfSize ?? r / b, S = f(x, t, n), C = S.map((e) => (e.x - e.y) * u), w = S.map((e) => (e.x + e.y) * d), T = e.center ?? {
|
|
15
15
|
x: -Math.min(...C),
|
|
16
16
|
y: a - Math.min(...w)
|
|
17
|
-
}, E = S.map((e) => m(e, a, T, u, d)), D = S.map((e) => m(e, 0, T, u, d)), O = h(S.map((e) => e.nx + e.ny >= 0)), ee = g(O, n), te = _(E, O), ne = _(D, O).reverse(), k = [...te, ...ne], A = _(D, ee), j = f(x * c, t, n).map((e) => m(e, a, T, u, d)),
|
|
17
|
+
}, E = S.map((e) => m(e, a, T, u, d)), D = S.map((e) => m(e, 0, T, u, d)), O = h(S.map((e) => e.nx + e.ny >= 0)), ee = g(O, n), te = _(E, O), ne = _(D, O).reverse(), k = [...te, ...ne], A = _(D, ee), j = f(x * c, t, n).map((e) => m(e, a, T, u, d)), re = v(E), M = v([...E, ...k]);
|
|
18
18
|
return {
|
|
19
19
|
config: {
|
|
20
20
|
width: r,
|
|
@@ -35,8 +35,8 @@ function c(e = {}) {
|
|
|
35
35
|
hiddenPoints: A,
|
|
36
36
|
inlayPoints: j,
|
|
37
37
|
labelTransform: `matrix(${y(u)},${y(d)},${y(-u)},${y(d)},${y(T.x)},${y(T.y - a)})`,
|
|
38
|
-
topBounds:
|
|
39
|
-
sideBounds:
|
|
38
|
+
topBounds: re,
|
|
39
|
+
sideBounds: M,
|
|
40
40
|
viewBox: `0 0 ${y(r)} ${y(i)}`
|
|
41
41
|
};
|
|
42
42
|
}
|
|
@@ -550,9 +550,12 @@ var b = {
|
|
|
550
550
|
function C(e) {
|
|
551
551
|
return b[e] ?? b[15];
|
|
552
552
|
}
|
|
553
|
+
function w(e) {
|
|
554
|
+
return !!(e && e in b);
|
|
555
|
+
}
|
|
553
556
|
//#endregion
|
|
554
557
|
//#region src/squircle/SquircleScene.tsx
|
|
555
|
-
var
|
|
558
|
+
var T = {
|
|
556
559
|
face: .35,
|
|
557
560
|
faceOpacity: .72,
|
|
558
561
|
wire: 1.6,
|
|
@@ -562,16 +565,239 @@ var w = {
|
|
|
562
565
|
dash: 2.2,
|
|
563
566
|
wireDash: 1.6,
|
|
564
567
|
labelWire: 1.1
|
|
565
|
-
},
|
|
568
|
+
}, E = {
|
|
566
569
|
transparentFace: .38,
|
|
567
570
|
transparentAnnotation: .62,
|
|
568
571
|
solidAnnotation: .88
|
|
569
|
-
},
|
|
570
|
-
|
|
572
|
+
}, D = "GPU", O = 62, ee = "Arial, Helvetica, sans-serif", te = 400, ne = "off", k = [
|
|
573
|
+
{
|
|
574
|
+
x: -1.12,
|
|
575
|
+
y: -1.04,
|
|
576
|
+
r: .48,
|
|
577
|
+
slot: 0,
|
|
578
|
+
i: 0,
|
|
579
|
+
sp: .95,
|
|
580
|
+
ax: .23,
|
|
581
|
+
ay: .21,
|
|
582
|
+
ar: .018
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
x: -.58,
|
|
586
|
+
y: -.7,
|
|
587
|
+
r: .49,
|
|
588
|
+
slot: 1,
|
|
589
|
+
i: 1,
|
|
590
|
+
sp: 1.1,
|
|
591
|
+
ax: .24,
|
|
592
|
+
ay: .2,
|
|
593
|
+
ar: .018
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
x: -.1,
|
|
597
|
+
y: -.16,
|
|
598
|
+
r: .47,
|
|
599
|
+
slot: 2,
|
|
600
|
+
i: 2,
|
|
601
|
+
sp: .9,
|
|
602
|
+
ax: .22,
|
|
603
|
+
ay: .23,
|
|
604
|
+
ar: .016
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
x: .46,
|
|
608
|
+
y: -.72,
|
|
609
|
+
r: .48,
|
|
610
|
+
slot: 3,
|
|
611
|
+
i: 3,
|
|
612
|
+
sp: 1.2,
|
|
613
|
+
ax: .23,
|
|
614
|
+
ay: .21,
|
|
615
|
+
ar: .018
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
x: 1.02,
|
|
619
|
+
y: -.18,
|
|
620
|
+
r: .46,
|
|
621
|
+
slot: 4,
|
|
622
|
+
i: 4,
|
|
623
|
+
sp: 1.05,
|
|
624
|
+
ax: .22,
|
|
625
|
+
ay: .23,
|
|
626
|
+
ar: .016
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
x: 1.18,
|
|
630
|
+
y: .58,
|
|
631
|
+
r: .48,
|
|
632
|
+
slot: 2,
|
|
633
|
+
i: 5,
|
|
634
|
+
sp: .85,
|
|
635
|
+
ax: .24,
|
|
636
|
+
ay: .21,
|
|
637
|
+
ar: .018
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
x: .42,
|
|
641
|
+
y: 1.08,
|
|
642
|
+
r: .47,
|
|
643
|
+
slot: 1,
|
|
644
|
+
i: 6,
|
|
645
|
+
sp: 1.3,
|
|
646
|
+
ax: .23,
|
|
647
|
+
ay: .24,
|
|
648
|
+
ar: .016
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
x: -.54,
|
|
652
|
+
y: 1.14,
|
|
653
|
+
r: .48,
|
|
654
|
+
slot: 3,
|
|
655
|
+
i: 7,
|
|
656
|
+
sp: 1,
|
|
657
|
+
ax: .24,
|
|
658
|
+
ay: .22,
|
|
659
|
+
ar: .018
|
|
660
|
+
}
|
|
661
|
+
], A = [
|
|
662
|
+
{
|
|
663
|
+
x: -.82,
|
|
664
|
+
y: -.44,
|
|
665
|
+
r: .48,
|
|
666
|
+
slot: 0,
|
|
667
|
+
i: 8,
|
|
668
|
+
sp: 1.7,
|
|
669
|
+
ax: .25,
|
|
670
|
+
ay: .23,
|
|
671
|
+
ar: .016
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
x: -.2,
|
|
675
|
+
y: -1.08,
|
|
676
|
+
r: .47,
|
|
677
|
+
slot: 1,
|
|
678
|
+
i: 9,
|
|
679
|
+
sp: 1.45,
|
|
680
|
+
ax: .24,
|
|
681
|
+
ay: .22,
|
|
682
|
+
ar: .016
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
x: .66,
|
|
686
|
+
y: 0,
|
|
687
|
+
r: .49,
|
|
688
|
+
slot: 0,
|
|
689
|
+
i: 10,
|
|
690
|
+
sp: 2,
|
|
691
|
+
ax: .23,
|
|
692
|
+
ay: .25,
|
|
693
|
+
ar: .016
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
x: 1.12,
|
|
697
|
+
y: .94,
|
|
698
|
+
r: .47,
|
|
699
|
+
slot: 1,
|
|
700
|
+
i: 11,
|
|
701
|
+
sp: 1.6,
|
|
702
|
+
ax: .25,
|
|
703
|
+
ay: .23,
|
|
704
|
+
ar: .016
|
|
705
|
+
}
|
|
706
|
+
], j = [
|
|
707
|
+
{
|
|
708
|
+
x: -1.08,
|
|
709
|
+
y: -.96,
|
|
710
|
+
r: .47,
|
|
711
|
+
slot: 0,
|
|
712
|
+
i: 12,
|
|
713
|
+
sp: .75,
|
|
714
|
+
ax: .2,
|
|
715
|
+
ay: .19,
|
|
716
|
+
ar: .016
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
x: -.56,
|
|
720
|
+
y: -.46,
|
|
721
|
+
r: .49,
|
|
722
|
+
slot: 1,
|
|
723
|
+
i: 13,
|
|
724
|
+
sp: .9,
|
|
725
|
+
ax: .21,
|
|
726
|
+
ay: .2,
|
|
727
|
+
ar: .016
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
x: .02,
|
|
731
|
+
y: .02,
|
|
732
|
+
r: .47,
|
|
733
|
+
slot: 2,
|
|
734
|
+
i: 14,
|
|
735
|
+
sp: .8,
|
|
736
|
+
ax: .2,
|
|
737
|
+
ay: .21,
|
|
738
|
+
ar: .016
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
x: .64,
|
|
742
|
+
y: -.6,
|
|
743
|
+
r: .48,
|
|
744
|
+
slot: 3,
|
|
745
|
+
i: 15,
|
|
746
|
+
sp: 1,
|
|
747
|
+
ax: .21,
|
|
748
|
+
ay: .19,
|
|
749
|
+
ar: .016
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
x: 1.12,
|
|
753
|
+
y: .2,
|
|
754
|
+
r: .46,
|
|
755
|
+
slot: 1,
|
|
756
|
+
i: 16,
|
|
757
|
+
sp: .85,
|
|
758
|
+
ax: .2,
|
|
759
|
+
ay: .21,
|
|
760
|
+
ar: .016
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
x: .74,
|
|
764
|
+
y: 1.08,
|
|
765
|
+
r: .49,
|
|
766
|
+
slot: 2,
|
|
767
|
+
i: 17,
|
|
768
|
+
sp: .95,
|
|
769
|
+
ax: .21,
|
|
770
|
+
ay: .2,
|
|
771
|
+
ar: .016
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
x: -.14,
|
|
775
|
+
y: 1.16,
|
|
776
|
+
r: .47,
|
|
777
|
+
slot: 0,
|
|
778
|
+
i: 18,
|
|
779
|
+
sp: .82,
|
|
780
|
+
ax: .2,
|
|
781
|
+
ay: .21,
|
|
782
|
+
ar: .016
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
x: -1.04,
|
|
786
|
+
y: .58,
|
|
787
|
+
r: .48,
|
|
788
|
+
slot: 3,
|
|
789
|
+
i: 19,
|
|
790
|
+
sp: 1.05,
|
|
791
|
+
ax: .21,
|
|
792
|
+
ay: .2,
|
|
793
|
+
ar: .016
|
|
794
|
+
}
|
|
795
|
+
];
|
|
796
|
+
function re({ layers: e, geometry: r, selectedLayerId: i, theme: s = "light", idPrefix: l, className: u, ariaLabel: d = "Squircle scene", fitToLayers: f = !0, transitionMs: p = 220, onLayerSelect: m }) {
|
|
571
797
|
let h = t().replace(/[^a-zA-Z0-9_-]/g, ""), g = l ?? `sq-${h}`, _ = n(() => c(r), [JSON.stringify(r ?? {})]), v = e.filter((e) => e.visible !== !1), y = Math.max(0, ...v.map((e) => e.offset?.y ?? 0)), b = r?.viewBoxHeight ?? (f ? Math.max(_.config.viewBoxHeight, y + _.sideBounds.maxY + 18) : _.config.viewBoxHeight), x = r?.viewBoxHeight === b ? _ : c({
|
|
572
798
|
...r,
|
|
573
799
|
viewBoxHeight: b
|
|
574
|
-
}), S = { "--sq-transition-ms": `${p}ms` };
|
|
800
|
+
}), S = { "--sq-transition-ms": `${p}ms` }, C = se(v.some(ce));
|
|
575
801
|
return /* @__PURE__ */ o("svg", {
|
|
576
802
|
className: [
|
|
577
803
|
"squircle-scene",
|
|
@@ -583,55 +809,94 @@ function te({ layers: e, geometry: r, selectedLayerId: i, theme: s = "light", id
|
|
|
583
809
|
role: "img",
|
|
584
810
|
"aria-label": d,
|
|
585
811
|
style: S,
|
|
586
|
-
children: [/* @__PURE__ */ a(
|
|
812
|
+
children: [/* @__PURE__ */ a(M, {
|
|
587
813
|
prefix: g,
|
|
588
814
|
geometry: x
|
|
589
|
-
}), v.map((e) => /* @__PURE__ */ a(
|
|
815
|
+
}), v.map((e) => /* @__PURE__ */ a(ie, {
|
|
590
816
|
layer: e,
|
|
591
817
|
geometry: x,
|
|
592
818
|
prefix: g,
|
|
819
|
+
motionTime: C,
|
|
593
820
|
selected: i === e.id,
|
|
594
821
|
onSelect: m
|
|
595
822
|
}, e.id))]
|
|
596
823
|
});
|
|
597
824
|
}
|
|
598
|
-
function
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
y2: t.topBounds.maxY,
|
|
606
|
-
stops: n.top
|
|
825
|
+
function M({ prefix: e, geometry: t }) {
|
|
826
|
+
let n = l(t.topPoints), r = J(t.config.halfSize * 2 * .13), i = J(t.config.halfSize * 3.6), s = i * 2;
|
|
827
|
+
return /* @__PURE__ */ o("defs", { children: [
|
|
828
|
+
/* @__PURE__ */ a("clipPath", {
|
|
829
|
+
id: `${e}-top-clip`,
|
|
830
|
+
clipPathUnits: "userSpaceOnUse",
|
|
831
|
+
children: /* @__PURE__ */ a("polygon", { points: n })
|
|
607
832
|
}),
|
|
608
|
-
/* @__PURE__ */ a(
|
|
609
|
-
id: `${e}-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
833
|
+
/* @__PURE__ */ a("filter", {
|
|
834
|
+
id: `${e}-fluid-main-blur`,
|
|
835
|
+
filterUnits: "userSpaceOnUse",
|
|
836
|
+
primitiveUnits: "userSpaceOnUse",
|
|
837
|
+
x: -i,
|
|
838
|
+
y: -i,
|
|
839
|
+
width: s,
|
|
840
|
+
height: s,
|
|
841
|
+
children: /* @__PURE__ */ a("feGaussianBlur", { stdDeviation: r })
|
|
615
842
|
}),
|
|
616
|
-
/* @__PURE__ */ a(
|
|
617
|
-
id: `${e}-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
843
|
+
/* @__PURE__ */ a("filter", {
|
|
844
|
+
id: `${e}-fluid-light-blur`,
|
|
845
|
+
filterUnits: "userSpaceOnUse",
|
|
846
|
+
primitiveUnits: "userSpaceOnUse",
|
|
847
|
+
x: -i,
|
|
848
|
+
y: -i,
|
|
849
|
+
width: s,
|
|
850
|
+
height: s,
|
|
851
|
+
children: /* @__PURE__ */ a("feGaussianBlur", { stdDeviation: r })
|
|
623
852
|
}),
|
|
624
|
-
/* @__PURE__ */ a(
|
|
625
|
-
id: `${e}-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
}
|
|
634
|
-
|
|
853
|
+
/* @__PURE__ */ a("filter", {
|
|
854
|
+
id: `${e}-frosted-blur`,
|
|
855
|
+
filterUnits: "userSpaceOnUse",
|
|
856
|
+
primitiveUnits: "userSpaceOnUse",
|
|
857
|
+
x: -i,
|
|
858
|
+
y: -i,
|
|
859
|
+
width: s,
|
|
860
|
+
height: s,
|
|
861
|
+
children: /* @__PURE__ */ a("feGaussianBlur", { stdDeviation: r })
|
|
862
|
+
}),
|
|
863
|
+
Object.values(b).map((n) => /* @__PURE__ */ o("g", { children: [
|
|
864
|
+
/* @__PURE__ */ a(N, {
|
|
865
|
+
id: `${e}-top-${n.id}`,
|
|
866
|
+
x1: t.topBounds.minX,
|
|
867
|
+
y1: t.topBounds.minY,
|
|
868
|
+
x2: t.topBounds.maxX,
|
|
869
|
+
y2: t.topBounds.maxY,
|
|
870
|
+
stops: n.top
|
|
871
|
+
}),
|
|
872
|
+
/* @__PURE__ */ a(N, {
|
|
873
|
+
id: `${e}-side-${n.id}`,
|
|
874
|
+
x1: t.sideBounds.minX,
|
|
875
|
+
y1: t.sideBounds.minY,
|
|
876
|
+
x2: t.sideBounds.maxX,
|
|
877
|
+
y2: t.sideBounds.maxY,
|
|
878
|
+
stops: n.side
|
|
879
|
+
}),
|
|
880
|
+
/* @__PURE__ */ a(N, {
|
|
881
|
+
id: `${e}-text-surface-${n.id}`,
|
|
882
|
+
x1: -425.63,
|
|
883
|
+
y1: -.1,
|
|
884
|
+
x2: 425.6,
|
|
885
|
+
y2: .07,
|
|
886
|
+
stops: n.top
|
|
887
|
+
}),
|
|
888
|
+
/* @__PURE__ */ a(N, {
|
|
889
|
+
id: `${e}-text-wire-${n.id}`,
|
|
890
|
+
x1: -64,
|
|
891
|
+
y1: -24,
|
|
892
|
+
x2: 64,
|
|
893
|
+
y2: 24,
|
|
894
|
+
stops: n.textWire
|
|
895
|
+
})
|
|
896
|
+
] }, n.id))
|
|
897
|
+
] });
|
|
898
|
+
}
|
|
899
|
+
function N({ id: e, x1: t, y1: n, x2: r, y2: i, stops: o }) {
|
|
635
900
|
return /* @__PURE__ */ a("linearGradient", {
|
|
636
901
|
id: e,
|
|
637
902
|
x1: t,
|
|
@@ -645,37 +910,39 @@ function k({ id: e, x1: t, y1: n, x2: r, y2: i, stops: o }) {
|
|
|
645
910
|
}, `${e.offset}-${e.color}`))
|
|
646
911
|
});
|
|
647
912
|
}
|
|
648
|
-
function
|
|
649
|
-
let
|
|
913
|
+
function ie({ layer: e, geometry: t, prefix: n, motionTime: r, selected: i, onSelect: s }) {
|
|
914
|
+
let c = L(e.base, e.stroke, e.opacity), l = e.hover ? L({
|
|
650
915
|
...e.base,
|
|
651
916
|
...e.hover
|
|
652
|
-
}, e.stroke, e.opacity) : null,
|
|
917
|
+
}, e.stroke, e.opacity) : null, u = !!(l && K(l) !== K(c)), d = e.offset?.x ?? 0, f = e.offset?.y ?? 0;
|
|
653
918
|
return /* @__PURE__ */ o("g", {
|
|
654
919
|
className: [
|
|
655
920
|
"sq-layer",
|
|
656
|
-
|
|
657
|
-
|
|
921
|
+
u ? "sq-has-hover" : "",
|
|
922
|
+
i ? "is-selected" : "",
|
|
658
923
|
e.className
|
|
659
924
|
].filter(Boolean).join(" "),
|
|
660
925
|
"data-layer-id": e.id,
|
|
661
|
-
"data-hover-enabled": String(
|
|
662
|
-
transform: `translate(${
|
|
663
|
-
onClick:
|
|
664
|
-
children: [/* @__PURE__ */ a(
|
|
926
|
+
"data-hover-enabled": String(u),
|
|
927
|
+
transform: `translate(${d} ${f})`,
|
|
928
|
+
onClick: s ? () => s(e.id) : void 0,
|
|
929
|
+
children: [/* @__PURE__ */ a(P, {
|
|
665
930
|
className: "sq-base",
|
|
666
|
-
variant:
|
|
931
|
+
variant: c,
|
|
667
932
|
geometry: t,
|
|
668
|
-
prefix: n
|
|
669
|
-
|
|
933
|
+
prefix: n,
|
|
934
|
+
motionTime: r
|
|
935
|
+
}), u && l ? /* @__PURE__ */ a(P, {
|
|
670
936
|
className: "sq-hover",
|
|
671
|
-
variant:
|
|
937
|
+
variant: l,
|
|
672
938
|
geometry: t,
|
|
673
|
-
prefix: n
|
|
939
|
+
prefix: n,
|
|
940
|
+
motionTime: r
|
|
674
941
|
}) : null]
|
|
675
942
|
});
|
|
676
943
|
}
|
|
677
|
-
function
|
|
678
|
-
let
|
|
944
|
+
function P({ className: e, variant: t, geometry: n, prefix: r, motionTime: s }) {
|
|
945
|
+
let c = le(t.paletteId), u = `url(#${r}-top-${c.id})`, d = `url(#${r}-side-${c.id})`, f = `url(#${r}-text-surface-${c.id})`, p = `url(#${r}-text-wire-${c.id})`, m = l(n.wallPoints), h = l(n.topPoints), g = l(n.hiddenPoints), _ = l(n.inlayPoints), v = `${r}-top-clip`;
|
|
679
946
|
return /* @__PURE__ */ o("g", {
|
|
680
947
|
className: [
|
|
681
948
|
"sq-variant",
|
|
@@ -686,50 +953,51 @@ function j({ className: e, variant: t, geometry: n, prefix: r }) {
|
|
|
686
953
|
t.material === "wireframe" ? /* @__PURE__ */ o(i, { children: [
|
|
687
954
|
/* @__PURE__ */ a("polyline", {
|
|
688
955
|
className: "sq-hidden",
|
|
689
|
-
points:
|
|
690
|
-
stroke:
|
|
956
|
+
points: g,
|
|
957
|
+
stroke: u,
|
|
691
958
|
strokeWidth: t.stroke.hidden,
|
|
692
959
|
opacity: t.stroke.hiddenOpacity
|
|
693
960
|
}),
|
|
694
961
|
/* @__PURE__ */ a("polygon", {
|
|
695
962
|
className: "sq-face sq-wire-side",
|
|
696
|
-
points:
|
|
963
|
+
points: m,
|
|
697
964
|
fill: "none",
|
|
698
|
-
stroke:
|
|
965
|
+
stroke: u,
|
|
699
966
|
strokeWidth: t.stroke.wire,
|
|
700
967
|
strokeOpacity: t.stroke.wireOpacity
|
|
701
968
|
}),
|
|
702
969
|
/* @__PURE__ */ a("polygon", {
|
|
703
970
|
className: "sq-face sq-wire-top",
|
|
704
|
-
points:
|
|
971
|
+
points: h,
|
|
705
972
|
fill: "none",
|
|
706
|
-
stroke:
|
|
973
|
+
stroke: u,
|
|
707
974
|
strokeWidth: t.stroke.wire,
|
|
708
975
|
strokeOpacity: t.stroke.wireOpacity
|
|
709
976
|
})
|
|
710
977
|
] }) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("polygon", {
|
|
711
978
|
className: "sq-face sq-solid-side",
|
|
712
|
-
points: p,
|
|
713
|
-
fill: u,
|
|
714
|
-
fillOpacity: t.material === "transparent" ? t.opacity.transparentFace : 1,
|
|
715
|
-
stroke: s.sideEdge,
|
|
716
|
-
strokeWidth: t.stroke.face,
|
|
717
|
-
strokeOpacity: t.stroke.faceOpacity
|
|
718
|
-
}), /* @__PURE__ */ a("polygon", {
|
|
719
|
-
className: "sq-face sq-solid-top",
|
|
720
979
|
points: m,
|
|
721
|
-
fill:
|
|
980
|
+
fill: d,
|
|
722
981
|
fillOpacity: t.material === "transparent" ? t.opacity.transparentFace : 1,
|
|
723
|
-
stroke:
|
|
982
|
+
stroke: c.sideEdge,
|
|
724
983
|
strokeWidth: t.stroke.face,
|
|
725
984
|
strokeOpacity: t.stroke.faceOpacity
|
|
985
|
+
}), /* @__PURE__ */ a(F, {
|
|
986
|
+
variant: t,
|
|
987
|
+
palette: c,
|
|
988
|
+
geometry: n,
|
|
989
|
+
prefix: r,
|
|
990
|
+
topClipId: v,
|
|
991
|
+
topFill: u,
|
|
992
|
+
topPoints: h,
|
|
993
|
+
motionTime: s
|
|
726
994
|
})] }),
|
|
727
995
|
t.dash ? /* @__PURE__ */ a("polygon", {
|
|
728
996
|
className: "sq-inlay",
|
|
729
|
-
points:
|
|
730
|
-
stroke:
|
|
997
|
+
points: _,
|
|
998
|
+
stroke: U(t, c, u),
|
|
731
999
|
strokeWidth: t.material === "wireframe" ? t.stroke.wireDash : t.stroke.dash,
|
|
732
|
-
opacity:
|
|
1000
|
+
opacity: W(t)
|
|
733
1001
|
}) : null,
|
|
734
1002
|
t.text ? /* @__PURE__ */ a("text", {
|
|
735
1003
|
className: "sq-label",
|
|
@@ -739,60 +1007,177 @@ function j({ className: e, variant: t, geometry: n, prefix: r }) {
|
|
|
739
1007
|
fontFamily: t.textFontFamily,
|
|
740
1008
|
fontSize: t.textSize,
|
|
741
1009
|
fontWeight: t.textFontWeight,
|
|
742
|
-
...
|
|
1010
|
+
...G(t, c, f, p),
|
|
743
1011
|
children: t.text
|
|
744
1012
|
}) : null
|
|
745
1013
|
]
|
|
746
1014
|
});
|
|
747
1015
|
}
|
|
748
|
-
function
|
|
1016
|
+
function F({ variant: e, palette: t, geometry: n, prefix: r, topClipId: s, topFill: c, topPoints: l, motionTime: u }) {
|
|
1017
|
+
let d = e.material === "transparent" ? e.opacity.transparentFace : 1, f = e.material === "solid" ? e.effect : "off", p = n.config.halfSize, m = {
|
|
1018
|
+
x: -p * 1.3,
|
|
1019
|
+
y: -p * 1.3,
|
|
1020
|
+
size: p * 2.6
|
|
1021
|
+
};
|
|
1022
|
+
return f === "fluid" ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("g", {
|
|
1023
|
+
className: "sq-top-effect sq-top-effect-fluid",
|
|
1024
|
+
clipPath: `url(#${s})`,
|
|
1025
|
+
children: /* @__PURE__ */ o("g", {
|
|
1026
|
+
transform: n.labelTransform,
|
|
1027
|
+
children: [
|
|
1028
|
+
/* @__PURE__ */ a("rect", {
|
|
1029
|
+
x: m.x,
|
|
1030
|
+
y: m.y,
|
|
1031
|
+
width: m.size,
|
|
1032
|
+
height: m.size,
|
|
1033
|
+
fill: t.effectColors[3]
|
|
1034
|
+
}),
|
|
1035
|
+
/* @__PURE__ */ a("g", {
|
|
1036
|
+
filter: `url(#${r}-fluid-main-blur)`,
|
|
1037
|
+
children: k.map((e) => /* @__PURE__ */ a(I, {
|
|
1038
|
+
blob: e,
|
|
1039
|
+
palette: t,
|
|
1040
|
+
geometry: n,
|
|
1041
|
+
motionTime: u
|
|
1042
|
+
}, e.i))
|
|
1043
|
+
}),
|
|
1044
|
+
/* @__PURE__ */ a("g", {
|
|
1045
|
+
filter: `url(#${r}-fluid-light-blur)`,
|
|
1046
|
+
opacity: .6,
|
|
1047
|
+
style: { mixBlendMode: "screen" },
|
|
1048
|
+
children: A.map((e) => /* @__PURE__ */ a(I, {
|
|
1049
|
+
blob: e,
|
|
1050
|
+
palette: t,
|
|
1051
|
+
geometry: n,
|
|
1052
|
+
motionTime: u
|
|
1053
|
+
}, e.i))
|
|
1054
|
+
})
|
|
1055
|
+
]
|
|
1056
|
+
})
|
|
1057
|
+
}), /* @__PURE__ */ a("polygon", {
|
|
1058
|
+
className: "sq-face sq-solid-top sq-effect-outline",
|
|
1059
|
+
points: l,
|
|
1060
|
+
fill: "none",
|
|
1061
|
+
stroke: t.topEdge,
|
|
1062
|
+
strokeWidth: e.stroke.face,
|
|
1063
|
+
strokeOpacity: e.stroke.faceOpacity
|
|
1064
|
+
})] }) : f === "frosted" ? /* @__PURE__ */ o(i, { children: [
|
|
1065
|
+
/* @__PURE__ */ o("g", {
|
|
1066
|
+
className: "sq-top-effect sq-top-effect-frosted",
|
|
1067
|
+
clipPath: `url(#${s})`,
|
|
1068
|
+
children: [/* @__PURE__ */ o("g", {
|
|
1069
|
+
transform: n.labelTransform,
|
|
1070
|
+
children: [/* @__PURE__ */ a("rect", {
|
|
1071
|
+
x: m.x,
|
|
1072
|
+
y: m.y,
|
|
1073
|
+
width: m.size,
|
|
1074
|
+
height: m.size,
|
|
1075
|
+
fill: t.effectColors[6]
|
|
1076
|
+
}), /* @__PURE__ */ a("g", {
|
|
1077
|
+
filter: `url(#${r}-frosted-blur)`,
|
|
1078
|
+
children: j.map((e) => /* @__PURE__ */ a(I, {
|
|
1079
|
+
blob: e,
|
|
1080
|
+
palette: t,
|
|
1081
|
+
geometry: n,
|
|
1082
|
+
motionTime: u
|
|
1083
|
+
}, e.i))
|
|
1084
|
+
})]
|
|
1085
|
+
}), /* @__PURE__ */ a("polygon", {
|
|
1086
|
+
points: l,
|
|
1087
|
+
fill: "#eef2ff",
|
|
1088
|
+
opacity: .16
|
|
1089
|
+
})]
|
|
1090
|
+
}),
|
|
1091
|
+
/* @__PURE__ */ a("polygon", {
|
|
1092
|
+
className: "sq-face sq-solid-top sq-effect-outline",
|
|
1093
|
+
points: l,
|
|
1094
|
+
fill: "none",
|
|
1095
|
+
stroke: t.topEdge,
|
|
1096
|
+
strokeWidth: e.stroke.face,
|
|
1097
|
+
strokeOpacity: e.stroke.faceOpacity
|
|
1098
|
+
}),
|
|
1099
|
+
/* @__PURE__ */ a("polygon", {
|
|
1100
|
+
className: "sq-face sq-frosted-rim",
|
|
1101
|
+
points: l,
|
|
1102
|
+
fill: "none",
|
|
1103
|
+
stroke: "#ffffff",
|
|
1104
|
+
strokeWidth: Math.max(.7, e.stroke.face * 1.8),
|
|
1105
|
+
strokeOpacity: .52
|
|
1106
|
+
})
|
|
1107
|
+
] }) : /* @__PURE__ */ a("polygon", {
|
|
1108
|
+
className: "sq-face sq-solid-top",
|
|
1109
|
+
points: l,
|
|
1110
|
+
fill: c,
|
|
1111
|
+
fillOpacity: d,
|
|
1112
|
+
stroke: t.topEdge,
|
|
1113
|
+
strokeWidth: e.stroke.face,
|
|
1114
|
+
strokeOpacity: e.stroke.faceOpacity
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
function I({ blob: e, palette: t, geometry: n, motionTime: r }) {
|
|
1118
|
+
let i = n.config.halfSize, o = i * 2, s = i * e.x, c = i * e.y, l = o * e.r, u = o * e.ax, d = o * e.ay, f = o * e.ar, p = s + u * Math.sin(r * .62 * e.sp + e.i * 1.7) + .5 * u * Math.cos(r * .4 * e.sp + e.i * .6), m = c + d * Math.cos(r * .55 * e.sp + e.i * 2.1) + .55 * d * Math.sin(r * .34 * e.sp + e.i), h = Math.max(4, l + f * Math.sin(r * .8 + e.i * 1.2));
|
|
1119
|
+
return /* @__PURE__ */ a("circle", {
|
|
1120
|
+
cx: J(p),
|
|
1121
|
+
cy: J(m),
|
|
1122
|
+
r: J(h),
|
|
1123
|
+
fill: t.effectColors[e.slot] ?? t.effectColors[3]
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
function L(e, t = {}, n = {}) {
|
|
749
1127
|
return {
|
|
750
1128
|
material: e.material ?? "wireframe",
|
|
751
|
-
paletteId: e.paletteId
|
|
752
|
-
|
|
1129
|
+
paletteId: oe(e.paletteId),
|
|
1130
|
+
effect: ae(e.effect ?? ne),
|
|
1131
|
+
text: z(e.text, R(e).gpu),
|
|
753
1132
|
dash: e.dash ?? !1,
|
|
754
|
-
textStyle:
|
|
755
|
-
textColor:
|
|
756
|
-
textSize: e.textSize ??
|
|
757
|
-
textFontFamily: e.textFontFamily ??
|
|
758
|
-
textFontWeight: e.textFontWeight ??
|
|
759
|
-
dashColor:
|
|
1133
|
+
textStyle: B(e.textStyle ?? R(e).gpuStyle ?? "solid"),
|
|
1134
|
+
textColor: V(e.textColor ?? R(e).gpuColor ?? "contrast"),
|
|
1135
|
+
textSize: e.textSize ?? O,
|
|
1136
|
+
textFontFamily: e.textFontFamily ?? ee,
|
|
1137
|
+
textFontWeight: e.textFontWeight ?? te,
|
|
1138
|
+
dashColor: V(e.dashColor ?? "contrast"),
|
|
760
1139
|
stroke: {
|
|
761
|
-
...
|
|
1140
|
+
...T,
|
|
762
1141
|
...t,
|
|
763
1142
|
...e.stroke
|
|
764
1143
|
},
|
|
765
1144
|
opacity: {
|
|
766
|
-
...
|
|
1145
|
+
...E,
|
|
767
1146
|
...n,
|
|
768
1147
|
...e.opacity
|
|
769
1148
|
}
|
|
770
1149
|
};
|
|
771
1150
|
}
|
|
772
|
-
function
|
|
1151
|
+
function R(e) {
|
|
773
1152
|
return e;
|
|
774
1153
|
}
|
|
775
|
-
function
|
|
776
|
-
return typeof e == "string" ? e.trim() ? e : null : e === !0 || t ?
|
|
1154
|
+
function z(e, t) {
|
|
1155
|
+
return typeof e == "string" ? e.trim() ? e : null : e === !0 || t ? D : null;
|
|
777
1156
|
}
|
|
778
|
-
function
|
|
1157
|
+
function B(e) {
|
|
779
1158
|
return e === "wireframe" ? "wireframe" : "solid";
|
|
780
1159
|
}
|
|
781
|
-
function
|
|
1160
|
+
function ae(e) {
|
|
1161
|
+
return e === "fluid" || e === "frosted" ? e : "off";
|
|
1162
|
+
}
|
|
1163
|
+
function oe(e) {
|
|
1164
|
+
return w(e) ? e : "15";
|
|
1165
|
+
}
|
|
1166
|
+
function V(e) {
|
|
782
1167
|
return e === "auto" ? "contrast" : e;
|
|
783
1168
|
}
|
|
784
|
-
function
|
|
785
|
-
let n =
|
|
1169
|
+
function H(e, t) {
|
|
1170
|
+
let n = V(e);
|
|
786
1171
|
return n === "white" ? "#ffffff" : n === "black" ? "#05070a" : t;
|
|
787
1172
|
}
|
|
788
|
-
function
|
|
789
|
-
return e.material === "wireframe" ? n :
|
|
1173
|
+
function U(e, t, n) {
|
|
1174
|
+
return e.material === "wireframe" ? n : H(e.dashColor, t.labelFill);
|
|
790
1175
|
}
|
|
791
|
-
function
|
|
1176
|
+
function W(e) {
|
|
792
1177
|
return e.material === "transparent" ? e.opacity.transparentAnnotation : e.opacity.solidAnnotation;
|
|
793
1178
|
}
|
|
794
|
-
function
|
|
795
|
-
let i =
|
|
1179
|
+
function G(e, t, n, r) {
|
|
1180
|
+
let i = W(e);
|
|
796
1181
|
return e.material === "wireframe" ? e.textStyle === "wireframe" ? {
|
|
797
1182
|
fill: "none",
|
|
798
1183
|
stroke: r,
|
|
@@ -805,23 +1190,73 @@ function z(e, t, n, r) {
|
|
|
805
1190
|
opacity: 1
|
|
806
1191
|
} : e.textStyle === "wireframe" ? {
|
|
807
1192
|
fill: "none",
|
|
808
|
-
stroke:
|
|
1193
|
+
stroke: H(e.textColor, t.labelFill),
|
|
809
1194
|
strokeWidth: e.stroke.labelWire,
|
|
810
1195
|
opacity: i
|
|
811
1196
|
} : {
|
|
812
|
-
fill:
|
|
1197
|
+
fill: H(e.textColor, t.labelFill),
|
|
813
1198
|
stroke: "none",
|
|
814
1199
|
strokeWidth: 0,
|
|
815
1200
|
opacity: i
|
|
816
1201
|
};
|
|
817
1202
|
}
|
|
818
|
-
function
|
|
1203
|
+
function K(e) {
|
|
819
1204
|
return JSON.stringify(e);
|
|
820
1205
|
}
|
|
1206
|
+
function se(t) {
|
|
1207
|
+
let [n, i] = r(0);
|
|
1208
|
+
return e(() => {
|
|
1209
|
+
if (!t) {
|
|
1210
|
+
i(0);
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
let e = () => i(performance.now() / 1e3);
|
|
1214
|
+
e();
|
|
1215
|
+
let n = window.setInterval(e, 33);
|
|
1216
|
+
return () => window.clearInterval(n);
|
|
1217
|
+
}, [t]), t ? n : 0;
|
|
1218
|
+
}
|
|
1219
|
+
function ce(e) {
|
|
1220
|
+
return q(L(e.base, e.stroke, e.opacity)) ? !0 : e.hover ? q(L({
|
|
1221
|
+
...e.base,
|
|
1222
|
+
...e.hover
|
|
1223
|
+
}, e.stroke, e.opacity)) : !1;
|
|
1224
|
+
}
|
|
1225
|
+
function q(e) {
|
|
1226
|
+
return e.material === "solid" && e.effect !== "off";
|
|
1227
|
+
}
|
|
1228
|
+
function le(e) {
|
|
1229
|
+
let t = C(e);
|
|
1230
|
+
return {
|
|
1231
|
+
id: t.id,
|
|
1232
|
+
labelFill: t.labelFill,
|
|
1233
|
+
topEdge: t.topEdge,
|
|
1234
|
+
sideEdge: t.sideEdge,
|
|
1235
|
+
top: t.top,
|
|
1236
|
+
side: t.side,
|
|
1237
|
+
textWire: t.textWire,
|
|
1238
|
+
effectColors: ue(t)
|
|
1239
|
+
};
|
|
1240
|
+
}
|
|
1241
|
+
function ue(e) {
|
|
1242
|
+
let t = e.top[0]?.color ?? "#f5f0ff", n = e.top[Math.floor(e.top.length / 2)]?.color ?? t, r = e.top.at(-1)?.color ?? n, i = e.side[0]?.color ?? n;
|
|
1243
|
+
return [
|
|
1244
|
+
t,
|
|
1245
|
+
t,
|
|
1246
|
+
n,
|
|
1247
|
+
r,
|
|
1248
|
+
i,
|
|
1249
|
+
e.side[Math.floor(e.side.length / 2)]?.color ?? i,
|
|
1250
|
+
e.side.at(-1)?.color ?? e.sideEdge
|
|
1251
|
+
];
|
|
1252
|
+
}
|
|
1253
|
+
function J(e) {
|
|
1254
|
+
return Number(e.toFixed(1));
|
|
1255
|
+
}
|
|
821
1256
|
//#endregion
|
|
822
1257
|
//#region src/squircle/codeExport.ts
|
|
823
|
-
function
|
|
824
|
-
let s =
|
|
1258
|
+
function de({ layers: e, theme: t, geometry: n, componentName: r = "CustomSquircle", importPath: i = "./squircle", styleImportPath: a, ariaLabel: o }) {
|
|
1259
|
+
let s = _e(r), c = JSON.stringify(i), l = fe(i, a), u = JSON.stringify(o ?? `${s} composition`), d = JSON.stringify(e.map(pe), null, 2), f = n ? JSON.stringify(ge(n), null, 2) : null;
|
|
825
1260
|
return [
|
|
826
1261
|
`import { SquircleScene, ${f ? "type SquircleGeometryConfig, type SquircleLayerConfig, type SquircleTheme" : "type SquircleLayerConfig, type SquircleTheme"} } from ${c};`,
|
|
827
1262
|
...l ? [`import ${JSON.stringify(l)};`] : [],
|
|
@@ -844,44 +1279,44 @@ function ie({ layers: e, theme: t, geometry: n, componentName: r = "CustomSquirc
|
|
|
844
1279
|
""
|
|
845
1280
|
].join("\n");
|
|
846
1281
|
}
|
|
847
|
-
function
|
|
1282
|
+
function fe(e, t) {
|
|
848
1283
|
return t === !1 ? null : typeof t == "string" ? t : e === "@dstackai/sqircle" ? "@dstackai/sqircle/style.css" : null;
|
|
849
1284
|
}
|
|
850
|
-
function
|
|
851
|
-
return
|
|
1285
|
+
function pe(e) {
|
|
1286
|
+
return ge({
|
|
852
1287
|
...e,
|
|
853
|
-
base:
|
|
854
|
-
hover: e.hover ?
|
|
1288
|
+
base: me(e.base),
|
|
1289
|
+
hover: e.hover ? me(e.hover) : void 0
|
|
855
1290
|
});
|
|
856
1291
|
}
|
|
857
|
-
function
|
|
858
|
-
let { gpu: t, gpuStyle: n, gpuColor: r, ...i } = e, a =
|
|
859
|
-
return
|
|
1292
|
+
function me(e) {
|
|
1293
|
+
let { gpu: t, gpuStyle: n, gpuColor: r, ...i } = e, a = he(i.text, t), o = i.textStyle ?? n, s = i.textColor ?? r;
|
|
1294
|
+
return ge({
|
|
860
1295
|
...i,
|
|
861
1296
|
text: a,
|
|
862
1297
|
textStyle: o,
|
|
863
1298
|
textColor: s
|
|
864
1299
|
});
|
|
865
1300
|
}
|
|
866
|
-
function
|
|
1301
|
+
function he(e, t) {
|
|
867
1302
|
if (typeof e == "string") return e;
|
|
868
1303
|
if (e === !0 || t) return "GPU";
|
|
869
1304
|
if (e === !1) return !1;
|
|
870
1305
|
}
|
|
871
|
-
function
|
|
1306
|
+
function ge(e) {
|
|
872
1307
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
873
1308
|
}
|
|
874
|
-
function
|
|
1309
|
+
function _e(e) {
|
|
875
1310
|
let t = e.trim().split(/[^a-zA-Z0-9]+/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("") || "CustomSquircle";
|
|
876
1311
|
return /^[A-Za-z_$]/.test(t) ? t : `Squircle${t}`;
|
|
877
1312
|
}
|
|
878
1313
|
//#endregion
|
|
879
1314
|
//#region src/squircle/SquircleEditor.tsx
|
|
880
|
-
var
|
|
1315
|
+
var ve = 88, ye = "GPU", be = {
|
|
881
1316
|
exponent: s.exponent,
|
|
882
1317
|
prismHeight: s.prismHeight,
|
|
883
1318
|
inlayScale: s.inlayScale
|
|
884
|
-
},
|
|
1319
|
+
}, xe = 0, Se = 100, Ce = 4, Y = 24, we = 4, Te = 36, Ee = .35, De = .82, Oe = 34, ke = 92, Ae = 62, je = 400, Me = [
|
|
885
1320
|
{
|
|
886
1321
|
value: "wireframe",
|
|
887
1322
|
label: "Wire",
|
|
@@ -897,7 +1332,23 @@ var oe = 88, K = "GPU", se = {
|
|
|
897
1332
|
label: "Glass",
|
|
898
1333
|
title: "Translucent filled prism"
|
|
899
1334
|
}
|
|
900
|
-
],
|
|
1335
|
+
], Ne = [
|
|
1336
|
+
{
|
|
1337
|
+
value: "off",
|
|
1338
|
+
label: "Off",
|
|
1339
|
+
title: "Use the static top-face gradient"
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
value: "fluid",
|
|
1343
|
+
label: "Fluid",
|
|
1344
|
+
title: "Animated clipped gradient blobs on the top face"
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
value: "frosted",
|
|
1348
|
+
label: "Frosted",
|
|
1349
|
+
title: "Muted animated blobs with a pale glass veil and rim"
|
|
1350
|
+
}
|
|
1351
|
+
], Pe = [{
|
|
901
1352
|
value: "solid",
|
|
902
1353
|
label: "Filled",
|
|
903
1354
|
title: "Filled top-plane text"
|
|
@@ -905,7 +1356,7 @@ var oe = 88, K = "GPU", se = {
|
|
|
905
1356
|
value: "wireframe",
|
|
906
1357
|
label: "Outline",
|
|
907
1358
|
title: "Outlined top-plane text"
|
|
908
|
-
}],
|
|
1359
|
+
}], Fe = [
|
|
909
1360
|
{
|
|
910
1361
|
value: "auto",
|
|
911
1362
|
label: "Auto",
|
|
@@ -921,7 +1372,7 @@ var oe = 88, K = "GPU", se = {
|
|
|
921
1372
|
label: "Black",
|
|
922
1373
|
title: "Use fixed black annotation paint"
|
|
923
1374
|
}
|
|
924
|
-
],
|
|
1375
|
+
], Ie = [
|
|
925
1376
|
{
|
|
926
1377
|
value: "300",
|
|
927
1378
|
label: "Light",
|
|
@@ -948,7 +1399,7 @@ var oe = 88, K = "GPU", se = {
|
|
|
948
1399
|
title: "Strongest top-plane label"
|
|
949
1400
|
}
|
|
950
1401
|
];
|
|
951
|
-
function
|
|
1402
|
+
function Le(e = "15") {
|
|
952
1403
|
return d([
|
|
953
1404
|
{
|
|
954
1405
|
id: "layer-1",
|
|
@@ -974,60 +1425,60 @@ function Se(e = "15") {
|
|
|
974
1425
|
paletteId: e
|
|
975
1426
|
}
|
|
976
1427
|
}
|
|
977
|
-
],
|
|
1428
|
+
], ve);
|
|
978
1429
|
}
|
|
979
|
-
function
|
|
980
|
-
let [E, D] = r(() => c ??
|
|
981
|
-
...
|
|
1430
|
+
function Re({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeometry: f, onGeometryChange: p, title: m = "Squircle", description: h = "React component constructor with 0-N layers and exported code.", className: g, layerGap: _ = ve, showCode: v, showConfig: y = !0, codeComponentName: b, codeImportPath: x = "./squircle", theme: S, defaultTheme: C = "light", onThemeChange: w, showThemeSwitch: T = !0 }) {
|
|
1431
|
+
let [E, D] = r(() => c ?? Le()), [O, ee] = r(() => ({
|
|
1432
|
+
...be,
|
|
982
1433
|
...f
|
|
983
|
-
})), [
|
|
984
|
-
layers:
|
|
1434
|
+
})), [te, ne] = r(C), k = t ?? E, A = u ?? O, j = S ?? te, [M, N] = r(() => k.at(-1)?.id ?? null), [ie, P] = r("base"), [F, I] = r(!1), [L, R] = r(!1), z = k.find((e) => e.id === M) ?? null, B = z ? k.findIndex((e) => e.id === z.id) + 1 : null, ae = k.filter((e) => e.visible !== !1).length, oe = v ?? y, V = Math.max(0, ...k.map((e) => e.offset?.y ?? 0)), H = n(() => ({
|
|
1435
|
+
layers: k,
|
|
985
1436
|
geometry: {
|
|
986
|
-
...
|
|
987
|
-
viewBoxHeight: Math.max(
|
|
1437
|
+
...A,
|
|
1438
|
+
viewBoxHeight: Math.max(A.viewBoxHeight ?? s.viewBoxHeight, V + 320)
|
|
988
1439
|
},
|
|
989
|
-
selectedLayerId:
|
|
1440
|
+
selectedLayerId: M
|
|
990
1441
|
}), [
|
|
991
|
-
j,
|
|
992
1442
|
A,
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1443
|
+
k,
|
|
1444
|
+
V,
|
|
1445
|
+
M
|
|
1446
|
+
]), U = n(() => de({
|
|
1447
|
+
layers: k,
|
|
1448
|
+
theme: j,
|
|
1449
|
+
geometry: st(A),
|
|
999
1450
|
componentName: b ?? m,
|
|
1000
1451
|
importPath: x,
|
|
1001
1452
|
ariaLabel: `${m} composition`
|
|
1002
1453
|
}), [
|
|
1454
|
+
A,
|
|
1003
1455
|
j,
|
|
1004
|
-
M,
|
|
1005
1456
|
b,
|
|
1006
1457
|
x,
|
|
1007
|
-
|
|
1458
|
+
k,
|
|
1008
1459
|
m
|
|
1009
1460
|
]);
|
|
1010
1461
|
e(() => {
|
|
1011
|
-
|
|
1012
|
-
}, [
|
|
1013
|
-
|
|
1014
|
-
}, [
|
|
1015
|
-
function
|
|
1462
|
+
M && k.some((e) => e.id === M) || N(k.at(-1)?.id ?? null);
|
|
1463
|
+
}, [k, M]), e(() => {
|
|
1464
|
+
R(!1);
|
|
1465
|
+
}, [U]);
|
|
1466
|
+
function W(e, n = {}) {
|
|
1016
1467
|
let r = n.reflow ? d(e, _) : e;
|
|
1017
1468
|
t || D(r), l?.(r);
|
|
1018
1469
|
}
|
|
1019
|
-
function
|
|
1470
|
+
function G(e) {
|
|
1020
1471
|
let t = {
|
|
1021
|
-
...
|
|
1472
|
+
...A,
|
|
1022
1473
|
...e
|
|
1023
1474
|
};
|
|
1024
1475
|
u || ee(t), p?.(t);
|
|
1025
1476
|
}
|
|
1026
|
-
function
|
|
1027
|
-
|
|
1477
|
+
function K(e, t) {
|
|
1478
|
+
W(k.map((n) => n.id === e ? t(n) : n));
|
|
1028
1479
|
}
|
|
1029
|
-
function
|
|
1030
|
-
|
|
1480
|
+
function se(e) {
|
|
1481
|
+
z && K(z.id, (t) => ({
|
|
1031
1482
|
...t,
|
|
1032
1483
|
base: {
|
|
1033
1484
|
...t.base,
|
|
@@ -1035,8 +1486,8 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1035
1486
|
}
|
|
1036
1487
|
}));
|
|
1037
1488
|
}
|
|
1038
|
-
function
|
|
1039
|
-
|
|
1489
|
+
function ce(e) {
|
|
1490
|
+
z && K(z.id, (t) => ({
|
|
1040
1491
|
...t,
|
|
1041
1492
|
hover: {
|
|
1042
1493
|
...t.hover ?? {},
|
|
@@ -1044,47 +1495,47 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1044
1495
|
}
|
|
1045
1496
|
}));
|
|
1046
1497
|
}
|
|
1047
|
-
function
|
|
1498
|
+
function q() {
|
|
1048
1499
|
let e = {
|
|
1049
|
-
id:
|
|
1500
|
+
id: it(k),
|
|
1050
1501
|
visible: !0,
|
|
1051
1502
|
base: {
|
|
1052
1503
|
material: "wireframe",
|
|
1053
|
-
paletteId:
|
|
1504
|
+
paletteId: k.at(-1)?.base.paletteId ?? "15"
|
|
1054
1505
|
}
|
|
1055
|
-
}, t = [...
|
|
1056
|
-
|
|
1506
|
+
}, t = [...k, e];
|
|
1507
|
+
N(e.id), P("base"), W(t, { reflow: !0 });
|
|
1057
1508
|
}
|
|
1058
|
-
function
|
|
1059
|
-
if (!
|
|
1060
|
-
let e =
|
|
1061
|
-
|
|
1509
|
+
function le() {
|
|
1510
|
+
if (!z) return;
|
|
1511
|
+
let e = k.filter((e) => e.id !== z.id);
|
|
1512
|
+
N(e.at(-1)?.id ?? null), P("base"), W(e, { reflow: !0 });
|
|
1062
1513
|
}
|
|
1063
|
-
function
|
|
1064
|
-
|
|
1514
|
+
function ue(e) {
|
|
1515
|
+
K(e, (e) => ({
|
|
1065
1516
|
...e,
|
|
1066
1517
|
visible: e.visible === !1
|
|
1067
1518
|
}));
|
|
1068
1519
|
}
|
|
1069
|
-
function
|
|
1070
|
-
S ||
|
|
1520
|
+
function J(e) {
|
|
1521
|
+
S || ne(e), w?.(e);
|
|
1071
1522
|
}
|
|
1072
|
-
async function
|
|
1523
|
+
async function fe() {
|
|
1073
1524
|
try {
|
|
1074
|
-
await navigator.clipboard.writeText(
|
|
1525
|
+
await navigator.clipboard.writeText(U);
|
|
1075
1526
|
} catch {
|
|
1076
1527
|
let e = document.createElement("textarea");
|
|
1077
|
-
e.value =
|
|
1528
|
+
e.value = U, e.setAttribute("readonly", ""), e.style.position = "fixed", e.style.top = "-9999px", document.body.append(e), e.select(), document.execCommand("copy"), e.remove();
|
|
1078
1529
|
}
|
|
1079
|
-
|
|
1530
|
+
R(!0), window.setTimeout(() => R(!1), 1400);
|
|
1080
1531
|
}
|
|
1081
1532
|
return /* @__PURE__ */ o("main", {
|
|
1082
1533
|
className: [
|
|
1083
1534
|
"squircle-editor",
|
|
1084
|
-
`squircle-editor-${
|
|
1535
|
+
`squircle-editor-${j}`,
|
|
1085
1536
|
g
|
|
1086
1537
|
].filter(Boolean).join(" "),
|
|
1087
|
-
"data-theme":
|
|
1538
|
+
"data-theme": j,
|
|
1088
1539
|
"aria-label": "Squircle editor",
|
|
1089
1540
|
children: [/* @__PURE__ */ o("header", {
|
|
1090
1541
|
className: "squircle-editor-topbar",
|
|
@@ -1099,13 +1550,13 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1099
1550
|
"aria-label": "Theme",
|
|
1100
1551
|
children: [/* @__PURE__ */ a("button", {
|
|
1101
1552
|
type: "button",
|
|
1102
|
-
"aria-pressed":
|
|
1103
|
-
onClick: () =>
|
|
1553
|
+
"aria-pressed": j === "light",
|
|
1554
|
+
onClick: () => J("light"),
|
|
1104
1555
|
children: "Light"
|
|
1105
1556
|
}), /* @__PURE__ */ a("button", {
|
|
1106
1557
|
type: "button",
|
|
1107
|
-
"aria-pressed":
|
|
1108
|
-
onClick: () =>
|
|
1558
|
+
"aria-pressed": j === "dark",
|
|
1559
|
+
onClick: () => J("dark"),
|
|
1109
1560
|
children: "Dark"
|
|
1110
1561
|
})]
|
|
1111
1562
|
}) : null
|
|
@@ -1121,7 +1572,7 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1121
1572
|
children: [/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("h2", { children: "Layers" }), /* @__PURE__ */ o("span", { children: [
|
|
1122
1573
|
ae,
|
|
1123
1574
|
"/",
|
|
1124
|
-
|
|
1575
|
+
k.length,
|
|
1125
1576
|
" visible"
|
|
1126
1577
|
] })] }), /* @__PURE__ */ o("div", {
|
|
1127
1578
|
className: "panel-actions",
|
|
@@ -1130,29 +1581,29 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1130
1581
|
className: "icon-button primary-action",
|
|
1131
1582
|
"aria-label": "Add layer",
|
|
1132
1583
|
title: "Add layer",
|
|
1133
|
-
onClick:
|
|
1134
|
-
children: /* @__PURE__ */ a(
|
|
1584
|
+
onClick: q,
|
|
1585
|
+
children: /* @__PURE__ */ a(Ke, {})
|
|
1135
1586
|
}), /* @__PURE__ */ a("button", {
|
|
1136
1587
|
type: "button",
|
|
1137
1588
|
className: "icon-button",
|
|
1138
1589
|
"aria-label": "Clear layers",
|
|
1139
1590
|
title: "Clear layers",
|
|
1140
|
-
onClick: () =>
|
|
1141
|
-
children: /* @__PURE__ */ a(
|
|
1591
|
+
onClick: () => W([]),
|
|
1592
|
+
children: /* @__PURE__ */ a(qe, {})
|
|
1142
1593
|
})]
|
|
1143
1594
|
})]
|
|
1144
1595
|
}),
|
|
1145
1596
|
/* @__PURE__ */ a("div", {
|
|
1146
1597
|
className: "squircle-editor-layer-list",
|
|
1147
|
-
children: [...
|
|
1148
|
-
let n =
|
|
1598
|
+
children: [...k].reverse().map((e, t) => {
|
|
1599
|
+
let n = k.length - t, r = $e(e.base.paletteId), i = e.base.material ?? "wireframe", s = tt(e.base);
|
|
1149
1600
|
return /* @__PURE__ */ o("article", {
|
|
1150
|
-
className: e.id ===
|
|
1601
|
+
className: e.id === M ? "squircle-editor-layer-row is-active" : "squircle-editor-layer-row",
|
|
1151
1602
|
children: [/* @__PURE__ */ o("button", {
|
|
1152
1603
|
type: "button",
|
|
1153
1604
|
className: "layer-select",
|
|
1154
|
-
onClick: () =>
|
|
1155
|
-
title: `Edit ${
|
|
1605
|
+
onClick: () => N(e.id),
|
|
1606
|
+
title: `Edit ${rt(e.id, n, k.length)}`,
|
|
1156
1607
|
children: [/* @__PURE__ */ o("span", {
|
|
1157
1608
|
className: "layer-card-topline",
|
|
1158
1609
|
children: [
|
|
@@ -1160,10 +1611,10 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1160
1611
|
className: "layer-number",
|
|
1161
1612
|
children: String(n).padStart(2, "0")
|
|
1162
1613
|
}),
|
|
1163
|
-
/* @__PURE__ */ a("strong", { children:
|
|
1614
|
+
/* @__PURE__ */ a("strong", { children: rt(e.id, n, k.length) }),
|
|
1164
1615
|
/* @__PURE__ */ a("span", {
|
|
1165
1616
|
className: `material-pill material-pill-${i}`,
|
|
1166
|
-
children:
|
|
1617
|
+
children: nt(i)
|
|
1167
1618
|
})
|
|
1168
1619
|
]
|
|
1169
1620
|
}), /* @__PURE__ */ o("span", {
|
|
@@ -1177,10 +1628,11 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1177
1628
|
}), /* @__PURE__ */ o("span", {
|
|
1178
1629
|
className: "layer-feature-tags",
|
|
1179
1630
|
children: [
|
|
1180
|
-
|
|
1631
|
+
$(e.base) ? /* @__PURE__ */ a("span", { children: "Text" }) : null,
|
|
1181
1632
|
e.base.dash ? /* @__PURE__ */ a("span", { children: "Dash" }) : null,
|
|
1633
|
+
i === "solid" && s !== "off" ? /* @__PURE__ */ a("span", { children: s }) : null,
|
|
1182
1634
|
e.hover ? /* @__PURE__ */ a("span", { children: "Hover" }) : null,
|
|
1183
|
-
|
|
1635
|
+
!$(e.base) && !e.base.dash && !e.hover && s === "off" ? /* @__PURE__ */ a("span", { children: "Clean" }) : null
|
|
1184
1636
|
]
|
|
1185
1637
|
})]
|
|
1186
1638
|
})]
|
|
@@ -1190,41 +1642,41 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1190
1642
|
"aria-label": e.visible === !1 ? "Show layer" : "Hide layer",
|
|
1191
1643
|
"aria-pressed": e.visible !== !1,
|
|
1192
1644
|
title: e.visible === !1 ? "Show layer" : "Hide layer",
|
|
1193
|
-
onClick: () =>
|
|
1194
|
-
children: e.visible === !1 ? /* @__PURE__ */ a(
|
|
1645
|
+
onClick: () => ue(e.id),
|
|
1646
|
+
children: e.visible === !1 ? /* @__PURE__ */ a(Ye, {}) : /* @__PURE__ */ a(Je, {})
|
|
1195
1647
|
})]
|
|
1196
1648
|
}, e.id);
|
|
1197
1649
|
})
|
|
1198
1650
|
}),
|
|
1199
|
-
/* @__PURE__ */ o(
|
|
1651
|
+
/* @__PURE__ */ o(X, {
|
|
1200
1652
|
title: "Shape",
|
|
1201
1653
|
children: [
|
|
1202
|
-
/* @__PURE__ */ a(
|
|
1654
|
+
/* @__PURE__ */ a(Q, {
|
|
1203
1655
|
label: "Radius",
|
|
1204
|
-
value:
|
|
1205
|
-
min:
|
|
1206
|
-
max:
|
|
1656
|
+
value: at(A.exponent ?? s.exponent),
|
|
1657
|
+
min: xe,
|
|
1658
|
+
max: Se,
|
|
1207
1659
|
step: 1,
|
|
1208
1660
|
formatValue: (e) => `${Math.round(e)}%`,
|
|
1209
|
-
onChange: (e) =>
|
|
1661
|
+
onChange: (e) => G({ exponent: ot(e) })
|
|
1210
1662
|
}),
|
|
1211
|
-
/* @__PURE__ */ a(
|
|
1663
|
+
/* @__PURE__ */ a(Q, {
|
|
1212
1664
|
label: "Height",
|
|
1213
|
-
value:
|
|
1214
|
-
min:
|
|
1215
|
-
max:
|
|
1665
|
+
value: A.prismHeight ?? s.prismHeight,
|
|
1666
|
+
min: we,
|
|
1667
|
+
max: Te,
|
|
1216
1668
|
step: 1,
|
|
1217
1669
|
formatValue: (e) => `${Math.round(e)}px`,
|
|
1218
|
-
onChange: (e) =>
|
|
1670
|
+
onChange: (e) => G({ prismHeight: e })
|
|
1219
1671
|
}),
|
|
1220
|
-
/* @__PURE__ */ a(
|
|
1672
|
+
/* @__PURE__ */ a(Q, {
|
|
1221
1673
|
label: "Dash size",
|
|
1222
|
-
value: (
|
|
1223
|
-
min:
|
|
1224
|
-
max:
|
|
1674
|
+
value: (A.inlayScale ?? s.inlayScale) * 100,
|
|
1675
|
+
min: Ee * 100,
|
|
1676
|
+
max: De * 100,
|
|
1225
1677
|
step: 1,
|
|
1226
1678
|
formatValue: (e) => `${Math.round(e)}%`,
|
|
1227
|
-
onChange: (e) =>
|
|
1679
|
+
onChange: (e) => G({ inlayScale: lt(e / 100, 2) })
|
|
1228
1680
|
})
|
|
1229
1681
|
]
|
|
1230
1682
|
})
|
|
@@ -1235,41 +1687,41 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1235
1687
|
children: [
|
|
1236
1688
|
/* @__PURE__ */ o("div", {
|
|
1237
1689
|
className: "preview-toolbar",
|
|
1238
|
-
children: [/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("h2", { children: "Preview" }), /* @__PURE__ */ a("span", { children:
|
|
1690
|
+
children: [/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("h2", { children: "Preview" }), /* @__PURE__ */ a("span", { children: B ? `Editing Layer ${B}` : `${ae} visible layers` })] }), oe ? /* @__PURE__ */ o("div", {
|
|
1239
1691
|
className: "preview-actions",
|
|
1240
1692
|
children: [/* @__PURE__ */ o("button", {
|
|
1241
1693
|
type: "button",
|
|
1242
1694
|
className: "code-toggle-button",
|
|
1243
|
-
"aria-pressed":
|
|
1244
|
-
onClick: () =>
|
|
1245
|
-
children: [/* @__PURE__ */ a(
|
|
1695
|
+
"aria-pressed": F,
|
|
1696
|
+
onClick: () => I((e) => !e),
|
|
1697
|
+
children: [/* @__PURE__ */ a(Ze, {}), "Code"]
|
|
1246
1698
|
}), /* @__PURE__ */ o("button", {
|
|
1247
1699
|
type: "button",
|
|
1248
1700
|
className: "copy-code-button",
|
|
1249
1701
|
"aria-label": "Copy React code",
|
|
1250
1702
|
title: "Copy React code",
|
|
1251
|
-
onClick:
|
|
1252
|
-
children: [/* @__PURE__ */ a(
|
|
1703
|
+
onClick: fe,
|
|
1704
|
+
children: [/* @__PURE__ */ a(Ge, {}), /* @__PURE__ */ a("span", {
|
|
1253
1705
|
className: "copy-status",
|
|
1254
1706
|
"aria-live": "polite",
|
|
1255
|
-
children:
|
|
1707
|
+
children: L ? "Copied" : ""
|
|
1256
1708
|
})]
|
|
1257
1709
|
})]
|
|
1258
1710
|
}) : null]
|
|
1259
1711
|
}),
|
|
1260
1712
|
/* @__PURE__ */ a("div", {
|
|
1261
1713
|
className: "preview-stage",
|
|
1262
|
-
children: /* @__PURE__ */ a(
|
|
1263
|
-
...
|
|
1264
|
-
theme:
|
|
1714
|
+
children: /* @__PURE__ */ a(re, {
|
|
1715
|
+
...H,
|
|
1716
|
+
theme: j,
|
|
1265
1717
|
ariaLabel: "Editable squircle composition",
|
|
1266
1718
|
onLayerSelect: (e) => {
|
|
1267
|
-
|
|
1719
|
+
N(e), P("base");
|
|
1268
1720
|
}
|
|
1269
1721
|
})
|
|
1270
1722
|
}),
|
|
1271
|
-
|
|
1272
|
-
className:
|
|
1723
|
+
oe ? /* @__PURE__ */ o("section", {
|
|
1724
|
+
className: F ? "code-panel is-open" : "code-panel",
|
|
1273
1725
|
"aria-label": "Generated React code",
|
|
1274
1726
|
children: [/* @__PURE__ */ o("header", {
|
|
1275
1727
|
className: "code-panel-header",
|
|
@@ -1278,23 +1730,23 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1278
1730
|
className: "copy-code-button",
|
|
1279
1731
|
"aria-label": "Copy React code",
|
|
1280
1732
|
title: "Copy React code",
|
|
1281
|
-
onClick:
|
|
1282
|
-
children: [/* @__PURE__ */ a(
|
|
1733
|
+
onClick: fe,
|
|
1734
|
+
children: [/* @__PURE__ */ a(Ge, {}), /* @__PURE__ */ a("span", {
|
|
1283
1735
|
className: "copy-status",
|
|
1284
1736
|
"aria-live": "polite",
|
|
1285
|
-
children:
|
|
1737
|
+
children: L ? "Copied" : ""
|
|
1286
1738
|
})]
|
|
1287
1739
|
})]
|
|
1288
|
-
}),
|
|
1740
|
+
}), F ? /* @__PURE__ */ a("pre", {
|
|
1289
1741
|
className: "code-output",
|
|
1290
|
-
children: /* @__PURE__ */ a("code", { children:
|
|
1742
|
+
children: /* @__PURE__ */ a("code", { children: U })
|
|
1291
1743
|
}) : null]
|
|
1292
1744
|
}) : null
|
|
1293
1745
|
]
|
|
1294
1746
|
}),
|
|
1295
1747
|
/* @__PURE__ */ a("aside", {
|
|
1296
|
-
className:
|
|
1297
|
-
children:
|
|
1748
|
+
className: z ? "side-panel inspector-panel" : "side-panel inspector-panel is-empty",
|
|
1749
|
+
children: z ? /* @__PURE__ */ o(i, { children: [
|
|
1298
1750
|
/* @__PURE__ */ o("div", {
|
|
1299
1751
|
className: "inspector-heading",
|
|
1300
1752
|
children: [/* @__PURE__ */ o("div", { children: [
|
|
@@ -1302,8 +1754,8 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1302
1754
|
className: "inspector-kicker",
|
|
1303
1755
|
children: "Selected"
|
|
1304
1756
|
}),
|
|
1305
|
-
/* @__PURE__ */ a("h2", { children:
|
|
1306
|
-
/* @__PURE__ */ a("p", { children:
|
|
1757
|
+
/* @__PURE__ */ a("h2", { children: B ? rt(z.id, B, k.length) : z.id }),
|
|
1758
|
+
/* @__PURE__ */ a("p", { children: Qe(z.base) })
|
|
1307
1759
|
] }), /* @__PURE__ */ o("div", {
|
|
1308
1760
|
className: "panel-actions",
|
|
1309
1761
|
children: [/* @__PURE__ */ a("button", {
|
|
@@ -1311,15 +1763,15 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1311
1763
|
className: "icon-button",
|
|
1312
1764
|
"aria-label": "Close inspector",
|
|
1313
1765
|
title: "Close inspector",
|
|
1314
|
-
onClick: () =>
|
|
1315
|
-
children: /* @__PURE__ */ a(
|
|
1766
|
+
onClick: () => N(null),
|
|
1767
|
+
children: /* @__PURE__ */ a(Xe, {})
|
|
1316
1768
|
}), /* @__PURE__ */ a("button", {
|
|
1317
1769
|
type: "button",
|
|
1318
1770
|
className: "icon-button danger",
|
|
1319
1771
|
"aria-label": "Delete layer",
|
|
1320
1772
|
title: "Delete layer",
|
|
1321
|
-
onClick:
|
|
1322
|
-
children: /* @__PURE__ */ a(
|
|
1773
|
+
onClick: le,
|
|
1774
|
+
children: /* @__PURE__ */ a(qe, {})
|
|
1323
1775
|
})]
|
|
1324
1776
|
})]
|
|
1325
1777
|
}),
|
|
@@ -1329,31 +1781,31 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1329
1781
|
"aria-label": "Layer state",
|
|
1330
1782
|
children: [/* @__PURE__ */ a("button", {
|
|
1331
1783
|
type: "button",
|
|
1332
|
-
"aria-pressed":
|
|
1333
|
-
onClick: () =>
|
|
1784
|
+
"aria-pressed": ie === "base",
|
|
1785
|
+
onClick: () => P("base"),
|
|
1334
1786
|
children: "Base"
|
|
1335
1787
|
}), /* @__PURE__ */ o("button", {
|
|
1336
1788
|
type: "button",
|
|
1337
|
-
"aria-pressed":
|
|
1338
|
-
onClick: () =>
|
|
1339
|
-
children: ["Hover",
|
|
1789
|
+
"aria-pressed": ie === "hover",
|
|
1790
|
+
onClick: () => P("hover"),
|
|
1791
|
+
children: ["Hover", z.hover ? /* @__PURE__ */ a("span", {
|
|
1340
1792
|
className: "state-dot",
|
|
1341
1793
|
"aria-hidden": "true"
|
|
1342
1794
|
}) : null]
|
|
1343
1795
|
})]
|
|
1344
1796
|
}),
|
|
1345
|
-
|
|
1797
|
+
ie === "base" ? /* @__PURE__ */ a(ze, {
|
|
1346
1798
|
title: "Base State",
|
|
1347
|
-
variant:
|
|
1348
|
-
onChange:
|
|
1349
|
-
}) : /* @__PURE__ */ o(
|
|
1799
|
+
variant: z.base,
|
|
1800
|
+
onChange: se
|
|
1801
|
+
}) : /* @__PURE__ */ o(X, {
|
|
1350
1802
|
title: "Hover State",
|
|
1351
|
-
children: [/* @__PURE__ */ a(
|
|
1803
|
+
children: [/* @__PURE__ */ a(Ve, {
|
|
1352
1804
|
label: "Hover variant",
|
|
1353
|
-
checked: !!
|
|
1805
|
+
checked: !!z.hover,
|
|
1354
1806
|
title: "Swap this layer to another variant on hover.",
|
|
1355
1807
|
onChange: (e) => {
|
|
1356
|
-
|
|
1808
|
+
K(z.id, (t) => ({
|
|
1357
1809
|
...t,
|
|
1358
1810
|
hover: e ? {
|
|
1359
1811
|
...t.base,
|
|
@@ -1361,26 +1813,26 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1361
1813
|
} : void 0
|
|
1362
1814
|
}));
|
|
1363
1815
|
}
|
|
1364
|
-
}),
|
|
1816
|
+
}), z.hover ? /* @__PURE__ */ a(Be, {
|
|
1365
1817
|
variant: {
|
|
1366
|
-
...
|
|
1367
|
-
...
|
|
1818
|
+
...z.base,
|
|
1819
|
+
...z.hover
|
|
1368
1820
|
},
|
|
1369
|
-
onChange:
|
|
1821
|
+
onChange: ce
|
|
1370
1822
|
}) : null]
|
|
1371
1823
|
}),
|
|
1372
|
-
/* @__PURE__ */ o(
|
|
1824
|
+
/* @__PURE__ */ o(X, {
|
|
1373
1825
|
title: "Stroke Widths",
|
|
1374
1826
|
collapsible: !0,
|
|
1375
1827
|
defaultOpen: !1,
|
|
1376
1828
|
children: [
|
|
1377
|
-
/* @__PURE__ */ a(
|
|
1829
|
+
/* @__PURE__ */ a(Q, {
|
|
1378
1830
|
label: "Face",
|
|
1379
|
-
value:
|
|
1831
|
+
value: z.stroke?.face ?? .35,
|
|
1380
1832
|
min: 0,
|
|
1381
1833
|
max: 1.5,
|
|
1382
1834
|
step: .05,
|
|
1383
|
-
onChange: (e) =>
|
|
1835
|
+
onChange: (e) => K(z.id, (t) => ({
|
|
1384
1836
|
...t,
|
|
1385
1837
|
stroke: {
|
|
1386
1838
|
...t.stroke,
|
|
@@ -1388,13 +1840,13 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1388
1840
|
}
|
|
1389
1841
|
}))
|
|
1390
1842
|
}),
|
|
1391
|
-
/* @__PURE__ */ a(
|
|
1843
|
+
/* @__PURE__ */ a(Q, {
|
|
1392
1844
|
label: "Wire",
|
|
1393
|
-
value:
|
|
1845
|
+
value: z.stroke?.wire ?? 1.6,
|
|
1394
1846
|
min: .4,
|
|
1395
1847
|
max: 4,
|
|
1396
1848
|
step: .1,
|
|
1397
|
-
onChange: (e) =>
|
|
1849
|
+
onChange: (e) => K(z.id, (t) => ({
|
|
1398
1850
|
...t,
|
|
1399
1851
|
stroke: {
|
|
1400
1852
|
...t.stroke,
|
|
@@ -1402,13 +1854,13 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1402
1854
|
}
|
|
1403
1855
|
}))
|
|
1404
1856
|
}),
|
|
1405
|
-
/* @__PURE__ */ a(
|
|
1857
|
+
/* @__PURE__ */ a(Q, {
|
|
1406
1858
|
label: "Dash",
|
|
1407
|
-
value:
|
|
1859
|
+
value: z.stroke?.dash ?? 2.2,
|
|
1408
1860
|
min: .6,
|
|
1409
1861
|
max: 5,
|
|
1410
1862
|
step: .1,
|
|
1411
|
-
onChange: (e) =>
|
|
1863
|
+
onChange: (e) => K(z.id, (t) => ({
|
|
1412
1864
|
...t,
|
|
1413
1865
|
stroke: {
|
|
1414
1866
|
...t.stroke,
|
|
@@ -1416,13 +1868,13 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1416
1868
|
}
|
|
1417
1869
|
}))
|
|
1418
1870
|
}),
|
|
1419
|
-
/* @__PURE__ */ a(
|
|
1871
|
+
/* @__PURE__ */ a(Q, {
|
|
1420
1872
|
label: "Text outline",
|
|
1421
|
-
value:
|
|
1873
|
+
value: z.stroke?.labelWire ?? 1.1,
|
|
1422
1874
|
min: .4,
|
|
1423
1875
|
max: 2,
|
|
1424
1876
|
step: .05,
|
|
1425
|
-
onChange: (e) =>
|
|
1877
|
+
onChange: (e) => K(z.id, (t) => ({
|
|
1426
1878
|
...t,
|
|
1427
1879
|
stroke: {
|
|
1428
1880
|
...t.stroke,
|
|
@@ -1437,7 +1889,7 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1437
1889
|
children: [/* @__PURE__ */ a("h2", { children: "No layer selected" }), /* @__PURE__ */ a("button", {
|
|
1438
1890
|
type: "button",
|
|
1439
1891
|
className: "primary-action",
|
|
1440
|
-
onClick:
|
|
1892
|
+
onClick: q,
|
|
1441
1893
|
children: "Add layer"
|
|
1442
1894
|
})]
|
|
1443
1895
|
})
|
|
@@ -1446,7 +1898,7 @@ function Ce({ value: t, initialLayers: c, onChange: l, geometry: u, initialGeome
|
|
|
1446
1898
|
})]
|
|
1447
1899
|
});
|
|
1448
1900
|
}
|
|
1449
|
-
function
|
|
1901
|
+
function X({ title: e, children: t, collapsible: n = !1, defaultOpen: r = !0 }) {
|
|
1450
1902
|
return n ? /* @__PURE__ */ o("details", {
|
|
1451
1903
|
className: "editor-section editor-section-details",
|
|
1452
1904
|
open: r,
|
|
@@ -1459,106 +1911,113 @@ function Y({ title: e, children: t, collapsible: n = !1, defaultOpen: r = !0 })
|
|
|
1459
1911
|
children: [/* @__PURE__ */ a("h3", { children: e }), t]
|
|
1460
1912
|
});
|
|
1461
1913
|
}
|
|
1462
|
-
function
|
|
1463
|
-
return /* @__PURE__ */ a(
|
|
1914
|
+
function ze({ title: e, variant: t, onChange: n }) {
|
|
1915
|
+
return /* @__PURE__ */ a(X, {
|
|
1464
1916
|
title: e,
|
|
1465
|
-
children: /* @__PURE__ */ a(
|
|
1917
|
+
children: /* @__PURE__ */ a(Be, {
|
|
1466
1918
|
variant: t,
|
|
1467
1919
|
onChange: n
|
|
1468
1920
|
})
|
|
1469
1921
|
});
|
|
1470
1922
|
}
|
|
1471
|
-
function
|
|
1923
|
+
function Be({ variant: e, onChange: t }) {
|
|
1924
|
+
let n = e.material ?? "wireframe";
|
|
1472
1925
|
return /* @__PURE__ */ o("div", {
|
|
1473
1926
|
className: "variant-controls",
|
|
1474
1927
|
children: [
|
|
1475
|
-
/* @__PURE__ */ a(
|
|
1928
|
+
/* @__PURE__ */ a(Z, {
|
|
1476
1929
|
label: "Material",
|
|
1477
|
-
value:
|
|
1478
|
-
options:
|
|
1930
|
+
value: n,
|
|
1931
|
+
options: Me,
|
|
1479
1932
|
onChange: (e) => t({ material: e })
|
|
1480
1933
|
}),
|
|
1481
|
-
/* @__PURE__ */ a(
|
|
1482
|
-
value: e.paletteId
|
|
1934
|
+
/* @__PURE__ */ a(Ue, {
|
|
1935
|
+
value: et(e.paletteId),
|
|
1483
1936
|
onChange: (e) => t({ paletteId: e })
|
|
1484
1937
|
}),
|
|
1938
|
+
n === "solid" ? /* @__PURE__ */ a(Z, {
|
|
1939
|
+
label: "Effect",
|
|
1940
|
+
value: tt(e),
|
|
1941
|
+
options: Ne,
|
|
1942
|
+
onChange: (e) => t({ effect: e })
|
|
1943
|
+
}) : null,
|
|
1485
1944
|
/* @__PURE__ */ o("div", {
|
|
1486
1945
|
className: "feature-grid",
|
|
1487
1946
|
"aria-label": "Top details",
|
|
1488
|
-
children: [/* @__PURE__ */ a(
|
|
1947
|
+
children: [/* @__PURE__ */ a(Ve, {
|
|
1489
1948
|
label: "Text",
|
|
1490
|
-
checked:
|
|
1949
|
+
checked: $(e),
|
|
1491
1950
|
title: "Toggle top-plane text for this state.",
|
|
1492
1951
|
onChange: (n) => t(n ? {
|
|
1493
|
-
text:
|
|
1494
|
-
textColor:
|
|
1952
|
+
text: ut(e),
|
|
1953
|
+
textColor: ft(e)
|
|
1495
1954
|
} : {
|
|
1496
1955
|
text: !1,
|
|
1497
1956
|
textColor: void 0
|
|
1498
1957
|
})
|
|
1499
|
-
}), /* @__PURE__ */ a(
|
|
1958
|
+
}), /* @__PURE__ */ a(Ve, {
|
|
1500
1959
|
label: "Dash",
|
|
1501
1960
|
checked: e.dash ?? !1,
|
|
1502
1961
|
title: "Toggle the dashed inlay for this state.",
|
|
1503
1962
|
onChange: (n) => t(n ? {
|
|
1504
1963
|
dash: !0,
|
|
1505
|
-
dashColor:
|
|
1964
|
+
dashColor: pt(e)
|
|
1506
1965
|
} : {
|
|
1507
1966
|
dash: !1,
|
|
1508
1967
|
dashColor: void 0
|
|
1509
1968
|
})
|
|
1510
1969
|
})]
|
|
1511
1970
|
}),
|
|
1512
|
-
|
|
1971
|
+
$(e) ? /* @__PURE__ */ o("div", {
|
|
1513
1972
|
className: "nested-fields",
|
|
1514
1973
|
children: [
|
|
1515
|
-
/* @__PURE__ */ a(
|
|
1974
|
+
/* @__PURE__ */ a(We, {
|
|
1516
1975
|
label: "Text",
|
|
1517
|
-
value:
|
|
1976
|
+
value: ut(e),
|
|
1518
1977
|
onChange: (e) => t({ text: e })
|
|
1519
1978
|
}),
|
|
1520
|
-
/* @__PURE__ */ a(
|
|
1979
|
+
/* @__PURE__ */ a(Z, {
|
|
1521
1980
|
label: "Text paint",
|
|
1522
|
-
value:
|
|
1523
|
-
options:
|
|
1981
|
+
value: dt(e),
|
|
1982
|
+
options: Pe,
|
|
1524
1983
|
onChange: (e) => t({ textStyle: e })
|
|
1525
1984
|
}),
|
|
1526
|
-
/* @__PURE__ */ a(
|
|
1985
|
+
/* @__PURE__ */ a(He, {
|
|
1527
1986
|
label: "Text color",
|
|
1528
|
-
value:
|
|
1529
|
-
forcedValue:
|
|
1987
|
+
value: ft(e),
|
|
1988
|
+
forcedValue: ht(e),
|
|
1530
1989
|
onChange: (e) => t({ textColor: e })
|
|
1531
1990
|
}),
|
|
1532
|
-
/* @__PURE__ */ a(
|
|
1991
|
+
/* @__PURE__ */ a(Q, {
|
|
1533
1992
|
label: "Text size",
|
|
1534
|
-
value: e.textSize ??
|
|
1535
|
-
min:
|
|
1536
|
-
max:
|
|
1993
|
+
value: e.textSize ?? Ae,
|
|
1994
|
+
min: Oe,
|
|
1995
|
+
max: ke,
|
|
1537
1996
|
step: 1,
|
|
1538
1997
|
formatValue: (e) => `${Math.round(e)}px`,
|
|
1539
1998
|
onChange: (e) => t({ textSize: e })
|
|
1540
1999
|
}),
|
|
1541
|
-
/* @__PURE__ */ a(
|
|
2000
|
+
/* @__PURE__ */ a(Z, {
|
|
1542
2001
|
label: "Font weight",
|
|
1543
|
-
value: String(e.textFontWeight ??
|
|
1544
|
-
options:
|
|
2002
|
+
value: String(e.textFontWeight ?? je),
|
|
2003
|
+
options: Ie,
|
|
1545
2004
|
onChange: (e) => t({ textFontWeight: Number(e) })
|
|
1546
2005
|
})
|
|
1547
2006
|
]
|
|
1548
2007
|
}) : null,
|
|
1549
2008
|
e.dash ? /* @__PURE__ */ a("div", {
|
|
1550
2009
|
className: "nested-fields",
|
|
1551
|
-
children: /* @__PURE__ */ a(
|
|
2010
|
+
children: /* @__PURE__ */ a(He, {
|
|
1552
2011
|
label: "Dash color",
|
|
1553
|
-
value:
|
|
1554
|
-
forcedValue:
|
|
2012
|
+
value: pt(e),
|
|
2013
|
+
forcedValue: gt(e),
|
|
1555
2014
|
onChange: (e) => t({ dashColor: e })
|
|
1556
2015
|
})
|
|
1557
2016
|
}) : null
|
|
1558
2017
|
]
|
|
1559
2018
|
});
|
|
1560
2019
|
}
|
|
1561
|
-
function
|
|
2020
|
+
function Ve({ label: e, checked: t, title: n, onChange: r }) {
|
|
1562
2021
|
return /* @__PURE__ */ o("button", {
|
|
1563
2022
|
type: "button",
|
|
1564
2023
|
className: "feature-switch",
|
|
@@ -1574,7 +2033,7 @@ function Ee({ label: e, checked: t, title: n, onChange: r }) {
|
|
|
1574
2033
|
})]
|
|
1575
2034
|
});
|
|
1576
2035
|
}
|
|
1577
|
-
function
|
|
2036
|
+
function He({ label: e, value: t, forcedValue: n, onChange: r }) {
|
|
1578
2037
|
return n ? /* @__PURE__ */ o("div", {
|
|
1579
2038
|
className: "field",
|
|
1580
2039
|
children: [/* @__PURE__ */ a("span", { children: e }), /* @__PURE__ */ a("div", {
|
|
@@ -1582,14 +2041,14 @@ function De({ label: e, value: t, forcedValue: n, onChange: r }) {
|
|
|
1582
2041
|
title: "This material controls annotation paint from the wireframe palette.",
|
|
1583
2042
|
children: n
|
|
1584
2043
|
})]
|
|
1585
|
-
}) : /* @__PURE__ */ a(
|
|
2044
|
+
}) : /* @__PURE__ */ a(Z, {
|
|
1586
2045
|
label: e,
|
|
1587
2046
|
value: t,
|
|
1588
|
-
options:
|
|
2047
|
+
options: Fe,
|
|
1589
2048
|
onChange: r
|
|
1590
2049
|
});
|
|
1591
2050
|
}
|
|
1592
|
-
function
|
|
2051
|
+
function Z({ label: e, value: t, options: n, onChange: r }) {
|
|
1593
2052
|
return /* @__PURE__ */ o("div", {
|
|
1594
2053
|
className: "field",
|
|
1595
2054
|
children: [/* @__PURE__ */ a("span", { children: e }), /* @__PURE__ */ a("div", {
|
|
@@ -1606,27 +2065,30 @@ function X({ label: e, value: t, options: n, onChange: r }) {
|
|
|
1606
2065
|
})]
|
|
1607
2066
|
});
|
|
1608
2067
|
}
|
|
1609
|
-
function
|
|
2068
|
+
function Ue({ value: e, onChange: t }) {
|
|
1610
2069
|
return /* @__PURE__ */ o("div", {
|
|
1611
2070
|
className: "field palette-field",
|
|
1612
2071
|
children: [/* @__PURE__ */ a("span", { children: "Palette" }), /* @__PURE__ */ a("div", {
|
|
1613
2072
|
className: "palette-grid",
|
|
1614
2073
|
role: "group",
|
|
1615
2074
|
"aria-label": "Palette",
|
|
1616
|
-
children: x.map((n) =>
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
2075
|
+
children: x.map((n) => {
|
|
2076
|
+
let r = $e(n);
|
|
2077
|
+
return /* @__PURE__ */ o("button", {
|
|
2078
|
+
type: "button",
|
|
2079
|
+
title: r.label,
|
|
2080
|
+
"aria-pressed": e === n,
|
|
2081
|
+
onClick: () => t(n),
|
|
2082
|
+
children: [/* @__PURE__ */ a("span", {
|
|
2083
|
+
className: "palette-swatch",
|
|
2084
|
+
style: { background: `linear-gradient(135deg, ${r.swatch[0]}, ${r.swatch[1]})` }
|
|
2085
|
+
}), /* @__PURE__ */ a("span", { children: n })]
|
|
2086
|
+
}, n);
|
|
2087
|
+
})
|
|
1626
2088
|
})]
|
|
1627
2089
|
});
|
|
1628
2090
|
}
|
|
1629
|
-
function
|
|
2091
|
+
function We({ label: e, value: t, onChange: n }) {
|
|
1630
2092
|
return /* @__PURE__ */ o("label", {
|
|
1631
2093
|
className: "field",
|
|
1632
2094
|
children: [/* @__PURE__ */ a("span", { children: e }), /* @__PURE__ */ a("input", {
|
|
@@ -1636,7 +2098,7 @@ function ke({ label: e, value: t, onChange: n }) {
|
|
|
1636
2098
|
})]
|
|
1637
2099
|
});
|
|
1638
2100
|
}
|
|
1639
|
-
function
|
|
2101
|
+
function Q({ label: e, value: t, min: n, max: r, step: i, formatValue: s, onChange: c }) {
|
|
1640
2102
|
return /* @__PURE__ */ o("label", {
|
|
1641
2103
|
className: "field",
|
|
1642
2104
|
children: [/* @__PURE__ */ o("span", { children: [
|
|
@@ -1653,7 +2115,7 @@ function Z({ label: e, value: t, min: n, max: r, step: i, formatValue: s, onChan
|
|
|
1653
2115
|
})]
|
|
1654
2116
|
});
|
|
1655
2117
|
}
|
|
1656
|
-
function
|
|
2118
|
+
function Ge() {
|
|
1657
2119
|
return /* @__PURE__ */ o("svg", {
|
|
1658
2120
|
className: "copy-icon",
|
|
1659
2121
|
viewBox: "0 0 24 24",
|
|
@@ -1668,7 +2130,7 @@ function Ae() {
|
|
|
1668
2130
|
}), /* @__PURE__ */ a("path", { d: "M5 15V6.8C5 5.8 5.8 5 6.8 5H15" })]
|
|
1669
2131
|
});
|
|
1670
2132
|
}
|
|
1671
|
-
function
|
|
2133
|
+
function Ke() {
|
|
1672
2134
|
return /* @__PURE__ */ a("svg", {
|
|
1673
2135
|
viewBox: "0 0 24 24",
|
|
1674
2136
|
"aria-hidden": "true",
|
|
@@ -1676,7 +2138,7 @@ function je() {
|
|
|
1676
2138
|
children: /* @__PURE__ */ a("path", { d: "M12 5v14M5 12h14" })
|
|
1677
2139
|
});
|
|
1678
2140
|
}
|
|
1679
|
-
function
|
|
2141
|
+
function qe() {
|
|
1680
2142
|
return /* @__PURE__ */ a("svg", {
|
|
1681
2143
|
viewBox: "0 0 24 24",
|
|
1682
2144
|
"aria-hidden": "true",
|
|
@@ -1684,7 +2146,7 @@ function Me() {
|
|
|
1684
2146
|
children: /* @__PURE__ */ a("path", { d: "M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3" })
|
|
1685
2147
|
});
|
|
1686
2148
|
}
|
|
1687
|
-
function
|
|
2149
|
+
function Je() {
|
|
1688
2150
|
return /* @__PURE__ */ o("svg", {
|
|
1689
2151
|
viewBox: "0 0 24 24",
|
|
1690
2152
|
"aria-hidden": "true",
|
|
@@ -1696,7 +2158,7 @@ function Ne() {
|
|
|
1696
2158
|
})]
|
|
1697
2159
|
});
|
|
1698
2160
|
}
|
|
1699
|
-
function
|
|
2161
|
+
function Ye() {
|
|
1700
2162
|
return /* @__PURE__ */ a("svg", {
|
|
1701
2163
|
viewBox: "0 0 24 24",
|
|
1702
2164
|
"aria-hidden": "true",
|
|
@@ -1704,7 +2166,7 @@ function Pe() {
|
|
|
1704
2166
|
children: /* @__PURE__ */ a("path", { d: "M3 3l18 18M9.4 5.5A10.9 10.9 0 0 1 12 5c6.1 0 9.5 7 9.5 7a15.2 15.2 0 0 1-3 4M6.7 6.9A15.5 15.5 0 0 0 2.5 12s3.4 7 9.5 7c1.1 0 2.2-.2 3.1-.6" })
|
|
1705
2167
|
});
|
|
1706
2168
|
}
|
|
1707
|
-
function
|
|
2169
|
+
function Xe() {
|
|
1708
2170
|
return /* @__PURE__ */ a("svg", {
|
|
1709
2171
|
viewBox: "0 0 24 24",
|
|
1710
2172
|
"aria-hidden": "true",
|
|
@@ -1712,7 +2174,7 @@ function Fe() {
|
|
|
1712
2174
|
children: /* @__PURE__ */ a("path", { d: "M6 6l12 12M18 6L6 18" })
|
|
1713
2175
|
});
|
|
1714
2176
|
}
|
|
1715
|
-
function
|
|
2177
|
+
function Ze() {
|
|
1716
2178
|
return /* @__PURE__ */ a("svg", {
|
|
1717
2179
|
viewBox: "0 0 24 24",
|
|
1718
2180
|
"aria-hidden": "true",
|
|
@@ -1720,73 +2182,79 @@ function Ie() {
|
|
|
1720
2182
|
children: /* @__PURE__ */ a("path", { d: "M9 18 3 12l6-6M15 6l6 6-6 6" })
|
|
1721
2183
|
});
|
|
1722
2184
|
}
|
|
1723
|
-
function
|
|
1724
|
-
let t = [
|
|
1725
|
-
return
|
|
2185
|
+
function Qe(e) {
|
|
2186
|
+
let t = [nt(e.material ?? "wireframe"), $e(e.paletteId).label], n = tt(e);
|
|
2187
|
+
return (e.material ?? "wireframe") === "solid" && n !== "off" && t.push(n), $(e) && t.push(`text: ${ut(e)}`), e.dash && t.push("dash"), t.join(" / ");
|
|
1726
2188
|
}
|
|
1727
|
-
function
|
|
2189
|
+
function $e(e) {
|
|
1728
2190
|
return b[e] ?? b[15];
|
|
1729
2191
|
}
|
|
1730
|
-
function
|
|
2192
|
+
function et(e) {
|
|
2193
|
+
return e && e in b ? e : "15";
|
|
2194
|
+
}
|
|
2195
|
+
function tt(e) {
|
|
2196
|
+
return e.effect === "fluid" || e.effect === "frosted" ? e.effect : "off";
|
|
2197
|
+
}
|
|
2198
|
+
function nt(e) {
|
|
1731
2199
|
return e === "transparent" ? "Glass" : e === "solid" ? "Solid" : "Wire";
|
|
1732
2200
|
}
|
|
1733
|
-
function
|
|
2201
|
+
function rt(e, t, n) {
|
|
1734
2202
|
return `Layer ${t}`;
|
|
1735
2203
|
}
|
|
1736
|
-
function
|
|
2204
|
+
function it(e) {
|
|
1737
2205
|
let t = new Set(e.map((e) => e.id)), n = e.length + 1;
|
|
1738
2206
|
for (; t.has(`layer-${n}`);) n += 1;
|
|
1739
2207
|
return `layer-${n}`;
|
|
1740
2208
|
}
|
|
1741
|
-
function
|
|
1742
|
-
let t = (
|
|
1743
|
-
return
|
|
2209
|
+
function at(e) {
|
|
2210
|
+
let t = (Y - e) / (Y - Ce);
|
|
2211
|
+
return ct(Math.round(t * 100), xe, Se);
|
|
1744
2212
|
}
|
|
1745
|
-
function
|
|
1746
|
-
return
|
|
2213
|
+
function ot(e) {
|
|
2214
|
+
return lt(Y - ct(e, xe, Se) / 100 * (Y - Ce), 1);
|
|
1747
2215
|
}
|
|
1748
|
-
function
|
|
2216
|
+
function st(e) {
|
|
1749
2217
|
return {
|
|
1750
2218
|
exponent: e.exponent ?? s.exponent,
|
|
1751
2219
|
prismHeight: e.prismHeight ?? s.prismHeight,
|
|
1752
2220
|
inlayScale: e.inlayScale ?? s.inlayScale
|
|
1753
2221
|
};
|
|
1754
2222
|
}
|
|
1755
|
-
function
|
|
2223
|
+
function ct(e, t, n) {
|
|
1756
2224
|
return Math.min(n, Math.max(t, e));
|
|
1757
2225
|
}
|
|
1758
|
-
function
|
|
2226
|
+
function lt(e, t) {
|
|
1759
2227
|
let n = 10 ** t;
|
|
1760
2228
|
return Math.round(e * n) / n;
|
|
1761
2229
|
}
|
|
1762
|
-
function
|
|
1763
|
-
return typeof e.text == "string" ? e.text.trim().length > 0 : e.text === !0 ||
|
|
2230
|
+
function $(e) {
|
|
2231
|
+
return typeof e.text == "string" ? e.text.trim().length > 0 : e.text === !0 || _t(e).gpu === !0;
|
|
1764
2232
|
}
|
|
1765
|
-
function
|
|
1766
|
-
return typeof e.text == "string" ? e.text : (e.text === !0 ||
|
|
2233
|
+
function ut(e) {
|
|
2234
|
+
return typeof e.text == "string" ? e.text : (e.text === !0 || _t(e).gpu, ye);
|
|
1767
2235
|
}
|
|
1768
|
-
function
|
|
1769
|
-
return e.textStyle ??
|
|
2236
|
+
function dt(e) {
|
|
2237
|
+
return e.textStyle ?? _t(e).gpuStyle ?? "solid";
|
|
1770
2238
|
}
|
|
1771
|
-
function
|
|
1772
|
-
return
|
|
2239
|
+
function ft(e) {
|
|
2240
|
+
return mt(e.textColor ?? _t(e).gpuColor ?? "contrast");
|
|
1773
2241
|
}
|
|
1774
|
-
function
|
|
1775
|
-
return
|
|
2242
|
+
function pt(e) {
|
|
2243
|
+
return mt(e.dashColor ?? "contrast");
|
|
1776
2244
|
}
|
|
1777
|
-
function
|
|
2245
|
+
function mt(e) {
|
|
1778
2246
|
return e === "contrast" ? "auto" : e;
|
|
1779
2247
|
}
|
|
1780
|
-
function
|
|
1781
|
-
return (e.material ?? "wireframe") === "wireframe" ?
|
|
2248
|
+
function ht(e) {
|
|
2249
|
+
return (e.material ?? "wireframe") === "wireframe" ? dt(e) === "wireframe" ? "Wire gradient" : "Surface gradient" : null;
|
|
1782
2250
|
}
|
|
1783
|
-
function
|
|
2251
|
+
function gt(e) {
|
|
1784
2252
|
return (e.material ?? "wireframe") === "wireframe" ? "Wire gradient" : null;
|
|
1785
2253
|
}
|
|
1786
|
-
function
|
|
2254
|
+
function _t(e) {
|
|
1787
2255
|
return e;
|
|
1788
2256
|
}
|
|
1789
2257
|
//#endregion
|
|
1790
|
-
export { s as DEFAULT_GEOMETRY, S as DEFAULT_PALETTE_ID, b as SQUIRCLE_PALETTES, x as SQUIRCLE_PALETTE_IDS,
|
|
2258
|
+
export { s as DEFAULT_GEOMETRY, S as DEFAULT_PALETTE_ID, b as SQUIRCLE_PALETTES, x as SQUIRCLE_PALETTE_IDS, Re as SquircleEditor, re as SquircleScene, Le as createDefaultSquircleEditorLayers, c as createSquircleGeometry, u as createSquircleLayers, de as createSquircleReactCode, C as getSquirclePalette, w as isSquirclePaletteId, d as reflowLayerOffsets, _e as toComponentName };
|
|
1791
2259
|
|
|
1792
2260
|
//# sourceMappingURL=sqircle.js.map
|