@justai/cuts 0.139.0 → 0.140.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/package.json +2 -2
- package/src/Catalogue.astro +5 -1
- package/src/behaviour/catalogue.ts +16 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justai/cuts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.140.0",
|
|
4
4
|
"description": "A persona's named parts \u2014 the page shell that holds them, and the cuts themselves.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@justai/core": "^0.
|
|
44
|
+
"@justai/core": "^0.37.0",
|
|
45
45
|
"@justai/ui": "^0.26.0",
|
|
46
46
|
"@justai/atrium": "^0.1.9"
|
|
47
47
|
},
|
package/src/Catalogue.astro
CHANGED
|
@@ -116,7 +116,11 @@ const appName = (a: App): string => entries[a.id]?.name ?? a.name;
|
|
|
116
116
|
// API is unreachable at build — the design never depends on the network.
|
|
117
117
|
let catalogByHome: Record<string, string> = {};
|
|
118
118
|
try {
|
|
119
|
-
|
|
119
|
+
// Asked by HOUSEHOLD, matching the runtime append — see behaviour/catalogue.ts for why a third
|
|
120
|
+
// apex made `kind` the wrong question here. This lookup is keyed by home, so a wider answer would
|
|
121
|
+
// still have worked; it asks the same question as the runtime path so the two cannot drift into
|
|
122
|
+
// disagreeing about who lives here.
|
|
123
|
+
const res = await fetch(`https://api.justai.pro/api/catalog?locale=${lang}&apex=${encodeURIComponent(apexHost)}`);
|
|
120
124
|
if (res.ok) {
|
|
121
125
|
const data = await res.json();
|
|
122
126
|
for (const p of data.personas ?? []) if (p.home && p.bio) catalogByHome[p.home] = p.bio;
|
|
@@ -27,13 +27,18 @@
|
|
|
27
27
|
const locale = document.documentElement.lang || "en";
|
|
28
28
|
const NEW_MS = 7 * 864e5; // a persona wears NEW only for its first week (honest — from its createdAt)
|
|
29
29
|
const newLabel = grid.dataset.newLabel || "New";
|
|
30
|
-
// queries: which personas appear on this apex · runtime append kind · why is my game not listed
|
|
30
|
+
// queries: which personas appear on this apex · runtime append kind · why is my game not listed ·
|
|
31
|
+
// a CiM persona is missing from its storefront · apex query parameter · mixed-kind apex
|
|
31
32
|
//
|
|
32
33
|
// WHICH CITIZENS THIS APEX LISTS — where the hostname test used to be. A bundled script cannot
|
|
33
|
-
// reach this component's props, so the
|
|
34
|
-
// newLabel and catMap.
|
|
35
|
-
//
|
|
36
|
-
|
|
34
|
+
// reach this component's props, so the fact it needs rides the same data-attribute channel as
|
|
35
|
+
// newLabel and catMap.
|
|
36
|
+
//
|
|
37
|
+
// IT ASKS THE REGISTRY BY HOUSEHOLD, NOT BY SPECIES, and the difference only became visible with a
|
|
38
|
+
// third apex. `kind` selects a SORT of persona; on app.zone and pin.games that happens to select
|
|
39
|
+
// the residents too, because every citizen of those two is the same sort. cityinmotion.nl is the
|
|
40
|
+
// household where they part — its citizens are sometimes games and sometimes apps — and asking it
|
|
41
|
+
// for one kind returns half a family and calls that the storefront.
|
|
37
42
|
const apexHost = grid.dataset.apex || "app.zone";
|
|
38
43
|
// The category label must be localized like the SSR path (catLabel), but the API returns the
|
|
39
44
|
// category in English regardless of ?locale=. So carry this page's cat dictionary through a data
|
|
@@ -93,13 +98,16 @@
|
|
|
93
98
|
return `<a class="card" href="${esc(url)}" data-name="${esc(name.toLowerCase())}" data-category="${esc(cat)}" data-id="${esc((a.handle || "").toLowerCase())}" data-added="${esc(a.createdAt || "")}">${icon}<div class="meta"><div class="top"><h2>${esc(name)}</h2>${badge}</div><p>${esc(tagMap[a.home] ?? a.bio ?? "")}</p></div><svg class="chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"/></svg></a>`;
|
|
94
99
|
};
|
|
95
100
|
|
|
96
|
-
fetch(`https://api.justai.pro/api/catalog?locale=${encodeURIComponent(locale)}&
|
|
101
|
+
fetch(`https://api.justai.pro/api/catalog?locale=${encodeURIComponent(locale)}&apex=${encodeURIComponent(apexHost)}`)
|
|
97
102
|
.then((r) => (r.ok ? r.json() : null))
|
|
98
103
|
.then((data) => {
|
|
99
104
|
if (!data || !data.personas) return;
|
|
100
105
|
const newcomers = (data.personas as Entry[]).filter(
|
|
101
|
-
//
|
|
102
|
-
//
|
|
106
|
+
// THE RESIDENCY TEST STAYS, AND IS NOW A REDUNDANCY ON PURPOSE. Asking by apex means the
|
|
107
|
+
// registry has already excluded the other households AND the platform furniture that stands
|
|
108
|
+
// on no shelf, so this filter should never remove anything. It is kept because a browser can
|
|
109
|
+
// be holding a cached response from before the question changed, and because a storefront
|
|
110
|
+
// listing somebody else's citizen is the one failure here that looks fine.
|
|
103
111
|
//
|
|
104
112
|
// queries: auth appeared on app.zone · a persona from another apex is listed · why both
|
|
105
113
|
// kind and home · residency
|