fix: select workspace (#1)
This commit is contained in:
parent
23472c414d
commit
2996ace23c
|
|
@ -40,6 +40,6 @@
|
||||||
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@1/dist/index.js"
|
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@1/dist/index.js"
|
||||||
],
|
],
|
||||||
"plugin.inlang.i18next": {
|
"plugin.inlang.i18next": {
|
||||||
"pathPattern": "./src/@types/translations/{{languageTag}}.json"
|
"pathPattern": "./src/@types/translations/{languageTag}.json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -55,7 +55,7 @@ function CreateWorkspace () {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t('workspace.new')}
|
{t('workspace.create')}
|
||||||
</Button>
|
</Button>
|
||||||
<NormalModal
|
<NormalModal
|
||||||
title={t('workspace.create')}
|
title={t('workspace.create')}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ function Color () {
|
||||||
} = useSelectionToolbarContext();
|
} = useSelectionToolbarContext();
|
||||||
const editor = useSlateStatic() as YjsEditor;
|
const editor = useSlateStatic() as YjsEditor;
|
||||||
const isActivated = CustomEditor.isMarkActive(editor, EditorMarkFormat.BgColor) || CustomEditor.isMarkActive(editor, EditorMarkFormat.FontColor);
|
const isActivated = CustomEditor.isMarkActive(editor, EditorMarkFormat.BgColor) || CustomEditor.isMarkActive(editor, EditorMarkFormat.FontColor);
|
||||||
|
const marks = CustomEditor.getAllMarks(editor);
|
||||||
|
const activeBgColor = marks.find(mark => mark[EditorMarkFormat.BgColor])?.[EditorMarkFormat.BgColor];
|
||||||
|
const activeFontColor = marks.find(mark => mark[EditorMarkFormat.FontColor])?.[EditorMarkFormat.FontColor];
|
||||||
|
|
||||||
const [anchorEl, setAnchorEl] = React.useState<HTMLButtonElement | null>(null);
|
const [anchorEl, setAnchorEl] = React.useState<HTMLButtonElement | null>(null);
|
||||||
const open = Boolean(anchorEl);
|
const open = Boolean(anchorEl);
|
||||||
|
|
||||||
|
|
@ -141,7 +145,8 @@ function Color () {
|
||||||
<div
|
<div
|
||||||
className={`w-full h-full absolute top-0 left-0 rounded-[6px] border-2 cursor-pointer opacity-50 hover:opacity-100`}
|
className={`w-full h-full absolute top-0 left-0 rounded-[6px] border-2 cursor-pointer opacity-50 hover:opacity-100`}
|
||||||
style={{
|
style={{
|
||||||
borderColor: color.color || 'var(--text-title)',
|
borderColor: activeFontColor === color.color ? 'var(--fill-default)' : undefined,
|
||||||
|
color: renderColor(color.color) || 'var(--text-title)',
|
||||||
opacity: color.color ? undefined : 1,
|
opacity: color.color ? undefined : 1,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
@ -169,7 +174,7 @@ function Color () {
|
||||||
<div
|
<div
|
||||||
className={`w-full h-full absolute top-0 left-0 rounded-[6px] border-2`}
|
className={`w-full h-full absolute top-0 left-0 rounded-[6px] border-2`}
|
||||||
style={{
|
style={{
|
||||||
borderColor: renderColor(color.color),
|
borderColor: activeBgColor === color.color ? 'var(--fill-default)' : undefined,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
|
|
@ -184,7 +189,7 @@ function Color () {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
}, [editorBgColors, editorTextColors, handlePickedColor, t]);
|
}, [activeBgColor, activeFontColor, editorBgColors, editorTextColors, handlePickedColor, t]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,15 @@ export const withPasted = (editor: ReactEditor) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lineLength > 1 && html && node.type !== BlockType.CodeBlock) {
|
if (lineLength > 1 && node.type !== BlockType.CodeBlock) {
|
||||||
return insertHtmlData(editor, data);
|
if (html) {
|
||||||
|
return insertHtmlData(editor, data);
|
||||||
|
} else {
|
||||||
|
const fragment = lines.map((line) => ({ type: BlockType.Paragraph, children: [{ text: line }] }));
|
||||||
|
|
||||||
|
insertFragment(editor, fragment);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue