[ui] DomiUi: @domi/ui v1.4.0: Water and Touch her are Button again (the handler fix from here), the credit is DomiCredit link={false}

This commit is contained in:
2026-11-23 02:31:50 +01:00
parent 7f8b6861f9
commit 87ca83cd1b
17 changed files with 213 additions and 60 deletions
+6 -9
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { Button, DOMI_ATTRIBUTION_TEXT, strike } from '@domi/ui';
import { Button, DomiCredit, strike } from '@domi/ui';
import { PRODUCT_NAME, type Gardener } from '@rosea/schema';
import { tick } from 'svelte';
import { en } from './copy/en.js';
@@ -244,11 +244,11 @@
<!--
The licence's credit (CPAL-1.0 Exhibit B, for Rosea and for @domi/ui): its exact words, at the foot of every screen
from the first open on (domi-ui.md D9). Plain text, not @domi/ui's DomiCredit link: the garden is offline, and a
tap must never carry the player out of it, least of all on Android, which has no internet at all.
from the first open on (domi-ui.md D9). link={false}: the address as plain text, because the garden is offline and
a tap must never carry the player out of it, least of all on Android, which has no internet at all.
-->
{#snippet credit()}
<p class="credit">{DOMI_ATTRIBUTION_TEXT}</p>
<DomiCredit link={false} class="credit" />
{/snippet}
{#if updateReady && onrefresh}
@@ -311,11 +311,8 @@
font-size: 0.9rem;
}
.credit {
margin: var(--space-4) 0 0;
font-size: 0.8rem;
color: var(--ink-soft);
text-align: center;
.shell :global(.credit) {
margin-top: var(--space-4);
}
.update {
+10 -16
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { Button, strike } from '@domi/ui';
import { Button } from '@domi/ui';
import {
careEvent, goodMoment, lightAt, localDay, newCare, newOpened, petalAt, petalsToday, pour, roseAt, ROSE, sentenceOpened, touch, TOUCH,
UNTOUCHED, weedsToday, type Mood, type PetalNow, type Place, type RoseNow, type Stage, type TouchState
@@ -266,14 +266,11 @@
if (e.key === 'Escape') void closeRing();
}}
>
<!-- Water and Touch her are @domi/ui's plate written as markup (INTEGRATE.md §3): Button sets its own
onkeydown and onblur after the ones passed to it, and the pour needs both (domi-ui.md D3). -->
<button
type="button"
class="domi-btn water"
class:pouring
<!-- Button runs a passed onkeydown and onblur before its own since @domi/ui 1.4.0 (the fix from here, domi-ui.md
D3): the pour needs both. -->
<Button
class={pouring ? 'water pouring' : 'water'}
aria-describedby="rose-water-hint"
use:strike
onpointerdown={(e) => {
e.preventDefault();
(e.currentTarget as HTMLElement).setPointerCapture?.(e.pointerId);
@@ -290,7 +287,7 @@
if (isPourKey(e)) stopPour();
}}
onblur={stopPour}
><span class="domi-btn__label">{en.rose.water}</span></button>
>{en.rose.water}</Button>
{#if rose.needs.wind}
<Button onclick={() => careBy('shade')}>{en.rose.shade}</Button>
{/if}
@@ -300,10 +297,7 @@
{#if rose.needs.petals}
<Button onclick={() => careBy('petals')}>{en.rose.petals}</Button>
{/if}
<button
type="button"
class="domi-btn"
use:strike
<Button
onclick={() => {
planet?.act('touch');
touchHer();
@@ -312,7 +306,7 @@
// A held key is one touch, not a rush (thorns.md T2).
if (e.repeat) e.preventDefault();
}}
><span class="domi-btn__label">{en.rose.touch.label}</span></button>
>{en.rose.touch.label}</Button>
<Button variant="quiet" onclick={() => void closeRing()}>{en.scene.close}</Button>
</div>
<p id="rose-water-hint" class="hint">{en.rose.waterHint}</p>
@@ -375,13 +369,13 @@
}
/* Water is held, not clicked: the page must not scroll or select under the finger (rose.md). */
.care .water {
.care :global(.water) {
touch-action: none;
user-select: none;
}
/* While she is being watered the plate stays pressed in (@domi/ui's own press, held). */
.care .water.pouring {
.care :global(.water.pouring) {
background: var(--domi-plate-press);
box-shadow: var(--domi-plate-shadow-press);
}