@justai/cuts 0.30.0 → 0.30.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/package.json +3 -3
- package/src/Posts.astro +22 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justai/cuts",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.2",
|
|
4
4
|
"description": "A persona's named parts — the page shell that holds them, and the cuts themselves.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"./ground.css": "./src/ground.css"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@justai/ui": ">=0.3.0",
|
|
28
27
|
"astro": ">=5"
|
|
29
28
|
},
|
|
30
29
|
"publishConfig": {
|
|
31
30
|
"access": "public"
|
|
32
31
|
},
|
|
33
32
|
"dependencies": {
|
|
34
|
-
"@justai/core": "^0.5.0"
|
|
33
|
+
"@justai/core": "^0.5.0",
|
|
34
|
+
"@justai/ui": "^0.3.0"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/src/Posts.astro
CHANGED
|
@@ -73,7 +73,25 @@ const vars = [
|
|
|
73
73
|
.trow.last .cc { padding-block-end: 0; }
|
|
74
74
|
|
|
75
75
|
.pa { flex: none; width: 42px; height: 42px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 22px; background: var(--feed-av-bg, #fff); border: 1px solid var(--border); overflow: hidden; }
|
|
76
|
-
|
|
76
|
+
/* A human's avatar takes the house FILL recipe (app-zone/.justai/expert/how-an-app-zone-icon-is-lit.md):
|
|
77
|
+
an off-centre radial at 37% 31% with stops at L+22 / L+4 / L−11, so light falls from the upper left.
|
|
78
|
+
The recipe's specular is omitted on purpose — the doc defines it as "what makes it a sphere rather than
|
|
79
|
+
a lighter disc", which is right for howlong's beads and wrong for an avatar, where it read as a ball.
|
|
80
|
+
Stops are derived in CSS because the colour arrives from the API at runtime; hue and saturation pass
|
|
81
|
+
through untouched and lightness does all the shading. NO % on those numbers: inside relative colour
|
|
82
|
+
syntax `l` is a <number>, so `calc(l + 22%)` mixes types, the declaration is dropped, and the disc
|
|
83
|
+
renders flat while looking finished. `background-color` is separate so an unsupporting browser loses
|
|
84
|
+
the light rather than the disc. `max(0, 39 - l)` is the L28 floor as a lift on all three stops. */
|
|
85
|
+
.uav {
|
|
86
|
+
flex: none; width: 30px; height: 30px; border-radius: 50%;
|
|
87
|
+
display: grid; place-items: center; font-size: 13px; font-weight: 600; color: #fff;
|
|
88
|
+
background-color: var(--c, #888);
|
|
89
|
+
background-image:
|
|
90
|
+
radial-gradient(ellipse 80% 80% at 37% 31%,
|
|
91
|
+
hsl(from var(--c, #888) h s calc(l + 22 + max(0, 39 - l))) 0%,
|
|
92
|
+
hsl(from var(--c, #888) h s calc(l + 4 + max(0, 39 - l))) 40%,
|
|
93
|
+
hsl(from var(--c, #888) h s calc(l - 11 + max(0, 39 - l))) 100%);
|
|
94
|
+
}
|
|
77
95
|
.rav { flex: none; width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 15px; background: var(--feed-av-bg, #fff); border: 1px solid var(--border); overflow: hidden; }
|
|
78
96
|
.pa :global(svg), .rav :global(svg) { display: block; }
|
|
79
97
|
.pa .mk, .rav .mk { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
@@ -187,11 +205,11 @@ const vars = [
|
|
|
187
205
|
: `<span style="font-size:16px">${esc(c.authorGlyph || "✦")}</span>`;
|
|
188
206
|
const nm = own ? NAME : esc(c.authorName); // own name is authored markup; an API name is escaped
|
|
189
207
|
const purl = own ? "#profile" : `${c.personaUrl || homeOf(c.authorHandle)}/#profile`;
|
|
190
|
-
const meta =
|
|
208
|
+
const meta = `· ${timeAgo(c.createdAt)}`; // a persona's name IS its handle — no @ in this feed
|
|
191
209
|
return `<div class="trow${last ? " last" : ""}"><div class="avc"><span class="rav">${av}</span>${ln}</div><div class="cc"><div class="ch"><a class="pn" href="${esc(purl)}"><b>${nm}</b></a>${ck}<span class="muted">${meta}</span></div><p class="cb">${esc(c.body)}</p></div></div>`;
|
|
192
210
|
}
|
|
193
211
|
const initial = esc(String(c.authorName || "?").slice(0, 1));
|
|
194
|
-
return `<div class="trow${last ? " last" : ""}"><div class="avc"><span class="uav" style="--c:${esc(c.authorColor || "#888")}">${initial}</span>${ln}</div><div class="cc"><div class="ch"><b>${esc(c.authorName)}</b><span class="muted"
|
|
212
|
+
return `<div class="trow${last ? " last" : ""}"><div class="avc"><span class="uav" style="--c:${esc(c.authorColor || "#888")}">${initial}</span>${ln}</div><div class="cc"><div class="ch"><b>${esc(c.authorName)}</b><span class="muted">· ${timeAgo(c.createdAt)}</span></div><p class="cb">${esc(c.body)}</p></div></div>`;
|
|
195
213
|
};
|
|
196
214
|
const post = (p: P): string => {
|
|
197
215
|
const cs = p.comments || [];
|
|
@@ -201,7 +219,7 @@ const vars = [
|
|
|
201
219
|
const n = String(p.id || "").split(":").pop() || "";
|
|
202
220
|
const perma = n ? `/feed/${n}` : "";
|
|
203
221
|
const pt = perma ? `<a class="pt" href="${perma}">${timeAgo(p.createdAt)}</a>` : `<span class="pt">${timeAgo(p.createdAt)}</span>`;
|
|
204
|
-
return `<article class="post"${perma ? ` data-href="${perma}"` : ""}><div class="trow"><div class="avc"><span class="pa">${AV}</span>${cs.length ? '<span class="ln"></span>' : ""}</div><div class="cc"><div class="ph"><a class="pn" href="#profile"><b>${NAME}</b></a><span class="
|
|
222
|
+
return `<article class="post"${perma ? ` data-href="${perma}"` : ""}><div class="trow"><div class="avc"><span class="pa">${AV}</span>${cs.length ? '<span class="ln"></span>' : ""}</div><div class="cc"><div class="ph"><a class="pn" href="#profile"><b>${NAME}</b></a><span class="dot">·</span>${pt}</div><p class="pbd">${esc(p.body)}</p>${pact}</div></div>${inner}</article>`;
|
|
205
223
|
};
|
|
206
224
|
|
|
207
225
|
let done = false;
|