@popcorn245/cornfield-components 0.52.0 → 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-HIgX35hE.js → engine-xmHJvQY9.js} +1360 -1343
- package/dist/chunks/{layers-n1mJVJs8.js → layers-ho10a2y7.js} +68 -68
- package/dist/chunks/{map-CeP9M2_w.js → map-DbfPgQRe.js} +736 -705
- 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-DWisOXyR.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-BWANwtZP.js +209 -0
- package/dist/chunks/source-address-DXanAREm.js +57 -0
- package/dist/chunks/{status-CsFpnQxw.js → status-DM-iIEsg.js} +57 -56
- 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-D7aqHejs.js +0 -78
- package/dist/chunks/corn-layers-g9AprK6G.js +0 -275
- package/dist/chunks/corn-map-DE-pg-A0.js +0 -125
- package/dist/chunks/corn-node-panel-CdtFb9IZ.js +0 -42
- package/dist/chunks/corn-review-9krtLSPK.js +0 -2900
- package/dist/chunks/corn-search-BY1Po63S.js +0 -484
- package/dist/chunks/node-panel-CY5xnuKC.js +0 -1291
- package/dist/chunks/scope-CUhp8mkf.js +0 -137
- package/dist/chunks/sheets-TFCL_dIn.js +0 -204
- package/dist/chunks/source-address-C70zNPIj.js +0 -79
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @popcorn245/cornfield-components
|
|
2
2
|
|
|
3
|
-
[cornfield](https://github.com/popcorn245/CornField)'s interface as web components: `<corn-review>` (a proposal on the map, with Approve and Send back, in one tag), `<corn-map>`, `<corn-scope
|
|
3
|
+
[cornfield](https://github.com/popcorn245/CornField)'s interface as web components: `<corn-review>` (a proposal on the map, with Approve and Send back, in one tag), `<corn-map>`, `<corn-scope>`, the three pieces that go around the map in a scope, `<corn-node-panel>`, `<corn-layers>` and `<corn-search>`, and the review's three sections to lay out in your own grid in a scope that holds the proposal, `<corn-proposal>`, `<corn-changes>` and `<corn-decision>`, today, more to follow. Built with StencilRS, as ES modules, with type declarations and a `tokens.css`.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
6
|
npm install @popcorn245/cornfield-components
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Dn as e, En as t, Gt as n, Kt as r, Mn as i, Wt as a, Zt as o, jn as s } from "./engine-xmHJvQY9.js";
|
|
2
|
+
// ../explorer/engine/roots.js
|
|
3
|
+
var c = (e) => [e.root, ...e.extraRoots].filter(Boolean);
|
|
4
|
+
function l(e, t) {
|
|
5
|
+
if (!t || e.ended) return () => {};
|
|
6
|
+
let n = typeof t.getRootNode == "function" ? t.getRootNode() : t;
|
|
7
|
+
if (!n || c(e).some((e) => e === n || e === t)) return () => {};
|
|
8
|
+
e.extraRoots.add(n), e.emit("root:changed");
|
|
9
|
+
let r = () => {
|
|
10
|
+
e.extraRoots.delete(n) && e.emit("root:changed"), e.release(r);
|
|
11
|
+
};
|
|
12
|
+
return e.own(r), r;
|
|
13
|
+
}
|
|
14
|
+
function u(e, t, n, r) {
|
|
15
|
+
let i = /* @__PURE__ */ new WeakSet(), a = (e) => {
|
|
16
|
+
i.has(e) || (i.add(e), n(e));
|
|
17
|
+
}, o = /* @__PURE__ */ new Map(), s = () => {
|
|
18
|
+
let n = new Set(c(e));
|
|
19
|
+
for (let [e, t] of [...o]) n.has(e) || (t(), o.delete(e));
|
|
20
|
+
for (let i of n) o.has(i) || o.set(i, e.listen(i, t, a, r));
|
|
21
|
+
};
|
|
22
|
+
s();
|
|
23
|
+
let l = e.on("root:changed", s), u = () => {
|
|
24
|
+
l();
|
|
25
|
+
for (let e of o.values()) e();
|
|
26
|
+
o.clear(), e.release(u);
|
|
27
|
+
};
|
|
28
|
+
return e.own(u), u;
|
|
29
|
+
}
|
|
30
|
+
function d(e, t, { capture: n = !0 } = {}) {
|
|
31
|
+
return e.doc ? e.listen(e.doc, "click", (e) => t(e), n) : () => {};
|
|
32
|
+
}
|
|
33
|
+
// ../explorer/pieces/around.js
|
|
34
|
+
function f(e, t) {
|
|
35
|
+
let r = e.nodeType === 11 ? e.host : e, i = r && typeof r.getRootNode == "function" ? r.getRootNode() : null;
|
|
36
|
+
i && t && (n(i.nodeType === 9 ? i : i.ownerDocument, t), i.nodeType === 11 && n(i, t));
|
|
37
|
+
}
|
|
38
|
+
function p(n, c, u, d = {}) {
|
|
39
|
+
let p = !u;
|
|
40
|
+
p && (u = i({ root: c }));
|
|
41
|
+
let m = typeof d.exclusive == "string" ? d.exclusive : "", h = a(u), g = e(u);
|
|
42
|
+
f(c, d.tokens), g.own(l(u, c)), h && h.serverTheme && g.own(h.serverTheme.adopt(c));
|
|
43
|
+
let [_] = t(u, c, "<p class=\"hx-sr-only\" role=\"status\" aria-live=\"polite\"></p>", null, "announcer"), v = o(u, _);
|
|
44
|
+
g.on("announce:fallback", (e) => (v(e), !0)), g.own(() => _.remove());
|
|
45
|
+
let y = m ? u.slot("exclusive", () => /* @__PURE__ */ new Map()) : null, b = {}, x = () => !!y && y.has(m) && y.get(m) !== b, S = () => !y || !x() && (y.set(m, b), !0), C = null, w = [], T = !1, E = { ...d.initial || {} }, D = !1, O = () => {
|
|
46
|
+
for (let e of w) e.remove();
|
|
47
|
+
w = [];
|
|
48
|
+
}, k = () => !!u.map && u.state.nodes.length > 0, A = (e = !1) => {
|
|
49
|
+
if (D) return;
|
|
50
|
+
let n = x() ? s(u, "secondSection") : h ? d.noMap === "nodePanelEmpty" ? s(u, "nodePanelEmpty") : u.map && !e ? s(u, "waitingForMap") : s(u, "needsMap") : s(u, "needsScope");
|
|
51
|
+
w.length && w[0].textContent === n || (O(), w = t(u, c, `<p class="hx-needs" data-corn="empty">${r(n)}</p>`, null, "needs"));
|
|
52
|
+
}, j = () => {
|
|
53
|
+
C || D || (S() ? k() ? (O(), C = n.mount(c, u, {
|
|
54
|
+
...d.piece || {},
|
|
55
|
+
inline: !0,
|
|
56
|
+
phone: !1
|
|
57
|
+
}), Object.keys(E).length && (C.update(E), E = {})) : A() : (A(), T || (T = !0, u.emit("piece:refused", {
|
|
58
|
+
piece: m,
|
|
59
|
+
reason: "second-section",
|
|
60
|
+
message: `A scope holds one ${m}.`
|
|
61
|
+
}))));
|
|
62
|
+
}, M = () => {
|
|
63
|
+
C &&= (C.destroy(), null);
|
|
64
|
+
};
|
|
65
|
+
if (g.on("map:ready", j), g.on("exclusive:released", (e) => {
|
|
66
|
+
e && e.name === m && j();
|
|
67
|
+
}), g.on("scene", () => {
|
|
68
|
+
C || j();
|
|
69
|
+
}), g.on("map:gone", () => {
|
|
70
|
+
M(), A(!0);
|
|
71
|
+
}), d.onSearch && g.on("search", (e) => d.onSearch(e)), d.signIn && h && h.mountStatus) {
|
|
72
|
+
let [e] = t(u, c, "<div class=\"hx-signin-slot\"></div>", null, "signin"), n = h.mountStatus(e, u, { follow: !1 });
|
|
73
|
+
g.on("auth", ({ status: e, during: t }) => {
|
|
74
|
+
d.signIn.during.includes(t) && n.show({
|
|
75
|
+
state: "sign-in",
|
|
76
|
+
status: e,
|
|
77
|
+
signIn: h.signIn()
|
|
78
|
+
});
|
|
79
|
+
}), g.on(d.signIn.clear, () => n.clear()), g.own(() => {
|
|
80
|
+
n.destroy(), e.remove();
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return j(), {
|
|
84
|
+
inst: u,
|
|
85
|
+
update(e = {}) {
|
|
86
|
+
D || (C ? C.update(e) : Object.assign(E, e));
|
|
87
|
+
},
|
|
88
|
+
focusField() {
|
|
89
|
+
C && typeof C.focusField == "function" && C.focusField();
|
|
90
|
+
},
|
|
91
|
+
destroy() {
|
|
92
|
+
if (D) return;
|
|
93
|
+
D = !0, M(), O();
|
|
94
|
+
let e = y && y.get(m) === b;
|
|
95
|
+
e && y.delete(m), g.destroy(), e && !u.ended && u.emit("exclusive:released", { name: m }), p && u.destroy();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export { u as n, d as r, p as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// ../explorer/engine/connection.js
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
return e.offline() ? `You are offline. ${t} was not sent; what you typed is kept. Try again when you are back.` : `cornfield did not answer. ${t} was not sent; what you typed is kept.`;
|
|
4
|
+
}
|
|
5
|
+
function t(e) {
|
|
6
|
+
return (t, r) => e.fetch(t, n(e, t, r));
|
|
7
|
+
}
|
|
8
|
+
function n(e, t, n) {
|
|
9
|
+
return e.base && r(e, t) ? {
|
|
10
|
+
credentials: "include",
|
|
11
|
+
redirect: "error",
|
|
12
|
+
...n
|
|
13
|
+
} : n;
|
|
14
|
+
}
|
|
15
|
+
function r(e, t) {
|
|
16
|
+
if (!e.base) return !1;
|
|
17
|
+
try {
|
|
18
|
+
return new URL(e.url(String(t)), e.base).origin === new URL(e.base).origin;
|
|
19
|
+
} catch {
|
|
20
|
+
return !1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export { e as n, n as r, t };
|