@popcorn245/cornfield-components 0.52.0 → 0.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{around-D7aqHejs.js → around-BFqYTZ0K.js} +10 -10
- package/dist/chunks/{corn-layers-g9AprK6G.js → corn-layers-Cni5rISZ.js} +95 -95
- package/dist/chunks/{corn-map-DE-pg-A0.js → corn-map-B2-YxiEL.js} +3 -3
- package/dist/chunks/{corn-node-panel-CdtFb9IZ.js → corn-node-panel-BkvJThlp.js} +3 -3
- package/dist/chunks/{corn-review-9krtLSPK.js → corn-review-5wf7AT4o.js} +889 -889
- package/dist/chunks/{corn-search-BY1Po63S.js → corn-search-CXs5d06S.js} +39 -39
- package/dist/chunks/{engine-HIgX35hE.js → engine-BmXtSISH.js} +415 -400
- package/dist/chunks/{layers-n1mJVJs8.js → layers-Bj4Tluxe.js} +50 -50
- package/dist/chunks/{map-CeP9M2_w.js → map-BZRFOYkt.js} +749 -718
- package/dist/chunks/{node-panel-CY5xnuKC.js → node-panel-BdvFvWCE.js} +332 -332
- package/dist/chunks/{review-source-DWisOXyR.js → review-source-CK5tYIqk.js} +1 -1
- package/dist/chunks/{scope-CUhp8mkf.js → scope-CqPbHcKL.js} +19 -19
- package/dist/chunks/sheets-D-sMZzSs.js +204 -0
- package/dist/chunks/{status-CsFpnQxw.js → status-DI5QLlAp.js} +55 -55
- package/dist/corn-layers.js +1 -1
- package/dist/corn-map.js +1 -1
- package/dist/corn-node-panel.js +1 -1
- package/dist/corn-review.js +1 -1
- package/dist/corn-scope.js +3 -3
- package/dist/corn-search.js +1 -1
- package/dist/index.js +6 -6
- package/dist/manifest.json +43 -43
- package/dist/version.json +1 -1
- package/package.json +1 -1
- package/dist/chunks/sheets-TFCL_dIn.js +0 -204
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
2
|
import { n as t, r as n, t as r } from "./runtime-DFu6W5g-.js";
|
|
3
|
-
import { n as i, t as a } from "./around-
|
|
4
|
-
import {
|
|
5
|
-
import { _ as ee } from "./layers-
|
|
6
|
-
import "./sheets-
|
|
7
|
-
var S = (e, t) => `${
|
|
3
|
+
import { n as i, t as a } from "./around-BFqYTZ0K.js";
|
|
4
|
+
import { Dn as o, En as s, F as c, Kt as l, O as u, P as d, Ut as f, cn as p, ct as m, dn as h, hn as g, jn as _, ot as v, qt as y, rn as b, t as x } from "./engine-BmXtSISH.js";
|
|
5
|
+
import { _ as ee } from "./layers-Bj4Tluxe.js";
|
|
6
|
+
import "./sheets-D-sMZzSs.js";
|
|
7
|
+
var S = (e, t) => `${_(e, "searchNoMatch")} “${t}”`, C = (e) => e.slot("search-status", () => {
|
|
8
8
|
let t = { pending: null };
|
|
9
9
|
return e.own(() => clearTimeout(t.pending)), t;
|
|
10
10
|
});
|
|
@@ -39,29 +39,29 @@ function O(e, t, n = {}) {
|
|
|
39
39
|
if (!r) return o;
|
|
40
40
|
let s = [];
|
|
41
41
|
for (let t of e) {
|
|
42
|
-
let e =
|
|
42
|
+
let e = c(t, r);
|
|
43
43
|
e < 0 || s.push({
|
|
44
44
|
node: t,
|
|
45
45
|
rank: e,
|
|
46
46
|
on: !!i(t),
|
|
47
|
-
group:
|
|
47
|
+
group: d(t),
|
|
48
48
|
parent: a(t)
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
s.sort((e, t) => e.rank - t.rank || String(e.node.label).localeCompare(String(t.node.label)) || String(e.node.id).localeCompare(String(t.node.id)));
|
|
52
|
-
let
|
|
52
|
+
let l = /* @__PURE__ */ new Map();
|
|
53
53
|
for (let e of s) {
|
|
54
54
|
let t = e.on ? `on|${e.group}` : "off";
|
|
55
|
-
|
|
55
|
+
l.has(t) || l.set(t, {
|
|
56
56
|
name: e.on ? e.group : D,
|
|
57
57
|
off: !e.on,
|
|
58
58
|
rows: []
|
|
59
|
-
}),
|
|
59
|
+
}), l.get(t).rows.push(e);
|
|
60
60
|
}
|
|
61
|
-
let
|
|
62
|
-
o.matches =
|
|
61
|
+
let u = [...l.values()].sort((e, t) => Number(e.off) - Number(t.off) || e.rows[0].rank - t.rows[0].rank || e.name.localeCompare(t.name));
|
|
62
|
+
o.matches = u.flatMap((e) => e.rows), o.total = o.matches.length, o.onMap = s.filter((e) => e.on).length, o.off = o.total - o.onMap;
|
|
63
63
|
let f = 50;
|
|
64
|
-
for (let e of
|
|
64
|
+
for (let e of u) {
|
|
65
65
|
if (f <= 0) break;
|
|
66
66
|
o.groups.push({
|
|
67
67
|
name: e.name,
|
|
@@ -115,18 +115,18 @@ var j = (e) => `No node matches “${e}”. Search reads names, files, types and
|
|
|
115
115
|
bar: e ? "<div id=\"mobile-search-bar\" class=\"hx-mobile-search glass-header\" role=\"search\" hidden data-corn=\"mobile-search\">\n <input type=\"text\" id=\"mobile-node-search\" class=\"hx-input hx-input--wide\" placeholder=\"Search nodes, apps, components...\" aria-label=\"Search nodes\" data-corn=\"search-input\" />\n <button type=\"button\" class=\"hx-textbtn\" data-action=\"close-mobile-search\" data-corn-kind=\"quiet\">Cancel</button>\n <span id=\"mobile-search-steps\" class=\"hx-search-steps\" data-corn=\"search-steps\" hidden>\n <span id=\"mobile-search-count\" class=\"hx-search-count\" data-corn=\"search-count\" aria-hidden=\"true\"></span>\n <button type=\"button\" class=\"hx-search-btn\" data-action=\"search-prev\" aria-label=\"Previous match\" title=\"Previous match (Shift+Enter)\" data-corn-kind=\"icon\"><svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M3.5 10.5L8 6l4.5 4.5\" /></svg></button>\n <button type=\"button\" class=\"hx-search-btn\" data-action=\"search-next\" aria-label=\"Next match\" title=\"Next match (Enter)\" data-corn-kind=\"icon\"><svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M3.5 5.5L8 10l4.5-4.5\" /></svg></button>\n <button type=\"button\" class=\"hx-search-btn\" data-action=\"clear-search\" aria-label=\"Clear search\" title=\"Clear search (Escape)\" data-corn-kind=\"icon\"><svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M4 4l8 8M12 4l-8 8\" /></svg></button>\n </span>\n <div id=\"mobile-search-status\" class=\"hx-search-status\" role=\"status\" aria-live=\"polite\" data-corn=\"search-status\"></div>\n <div id=\"mobile-search-results\" class=\"hx-search-results\" data-corn=\"search-results\" hidden></div>\n</div>" : ""
|
|
116
116
|
});
|
|
117
117
|
function L(e, t, n, r = !1) {
|
|
118
|
-
let i = n ? ` · ${
|
|
119
|
-
return `<button type="button" role="option" class="hx-search-row" data-corn="search-result" data-search-id="${
|
|
118
|
+
let i = n ? ` · ${l(t.group)}` : "", a = t.parent ? l(t.parent) : "", o = e.searchCurrent === t.node.id;
|
|
119
|
+
return `<button type="button" role="option" class="hx-search-row" data-corn="search-result" data-search-id="${l(t.node.id)}" tabindex="${r ? 0 : -1}" aria-selected="${o}"${o ? " aria-current=\"true\"" : ""}><span class="hx-search-row-label">${l(t.node.label)}</span><span class="hx-search-row-parent">${a}${i}</span></button>`;
|
|
120
120
|
}
|
|
121
121
|
function R(e, t, n = "search-listbox") {
|
|
122
122
|
if (!t.query) return "";
|
|
123
|
-
if (!t.total) return `<p class="hx-search-empty" data-corn="search-empty">${
|
|
124
|
-
let r = t.groups.flatMap((e) => e.rows), i = r.some((t) => t.node.id === e.searchCurrent) ? e.searchCurrent : t.onMap ? F : r[0].node.id, a = t.onMap ? `<button type="button" role="option" aria-selected="false" class="hx-search-row hx-search-frame" data-corn="search-result" data-search-frame tabindex="${i === F ? 0 : -1}">Frame all ${t.onMap}</button>` : "", o = t.groups.map((t) => `<div class="hx-search-group" role="group" aria-label="${
|
|
125
|
-
return `<div role="listbox" id="${
|
|
123
|
+
if (!t.total) return `<p class="hx-search-empty" data-corn="search-empty">${l(j(t.query))}</p>`;
|
|
124
|
+
let r = t.groups.flatMap((e) => e.rows), i = r.some((t) => t.node.id === e.searchCurrent) ? e.searchCurrent : t.onMap ? F : r[0].node.id, a = t.onMap ? `<button type="button" role="option" aria-selected="false" class="hx-search-row hx-search-frame" data-corn="search-result" data-search-frame tabindex="${i === F ? 0 : -1}">Frame all ${t.onMap}</button>` : "", o = t.groups.map((t) => `<div class="hx-search-group" role="group" aria-label="${l(t.name)}, ${t.count}" data-corn="search-group"><div class="hx-search-group-title" aria-hidden="true">${l(t.name)} <span class="hx-search-group-count">${t.count}</span></div>${t.rows.map((n) => L(e, n, t.off, n.node.id === i)).join("")}</div>`).join(""), s = t.more ? `<p class="hx-search-more">${l(M(t.more))}</p>` : "";
|
|
125
|
+
return `<div role="listbox" id="${l(n)}" aria-label="Search results">${a}${o}</div>${s}`;
|
|
126
126
|
}
|
|
127
127
|
var z = (e) => [...e.querySelectorAll("[data-corn=\"search-result\"]")], B = (e) => !!e && (e.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));
|
|
128
128
|
function V(e, t, n = {}) {
|
|
129
|
-
let { state: r } = t, a =
|
|
129
|
+
let { state: r } = t, a = o(t), c = [...s(t, e, I({ phone: n.phone !== !1 }).field, n.slots, "field"), ...s(t, e, I({ phone: n.phone !== !1 }).bar, n.slots, "bar")], l = (e) => {
|
|
130
130
|
for (let t of c) {
|
|
131
131
|
if (t.id === e) return t;
|
|
132
132
|
let n = t.querySelector(`[id="${e}"]`);
|
|
@@ -135,8 +135,8 @@ function V(e, t, n = {}) {
|
|
|
135
135
|
return null;
|
|
136
136
|
};
|
|
137
137
|
a.keepParts(...c);
|
|
138
|
-
let d = P.filter((e) => l(e.input)), f = null,
|
|
139
|
-
function
|
|
138
|
+
let d = P.filter((e) => l(e.input)), f = null, _ = 0;
|
|
139
|
+
function x() {
|
|
140
140
|
let e = new Map(r.nodes.map((e) => [e.id, e])), t = /* @__PURE__ */ new Map();
|
|
141
141
|
for (let e of r.edges) e.kind || e.dashed || t.has(e.to) || t.set(e.to, e.from);
|
|
142
142
|
return (n) => {
|
|
@@ -149,7 +149,7 @@ function V(e, t, n = {}) {
|
|
|
149
149
|
if (f && f.key === e && f.nodes === r.nodes) return f.result;
|
|
150
150
|
let n = O(r.nodes, r.searchQuery, {
|
|
151
151
|
visible: (e) => t.map.isNodeVisible(e),
|
|
152
|
-
parentLabel:
|
|
152
|
+
parentLabel: x()
|
|
153
153
|
});
|
|
154
154
|
return f = {
|
|
155
155
|
key: e,
|
|
@@ -208,19 +208,19 @@ function V(e, t, n = {}) {
|
|
|
208
208
|
}
|
|
209
209
|
function F(e) {
|
|
210
210
|
let n = [
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
m(r, e),
|
|
212
|
+
u(e),
|
|
213
213
|
e.type === "store" || e.type === "rom" ? "flow" : null,
|
|
214
214
|
e.type === "core" ? "pkg" : null,
|
|
215
215
|
e.type === "core" ? "core" : null
|
|
216
216
|
];
|
|
217
217
|
for (let i of n) {
|
|
218
218
|
if (t.map.isNodeVisible(e)) return;
|
|
219
|
-
i && !
|
|
219
|
+
i && !v(r, i) && ee(t, i);
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
function L(e, n) {
|
|
223
|
-
let r =
|
|
223
|
+
let r = g(t);
|
|
224
224
|
return {
|
|
225
225
|
x: r.x + r.width / 2 - e.x * n,
|
|
226
226
|
y: r.y + r.height / 2 - e.y * n,
|
|
@@ -228,16 +228,16 @@ function V(e, t, n = {}) {
|
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
230
|
async function V(e, { say: n = !0 } = {}) {
|
|
231
|
-
let i = e.node, a = ++
|
|
231
|
+
let i = e.node, a = ++_;
|
|
232
232
|
t.map.isNodeVisible(i) || F(i), r.searchCurrent = i.id, t.touchScene();
|
|
233
|
-
let o = S(),
|
|
234
|
-
if (b(t, i, { source: "search" }), a !==
|
|
235
|
-
|
|
233
|
+
let o = S(), s = o.matches.findIndex((e) => e.node.id === i.id);
|
|
234
|
+
if (b(t, i, { source: "search" }), a !== _ || r.searchCurrent !== i.id) return;
|
|
235
|
+
p(t, L(i, Math.max(r.camera.zoom, 1))), D(), t.emit("search", {
|
|
236
236
|
query: r.searchQuery,
|
|
237
237
|
current: r.searchCurrent
|
|
238
238
|
});
|
|
239
|
-
let
|
|
240
|
-
T(t, ""), n &&
|
|
239
|
+
let c = `${s + 1} of ${o.total}: ${i.label}${e.parent ? `, in ${e.parent}` : ""}`;
|
|
240
|
+
T(t, ""), n && y(t, c);
|
|
241
241
|
}
|
|
242
242
|
function H(e) {
|
|
243
243
|
let t = S();
|
|
@@ -247,7 +247,7 @@ function V(e, t, n = {}) {
|
|
|
247
247
|
}
|
|
248
248
|
function U() {
|
|
249
249
|
let e = S(), n = new Set(e.matches.filter((e) => e.on).map((e) => e.node.id));
|
|
250
|
-
n.size && (t.map.fitGraphToViewport(t.map.fitPadding(), n), T(t, ""),
|
|
250
|
+
n.size && (t.map.fitGraphToViewport(t.map.fitPadding(), n), T(t, ""), y(t, `Framed ${n.size} ${n.size === 1 ? "match" : "matches"}`));
|
|
251
251
|
}
|
|
252
252
|
function W(e, n) {
|
|
253
253
|
let i = e.currentTarget;
|
|
@@ -257,7 +257,7 @@ function V(e, t, n = {}) {
|
|
|
257
257
|
let n = i.value.trim();
|
|
258
258
|
if (n !== r.searchQuery && N(i.value), !n) return;
|
|
259
259
|
if (!S().total) {
|
|
260
|
-
|
|
260
|
+
y(t, `No node matches ${n}`);
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
263
|
H(e.shiftKey ? -1 : 1);
|
|
@@ -276,7 +276,7 @@ function V(e, t, n = {}) {
|
|
|
276
276
|
e.preventDefault(), j(n);
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
279
|
-
r.searchQuery && (e.preventDefault(), N(""),
|
|
279
|
+
r.searchQuery && (e.preventDefault(), N(""), y(t, "Search cleared"));
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
function G(e, n) {
|
|
@@ -392,7 +392,7 @@ function V(e, t, n = {}) {
|
|
|
392
392
|
}), a.on("search:active", () => C()), a.on("search:step", (e) => H(e)), a.on("layers", () => {
|
|
393
393
|
r.searchQuery && D();
|
|
394
394
|
}), a.own(() => {
|
|
395
|
-
|
|
395
|
+
_++, c.forEach((e) => e.remove());
|
|
396
396
|
}), {
|
|
397
397
|
elements: c,
|
|
398
398
|
setQuery: N,
|
|
@@ -408,7 +408,7 @@ function V(e, t, n = {}) {
|
|
|
408
408
|
e && (e.focus(), e.select());
|
|
409
409
|
},
|
|
410
410
|
reset() {
|
|
411
|
-
f = null,
|
|
411
|
+
f = null, _++, r.searchQuery = "", r.searchCurrent = null;
|
|
412
412
|
},
|
|
413
413
|
update(e) {
|
|
414
414
|
e && "query" in e ? N(e.query) : D();
|
|
@@ -446,8 +446,8 @@ var H = () => "*,:before,:after{box-sizing:border-box}*{--hx-control-h:var(--cor
|
|
|
446
446
|
this.unmountPiece(), this.loaded && this.el.isConnected && this.mountPiece();
|
|
447
447
|
}
|
|
448
448
|
mountPiece() {
|
|
449
|
-
!this.piece && this.el.shadowRoot && (this.changes = {}, this.scope =
|
|
450
|
-
tokens:
|
|
449
|
+
!this.piece && this.el.shadowRoot && (this.changes = {}, this.scope = f(this.el, () => this.remount()), this.piece = a(N, this.el.shadowRoot, this.scope.inst, {
|
|
450
|
+
tokens: x,
|
|
451
451
|
initial: this.query ? { query: this.query } : {},
|
|
452
452
|
onSearch: (e) => {
|
|
453
453
|
this.query = e.query, delete this.changes.query, this.cornSearch.emit(e);
|