feat(multi): add editor decoration

The warning region does not grow at the edges This makes it harder for
the user to get into an odd state.  It might be better to have let the
user expand the second region at the trailing edge.  I'm not sure, and
that's harder to implement.
This commit is contained in:
Oliver Eyton-Williams
2020-06-25 17:25:30 +02:00
committed by Mrugesh Mohapatra
parent dfbf1ae9ae
commit 59c838e8ca
4 changed files with 183 additions and 10 deletions

View File

@@ -106,6 +106,7 @@ export const sagas = [
...createCurrentChallengeSaga(types)
];
// TODO: can createPoly handle editable region, rather than separating it?
export const createFiles = createAction(types.createFiles, challengeFiles =>
Object.keys(challengeFiles)
.filter(key => challengeFiles[key])
@@ -115,7 +116,8 @@ export const createFiles = createAction(types.createFiles, challengeFiles =>
...challengeFiles,
[file.key]: {
...createPoly(file),
seed: file.contents.slice(0)
seed: file.contents.slice(0),
editableRegion: file.editableRegion
}
}),
{}
@@ -311,7 +313,8 @@ export const reducer = handleActions(
...files,
[file.key]: {
...file,
contents: file.seed.slice()
contents: file.seed.slice(),
editableRegion: file.editableRegion
}
}),
{}