@justai/cuts 0.129.6 → 0.130.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justai/cuts",
3
- "version": "0.129.6",
3
+ "version": "0.130.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": {
package/src/Base.astro CHANGED
@@ -54,8 +54,21 @@ interface Props {
54
54
  * rather than narrowed to a shape only this package would recognise.
55
55
  */
56
56
  t: Record<string, unknown>;
57
- /** The persona's own origin, e.g. https://tabata.app.zone — canonical, hreflang and OG all read it. */
58
- site: string;
57
+ /**
58
+ * DEPRECATED — declare the origin in astro.config.mjs (`site:`) and stop passing this.
59
+ *
60
+ * The origin now comes from `Astro.site`, which every persona already has to declare for the
61
+ * build. Passing it here as well is the second declaration site this docstring warns about
62
+ * twenty lines above, and it went wrong exactly the way the locale list did: compress-image was
63
+ * copied from cleanmylink and shipped with cleanmylink's origin in this prop while its
64
+ * astro.config was correct. For a day, canonical, og:site_name and all fourteen hreflang hrefs
65
+ * named another product — while og:url and og:image, three lines apart in the same head, read
66
+ * `Astro.site` and were right. One head, two truths, and nothing said so.
67
+ *
68
+ * Still accepted so no persona has to change on the same day this ships; it is now checked
69
+ * rather than trusted, and a build where the two disagree fails.
70
+ */
71
+ site?: string;
59
72
  /** From the consuming repo's src/i18n — never from this package. */
60
73
  locales: readonly string[];
61
74
  defaultLocale: string;
@@ -87,13 +100,37 @@ interface Props {
87
100
  }
88
101
 
89
102
  const {
90
- lang, t, site, locales, defaultLocale, favicon,
103
+ lang, t, site: siteProp, locales, defaultLocale, favicon,
91
104
  themeDark,
92
105
  themeLight,
93
106
  gaId = "G-13L3BP6XCW",
94
107
  kind = "app",
95
108
  } = Astro.props;
96
109
 
110
+ // ── ONE HOME FOR THE ORIGIN ───────────────────────────────────────────────────────────────────
111
+ // queries: canonical yanlış · başka personanın alan adı · site prop · hreflang yanlış domain
112
+ //
113
+ // A wrong origin renders perfectly. That is the whole difficulty: nothing is red, the page is
114
+ // valid, and the only symptom is search engines being told this page belongs to someone else.
115
+ // The failure has to be moved to a place where it CANNOT be quiet, and a static build is the one
116
+ // place available — so a disagreement is an error, not a warning. A warning in a build log is the
117
+ // same silence with more steps.
118
+ const site = Astro.site?.origin ?? siteProp;
119
+ if (!site) {
120
+ throw new Error(
121
+ "[@justai/cuts] No origin. Declare it once, in astro.config.mjs:\n" +
122
+ ' export default personaConfig({ site: "https://<persona>.app.zone", ... })',
123
+ );
124
+ }
125
+ if (siteProp && Astro.site && new URL(siteProp).origin !== Astro.site.origin) {
126
+ throw new Error(
127
+ "[@justai/cuts] Two origins, and they disagree:\n" +
128
+ ` astro.config.mjs ${Astro.site.origin}\n` +
129
+ ` <Base site=…> ${new URL(siteProp).origin}\n` +
130
+ "astro.config wins — it is what the sitemap, the build and og:url already use. Drop the prop.",
131
+ );
132
+ }
133
+
97
134
  // queries: theme-color · a grey band under the game on iPhone · Safari's bottom bar colour ·
98
135
  // the browser chrome does not match the game · game persona theme colour
99
136
  //
package/src/Preroll.astro CHANGED
@@ -369,12 +369,29 @@ const safeId = "game-" + (id.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/
369
369
  * half a second to fade - and every pause put a brief wave of darkness across the game itself.
370
370
  * Static costs nothing (the room is transparent outside playing) and cannot mistime. */
371
371
  .cut.kernel:has(#pr) { position: relative; z-index: 35; }
372
+ /* ── THE ROOM IS DARK DOT PAPER, NOT A BLACK FILM ───────────────────────────────────────────
373
+ * queries: theater dim flat colour · the dots disappear in the dark · blender dark theme ·
374
+ * dot paper grid in theater mode
375
+ *
376
+ * The founder, looking at the first dim: *"dot paper grid'de dot kendini belli etmeyince bu
377
+ * sefer duz bir renk gibi algilaniyor"* — and pointing at the fix: 3dviewer's player, whose
378
+ * stage is Blender's own Theme Space grey, read out of a running Blender. A flat translucent
379
+ * black erased the ground's identity; a dark room should still be THE SAME PAPER with the
380
+ * lights down, the way Blender's viewport keeps its grid in the dark.
381
+ *
382
+ * So the layer carries its own lattice — the door's 24px dot grid, light-on-dark — over a
383
+ * neutral Blender-family dark. The opacity is high on purpose: the dots belong to THIS layer,
384
+ * and a translucent lattice over a busy page is noise, while a nearly-opaque one is a surface.
385
+ * The chrome beneath (the toolbar steps under at z 20) stays legible as shapes in a dark room. */
372
386
  .pr-room {
373
387
  position: fixed; inset: 0; z-index: 30;
374
- background: #05070d; opacity: 0; pointer-events: none;
388
+ background:
389
+ radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 24px 24px,
390
+ #262626;
391
+ opacity: 0; pointer-events: none;
375
392
  transition: opacity 0.5s var(--ease-out, ease-out);
376
393
  }
377
- html[data-stage="playing"] .pr-room { opacity: 0.55; }
394
+ html[data-stage="playing"] .pr-room { opacity: 0.86; }
378
395
  </style>
379
396
 
380
397
  <script>