This commit is contained in:
IRBorisov 2023-08-25 00:33:16 +03:00
parent 5a67d982e5
commit 5d45094640
4 changed files with 42 additions and 6 deletions

View File

@ -16,7 +16,7 @@ function Footer() {
<p className='mt-0.5 text-center'>© 2023 ЦИВТ КОНЦЕПТ</p>
</div>
<div className='flex flex-col underline'>
<a href={urls.exteor64} tabIndex={-1}>Экстеор</a>
<Link to='/manuals?topic=exteor' tabIndex={-1}>Экстеор</Link>
</div>
</div>

View File

@ -139,7 +139,7 @@ function RSInput({
}, [thisRef]);
return (
<div className={`w-full ${cursor} text-lg`}>
<div className={`w-full ${cursor}`}>
{label &&
<Label
text={label}

View File

@ -70,9 +70,45 @@ export class TextWrapper {
insertToken(tokenID: TokenID): boolean {
const hasSelection = this.ref.view.state.selection.main.from !== this.ref.view.state.selection.main.to
switch (tokenID) {
case TokenID.NT_DECLARATIVE_EXPR: this.envelopeWith('D{ξ∈X1 | P1[ξ]', '}'); return true;
case TokenID.NT_IMPERATIVE_EXPR: this.envelopeWith('I{(σ, γ) | σ:∈X1; γ:=F1[σ]; P1[σ, γ]', '}'); return true;
case TokenID.NT_RECURSIVE_FULL: this.envelopeWith('R{ ξ:=D1 | F1[ξ]≠∅ | ξF1[ξ]', '}'); return true;
case TokenID.NT_DECLARATIVE_EXPR: {
if (hasSelection) {
this.envelopeWith('D{ξ∈X1 | ', '}');
} else {
this.envelopeWith('D{ξ∈X1 | P1[ξ]', '}');
}
this.ref.view.dispatch({
selection: {
anchor: this.ref.view.state.selection.main.from + 2,
}
});
return true;
}
case TokenID.NT_IMPERATIVE_EXPR: {
if (hasSelection) {
this.envelopeWith('I{(σ, γ) | σ:∈X1; γ:=F1[σ]; ', '}');
} else {
this.envelopeWith('I{(σ, γ) | σ:∈X1; γ:=F1[σ]; P1[σ, γ]', '}');
}
this.ref.view.dispatch({
selection: {
anchor: this.ref.view.state.selection.main.from + 2,
}
});
return true;
}
case TokenID.NT_RECURSIVE_FULL: {
if (hasSelection) {
this.envelopeWith('R{ξ:=D1 | F1[ξ]≠∅ | ', '}');
} else {
this.envelopeWith('R{ξ:=D1 | F1[ξ]≠∅ | ξF1[ξ]', '}');
}
this.ref.view.dispatch({
selection: {
anchor: this.ref.view.state.selection.main.from + 2,
}
});
return true;
}
case TokenID.BIGPR: this.envelopeWith('Pr1(', ')'); return true;
case TokenID.SMALLPR: this.envelopeWith('pr1(', ')'); return true;
case TokenID.FILTER: this.envelopeWith('Fi1[α](', ')'); return true;

View File

@ -196,7 +196,7 @@ function EditorRSExpression({
</div>
</div>
<RSInput innerref={rsInput}
className='mt-2'
className='mt-2 text-lg'
height='10.1rem'
value={value}
editable={!disabled}