@harmonics/lattice-ui 0.7.0 → 0.8.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.
- package/CHANGELOG.md +6 -0
- package/README.md +5 -1
- package/dist/define.js +1 -1
- package/dist/{elements-DdyLdkzr.js → elements-Bk_vtqsk.js} +163 -86
- package/dist/index.js +1 -1
- package/dist/types/elements/icon.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
`@harmonics/lattice-ui` follows semantic versioning; while it is `0.x`, a minor version may change
|
|
4
4
|
an element's inputs, events or tokens, and says so here.
|
|
5
5
|
|
|
6
|
+
## 0.8.0
|
|
7
|
+
|
|
8
|
+
- `<lattice-icon>` draws three more marks: `name` (a pencil), `split` (the Sierpinski step) and
|
|
9
|
+
`search` (a hexagon lens). Every line upright or at 30°, as the others. Additive: nothing in
|
|
10
|
+
0.7.0 changes.
|
|
11
|
+
|
|
6
12
|
## 0.7.0
|
|
7
13
|
|
|
8
14
|
- `<lattice-shape pressable>`: a button shaped like itself, in the tab order, named by its
|
package/README.md
CHANGED
|
@@ -152,8 +152,12 @@ at 30°.
|
|
|
152
152
|
| `glue` | two cells sharing a heavy side (G) | `glue-cell`, `glue-seam` |
|
|
153
153
|
| `apart` | two cells with a gap (Shift+G) | `apart-cell` |
|
|
154
154
|
| `bin` | a cup under a diamond lid (Delete) | `bin-can`, `bin-rib`, `bin-lid` |
|
|
155
|
+
| `name` | a pencil rising at 30°, a triangle for its point | `name-body`, `name-point`, `name-band` |
|
|
156
|
+
| `split` | a triangle with its middle turned over, the Sierpinski step | `split-whole`, `split-hole` |
|
|
157
|
+
| `search` | a hexagon lens, a strip for its handle | `search-lens`, `search-handle` |
|
|
155
158
|
|
|
156
|
-
|
|
159
|
+
`turn`, `glue`, `apart` and `bin` are `<lattice-board>`'s keyboard actions, for a page that gives
|
|
160
|
+
each a button; `name`, `split` and `bin` are the Harmonics grid's own controls.
|
|
157
161
|
|
|
158
162
|
## Board
|
|
159
163
|
|
package/dist/define.js
CHANGED
|
@@ -850,91 +850,165 @@ var je = ".face .plate-top{fill:var(--color-tree-raised);stroke:color-mix(in srg
|
|
|
850
850
|
}, Je = (e, t) => {
|
|
851
851
|
let n = e * Z / 2;
|
|
852
852
|
return [Q(8 - n - t / 2, 8, e), Q(8 + n + t / 2, 8, e)];
|
|
853
|
-
}, Ye = {
|
|
853
|
+
}, Ye = () => {
|
|
854
|
+
let e = 4.2, [t, n] = Je(e, 0);
|
|
855
|
+
return [
|
|
856
|
+
{
|
|
857
|
+
part: "glue-cell",
|
|
858
|
+
look: "line",
|
|
859
|
+
d: h(t)
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
part: "glue-cell",
|
|
863
|
+
look: "line",
|
|
864
|
+
d: h(n)
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
part: "glue-seam",
|
|
868
|
+
look: "heavy",
|
|
869
|
+
d: $([{
|
|
870
|
+
x: 8,
|
|
871
|
+
y: 8 - e / 2
|
|
872
|
+
}, {
|
|
873
|
+
x: 8,
|
|
874
|
+
y: 10.1
|
|
875
|
+
}])
|
|
876
|
+
}
|
|
877
|
+
];
|
|
878
|
+
}, Xe = () => {
|
|
879
|
+
let [e, t] = Je(3.7, 2);
|
|
880
|
+
return [{
|
|
881
|
+
part: "apart-cell",
|
|
882
|
+
look: "line",
|
|
883
|
+
d: h(e)
|
|
884
|
+
}, {
|
|
885
|
+
part: "apart-cell",
|
|
886
|
+
look: "line",
|
|
887
|
+
d: h(t)
|
|
888
|
+
}];
|
|
889
|
+
}, Ze = () => {
|
|
890
|
+
let [, e, t, n, r, i] = Q(8, 9.4, 5.2), a = (e) => $([{
|
|
891
|
+
x: e,
|
|
892
|
+
y: 8.6
|
|
893
|
+
}, {
|
|
894
|
+
x: e,
|
|
895
|
+
y: 12.2
|
|
896
|
+
}]);
|
|
897
|
+
return [
|
|
898
|
+
{
|
|
899
|
+
part: "bin-can",
|
|
900
|
+
look: "line",
|
|
901
|
+
d: $([
|
|
902
|
+
i,
|
|
903
|
+
r,
|
|
904
|
+
n,
|
|
905
|
+
t,
|
|
906
|
+
e
|
|
907
|
+
])
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
part: "bin-rib",
|
|
911
|
+
look: "line",
|
|
912
|
+
d: `${a(6.5)} ${a(9.5)}`
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
part: "bin-lid",
|
|
916
|
+
look: "line",
|
|
917
|
+
d: h(Ue(8, 3.9, 5))
|
|
918
|
+
}
|
|
919
|
+
];
|
|
920
|
+
}, Qe = (e, t, n, r, i) => {
|
|
921
|
+
let a = (n - e) / Z * (i ? -1 : 1);
|
|
922
|
+
return [
|
|
923
|
+
{
|
|
924
|
+
x: e,
|
|
925
|
+
y: t
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
x: n,
|
|
929
|
+
y: t + a
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
x: n,
|
|
933
|
+
y: t + a + r
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
x: e,
|
|
937
|
+
y: t + r
|
|
938
|
+
}
|
|
939
|
+
];
|
|
940
|
+
}, $e = {
|
|
854
941
|
shears: We,
|
|
855
942
|
done: Ge,
|
|
856
943
|
note: Ke,
|
|
857
944
|
turn: qe,
|
|
858
|
-
glue:
|
|
859
|
-
|
|
945
|
+
glue: Ye,
|
|
946
|
+
apart: Xe,
|
|
947
|
+
bin: Ze,
|
|
948
|
+
name: () => {
|
|
949
|
+
let e = 3.6, t = Qe(5, 9.9, 14.4, e, !0), n = 9.9 - 7 / Z;
|
|
860
950
|
return [
|
|
861
951
|
{
|
|
862
|
-
part: "
|
|
952
|
+
part: "name-body",
|
|
863
953
|
look: "line",
|
|
864
954
|
d: h(t)
|
|
865
955
|
},
|
|
866
956
|
{
|
|
867
|
-
part: "
|
|
868
|
-
look: "
|
|
869
|
-
d: h(
|
|
957
|
+
part: "name-point",
|
|
958
|
+
look: "fill",
|
|
959
|
+
d: h(He(5, 11.700000000000001, e, -1))
|
|
870
960
|
},
|
|
871
961
|
{
|
|
872
|
-
part: "
|
|
873
|
-
look: "
|
|
962
|
+
part: "name-band",
|
|
963
|
+
look: "line",
|
|
874
964
|
d: $([{
|
|
875
|
-
x:
|
|
876
|
-
y:
|
|
965
|
+
x: 12,
|
|
966
|
+
y: n
|
|
877
967
|
}, {
|
|
878
|
-
x:
|
|
879
|
-
y:
|
|
968
|
+
x: 12,
|
|
969
|
+
y: n + e
|
|
880
970
|
}])
|
|
881
971
|
}
|
|
882
972
|
];
|
|
883
973
|
},
|
|
884
|
-
|
|
885
|
-
let
|
|
974
|
+
split: () => {
|
|
975
|
+
let e = He(3, 8, 13, 1), [t, n, r] = e, i = (e, t) => ({
|
|
976
|
+
x: (e.x + t.x) / 2,
|
|
977
|
+
y: (e.y + t.y) / 2
|
|
978
|
+
});
|
|
886
979
|
return [{
|
|
887
|
-
part: "
|
|
980
|
+
part: "split-whole",
|
|
888
981
|
look: "line",
|
|
889
982
|
d: h(e)
|
|
890
983
|
}, {
|
|
891
|
-
part: "
|
|
984
|
+
part: "split-hole",
|
|
892
985
|
look: "line",
|
|
893
|
-
d: h(
|
|
986
|
+
d: h([
|
|
987
|
+
i(t, r),
|
|
988
|
+
i(t, n),
|
|
989
|
+
i(n, r)
|
|
990
|
+
])
|
|
894
991
|
}];
|
|
895
992
|
},
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
look: "line",
|
|
908
|
-
d: $([
|
|
909
|
-
i,
|
|
910
|
-
r,
|
|
911
|
-
n,
|
|
912
|
-
t,
|
|
913
|
-
e
|
|
914
|
-
])
|
|
915
|
-
},
|
|
916
|
-
{
|
|
917
|
-
part: "bin-rib",
|
|
918
|
-
look: "line",
|
|
919
|
-
d: `${a(6.5)} ${a(9.5)}`
|
|
920
|
-
},
|
|
921
|
-
{
|
|
922
|
-
part: "bin-lid",
|
|
923
|
-
look: "line",
|
|
924
|
-
d: h(Ue(8, 3.9, 5))
|
|
925
|
-
}
|
|
926
|
-
];
|
|
927
|
-
}
|
|
928
|
-
}, Xe = /*#__PURE__*/ u("<svg viewBox=\"0 0 16 16\"aria-hidden=true>"), Ze = /*#__PURE__*/ u("<svg><path></svg>", !1, !0, !1);
|
|
929
|
-
function Qe(e) {
|
|
993
|
+
search: () => [{
|
|
994
|
+
part: "search-lens",
|
|
995
|
+
look: "line",
|
|
996
|
+
d: h(Q(6.4, 6.4, 4.6))
|
|
997
|
+
}, {
|
|
998
|
+
part: "search-handle",
|
|
999
|
+
look: "fill",
|
|
1000
|
+
d: h(Qe(11.2, 8.07, 15.2, 2.2, !1))
|
|
1001
|
+
}]
|
|
1002
|
+
}, et = /*#__PURE__*/ u("<svg viewBox=\"0 0 16 16\"aria-hidden=true>"), tt = /*#__PURE__*/ u("<svg><path></svg>", !1, !0, !1);
|
|
1003
|
+
function nt(e) {
|
|
930
1004
|
return (() => {
|
|
931
|
-
var t =
|
|
1005
|
+
var t = et();
|
|
932
1006
|
return c(t, s(o, {
|
|
933
1007
|
get each() {
|
|
934
|
-
return
|
|
1008
|
+
return $e[e.name]();
|
|
935
1009
|
},
|
|
936
1010
|
children: (e) => (() => {
|
|
937
|
-
var t =
|
|
1011
|
+
var t = tt();
|
|
938
1012
|
return a((n) => {
|
|
939
1013
|
var r = `${e.part} ${e.look}`, i = e.part, a = e.d;
|
|
940
1014
|
return r !== n.e && w(t, "class", n.e = r), i !== n.t && w(t, "part", n.t = i), a !== n.a && w(t, "d", n.a = a), n;
|
|
@@ -949,15 +1023,18 @@ function Qe(e) {
|
|
|
949
1023
|
}
|
|
950
1024
|
//#endregion
|
|
951
1025
|
//#region src/elements/icon.css?inline
|
|
952
|
-
var
|
|
1026
|
+
var rt = ":host{width:var(--lattice-icon-size,var(--space-tree-4));height:var(--lattice-icon-size,var(--space-tree-4))}span{width:100%;height:100%;display:block}svg{width:100%;height:100%}.mark{fill:none;stroke:currentColor;stroke-width:1.3px;stroke-linejoin:miter}.mark .fill{fill:currentColor}.mark .heavy{stroke-width:1.6px}", it = /*#__PURE__*/ u("<span part=icon>"), at = /*#__PURE__*/ u("<span part=icon role=img>"), ot = "lattice-icon", st = [
|
|
953
1027
|
"shears",
|
|
954
1028
|
"done",
|
|
955
1029
|
"note",
|
|
956
1030
|
"turn",
|
|
957
1031
|
"glue",
|
|
958
1032
|
"apart",
|
|
959
|
-
"bin"
|
|
960
|
-
|
|
1033
|
+
"bin",
|
|
1034
|
+
"name",
|
|
1035
|
+
"split",
|
|
1036
|
+
"search"
|
|
1037
|
+
], ct = (e) => Object.hasOwn($e, e), lt = S(rt), ut = class e extends v {
|
|
961
1038
|
static observedAttributes = ["name", "label"];
|
|
962
1039
|
inputs = e.observedAttributes;
|
|
963
1040
|
nameSignal = _("shears");
|
|
@@ -967,7 +1044,7 @@ var $e = ":host{width:var(--lattice-icon-size,var(--space-tree-4));height:var(--
|
|
|
967
1044
|
}
|
|
968
1045
|
set name(e) {
|
|
969
1046
|
let t = String(e ?? "").toLowerCase();
|
|
970
|
-
this.nameSignal[1](
|
|
1047
|
+
this.nameSignal[1](ct(t) ? t : "shears");
|
|
971
1048
|
}
|
|
972
1049
|
get label() {
|
|
973
1050
|
return this.labelSignal[0]();
|
|
@@ -979,12 +1056,12 @@ var $e = ":host{width:var(--lattice-icon-size,var(--space-tree-4));height:var(--
|
|
|
979
1056
|
Reflect.set(this, e, n ?? "");
|
|
980
1057
|
}
|
|
981
1058
|
sheet() {
|
|
982
|
-
return
|
|
1059
|
+
return lt();
|
|
983
1060
|
}
|
|
984
1061
|
draw() {
|
|
985
1062
|
let e = () => {
|
|
986
1063
|
let e = this;
|
|
987
|
-
return s(
|
|
1064
|
+
return s(nt, { get name() {
|
|
988
1065
|
return e.name;
|
|
989
1066
|
} });
|
|
990
1067
|
}, t = this;
|
|
@@ -994,17 +1071,17 @@ var $e = ":host{width:var(--lattice-icon-size,var(--space-tree-4));height:var(--
|
|
|
994
1071
|
},
|
|
995
1072
|
get fallback() {
|
|
996
1073
|
return (() => {
|
|
997
|
-
var t =
|
|
1074
|
+
var t = it();
|
|
998
1075
|
return c(t, e), t;
|
|
999
1076
|
})();
|
|
1000
1077
|
},
|
|
1001
1078
|
children: (t) => (() => {
|
|
1002
|
-
var n =
|
|
1079
|
+
var n = at();
|
|
1003
1080
|
return c(n, e), a(() => w(n, "aria-label", t())), n;
|
|
1004
1081
|
})()
|
|
1005
1082
|
});
|
|
1006
1083
|
}
|
|
1007
|
-
},
|
|
1084
|
+
}, dt = (e) => C(ot, ut, e), ft = /*#__PURE__*/ u("<svg class=\"shape woods\"part=shape><g class=faces></g><path class=seams></path><g class=ring part=ring>"), pt = /*#__PURE__*/ u("<svg><path></svg>", !1, !0, !1), mt = /*#__PURE__*/ u("<svg><line></svg>", !1, !0, !1), ht = "lattice-shape", gt = (e) => Object.hasOwn(b, e), _t = S(`${te}\n${d}`), vt = 4, yt = !1, bt = class e extends v {
|
|
1008
1085
|
static observedAttributes = [
|
|
1009
1086
|
"shape",
|
|
1010
1087
|
"parts",
|
|
@@ -1031,7 +1108,7 @@ var $e = ":host{width:var(--lattice-icon-size,var(--space-tree-4));height:var(--
|
|
|
1031
1108
|
}
|
|
1032
1109
|
set shape(e) {
|
|
1033
1110
|
let t = String(e ?? "").toLowerCase();
|
|
1034
|
-
this.shapeSignal[1](
|
|
1111
|
+
this.shapeSignal[1](gt(t) ? t : "cell");
|
|
1035
1112
|
}
|
|
1036
1113
|
made;
|
|
1037
1114
|
get parts() {
|
|
@@ -1100,7 +1177,7 @@ var $e = ":host{width:var(--lattice-icon-size,var(--space-tree-4));height:var(--
|
|
|
1100
1177
|
e === "parts" ? this.parts = n : e === "pressable" || e === "pressed" || e === "disabled" ? Reflect.set(this, e, n) : Reflect.set(this, e, n ?? "");
|
|
1101
1178
|
}
|
|
1102
1179
|
sheet() {
|
|
1103
|
-
return
|
|
1180
|
+
return _t();
|
|
1104
1181
|
}
|
|
1105
1182
|
beAButton() {
|
|
1106
1183
|
let e = !1;
|
|
@@ -1108,7 +1185,7 @@ var $e = ":host{width:var(--lattice-icon-size,var(--space-tree-4));height:var(--
|
|
|
1108
1185
|
let t = this.pressable, n = this.disabled, r = this.pressedSignal[0](), i = (e, t) => {
|
|
1109
1186
|
t === void 0 ? this.removeAttribute(e) : this.getAttribute(e) !== t && this.setAttribute(e, t);
|
|
1110
1187
|
};
|
|
1111
|
-
i("role", t ? "button" : void 0), i("aria-label", t && this.label ? this.label : void 0), i("aria-pressed", t && r !== void 0 ? String(r) : void 0), i("aria-disabled", t && n ? "true" : void 0), t && !n && !this.hasAttribute("tabindex") ? (this.setAttribute("tabindex", "0"), e = !0) : (!t || n) && e && (this.removeAttribute("tabindex"), e = !1), t && !this.label && !
|
|
1188
|
+
i("role", t ? "button" : void 0), i("aria-label", t && this.label ? this.label : void 0), i("aria-pressed", t && r !== void 0 ? String(r) : void 0), i("aria-disabled", t && n ? "true" : void 0), t && !n && !this.hasAttribute("tabindex") ? (this.setAttribute("tabindex", "0"), e = !0) : (!t || n) && e && (this.removeAttribute("tabindex"), e = !1), t && !this.label && !yt && (yt = !0, console.warn("<lattice-shape pressable> has no label: give it one, so it can be named"));
|
|
1112
1189
|
});
|
|
1113
1190
|
}
|
|
1114
1191
|
draw() {
|
|
@@ -1136,15 +1213,15 @@ var $e = ":host{width:var(--lattice-icon-size,var(--space-tree-4));height:var(--
|
|
|
1136
1213
|
g(() => {
|
|
1137
1214
|
for (let [e, t] of p) this.removeEventListener(e, t);
|
|
1138
1215
|
});
|
|
1139
|
-
let h = () => this.pressable ? i() || this.pressed ? this.lift / 2 : e() && !this.disabled ? this.lift +
|
|
1216
|
+
let h = () => this.pressable ? i() || this.pressed ? this.lift / 2 : e() && !this.disabled ? this.lift + vt : this.lift : this.lift, v = n(() => l(this.parts, h())), y = n(() => l(this.parts, this.pressable ? this.lift + vt : this.lift).box), b = n(() => ae(ie("shape", this.parts))), x = () => !this.pressable && this.label !== "", S = this;
|
|
1140
1217
|
return (() => {
|
|
1141
|
-
var e =
|
|
1218
|
+
var e = ft(), n = e.firstChild, i = n.nextSibling, l = i.nextSibling;
|
|
1142
1219
|
return m(n, "pointerleave", () => r(!1)), m(n, "pointerenter", () => r(!0)), c(n, s(t, {
|
|
1143
1220
|
get each() {
|
|
1144
1221
|
return v().faces;
|
|
1145
1222
|
},
|
|
1146
1223
|
children: (e) => (() => {
|
|
1147
|
-
var t =
|
|
1224
|
+
var t = pt();
|
|
1148
1225
|
return a((n) => {
|
|
1149
1226
|
var r = `flat-${e().kind}`, i = e().tone, a = e().d;
|
|
1150
1227
|
return r !== n.e && w(t, "class", n.e = r), i !== n.t && w(t, "data-tone", n.t = i), a !== n.a && w(t, "d", n.a = a), n;
|
|
@@ -1159,7 +1236,7 @@ var $e = ":host{width:var(--lattice-icon-size,var(--space-tree-4));height:var(--
|
|
|
1159
1236
|
return b();
|
|
1160
1237
|
},
|
|
1161
1238
|
children: ([e, t]) => (() => {
|
|
1162
|
-
var n =
|
|
1239
|
+
var n = mt();
|
|
1163
1240
|
return a((r) => {
|
|
1164
1241
|
var i = e.x, a = e.y, o = t.x, s = t.y;
|
|
1165
1242
|
return i !== r.e && w(n, "x1", r.e = i), a !== r.t && w(n, "y1", r.t = a), o !== r.a && w(n, "x2", r.a = o), s !== r.o && w(n, "y2", r.o = s), r;
|
|
@@ -1185,11 +1262,11 @@ var $e = ":host{width:var(--lattice-icon-size,var(--space-tree-4));height:var(--
|
|
|
1185
1262
|
}), e;
|
|
1186
1263
|
})();
|
|
1187
1264
|
}
|
|
1188
|
-
},
|
|
1189
|
-
function
|
|
1265
|
+
}, xt = (e) => C(ht, bt, e), St = ":host{touch-action:none;cursor:crosshair;display:block;position:relative}:host([disabled]){cursor:auto;pointer-events:none}.trail{pointer-events:none;width:100%;height:100%;position:absolute;inset:0}.blade{fill:none;stroke:var(--color-tree-alert);stroke-width:var(--tree-rule-thick-width);stroke-linecap:round;stroke-linejoin:round}", Ct = 220;
|
|
1266
|
+
function wt() {
|
|
1190
1267
|
let [e, t] = _([]), n, r = () => {
|
|
1191
1268
|
let i = performance.now();
|
|
1192
|
-
t((e) => e.filter((e) => i - e.at <
|
|
1269
|
+
t((e) => e.filter((e) => i - e.at < Ct)), n = e().length > 0 ? requestAnimationFrame(r) : void 0;
|
|
1193
1270
|
};
|
|
1194
1271
|
return g(() => {
|
|
1195
1272
|
n !== void 0 && cancelAnimationFrame(n);
|
|
@@ -1205,7 +1282,7 @@ function bt() {
|
|
|
1205
1282
|
}
|
|
1206
1283
|
//#endregion
|
|
1207
1284
|
//#region src/elements/shears.tsx
|
|
1208
|
-
var
|
|
1285
|
+
var Tt = /*#__PURE__*/ u("<svg class=trail part=trail aria-hidden=true><polyline class=blade>"), Et = "shears-pad", Dt = S(St), Ot = class t extends v {
|
|
1209
1286
|
static observedAttributes = ["disabled"];
|
|
1210
1287
|
inputs = t.observedAttributes;
|
|
1211
1288
|
disabledSignal = _(!1);
|
|
@@ -1219,10 +1296,10 @@ var xt = /*#__PURE__*/ u("<svg class=trail part=trail aria-hidden=true><polyline
|
|
|
1219
1296
|
this.disabled = n;
|
|
1220
1297
|
}
|
|
1221
1298
|
sheet() {
|
|
1222
|
-
return
|
|
1299
|
+
return Dt();
|
|
1223
1300
|
}
|
|
1224
1301
|
draw() {
|
|
1225
|
-
let t =
|
|
1302
|
+
let t = wt(), n, i, o = (e) => {
|
|
1226
1303
|
let t = this.getBoundingClientRect();
|
|
1227
1304
|
return {
|
|
1228
1305
|
x: e.clientX - t.left,
|
|
@@ -1266,11 +1343,11 @@ var xt = /*#__PURE__*/ u("<svg class=trail part=trail aria-hidden=true><polyline
|
|
|
1266
1343
|
s(!0);
|
|
1267
1344
|
for (let [e, t] of d) this.removeEventListener(e, t);
|
|
1268
1345
|
}), (() => {
|
|
1269
|
-
var e =
|
|
1346
|
+
var e = Tt(), n = e.firstChild;
|
|
1270
1347
|
return a(() => w(n, "points", t.points())), e;
|
|
1271
1348
|
})();
|
|
1272
1349
|
}
|
|
1273
|
-
},
|
|
1350
|
+
}, kt = (e) => C(Et, Ot, e), At = ":host{background:var(--color-tree-sky);display:block;position:relative}:host([kind=earth]){background:var(--color-tree-earth)}.sky{width:100%;height:100%;position:absolute;inset:0;overflow:hidden}.line{fill:none;stroke:var(--color-tree-lattice-sky);stroke-width:var(--tree-rule-width)}:host([kind=earth]) .line{stroke:var(--color-tree-lattice-earth)}", jt = /*#__PURE__*/ u("<svg class=sky part=sky aria-hidden=true><defs><pattern patternUnits=userSpaceOnUse><path class=line></path></pattern></defs><rect width=100% height=100%>"), Mt = "hex-sky", Nt = S(At), Pt = 0, Ft = class e extends v {
|
|
1274
1351
|
static observedAttributes = [
|
|
1275
1352
|
"kind",
|
|
1276
1353
|
"orient",
|
|
@@ -1319,12 +1396,12 @@ var xt = /*#__PURE__*/ u("<svg class=trail part=trail aria-hidden=true><polyline
|
|
|
1319
1396
|
Reflect.set(this, e, n ?? "");
|
|
1320
1397
|
}
|
|
1321
1398
|
sheet() {
|
|
1322
|
-
return
|
|
1399
|
+
return Nt();
|
|
1323
1400
|
}
|
|
1324
1401
|
draw() {
|
|
1325
|
-
let e = `${
|
|
1402
|
+
let e = `${Mt}-${++Pt}`, t = this;
|
|
1326
1403
|
return (() => {
|
|
1327
|
-
var n =
|
|
1404
|
+
var n = jt(), r = n.firstChild, i = r.firstChild, o = i.firstChild, s = r.nextSibling;
|
|
1328
1405
|
return w(i, "id", e), w(s, "fill", `url(#${e})`), a((e) => {
|
|
1329
1406
|
var n = re.width, r = re.height, a = `translate(${t.x} ${t.y})${t.orient === "flat" ? " rotate(90)" : ""} scale(${t.scale})`, s = oe[t.kind];
|
|
1330
1407
|
return n !== e.e && w(i, "width", e.e = n), r !== e.t && w(i, "height", e.t = r), a !== e.a && w(i, "patternTransform", e.a = a), s !== e.o && w(o, "d", e.o = s), e;
|
|
@@ -1336,11 +1413,11 @@ var xt = /*#__PURE__*/ u("<svg class=trail part=trail aria-hidden=true><polyline
|
|
|
1336
1413
|
}), n;
|
|
1337
1414
|
})();
|
|
1338
1415
|
}
|
|
1339
|
-
},
|
|
1416
|
+
}, It = (e) => C(Mt, Ft, e);
|
|
1340
1417
|
//#endregion
|
|
1341
1418
|
//#region src/elements/index.ts
|
|
1342
|
-
function
|
|
1343
|
-
Ve(),
|
|
1419
|
+
function Lt() {
|
|
1420
|
+
Ve(), It(), xt(), kt(), dt();
|
|
1344
1421
|
}
|
|
1345
1422
|
//#endregion
|
|
1346
|
-
export { Fe as _,
|
|
1423
|
+
export { Fe as _, Et as a, bt as c, st as d, ot as f, Be as g, Pe as h, It as i, ht as l, dt as m, Ft as n, Ot as o, ut as p, Mt as r, kt as s, Lt as t, xt as u, Ve as v, K as y };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as e, r as t } from "./woods-C8W11GkD.js";
|
|
2
|
-
import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, y as b } from "./elements-
|
|
2
|
+
import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, y as b } from "./elements-Bk_vtqsk.js";
|
|
3
3
|
export { b as FACES, c as FACE_TAG, f as HexSky, a as ICON_NAMES, o as ICON_TAG, s as LatticeFace, m as LatticeIcon, i as LatticeShape, n as MOODS, t as SHAPE_NAMES, u as SHAPE_TAG, r as SHEARS_TAG, h as SKY_TAG, p as ShearsPadElement, e as TONES, l as defineHexSky, _ as defineLatticeElements, y as defineLatticeFace, d as defineLatticeIcon, v as defineLatticeShape, g as defineShearsPad };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LatticeElement } from "./host";
|
|
2
2
|
export declare const ICON_TAG = "lattice-icon";
|
|
3
|
-
export declare const ICON_NAMES: readonly ["shears", "done", "note", "turn", "glue", "apart", "bin"];
|
|
3
|
+
export declare const ICON_NAMES: readonly ["shears", "done", "note", "turn", "glue", "apart", "bin", "name", "split", "search"];
|
|
4
4
|
export type IconName = (typeof ICON_NAMES)[number];
|
|
5
5
|
export declare class LatticeIcon extends LatticeElement {
|
|
6
6
|
static readonly observedAttributes: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harmonics/lattice-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "The Harmonics tree's look as Custom Elements: a lattice face, the hexagon sky, raised lattice shapes, a shears cut gesture, two marks and a board of pieces to build on. Any page, any framework.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|