Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix Controller, styles API #1926

Merged
merged 8 commits into from
Apr 11, 2023
Merged

Matrix Controller, styles API #1926

merged 8 commits into from
Apr 11, 2023

Conversation

WildYellowfin
Copy link
Collaborator

This PR introduces a matrix controller:

Screen.Recording.2023-04-11.at.16.54.17.mov

This panel can be resized using the --environment-panel-height setting. Aspect ratio is 2:1 so no width is necessary.
The left hand side of the controller is for moving around and manipulating arrays. I plan to make a moveCell(direction) command so that the arrows always move selection to the appropriate cell.

In building this I needed to better type the Environment, so there are now MatrixEnvironment, CasesEnvironment and TabularEnvironment types, as well as type guards. These distinctions govern what shows up in the env panel when it comes to delimiters.

This PR also introduces a "selectionStyle" at window.mathVirtualKeyboard.style. This returns the intersection of styles for all selected atoms. An example use case (mine :) is displaying a rich text editor toolbar with styles information about the selection.

@arnog arnog merged commit 337d781 into arnog:master Apr 11, 2023
@arnog
Copy link
Owner

arnog commented Apr 11, 2023

I'm attempting a merge. I assume that

in get selectionStyle(): Style

for (const [key, value] of Object.entries(style)
should be
for (const [key, value] of Object.entries(a.style)

@arnog
Copy link
Owner

arnog commented Apr 11, 2023

The merge seems to work...

FYI, now typing ( alt/option+Tab creates a pmatrix.

@WildYellowfin
Copy link
Collaborator Author

Closes #600

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants