mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 02:32:18 +00:00
docs/VUE-MIGRATION.md says every select is a UiSelect, every close button a UiCloseButton and (nearly) every pressed toggle a UiButton. Make those true in code, correct the sentences that were not, and pin them. Selects: Story Explore's sort, the chat's layer picker and a layer row's range ends are UiSelects. The range ends take `hold`, since the layer panel repaints the row on a later frame. Close buttons: the space mission replay's Cancel is a bare UiCloseButton. An imported file's row actions (show or hide, fly to, remove) are icon UiButtons drawing the icon the file import names, so Remove stays one of them; the presenter's `pressed` is now a boolean. Pressed toggles: the tilt-map button, the scene action buttons, the chat and voice panels' dock (and its minimize), the Context header's search and expand, Recent Imagery's day chips, SWAP and ZOOM IN, the rail row lists and the rail cards' action chips are UiButtons with `pressed` (and `pressed-class="active"` where their active class came from the same state). Their Material glyphs, and the rail chips' icons, are UiIcons with `:size="null"`. Bhote Koshi's cinematic button keeps the attributes its layer writes, and Explore's story cards stay role="button" elements. Docs: the kit list gains UiPanelToggle and UiPanelEdge; the pressed-toggle, chips, Stories search fields, role="dialog", close button, range and source-reading-tests sentences now say what the code does. Tests: src/ui/kit/viewControls.test.mjs walks every .vue outside the kit and fails on a raw select, a hand-written aria-pressed on a button, UiButton or role="button" element (outside the two documented exceptions), or a hand-written close glyph button. closeButtons.test.mjs also catches a × inside a span. Co-authored-by: Manjunath Paparaju <[email protected]>
52 lines
2.1 KiB
Vue
52 lines
2.1 KiB
Vue
<script setup>
|
|
import { storeToRefs } from 'pinia';
|
|
import { t } from '../../../i18n/index.js';
|
|
import { useSceneInteractionsStore } from '../../stores/sceneInteractions.js';
|
|
import UiButton from '../../kit/UiButton.vue';
|
|
|
|
// The active shot's Scene actions panel, inside the viewer's container, as
|
|
// the scene interactions owner (src/scenes/interactions.js) presents it.
|
|
const { panel, controls } = storeToRefs(useSceneInteractionsStore());
|
|
|
|
const panelStyle = {
|
|
position: 'absolute',
|
|
left: '12px',
|
|
bottom: '80px',
|
|
zIndex: '31',
|
|
maxWidth: '300px',
|
|
maxHeight: '40vh',
|
|
overflowY: 'auto',
|
|
background: '#08141eed',
|
|
color: '#e3faff',
|
|
border: '1px solid #2491a8',
|
|
padding: '10px',
|
|
font: '13px sans-serif',
|
|
};
|
|
const buttonStyle = {
|
|
display: 'block',
|
|
background: '#10242e',
|
|
color: '#e3faff',
|
|
border: '1px solid #397080',
|
|
borderRadius: '3px',
|
|
padding: '6px 10px',
|
|
cursor: 'pointer',
|
|
font: 'inherit',
|
|
margin: '6px 0',
|
|
maxWidth: '100%',
|
|
whiteSpace: 'normal',
|
|
};
|
|
// Each button keeps the panel it was rendered for, so one left over from an
|
|
// earlier panel cannot run the current actions.
|
|
const onClick = (owner, id) => () => controls.value?.dispatch(id, owner);
|
|
const outline = (id) => ({
|
|
...buttonStyle,
|
|
outline: panel.value.outlined.includes(id) ? '2px solid #6eeaff' : '',
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<Teleport v-if="panel" :to="panel.container">
|
|
<section :key="panel.id" data-director-interactions="" :aria-label="t('Scene actions')" :style="panelStyle"><strong>{{ t('Scene actions') }}</strong><p role="status">{{ panel.status }}</p><UiButton v-for="item in panel.items" :key="item.id" :data-director-action="item.id" :disabled="panel.busy" :pressed="panel.selected === item.id" :style="outline(item.id)" :onClick="onClick(panel.owner, item.id)">{{ item.label }}</UiButton><div data-director-action-card=""><template v-if="panel.card"><p>{{ panel.card.text }}</p><a v-if="panel.card.url" :href="panel.card.url" target="_blank" rel="noopener noreferrer" style="color: #6eeaff">{{ t('Source') }}</a></template></div></section>
|
|
</Teleport>
|
|
</template>
|