mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
feat(bhote-koshi): render the reconstruction panel from a store
The Bhote Koshi layer keeps its panel controls as plain records and presents them to a store; the context rail renders the panel as its last child and marks itself while it is on. Controls are bound to the enable that published them, and an unchanged frame is not sent again.
This commit is contained in:
1 parent
9ea6d7e8aa
commit
fd0d51c450
10 files changed
+580
-234
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { markRaw, shallowRef } from 'vue';
|
||||
|
||||
/**
|
||||
* The Bhote Koshi event's reconstruction panel as its view renders it. The
|
||||
* event layer (src/data/bhoteKoshiEvent.js) presents each control's state
|
||||
* and the field reports; the view sends clicks and slider moves back to the
|
||||
* connected controls.
|
||||
*/
|
||||
export const useBhoteKoshiPanelStore = defineStore(
|
||||
'gev-bhote-koshi-panel',
|
||||
() => {
|
||||
/**
|
||||
* `{owner, sceneBeat, refs, beforeDate, afterDate, reports}`, or null while
|
||||
* the event layer is off. Each entry of `refs` holds one control's
|
||||
* `textContent`, `hidden`, `disabled`, `value` and `attributes`.
|
||||
*/
|
||||
const panel = shallowRef(null);
|
||||
|
||||
/** @param {?object} next A fresh presentation; every publish re-renders. */
|
||||
function publish(next) {
|
||||
panel.value = next && markRaw(next);
|
||||
}
|
||||
|
||||
/** The controls the panel's buttons, sliders and reports call. */
|
||||
const controls = shallowRef(null);
|
||||
|
||||
/** @param {?object} next The controls, or null to disconnect. */
|
||||
function connect(next) {
|
||||
controls.value = next && markRaw(next);
|
||||
}
|
||||
|
||||
return { panel, publish, controls, connect };
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user