import { useLpc } from "@markwhen/view-client"
const { postRequest } = useLpc({
markwhenState(ms) {
// When there is some state change from the editor
console.log(ms)
}
appState(newState) {
// When the app state changes (dark mode, hovering event, selected event, etc)
console.log(newState)
}
}, {
// Proxy all keystrokes by default; override specific combos when you want
// to handle them inside the view instead of the parent window
keystrokeOverrides: [
{ combo: "meta+k", action: "skip" },
{ combo: "ctrl+p", action: "proxy" }
],
// Prevent default in the iframe when proxying (default: true)
preventDefaultOnProxy: true
})- Proxy keydown events to the parent window by default
- Prevent default on proxied keydown events by default (configurable via
preventDefaultOnProxy) - Allow opt-out or forced proxying for specific key combinations via
keystrokeOverrides
- Bump deps
- Bump parser
- Add close function to close sockets and/or remove event listeners
- VS code support
- Error if nothing to post to
- Separate state into appState and markwhenState instead of sending both at the same time
- Bump parser (0.9.1)
- Support for imports
- Bump parser (0.8.1)
- Add colorMap to appState
- Use initially set state even if we have a socket connection
- Add websocket support