Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 55 additions & 65 deletions src/components/AER.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react'
import {
ExpressionRunnerSimple,
ExpressionRunnerPlayButtonOnly,
ExpressionRunnerPairSimpleDeprecated,
ExpressionRunnerSingleStep,
ExpressionRunnerPairSimple
} from 'src/components/ExpressionRunnerShorthand'
Expand All @@ -21,11 +20,6 @@ export default {
expressionContainer={lessonExpressions.e1E1}
/>
),
uqwm: (
<ExpressionRunnerPairSimpleDeprecated
expressionContainer={lessonExpressions.e1E1}
/>
),
zwpj: (
<ExpressionRunnerPlayButtonOnly
expressionContainer={lessonExpressions.e1E2}
Expand All @@ -42,18 +36,21 @@ export default {
/>
),
bgfl: (
<ExpressionRunnerPairSimpleDeprecated
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e1E2}
isDone
/>
),
tuqr: (
<ExpressionRunnerPairSimpleDeprecated
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e1E3}
isDone
/>
),
cpkp: (
<ExpressionRunnerPairSimpleDeprecated
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e1E4}
isDone
/>
),
loai: <ExpressionRunnerSimple expressionContainer={lessonExpressions.e1E5} />,
Expand Down Expand Up @@ -126,10 +123,9 @@ export default {
/>
),
mhgm: (
<ExpressionRunnerPairSimpleDeprecated
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e1E1}
initialState="betaReducePreviewCrossed"
finalIsDone
/>
),
osqo: (
Expand All @@ -154,11 +150,16 @@ export default {
finalState="betaReducePreviewCrossed"
/>
),
zxfv: (
<ExpressionRunnerPairSimpleDeprecated
jwzh: (
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e1E2}
initialState="betaReducePreviewBefore"
finalState="betaReducePreviewCrossed"
/>
),
knhw: (
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e1E2}
initialState="betaReducePreviewCrossed"
/>
),
ahsd: (
Expand Down Expand Up @@ -213,11 +214,6 @@ export default {
initialState="showFuncUnbound"
/>
),
iped: (
<ExpressionRunnerPairSimpleDeprecated
expressionContainer={lessonExpressions.e2E1}
/>
),
cvtc: (
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e3E1}
Expand Down Expand Up @@ -284,36 +280,33 @@ export default {
skipToTheEnd={false}
/>
),
jrxw: (
<ExpressionRunnerPairSimpleDeprecated
udic: (
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e3E1}
initialState="showFuncUnbound"
showPriorities
secondInitializeInstructions={[
{
type: 'nextIteration'
},
{
type: 'stepForwardUntilPreviouslyChangedExpressionState',
state: 'default'
}
]}
/>
),
esyi: (
<ExpressionRunnerPairSimpleDeprecated
xzqu: (
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e3E1}
showPriorities
nextIteration
/>
),
dnvw: (
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e3E1}
nextIteration
initialState="showFuncBound"
showPriorities
/>
),
nric: (
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e3E1}
isDone
showPriorities
firstInitializeInstructions={[
{
type: 'nextIteration'
},
{
type: 'stepForwardUntilPreviouslyChangedExpressionState',
state: 'showFuncBound'
}
]}
finalIsDone
/>
),
hdxc: (
Expand All @@ -323,36 +316,33 @@ export default {
skipToTheEnd={false}
/>
),
wepe: (
<ExpressionRunnerPairSimpleDeprecated
eial: (
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e3E2}
initialState="showFuncUnbound"
showPriorities
secondInitializeInstructions={[
{
type: 'nextIteration'
},
{
type: 'stepForwardUntilPreviouslyChangedExpressionState',
state: 'default'
}
]}
/>
),
bwop: (
<ExpressionRunnerPairSimpleDeprecated
iwkx: (
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e3E2}
nextIteration
showPriorities
/>
),
vjaa: (
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e3E2}
initialState="showFuncBound"
showPriorities
nextIteration
/>
),
iifq: (
<ExpressionRunnerSimple
expressionContainer={lessonExpressions.e3E2}
isDone
showPriorities
firstInitializeInstructions={[
{
type: 'nextIteration'
},
{
type: 'stepForwardUntilPreviouslyChangedExpressionState',
state: 'showFuncBound'
}
]}
finalIsDone
/>
),
laea: (
Expand Down
94 changes: 0 additions & 94 deletions src/components/ExpressionRunnerShorthand.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,105 +345,11 @@ ExpressionRunnerPairSimple.defaultProps = {
...ExpressionRunnerSimple.defaultProps
}

export const ExpressionRunnerPairSimpleDeprecated = ({
expressionContainer,
initialState,
finalIsDone,
finalState,
showPriorities,
hidePrioritiesOnSecond,
firstInitializeInstructions,
secondInitializeInstructions,
highlightOverrides,
highlightOverrideActiveAfterStart,
skipAlphaConvert,
variableSize
}: {
expressionContainer: SteppedExpressionContainer
initialState: ExpressionContainer['previouslyChangedExpressionState']
finalIsDone: boolean
finalState?: ExpressionContainer['previouslyChangedExpressionState']
showPriorities: boolean
hidePrioritiesOnSecond: boolean
skipAlphaConvert: boolean
firstInitializeInstructions?: ExpressionRunnerProps['initializeInstructions']
secondInitializeInstructions?: ExpressionRunnerProps['initializeInstructions']
highlightOverrides?: ExpressionRunnerProps['highlightOverrides']
highlightOverrideActiveAfterStart?: ExpressionRunnerProps['highlightOverrideActiveAfterStart']
variableSize: ExpressionRunnerProps['variableSize']
}) => (
<>
<ExpressionRunner
expressionContainer={expressionContainer}
hideControls
hidePriorities={!showPriorities}
explanationsVisibility="hidden"
variableSize={variableSize}
skipAlphaConvert={skipAlphaConvert}
highlightOverrides={highlightOverrides}
highlightOverrideActiveAfterStart={highlightOverrideActiveAfterStart}
initializeInstructions={
firstInitializeInstructions
? firstInitializeInstructions
: [
{
type: 'stepForwardUntilPreviouslyChangedExpressionState',
state: initialState
}
]
}
/>
<P
css={css`
text-align: center;
margin: ${spaces('-0.75')} 0 ${spaces('-0.5')};
`}
>
{finalState || finalIsDone || secondInitializeInstructions ? (
<>
<Emoji size="mdlg">⬇️</Emoji>
</>
) : (
<>
<Emoji>🔽</Emoji>{' '}
<H args={{ name: 'afterPlay' }} highlightType="none" />{' '}
<Emoji>🔽</Emoji>
</>
)}
</P>
<ExpressionRunner
expressionContainer={expressionContainer}
hideControls
hidePriorities={!showPriorities || hidePrioritiesOnSecond}
explanationsVisibility="hidden"
variableSize={variableSize}
skipAlphaConvert={skipAlphaConvert}
highlightOverrides={highlightOverrides}
highlightOverrideActiveAfterStart={highlightOverrideActiveAfterStart}
initializeInstructions={
secondInitializeInstructions
? secondInitializeInstructions
: [
finalState
? {
type: 'stepForwardUntilPreviouslyChangedExpressionState',
state: finalState
}
: {
type: 'stepForwardUntilTheEnd'
}
]
}
/>
</>
)

ExpressionRunnerPairSimpleDeprecated.defaultProps = {
initialState: 'default',
finalIsDone: false,
showPriorities: false,
skipAlphaConvert: false,
hidePrioritiesOnSecond: false,
variableSize: 'lg'
}

Expand Down
11 changes: 10 additions & 1 deletion src/contents/1.jp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import AER from 'src/components/AER'
import NextLessonButton from 'src/components/NextLessonButton'
import EpisodeCardList from 'src/components/EpisodeCardList'
import H from 'src/components/H'
import ExpressionRunnerSeparator from 'src/components/ExpressionRunnerSeparator'

export default () => (
<EpisodeCardList
Expand Down Expand Up @@ -189,7 +190,9 @@ export default () => (
<P>
<InlineHeader>例その1:</InlineHeader>
</P>
{AER.uqwm}
{AER.ilpo}
<ExpressionRunnerSeparator />
{AER.osqo}
<P>
実はこれ、
<H args={{ name: 'unknownRule' }} />
Expand Down Expand Up @@ -256,14 +259,20 @@ export default () => (
<P>
<InlineHeader>例その2:</InlineHeader>
</P>
{AER.imyd}
<ExpressionRunnerSeparator />
{AER.bgfl}
<P>
<InlineHeader>例その3:</InlineHeader>
</P>
{AER.emmb}
<ExpressionRunnerSeparator />
{AER.tuqr}
<P>
<InlineHeader>例その4:</InlineHeader>
</P>
{AER.jozw}
<ExpressionRunnerSeparator />
{AER.cpkp}
</>
),
Expand Down
11 changes: 9 additions & 2 deletions src/contents/2.jp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import YesNoButtons from 'src/components/YesNoButtons'
import EpisodeCardList from 'src/components/EpisodeCardList'
import H from 'src/components/H'
import episodeEmojis from 'src/lib/episodeEmojis'
import ExpressionRunnerSeparator from 'src/components/ExpressionRunnerSeparator'

export const BasicRules = ({
includeFuncUnbound
Expand Down Expand Up @@ -49,6 +50,8 @@ export const BasicRules = ({
<BottomRightBadge inline bottomRightBadgeType="funcArg" />
</P>
{AER.mhgm}
<ExpressionRunnerSeparator />
{AER.osqo}
</>
)

Expand All @@ -73,7 +76,9 @@ export default () => (
ここでは、前回のはじめに登場した弁当箱(<Strong>例その1</Strong>
)を使って説明します:
</P>
{AER.uqwm}
{AER.ilpo}
<ExpressionRunnerSeparator />
{AER.osqo}
</>
)
},
Expand Down Expand Up @@ -315,7 +320,9 @@ export default () => (
</Strong>
</P>
{AER.zxfv}
{AER.jwzh}
<ExpressionRunnerSeparator />
{AER.knhw}
</>
)
},
Expand Down
Loading