Merge remote-tracking branch 'origin/main' into samehkhamis/kit-sweep-omnibar

This commit is contained in:
Sameh Khamis committed 2026-11-19 03:14:23 -08:00
commit 1ef0aaa5cd
17 files changed
+886 -386

No files matched your search

+82
View File
@@ -0,0 +1,82 @@
<script setup>
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
// The Omnibar's guided walk: the spotlight ring and the callout beside it,
// teleported to the end of `to` (the page's body). `startGuide()` in
// src/ui/omnibarGuide.js owns every decision and every word: it renders this
// with the `view` it computes for each step and keeps the parts the template
// never binds: the guide's `visible` class, the callout's entrance replay
// (its `swap` class), place and side, the ring's and the extra rings' boxes,
// and focus. It finds those elements in the rendered tree itself.
defineProps({
to: { type: Object, required: true },
view: { type: Object, required: true },
onClose: { type: Function, required: true },
onSkip: { type: Function, required: true },
onOffer: { type: Function, required: true },
onNext: { type: Function, required: true },
});
/** A progress segment's attributes: no class at all for one still to come. */
const dot = (name) => (name ? { class: name } : {});
</script>
<!-- Only line breaks inside tags: the markup has no whitespace between elements. -->
<template><Teleport :to="to"
><div class="gev-guide"
><div class="gev-guide-ring"><i></i></div
><div
class="gev-guide-callout"
role="dialog"
aria-modal="false"
tabindex="-1"
aria-labelledby="gev-guide-title"
aria-describedby="gev-guide-text"
><div class="gev-guide-head"
><p id="gev-guide-title" class="gev-guide-title">{{ view.title }}</p
><p class="gev-guide-count">{{ view.count }}</p
><UiCloseButton
class="gev-guide-close"
:label="view.endLabel"
:title="view.endLabel"
@click="onClose()" /></div
><ol class="gev-guide-progress" aria-hidden="true"
><li
v-for="(name, i) in view.progress"
:key="`${view.step}-${i}`"
v-bind="dot(name)"></li></ol
><div class="gev-guide-body"
><p id="gev-guide-text" class="gev-guide-text">{{ view.text }}</p
><p class="gev-guide-hint" :hidden="view.hintHidden"
><span class="gev-guide-hint-dot"></span
><span>{{ view.hint }}</span></p
></div
><div class="gev-guide-actions"
><p class="gev-guide-keys" :hidden="view.keysHidden"
><kbd>{{ view.keyCap }}</kbd><span>{{ view.keyText }}</span></p
><span
><UiButton
class="gev-guide-skip"
:hidden="view.skipHidden"
@click="onSkip()"
>{{ view.skipLabel }}</UiButton
><UiButton
class="gev-guide-offer"
:hidden="view.offerHidden"
@click="onOffer()"
>{{ view.offerLabel }}</UiButton
><UiButton
class="gev-guide-next"
:class="{ quiet: view.nextQuiet }"
:hidden="view.nextHidden"
@click="onNext()"
>{{ view.nextLabel }}</UiButton
></span
></div
><p class="gev-guide-status" role="status" aria-live="polite">{{
view.status
}}</p></div
></div
></Teleport
></template>
+110
View File
@@ -0,0 +1,110 @@
<script setup>
import { ref } from 'vue';
import { t } from '../../../i18n/index.js';
import UiButton from '../../kit/UiButton.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
// The Québec 511 camera's floating player and its map preview, teleported to
// the end of the page. `createQuebecCctvOverlay()` owns every decision: it
// renders this with the `view` it computes and keeps the imperative parts,
// which the template never binds: each video's source, playback and load, the
// panel's dragged position, and the marker's per-frame visibility and place.
// The elements those parts need are exposed.
defineProps({
view: { type: Object, required: true },
});
const emit = defineEmits([
'close',
'play',
'refresh',
'keydown',
'headerPointerdown',
'liveError',
'liveLoadeddata',
'stillError',
'stillLoadeddata',
]);
const panel = ref(null);
const header = ref(null);
const close = ref(null);
const live = ref(null);
const marker = ref(null);
const still = ref(null);
defineExpose({ panel, header, close, live, marker, still });
// Each video's load and failure go to the owner, which marks the source.
const liveListeners = {
error: () => emit('liveError'),
loadeddata: () => emit('liveLoadeddata'),
};
const stillListeners = {
error: () => emit('stillError'),
loadeddata: () => emit('stillLoadeddata'),
};
</script>
<!-- Only line breaks inside tags: the markup has no whitespace between elements. -->
<template><Teleport to="body"
><section
ref="panel"
class="qci-panel"
:hidden="view.panelHidden"
role="region"
:aria-label="t('CCTV camera')"
@keydown="emit('keydown', $event)"
><header
ref="header"
class="qci-header"
@pointerdown="emit('headerPointerdown', $event)"
><strong>{{ view.title }}</strong
><UiCloseButton
ref="close"
:label="t('Close camera preview')"
@click="emit('close')" /></header
><p class="qci-coordinates">{{ view.coordinates }}</p
><p class="qci-credit" :hidden="view.creditHidden">{{ view.credit }}</p
><video
ref="live"
class="qci-live"
controls
muted
autoplay
loop
playsinline
:hidden="view.liveHidden"
:aria-label="t('CCTV camera')"
v-on="liveListeners"></video
><div class="qci-actions" :hidden="view.actionsHidden"
><UiButton
class="qci-play"
:hidden="view.playHidden"
@click="emit('play')"
>{{ t('Play') }}</UiButton
><UiButton :hidden="view.refreshHidden" @click="emit('refresh')">{{
t('Refresh map still')
}}</UiButton></div
><p class="qci-note" :hidden="view.noteHidden">{{ view.note }}</p
><a
target="_blank"
rel="noopener noreferrer"
:href="view.sourceHref"
:hidden="view.sourceHidden"
>{{ t("Open this image on the provider's site") }}</a
></section
><div
ref="marker"
class="qci-marker"
:class="{ 'qci-marker-link-only': view.markerLinkOnly }"
hidden
><video
ref="still"
class="qci-marker-still"
muted
playsinline
preload="none"
:hidden="view.stillHidden"
aria-hidden="true"
v-on="stillListeners"></video
><span class="qci-marker-label">{{ view.markerLabel }}</span></div
></Teleport
></template>