@popcorn245/cornfield-components 0.52.1 → 0.53.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/README.md +1 -1
- package/dist/chunks/around-BcnegEdS.js +99 -0
- package/dist/chunks/connection-KDiWvV19.js +23 -0
- package/dist/chunks/{engine-BmXtSISH.js → engine-xmHJvQY9.js} +1188 -1186
- package/dist/chunks/{layers-Bj4Tluxe.js → layers-ho10a2y7.js} +48 -48
- package/dist/chunks/{map-BZRFOYkt.js → map-DbfPgQRe.js} +385 -385
- package/dist/chunks/node-panel-CC8UrSzJ.js +410 -0
- package/dist/chunks/panel-review-ih7RlfkH.js +884 -0
- package/dist/chunks/review-pieces-DtRxCDMr.js +2523 -0
- package/dist/chunks/{review-source-CK5tYIqk.js → review-source-CmbwaPCM.js} +1 -1
- package/dist/chunks/scope-2m2VmJXn.js +185 -0
- package/dist/chunks/scope-proposal-T06ndbin.js +116 -0
- package/dist/chunks/{sheets-D-sMZzSs.js → sheets-BWANwtZP.js} +7 -2
- package/dist/chunks/source-address-DXanAREm.js +57 -0
- package/dist/chunks/{status-DI5QLlAp.js → status-DM-iIEsg.js} +4 -3
- package/dist/corn-changes.js +43 -0
- package/dist/corn-decision.js +52 -0
- package/dist/corn-layers.js +275 -1
- package/dist/corn-map.js +125 -1
- package/dist/corn-node-panel.js +42 -1
- package/dist/corn-proposal.js +50 -0
- package/dist/corn-review.js +425 -1
- package/dist/corn-scope.js +33 -9
- package/dist/corn-search.js +484 -1
- package/dist/index.js +11 -8
- package/dist/manifest.json +95 -70
- package/dist/tokens.css +6 -0
- package/dist/types/components.d.ts +111 -5
- package/dist/types/corn-changes.d.ts +2 -0
- package/dist/types/corn-decision.d.ts +2 -0
- package/dist/types/corn-proposal.d.ts +2 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/version.json +1 -1
- package/package.json +17 -5
- package/dist/chunks/around-BFqYTZ0K.js +0 -78
- package/dist/chunks/corn-layers-Cni5rISZ.js +0 -275
- package/dist/chunks/corn-map-B2-YxiEL.js +0 -125
- package/dist/chunks/corn-node-panel-BkvJThlp.js +0 -42
- package/dist/chunks/corn-review-5wf7AT4o.js +0 -2900
- package/dist/chunks/corn-search-CXs5d06S.js +0 -484
- package/dist/chunks/node-panel-BdvFvWCE.js +0 -1291
- package/dist/chunks/scope-CqPbHcKL.js +0 -137
- package/dist/chunks/source-address-C70zNPIj.js +0 -79
|
@@ -1,484 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
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-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
|
-
let t = { pending: null };
|
|
9
|
-
return e.own(() => clearTimeout(t.pending)), t;
|
|
10
|
-
});
|
|
11
|
-
function w(e, t) {
|
|
12
|
-
e.emit("search:status", t);
|
|
13
|
-
}
|
|
14
|
-
function T(e, t) {
|
|
15
|
-
let n = C(e);
|
|
16
|
-
clearTimeout(n.pending), n.pending = null, w(e, t);
|
|
17
|
-
}
|
|
18
|
-
function E(e, t, n, r = "") {
|
|
19
|
-
let i = C(e);
|
|
20
|
-
clearTimeout(i.pending), i.pending = null, w(e, "");
|
|
21
|
-
let a = t ? n ? r : S(e, t) : "";
|
|
22
|
-
a && (i.pending = setTimeout(() => {
|
|
23
|
-
i.pending = null, w(e, a);
|
|
24
|
-
}, 400));
|
|
25
|
-
}
|
|
26
|
-
// ../explorer/search-model.js
|
|
27
|
-
var D = "In layers that are off";
|
|
28
|
-
function O(e, t, n = {}) {
|
|
29
|
-
let r = String(t || "").trim().toLowerCase(), i = n.visible || (() => !0), a = n.parentLabel || (() => ""), o = {
|
|
30
|
-
query: String(t || "").trim(),
|
|
31
|
-
matches: [],
|
|
32
|
-
groups: [],
|
|
33
|
-
total: 0,
|
|
34
|
-
onMap: 0,
|
|
35
|
-
off: 0,
|
|
36
|
-
rows: 0,
|
|
37
|
-
more: 0
|
|
38
|
-
};
|
|
39
|
-
if (!r) return o;
|
|
40
|
-
let s = [];
|
|
41
|
-
for (let t of e) {
|
|
42
|
-
let e = c(t, r);
|
|
43
|
-
e < 0 || s.push({
|
|
44
|
-
node: t,
|
|
45
|
-
rank: e,
|
|
46
|
-
on: !!i(t),
|
|
47
|
-
group: d(t),
|
|
48
|
-
parent: a(t)
|
|
49
|
-
});
|
|
50
|
-
}
|
|
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 l = /* @__PURE__ */ new Map();
|
|
53
|
-
for (let e of s) {
|
|
54
|
-
let t = e.on ? `on|${e.group}` : "off";
|
|
55
|
-
l.has(t) || l.set(t, {
|
|
56
|
-
name: e.on ? e.group : D,
|
|
57
|
-
off: !e.on,
|
|
58
|
-
rows: []
|
|
59
|
-
}), l.get(t).rows.push(e);
|
|
60
|
-
}
|
|
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
|
-
let f = 50;
|
|
64
|
-
for (let e of u) {
|
|
65
|
-
if (f <= 0) break;
|
|
66
|
-
o.groups.push({
|
|
67
|
-
name: e.name,
|
|
68
|
-
off: e.off,
|
|
69
|
-
count: e.rows.length,
|
|
70
|
-
rows: e.rows.slice(0, f)
|
|
71
|
-
}), f -= e.rows.length;
|
|
72
|
-
}
|
|
73
|
-
return o.rows = Math.min(50, o.total), o.more = Math.max(0, o.total - 50), o;
|
|
74
|
-
}
|
|
75
|
-
function k(e, t, n) {
|
|
76
|
-
if (!e.length) return -1;
|
|
77
|
-
let r = e.findIndex((e) => e.node.id === t);
|
|
78
|
-
return r < 0 ? n < 0 ? e.length - 1 : 0 : (r + (n < 0 ? -1 : 1) + e.length) % e.length;
|
|
79
|
-
}
|
|
80
|
-
function A(e, t) {
|
|
81
|
-
if (!e.query) return "";
|
|
82
|
-
if (!e.total) return "No match";
|
|
83
|
-
let n = e.matches.findIndex((e) => e.node.id === t);
|
|
84
|
-
return n >= 0 ? `${n + 1} of ${e.total}` : e.total === 1 ? "1 match" : `${e.total} matches`;
|
|
85
|
-
}
|
|
86
|
-
var j = (e) => `No node matches “${e}”. Search reads names, files, types and kinds.`, M = (e) => `and ${e} more: type more to narrow`, N = /* @__PURE__ */ e({
|
|
87
|
-
MATCH_ZOOM: () => 1,
|
|
88
|
-
markup: () => I,
|
|
89
|
-
mount: () => V,
|
|
90
|
-
resultsHtml: () => R
|
|
91
|
-
}), P = [{
|
|
92
|
-
input: "node-search",
|
|
93
|
-
count: "search-count",
|
|
94
|
-
results: "search-results",
|
|
95
|
-
steps: "search-steps"
|
|
96
|
-
}, {
|
|
97
|
-
input: "mobile-node-search",
|
|
98
|
-
count: "mobile-search-count",
|
|
99
|
-
results: "mobile-search-results",
|
|
100
|
-
steps: "mobile-search-steps"
|
|
101
|
-
}], F = Symbol("frame all"), I = ({ phone: e = !0 } = {}) => ({
|
|
102
|
-
field: `${e ? "<button type=\"button\" id=\"mobile-search-toggle\" class=\"hx-hdr-icon hx-only-mobile\" data-corn=\"mobile-search-button\" data-action=\"toggle-mobile-search\" aria-label=\"Open Search\" title=\"Search nodes\" data-corn-kind=\"icon\">\n <svg viewBox=\"0 0 16 16\" width=\"18\" height=\"18\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" aria-hidden=\"true\" focusable=\"false\"><circle cx=\"7\" cy=\"7\" r=\"4.5\" /><path d=\"M10.5 10.5L14 14\" /></svg>\n</button>\n\n" : ""}<div class="hx-search" role="search" data-corn="search">
|
|
103
|
-
<svg class="hx-search-icon" viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true" focusable="false"><circle cx="7" cy="7" r="4.5" /><path d="M10.5 10.5L14 14" /></svg>
|
|
104
|
-
<input type="text" id="node-search" class="hx-search-input" placeholder="Search..." data-corn-string-placeholder="searchPlaceholder" aria-label="Search nodes" aria-keyshortcuts="/" data-corn="search-input" />
|
|
105
|
-
<kbd class="hx-kbd" data-corn="search-key" aria-hidden="true">/</kbd>
|
|
106
|
-
<span id="search-steps" class="hx-search-steps" data-corn="search-steps" hidden>
|
|
107
|
-
<span id="search-count" class="hx-search-count" data-corn="search-count" aria-hidden="true"></span>
|
|
108
|
-
<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>
|
|
109
|
-
<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>
|
|
110
|
-
<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>
|
|
111
|
-
</span>
|
|
112
|
-
<div id="search-status" class="hx-search-status" role="status" aria-live="polite" data-corn="search-status"></div>
|
|
113
|
-
<div id="search-results" class="hx-search-results" data-corn="search-results" hidden></div>
|
|
114
|
-
</div>`,
|
|
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
|
-
});
|
|
117
|
-
function L(e, t, n, r = !1) {
|
|
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
|
-
}
|
|
121
|
-
function R(e, t, n = "search-listbox") {
|
|
122
|
-
if (!t.query) return "";
|
|
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
|
-
}
|
|
127
|
-
var z = (e) => [...e.querySelectorAll("[data-corn=\"search-result\"]")], B = (e) => !!e && (e.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));
|
|
128
|
-
function V(e, t, n = {}) {
|
|
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
|
-
for (let t of c) {
|
|
131
|
-
if (t.id === e) return t;
|
|
132
|
-
let n = t.querySelector(`[id="${e}"]`);
|
|
133
|
-
if (n) return n;
|
|
134
|
-
}
|
|
135
|
-
return null;
|
|
136
|
-
};
|
|
137
|
-
a.keepParts(...c);
|
|
138
|
-
let d = P.filter((e) => l(e.input)), f = null, _ = 0;
|
|
139
|
-
function x() {
|
|
140
|
-
let e = new Map(r.nodes.map((e) => [e.id, e])), t = /* @__PURE__ */ new Map();
|
|
141
|
-
for (let e of r.edges) e.kind || e.dashed || t.has(e.to) || t.set(e.to, e.from);
|
|
142
|
-
return (n) => {
|
|
143
|
-
let r = e.get(t.get(n.id));
|
|
144
|
-
return r ? String(r.label || "") : "";
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
function S() {
|
|
148
|
-
let e = `${r.searchQuery}|${r.sceneVersion}|${r.nodes.length}`;
|
|
149
|
-
if (f && f.key === e && f.nodes === r.nodes) return f.result;
|
|
150
|
-
let n = O(r.nodes, r.searchQuery, {
|
|
151
|
-
visible: (e) => t.map.isNodeVisible(e),
|
|
152
|
-
parentLabel: x()
|
|
153
|
-
});
|
|
154
|
-
return f = {
|
|
155
|
-
key: e,
|
|
156
|
-
nodes: r.nodes,
|
|
157
|
-
result: n
|
|
158
|
-
}, n;
|
|
159
|
-
}
|
|
160
|
-
let C = () => !!r.searchQuery && S().total > 0, w = (e) => l(e.results);
|
|
161
|
-
function D({ keepOpen: e = !0 } = {}) {
|
|
162
|
-
let n = S(), i = A(n, r.searchCurrent);
|
|
163
|
-
for (let a of d) {
|
|
164
|
-
let o = l(a.count);
|
|
165
|
-
o && (o.textContent = i, o.dataset.empty = n.query && !n.total ? "true" : "false");
|
|
166
|
-
let s = l(a.steps);
|
|
167
|
-
if (s) {
|
|
168
|
-
s.hidden = !n.query;
|
|
169
|
-
for (let e of s.querySelectorAll("[data-action=\"search-prev\"], [data-action=\"search-next\"]")) e.disabled = !n.total;
|
|
170
|
-
}
|
|
171
|
-
let c = w(a);
|
|
172
|
-
if (!c) continue;
|
|
173
|
-
let u = l(a.input), d = t.active(), f = !!n.query && e && (d === u || c.contains(d) || c.dataset.open === "true"), p = c.contains(d) ? d : null, m = p ? p.dataset.searchId || (p.hasAttribute("data-search-frame") ? "" : null) : null, h = `${a.results}-listbox`;
|
|
174
|
-
if (c.innerHTML = f ? R(r, n, h) : "", f) for (let e of c.querySelectorAll("[data-corn]:not([part])")) e.setAttribute("part", e.getAttribute("data-corn"));
|
|
175
|
-
if (p && f && m !== null) {
|
|
176
|
-
let e = z(c).find((e) => m === "" ? e.hasAttribute("data-search-frame") : e.dataset.searchId === m);
|
|
177
|
-
e && e.focus();
|
|
178
|
-
}
|
|
179
|
-
if (c.hidden = !f, c.dataset.open = f ? "true" : "false", u) {
|
|
180
|
-
let e = f && n.total > 0;
|
|
181
|
-
u.setAttribute("aria-expanded", String(e)), u.setAttribute("aria-controls", e ? h : a.results);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
function j(e) {
|
|
186
|
-
let t = w(e);
|
|
187
|
-
if (!t) return;
|
|
188
|
-
t.hidden = !0, t.dataset.open = "false", t.innerHTML = "";
|
|
189
|
-
let n = l(e.input);
|
|
190
|
-
n && n.setAttribute("aria-expanded", "false");
|
|
191
|
-
}
|
|
192
|
-
function M(e) {
|
|
193
|
-
E(t, e.query, e.total > 0, A(e, r.searchCurrent));
|
|
194
|
-
}
|
|
195
|
-
function N(e) {
|
|
196
|
-
let n = String(e || "").trim(), i = n !== r.searchQuery;
|
|
197
|
-
r.searchQuery = n, i && (r.searchCurrent = null), t.touchScene();
|
|
198
|
-
for (let n of d) {
|
|
199
|
-
let r = l(n.input);
|
|
200
|
-
r && r.value !== e && (r.value = e || "");
|
|
201
|
-
let i = w(n);
|
|
202
|
-
i && r && t.active() === r && (i.dataset.open = "true");
|
|
203
|
-
}
|
|
204
|
-
D(), M(S()), t.map.render(), i && t.emit("search", {
|
|
205
|
-
query: r.searchQuery,
|
|
206
|
-
current: r.searchCurrent
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
function F(e) {
|
|
210
|
-
let n = [
|
|
211
|
-
m(r, e),
|
|
212
|
-
u(e),
|
|
213
|
-
e.type === "store" || e.type === "rom" ? "flow" : null,
|
|
214
|
-
e.type === "core" ? "pkg" : null,
|
|
215
|
-
e.type === "core" ? "core" : null
|
|
216
|
-
];
|
|
217
|
-
for (let i of n) {
|
|
218
|
-
if (t.map.isNodeVisible(e)) return;
|
|
219
|
-
i && !v(r, i) && ee(t, i);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
function L(e, n) {
|
|
223
|
-
let r = g(t);
|
|
224
|
-
return {
|
|
225
|
-
x: r.x + r.width / 2 - e.x * n,
|
|
226
|
-
y: r.y + r.height / 2 - e.y * n,
|
|
227
|
-
zoom: n
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
async function V(e, { say: n = !0 } = {}) {
|
|
231
|
-
let i = e.node, a = ++_;
|
|
232
|
-
t.map.isNodeVisible(i) || F(i), r.searchCurrent = i.id, t.touchScene();
|
|
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
|
-
query: r.searchQuery,
|
|
237
|
-
current: r.searchCurrent
|
|
238
|
-
});
|
|
239
|
-
let c = `${s + 1} of ${o.total}: ${i.label}${e.parent ? `, in ${e.parent}` : ""}`;
|
|
240
|
-
T(t, ""), n && y(t, c);
|
|
241
|
-
}
|
|
242
|
-
function H(e) {
|
|
243
|
-
let t = S();
|
|
244
|
-
if (!r.searchQuery || !t.total) return !1;
|
|
245
|
-
let n = k(t.matches, r.searchCurrent, e);
|
|
246
|
-
return n < 0 ? !1 : (V(t.matches[n]), !0);
|
|
247
|
-
}
|
|
248
|
-
function U() {
|
|
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, ""), y(t, `Framed ${n.size} ${n.size === 1 ? "match" : "matches"}`));
|
|
251
|
-
}
|
|
252
|
-
function W(e, n) {
|
|
253
|
-
let i = e.currentTarget;
|
|
254
|
-
if (e.key === "Enter") {
|
|
255
|
-
if (e.isComposing) return;
|
|
256
|
-
e.preventDefault();
|
|
257
|
-
let n = i.value.trim();
|
|
258
|
-
if (n !== r.searchQuery && N(i.value), !n) return;
|
|
259
|
-
if (!S().total) {
|
|
260
|
-
y(t, `No node matches ${n}`);
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
H(e.shiftKey ? -1 : 1);
|
|
264
|
-
} else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
265
|
-
let t = w(n);
|
|
266
|
-
if (!t || t.hidden) {
|
|
267
|
-
e.key === "ArrowDown" && r.searchQuery && (e.preventDefault(), t.dataset.open = "true", D());
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
let i = z(t);
|
|
271
|
-
if (!i.length) return;
|
|
272
|
-
e.preventDefault(), (e.key === "ArrowDown" ? i[0] : i[i.length - 1]).focus();
|
|
273
|
-
} else if (e.key === "Escape") {
|
|
274
|
-
let i = w(n);
|
|
275
|
-
if (i && !i.hidden) {
|
|
276
|
-
e.preventDefault(), j(n);
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
r.searchQuery && (e.preventDefault(), N(""), y(t, "Search cleared"));
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
function G(e, n) {
|
|
283
|
-
let r = z(w(n)), i = r.indexOf(t.active());
|
|
284
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
285
|
-
e.preventDefault();
|
|
286
|
-
let t = i + (e.key === "ArrowDown" ? 1 : -1);
|
|
287
|
-
t < 0 ? l(n.input).focus() : r[Math.min(r.length - 1, t)].focus();
|
|
288
|
-
} else e.key === "Home" || e.key === "End" ? (e.preventDefault(), r[e.key === "Home" ? 0 : r.length - 1].focus()) : e.key === "Escape" && (e.preventDefault(), l(n.input).focus());
|
|
289
|
-
}
|
|
290
|
-
function K(e) {
|
|
291
|
-
let n = e.target.closest && e.target.closest("[data-corn=\"search-result\"]");
|
|
292
|
-
if (!n) return;
|
|
293
|
-
if (n.hasAttribute("data-search-frame")) {
|
|
294
|
-
U();
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
let r = S().matches.find((e) => e.node.id === n.dataset.searchId);
|
|
298
|
-
if (!r) return;
|
|
299
|
-
V(r);
|
|
300
|
-
let i = d.find((t) => w(t) === e.currentTarget);
|
|
301
|
-
if (i && i.input === "mobile-node-search" && h(t)) {
|
|
302
|
-
j(i);
|
|
303
|
-
let e = l(i.steps) && l(i.steps).querySelector("[data-action=\"search-next\"]");
|
|
304
|
-
e && e.focus();
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
function q(e, t) {
|
|
308
|
-
let n = e.relatedTarget, r = l(t.input).closest("[data-corn=\"search\"], [data-corn=\"mobile-search\"]");
|
|
309
|
-
n && r && r.contains(n) || !n && e.target && e.target.matches && e.target.matches("[data-corn=\"search-result\"]") || j(t);
|
|
310
|
-
}
|
|
311
|
-
function J(e) {
|
|
312
|
-
let t = l("mobile-search-bar"), n = l("mobile-node-search"), i = e === void 0 ? t.hidden : e;
|
|
313
|
-
t.hidden = !i, i && (n.value = r.searchQuery, a.timeout(() => n.focus(), 60));
|
|
314
|
-
}
|
|
315
|
-
for (let e of d) {
|
|
316
|
-
let t = l(e.input);
|
|
317
|
-
t.setAttribute("role", "combobox"), t.setAttribute("aria-haspopup", "listbox"), t.setAttribute("aria-autocomplete", "none"), t.setAttribute("aria-expanded", "false"), t.setAttribute("aria-controls", e.results), a.listen(t, "input", (e) => N(e.target.value)), a.listen(t, "keydown", (t) => W(t, e)), a.listen(t, "focus", () => {
|
|
318
|
-
let t = w(e);
|
|
319
|
-
t && r.searchQuery && (t.dataset.open = "true", D());
|
|
320
|
-
});
|
|
321
|
-
let n = t.closest("[data-corn=\"search\"], [data-corn=\"mobile-search\"]");
|
|
322
|
-
n && a.listen(n, "focusout", (t) => q(t, e));
|
|
323
|
-
let i = w(e);
|
|
324
|
-
i && (a.listen(i, "mousedown", (e) => {
|
|
325
|
-
e.target.closest && e.target.closest("[data-corn=\"search-result\"]") && e.preventDefault();
|
|
326
|
-
}), a.listen(i, "click", K), a.listen(i, "keydown", (t) => G(t, e)));
|
|
327
|
-
}
|
|
328
|
-
let Y = {
|
|
329
|
-
"toggle-mobile-search": () => J(),
|
|
330
|
-
"close-mobile-search": () => J(!1),
|
|
331
|
-
"clear-search": () => {
|
|
332
|
-
N("");
|
|
333
|
-
let e = l("mobile-search-bar");
|
|
334
|
-
(e && !e.hidden ? l("mobile-node-search") : l("node-search")).focus();
|
|
335
|
-
},
|
|
336
|
-
"search-prev": () => H(-1),
|
|
337
|
-
"search-next": () => H(1)
|
|
338
|
-
};
|
|
339
|
-
for (let e of c) a.listen(e, "click", (t) => {
|
|
340
|
-
let n = t.target.closest && t.target.closest("[data-action]");
|
|
341
|
-
if (!n || !e.contains(n)) return;
|
|
342
|
-
let r = Y[n.dataset.action];
|
|
343
|
-
r && r(n);
|
|
344
|
-
});
|
|
345
|
-
function X() {
|
|
346
|
-
let e = l("node-search");
|
|
347
|
-
if (e && e.closest(".hx-search") && t.win.getComputedStyle(e.closest(".hx-search")).display !== "none") {
|
|
348
|
-
e.focus(), e.select();
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
let n = l("mobile-search-bar");
|
|
352
|
-
if (n && !n.hidden) {
|
|
353
|
-
l("mobile-node-search").focus();
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
let r = l("mobile-search-toggle");
|
|
357
|
-
r && r.click();
|
|
358
|
-
}
|
|
359
|
-
let Z = typeof e.getRootNode == "function" ? e.getRootNode() : e;
|
|
360
|
-
a.own(i(t, "keydown", (e) => {
|
|
361
|
-
if (e.key === "/" && !e.ctrlKey && !e.metaKey && !e.altKey && !B(e.target) && !(Z.querySelector && Z.querySelector("[data-corn=\"dialog-scrim\"]:not([hidden]), .hx-mockup-dialog"))) {
|
|
362
|
-
e.preventDefault();
|
|
363
|
-
let n = t.active();
|
|
364
|
-
if (n && typeof n.matches == "function" && n.matches("[data-corn=\"search-input\"]") && !c.some((e) => e.contains(n))) return;
|
|
365
|
-
X();
|
|
366
|
-
}
|
|
367
|
-
}));
|
|
368
|
-
let Q = t.slot("search-voice", () => ({
|
|
369
|
-
current: null,
|
|
370
|
-
all: /* @__PURE__ */ new Set()
|
|
371
|
-
})), $ = {};
|
|
372
|
-
Q.all.add($), Q.current ||= $;
|
|
373
|
-
for (let e of d) a.listen(l(e.input), "focus", () => {
|
|
374
|
-
Q.current = $;
|
|
375
|
-
});
|
|
376
|
-
return a.own(() => {
|
|
377
|
-
Q.all.delete($), Q.current === $ && (Q.current = null);
|
|
378
|
-
}), a.on("search:status", (e) => {
|
|
379
|
-
Q.current ||= $;
|
|
380
|
-
for (let t of ["search-status", "mobile-search-status"]) {
|
|
381
|
-
let n = l(t);
|
|
382
|
-
n && (n.textContent = Q.current === $ ? e : "");
|
|
383
|
-
}
|
|
384
|
-
}), a.on("search", () => {
|
|
385
|
-
if (!(Q.all.size < 2 || c.some((e) => e.contains(t.active())))) {
|
|
386
|
-
for (let e of d) {
|
|
387
|
-
let t = l(e.input);
|
|
388
|
-
t && t.value.trim() !== r.searchQuery && (t.value = r.searchQuery);
|
|
389
|
-
}
|
|
390
|
-
D({ keepOpen: !1 });
|
|
391
|
-
}
|
|
392
|
-
}), a.on("search:active", () => C()), a.on("search:step", (e) => H(e)), a.on("layers", () => {
|
|
393
|
-
r.searchQuery && D();
|
|
394
|
-
}), a.own(() => {
|
|
395
|
-
_++, c.forEach((e) => e.remove());
|
|
396
|
-
}), {
|
|
397
|
-
elements: c,
|
|
398
|
-
setQuery: N,
|
|
399
|
-
stepMatch: H,
|
|
400
|
-
frameAll: U,
|
|
401
|
-
chooseMatch: V,
|
|
402
|
-
currentResult: S,
|
|
403
|
-
searchActive: C,
|
|
404
|
-
paintSearch: D,
|
|
405
|
-
toggleMobileSearch: J,
|
|
406
|
-
focusField() {
|
|
407
|
-
let e = l("node-search");
|
|
408
|
-
e && (e.focus(), e.select());
|
|
409
|
-
},
|
|
410
|
-
reset() {
|
|
411
|
-
f = null, _++, r.searchQuery = "", r.searchCurrent = null;
|
|
412
|
-
},
|
|
413
|
-
update(e) {
|
|
414
|
-
e && "query" in e ? N(e.query) : D();
|
|
415
|
-
},
|
|
416
|
-
destroy: () => a.destroy()
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
// \0stencil-css:/home/runner/work/CornField/CornField/explorer/css/base?tag=corn-search&encapsulation=shadow&__ext=css
|
|
420
|
-
var H = () => "*,:before,:after{box-sizing:border-box}*{--hx-control-h:var(--corn-control-height);--hx-seg-inner:calc(var(--hx-control-h) - var(--corn-space-1) - 2 * var(--corn-border))}@container corn-box (width<=767px){*{--hx-control-h:max(44px, var(--corn-control-height));--hx-seg-inner:var(--hx-control-h)}}img{image-rendering:var(--hx-pixelated,auto)}[hidden]{display:none!important}button{font:inherit;color:inherit;cursor:pointer}h1,h2,h3,p{margin:0}.glass{background:var(--corn-surface-1);-webkit-backdrop-filter:blur(var(--corn-blur));border:var(--corn-border) solid var(--corn-line);box-shadow:var(--corn-shadow)}.glass-header{background:color-mix(in srgb, var(--corn-ground) 88%, transparent);-webkit-backdrop-filter:blur(var(--corn-blur));border-bottom:var(--corn-border) solid var(--corn-line)}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:color-mix(in srgb, var(--corn-text) 18%, transparent);border-radius:var(--corn-radius-pill)}::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb, var(--corn-text) 28%, transparent)}.hx-faint{color:var(--corn-text-3)}.hx-mono{font-family:var(--corn-mono);font-size:var(--corn-text-2xs)}.hx-strong{color:var(--corn-text-2)}.hx-bold{font-weight:700}.hx-name{color:var(--corn-text-2)}.hx-accent{color:var(--corn-accent-text)}.hx-good{color:var(--corn-ok)}.hx-warn{color:var(--corn-warn)}.hx-rom{color:var(--corn-hue-fuchsia)}.hx-link{color:var(--corn-info);text-decoration:underline}.hx-link-faint{color:var(--corn-text-3);font-family:var(--corn-mono);font-size:var(--corn-text-2xs)}.hx-link-faint:hover{color:var(--corn-warn)}.hx-code{color:var(--corn-warn);font-family:var(--corn-mono);font-size:var(--corn-text-2xs)}.hx-chips{gap:var(--corn-space-1);padding-top:var(--corn-space-1);flex-wrap:wrap;display:flex}.hx-pt{padding-top:var(--corn-space-3)}.hx-switch{border-radius:var(--corn-radius-pill);border:var(--corn-border) solid var(--corn-line);background:var(--corn-surface-3);flex:none;width:28px;height:16px;position:relative}.hx-switch:after{content:\"\";background:var(--corn-text-3);border-radius:50%;width:10px;height:10px;transition:transform .15s;position:absolute;top:2px;left:2px}[aria-checked=true]>.hx-switch{background:var(--corn-accent);border-color:var(--corn-accent)}[aria-checked=true]>.hx-switch:after{background:var(--corn-text-on-accent);transform:translate(12px)}@media (prefers-reduced-motion:reduce){.hx-switch:after{transition:none}}.hx-btn{align-items:center;gap:var(--corn-space-2);padding:var(--corn-space-1) var(--corn-space-3);border-radius:var(--corn-radius-sm);border:var(--corn-border) solid var(--corn-line);background:var(--corn-surface-2);color:var(--corn-text-2);font-size:var(--corn-text-xs);white-space:nowrap;font-weight:600;transition:background .15s,color .15s,border-color .15s;display:inline-flex}.hx-btn:hover{background:var(--corn-surface-3);color:var(--corn-text)}.hx-btn:focus-visible,.hx-textbtn:focus-visible{outline:var(--corn-focus-width) solid var(--corn-focus);outline-offset:var(--corn-focus-offset)}.hx-btn--active,.hx-btn--active:hover{background:var(--corn-accent);border-color:var(--corn-accent-text);color:var(--corn-text-on-accent);box-shadow:var(--corn-shadow-sm)}.hx-btn--quiet{color:var(--corn-text-3);font-weight:500}.hx-btn--icon{width:28px;height:28px;font-size:var(--corn-text-base);justify-content:center;padding:0}.hx-btn--rom{width:100%;margin-top:var(--corn-space-1);padding:var(--corn-space-2);background:color-mix(in srgb, var(--corn-hue-fuchsia) 20%, transparent);border-color:color-mix(in srgb, var(--corn-hue-fuchsia) 40%, transparent);color:color-mix(in srgb, var(--corn-hue-fuchsia) 60%, var(--corn-text));justify-content:center;font-weight:700}.hx-btn--rom:hover{background:color-mix(in srgb, var(--corn-hue-fuchsia) 30%, transparent)}.hx-input{width:128px;padding:var(--corn-space-1) var(--corn-space-3) var(--corn-space-1) var(--corn-space-6);border-radius:var(--corn-radius-sm);border:var(--corn-border) solid var(--corn-line);background:color-mix(in srgb, var(--corn-ground) 80%, transparent);color:var(--corn-text);font:inherit;font-size:var(--corn-text-sm);user-select:text;outline:none;transition:width .2s,border-color .2s}.hx-input:focus{border-color:var(--corn-focus);width:208px}.hx-input::placeholder{color:var(--corn-text-3)}.hx-input--wide,.hx-input--wide:focus{flex:1;width:100%}.hx-menu-wrap{flex:none;position:relative}.hx-menu{margin-top:var(--corn-space-3);width:288px;max-width:calc(100cqw - 24px);max-height:calc(100cqh - 80px);padding:var(--corn-space-4);border-radius:var(--corn-radius-lg);font-size:var(--corn-text-xs);z-index:50;user-select:none;position:absolute;top:100%;left:0;overflow-y:auto}.hx-textbtn{padding:calc(var(--corn-space-1) / 2) var(--corn-space-1);border-radius:var(--corn-radius-xs);color:var(--corn-text-3);font-size:var(--corn-text-2xs);background:0 0;border:0;font-weight:600}.hx-textbtn:hover{background:var(--corn-line-soft);color:var(--corn-text-2)}.hx-textbtn--accent{color:var(--corn-accent-text)}.hx-close{width:var(--hx-control-h);height:var(--hx-control-h);border-radius:var(--corn-radius-sm);background:var(--corn-surface-2);color:var(--corn-text-3);font-weight:700;font-size:var(--corn-text-base);border:0;flex:none}.hx-close:hover{color:var(--corn-text)}.hx-mark-dot{width:12px;height:12px;margin-right:var(--corn-space-2);border:var(--corn-border-strong) solid var(--corn-changed);vertical-align:-2px;border-radius:50%;flex:none;display:inline-block}.hx-mark-dot--added{border-color:var(--corn-added);border-style:dashed}.hx-mark-dot--changed{border-color:var(--corn-changed)}.hx-mark-dot--removed{border-color:var(--corn-removed);background:color-mix(in srgb, var(--corn-removed) 25%, transparent)}.hx-mark-dot--edit{border-color:var(--corn-edit);border-style:dotted}.hx-glyph{color:color-mix(in srgb, var(--glyph) var(--corn-glyph-mix), var(--corn-text))}.hx-sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;overflow:hidden;position:absolute!important}:where(button,a[href],summary,select,textarea,[tabindex]):focus-visible{outline:var(--corn-focus-width) solid var(--corn-focus);outline-offset:var(--corn-focus-offset)}@media (prefers-reduced-motion:reduce){.hx-input,.hx-btn,.hx-menu{transition:none;animation:none}}.hx-btn[aria-disabled=true]{opacity:.6;cursor:progress}@container corn-box (width<=767px){.hx-textbtn{min-width:44px;min-height:44px}}@media (pointer:coarse){.hx-textbtn{min-width:44px;min-height:44px}}", U = () => ".hx-search{align-items:center;gap:var(--corn-space-3);width:260px;min-width:120px;height:var(--hx-control-h);padding:0 var(--corn-space-3);border-radius:var(--corn-radius-sm);border:var(--corn-border) solid var(--corn-line);background:var(--corn-surface-2);color:var(--corn-text-3);display:none}.hx-search:focus-within{border-color:var(--corn-focus);outline:var(--corn-focus-width) solid var(--corn-focus);outline-offset:var(--corn-focus-offset)}.hx-search-icon{flex:none}.hx-search-input{min-width:0;color:var(--corn-text);font:inherit;font-size:var(--corn-text-sm);user-select:text;background:0 0;border:0;outline:none;flex:1}.hx-search-input::placeholder{color:var(--corn-text-3)}.hx-kbd{padding:0 var(--corn-space-1);border-radius:var(--corn-radius-xs);border:var(--corn-border) solid var(--corn-line);font-family:var(--corn-mono);font-size:var(--corn-text-2xs);color:var(--corn-text-3);flex:none}.hx-search:focus-within .hx-kbd{display:none}.hx-hdr-icon{width:var(--hx-control-h);height:var(--hx-control-h);border-radius:var(--corn-radius-sm);color:var(--corn-text-2);background:0 0;border:0;justify-content:center;align-items:center;padding:0}.hx-hdr-icon:hover{background:var(--corn-surface-3);color:var(--corn-text)}@container corn-box (width>=768px){.hx-search{flex:0 260px;width:auto;display:flex}}.hx-mobile-search{align-items:center;gap:var(--corn-space-3);padding:var(--corn-space-3);z-index:30;display:flex;position:absolute;top:56px;left:0;right:0}.hx-mobile-search:before{content:\"\";top:50%;left:calc(var(--corn-space-3) + 8px);background:var(--corn-text-3);pointer-events:none;z-index:1;width:14px;height:14px;position:absolute;transform:translateY(-50%);-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E\") 50%/contain no-repeat;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E\") 50%/contain no-repeat}@media (forced-colors:active){.hx-mobile-search:before{background:canvastext}}.hx-search{position:relative}.hx-search-status{clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}@container corn-box (width<=767px){.hx-mobile-search .hx-input{min-height:44px}}@media (pointer:coarse){.hx-mobile-search .hx-input{min-height:44px}}.hx-search-steps{align-items:center;gap:var(--corn-space-1);flex:none;display:flex}.hx-search-steps[hidden]{display:none}.hx-search-count{padding:0 var(--corn-space-2);font-size:var(--corn-text-2xs);color:var(--corn-text-2);white-space:nowrap;font-variant-numeric:tabular-nums}.hx-search-count[data-empty=true]{color:var(--corn-text);font-weight:600}.hx-search-btn{border-radius:var(--corn-radius-xs);width:24px;height:24px;color:var(--corn-text-3);background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:inline-flex}.hx-search-btn:hover{background:var(--corn-surface-3);color:var(--corn-text)}.hx-search-btn:focus-visible,.hx-search-row:focus-visible{outline:var(--corn-focus-width) solid var(--corn-focus);outline-offset:calc(var(--corn-focus-offset) * -1)}.hx-search:has(.hx-search-steps:not([hidden])){flex-basis:340px}@container corn-box (width>=768px) and (width<=959px){.hx-search [data-action=search-prev],.hx-search [data-action=search-next]{display:none}}.hx-search-results{top:calc(100% + var(--corn-space-2));z-index:40;width:min(440px,92cqw);max-height:min(calc(60 * var(--hx-vh,1cqh)), 560px);padding:var(--corn-space-1) 0;border-radius:var(--corn-radius-sm);border:var(--corn-border) solid var(--corn-line);background:var(--corn-ground);box-shadow:var(--corn-shadow);color:var(--corn-text);font-size:var(--corn-text-sm);position:absolute;right:0;overflow-y:auto}.hx-search-results[hidden]{display:none}.hx-header:has(.hx-search-results:not([hidden])),.hx-mobile-search:has(.hx-search-results:not([hidden])){z-index:46}.hx-search-group-title{justify-content:space-between;gap:var(--corn-space-3);padding:var(--corn-space-2) var(--corn-space-3) var(--corn-space-1);background:var(--corn-ground);color:var(--corn-text-3);font-size:var(--corn-text-2xs);text-transform:uppercase;letter-spacing:.05em;font-weight:700;display:flex;position:sticky;top:0}.hx-search-row{justify-content:space-between;align-items:baseline;gap:var(--corn-space-3);width:100%;min-height:28px;padding:var(--corn-space-1) var(--corn-space-3);border:0;border-left:var(--corn-border-strong) solid transparent;color:var(--corn-text);font:inherit;text-align:left;cursor:pointer;background:0 0;display:flex}.hx-search-row:hover,.hx-search-row:focus-visible{background:var(--corn-surface-3)}.hx-search-row[aria-current=true]{border-left-color:var(--corn-accent);background:var(--corn-accent-soft)}.hx-search-row-label{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.hx-search-row-parent{text-overflow:ellipsis;white-space:nowrap;max-width:45%;color:var(--corn-text-3);font-size:var(--corn-text-xs);flex:none;overflow:hidden}.hx-search-frame{color:var(--corn-text);font-weight:600}.hx-search-empty,.hx-search-more{padding:var(--corn-space-2) var(--corn-space-3);color:var(--corn-text-2);overflow-wrap:anywhere;margin:0}.hx-mobile-search{flex-wrap:wrap}.hx-mobile-search .hx-input{flex:1 1 0;min-width:0}.hx-mobile-search:before{top:calc(var(--corn-space-3) + 22px)}.hx-mobile-search .hx-search-steps{justify-content:flex-end;gap:var(--corn-space-1);flex:1 0 100%}.hx-mobile-search .hx-search-count{font-size:var(--corn-text-xs);margin-right:auto}.hx-mobile-search .hx-search-results{width:auto;max-height:calc(50 * var(--hx-vh,1cqh));border-left:0;border-right:0;border-radius:0;top:100%;left:0;right:0}@container corn-box (width<=767px){.hx-search-btn{min-width:44px;min-height:44px}.hx-search-row{min-height:44px}}@media (pointer:coarse){.hx-search-btn{min-width:44px;min-height:44px}.hx-search-row{min-height:44px}}@media (forced-colors:active){.hx-search-row[aria-current=true]{border-left-color:highlight}}", W = () => ":host{min-width:0;color:var(--corn-text);font-family:var(--corn-font);display:block;position:relative;container:corn-box/inline-size}:host([hidden]){display:none!important}.hx-search{flex:auto;width:100%;min-width:0;display:flex}@container corn-box (width<=767px){.hx-search{height:auto;min-height:var(--hx-control-h);padding-block:var(--corn-space-1);flex-wrap:wrap}.hx-search .hx-search-input{min-height:var(--hx-control-h);flex:6rem}.hx-search .hx-search-steps{flex:1 0 100%;justify-content:flex-end}}.hx-search-results{width:max(100%,min(26rem,92cqw));left:0;right:auto}.hx-needs{color:var(--corn-text-3);font-size:var(--corn-text-sm);margin:0}", G = class extends r {
|
|
421
|
-
constructor(e) {
|
|
422
|
-
super(), e !== !1 && this.__registerHost(), this.__attachShadow(), this.cornSearch = t(this, "cornSearch", 7);
|
|
423
|
-
}
|
|
424
|
-
get el() {
|
|
425
|
-
return this;
|
|
426
|
-
}
|
|
427
|
-
query;
|
|
428
|
-
cornSearch;
|
|
429
|
-
piece = null;
|
|
430
|
-
scope = null;
|
|
431
|
-
loaded = !1;
|
|
432
|
-
changes = {};
|
|
433
|
-
connectedCallback() {
|
|
434
|
-
this.loaded && this.mountPiece();
|
|
435
|
-
}
|
|
436
|
-
componentDidLoad() {
|
|
437
|
-
this.loaded = !0, this.mountPiece();
|
|
438
|
-
}
|
|
439
|
-
disconnectedCallback() {
|
|
440
|
-
this.unmountPiece();
|
|
441
|
-
}
|
|
442
|
-
unmountPiece() {
|
|
443
|
-
this.piece && this.piece.destroy(), this.piece = null, this.scope && this.scope.leave(), this.scope = null;
|
|
444
|
-
}
|
|
445
|
-
remount() {
|
|
446
|
-
this.unmountPiece(), this.loaded && this.el.isConnected && this.mountPiece();
|
|
447
|
-
}
|
|
448
|
-
mountPiece() {
|
|
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
|
-
initial: this.query ? { query: this.query } : {},
|
|
452
|
-
onSearch: (e) => {
|
|
453
|
-
this.query = e.query, delete this.changes.query, this.cornSearch.emit(e);
|
|
454
|
-
}
|
|
455
|
-
}));
|
|
456
|
-
}
|
|
457
|
-
componentDidRender() {
|
|
458
|
-
let e = this.changes;
|
|
459
|
-
this.changes = {}, this.piece && Object.keys(e).length && this.piece.update(e);
|
|
460
|
-
}
|
|
461
|
-
changed(e, t, n) {
|
|
462
|
-
this.changes[n] = e;
|
|
463
|
-
}
|
|
464
|
-
async focusField() {
|
|
465
|
-
this.piece && this.piece.focusField();
|
|
466
|
-
}
|
|
467
|
-
static get watchers() {
|
|
468
|
-
return { query: [{ changed: 0 }] };
|
|
469
|
-
}
|
|
470
|
-
static get style() {
|
|
471
|
-
return H() + U() + W();
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
n(G, [
|
|
475
|
-
513,
|
|
476
|
-
"corn-search",
|
|
477
|
-
{
|
|
478
|
-
query: [1025],
|
|
479
|
-
focusField: [64]
|
|
480
|
-
},
|
|
481
|
-
void 0,
|
|
482
|
-
{ query: [{ changed: 0 }] }
|
|
483
|
-
]);
|
|
484
|
-
export { G as t };
|