-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from lynhan318/refactor/codeBlock
- Loading branch information
Showing
27 changed files
with
3,391 additions
and
561 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@nextlint/svelte': minor | ||
--- | ||
|
||
refactor: codeBlock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
<script lang="ts" context="module"> | ||
const themeStore: Writable<Theme> = writable('light'); | ||
export const useEditorTheme = () => themeStore; | ||
</script> | ||
|
||
<script lang="ts"> | ||
import type {Theme} from '$lib/node-view'; | ||
import './EditorTheme.scss'; | ||
import {writable, type Writable} from 'svelte/store'; | ||
export let theme: Theme = 'light'; | ||
$: { | ||
themeStore.set(theme); | ||
} | ||
</script> | ||
|
||
<slot /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script context="module" lang="ts"> | ||
</script> | ||
|
||
<script lang="ts"> | ||
import {useEditor} from '$lib/context'; | ||
import {useNodeViewContext} from '@prosemirror-adapter/svelte'; | ||
import {onMount} from 'svelte'; | ||
let selected = false; | ||
const contentRef = useNodeViewContext('contentRef'); | ||
const selectedStore = useNodeViewContext('selected'); | ||
selectedStore.subscribe(value => { | ||
selected = value; | ||
}); | ||
const editor = useEditor(); | ||
onMount(() => {}); | ||
</script> | ||
|
||
<div use:contentRef class:selected /> | ||
|
||
<style> | ||
.selected { | ||
outline: blue solid 1px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.