-
-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
73 additions
and
22 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
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
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,13 @@ | ||
import * as React from 'react'; | ||
|
||
const LoadedHTMLContext = React.createContext<{ | ||
html: string | null; | ||
setHTML: (html: string) => void; | ||
}>({ | ||
html: null, | ||
setHTML: () => void 0 | ||
}); | ||
|
||
export const useLoadedHTML = () => React.useContext(LoadedHTMLContext); | ||
|
||
export default LoadedHTMLContext; |
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,11 @@ | ||
import * as React from 'react'; | ||
import snippets from '../snippets'; | ||
|
||
export const defaultSelectedSnippet: keyof typeof snippets = 'whitespace'; | ||
|
||
const SelectedSnippetContext = React.createContext(defaultSelectedSnippet); | ||
|
||
export const useSelectedSnippet = () => | ||
React.useContext(SelectedSnippetContext); | ||
|
||
export default SelectedSnippetContext; |
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,8 +1,11 @@ | ||
import * as React from 'react'; | ||
import { TNode } from '@native-html/transient-render-engine'; | ||
|
||
const TTreeContext = React.createContext<{ ttree: TNode | null, setTTree: (ttree: TNode) => void; }>({ ttree: null, setTTree: () => null }); | ||
const TTreeContext = React.createContext<{ | ||
ttree: TNode | null; | ||
setTTree: (ttree: TNode) => void; | ||
}>({ ttree: null, setTTree: () => null }); | ||
export const useTTree = () => React.useContext(TTreeContext); | ||
const TTreeContextProvider = TTreeContext.Provider | ||
const TTreeContextProvider = TTreeContext.Provider; | ||
|
||
export default TTreeContextProvider; |