Svelte Editor hotfixes (#1436)

* Fix white on white text in light mode

* Reflect rename to FieldsEditor in class name

* Fix adjusting fields ending in an endless loop
This commit is contained in:
Henrik Giesel 2021-10-19 00:38:06 +02:00 committed by GitHub
parent ad2c17aced
commit bf3adbc812
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View file

@ -2,12 +2,12 @@
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<div class="multi-root-editor">
<div class="fields-editor">
<slot />
</div>
<style lang="scss">
.multi-root-editor {
.fields-editor {
position: relative;
display: flex;
flex-direction: column;

View file

@ -83,7 +83,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
newStore.subscribe((value) => updateField(i, value));
}
for (let i = fieldStores.length; i > newFieldNames.length; i++) {
for (
let i = fieldStores.length;
i > newFieldNames.length;
i = fieldStores.length
) {
fieldStores.pop();
}

View file

@ -34,7 +34,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import SetContext from "./SetContext.svelte";
import ContentEditable from "../editable/ContentEditable.svelte";
import { onMount, getAllContexts } from "svelte";
import { onMount, getContext, getAllContexts } from "svelte";
import {
nodeIsElement,
nodeContainsInlineContent,
@ -48,6 +48,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { wrapInternal } from "../lib/wrap";
import { nodeStore } from "../sveltelib/node-store";
import type { DecoratedElement } from "../editable/decorated";
import { nightModeKey } from "../components/context-keys";
export let hidden: boolean;
@ -222,10 +223,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
unsubscribeToEditingArea();
};
});
const nightMode = getContext<boolean>(nightModeKey);
</script>
<RichTextStyles
color="white"
color={nightMode ? "white" : "black"}
let:attachToShadow={attachStyles}
let:promise={stylesPromise}
let:stylesDidLoad