-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented "loadExternalStyles" api. This can be used to load extern…
…al css files
- Loading branch information
Showing
12 changed files
with
126 additions
and
44 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,49 @@ | ||
/** | ||
* Load external fonts using their URLs. You can use any fonts source. | ||
* | ||
* E.g.: Fonts source: https://www.cdnfonts.com/ | ||
* | ||
* Usage example: | ||
* | ||
* ``` | ||
* const fontsLoaded = loadFonts(["https://fonts.cdnfonts.com/css/display"]); | ||
* console.log(fontsLoaded); // true / false | ||
* ``` | ||
* | ||
* @returns {boolean} fonts loaded? | ||
*/ | ||
export declare const loadFonts: (fontURLs: string[]) => boolean; | ||
|
||
/** | ||
* Load external css files using their URLs. | ||
* | ||
* Usage example: | ||
* | ||
* ``` | ||
* const stylesLoaded = loadExternalStyles(["https://cdn.jsdelivr.net/gh/codemirror/codemirror5/lib/codemirror.css"]); | ||
* console.log(stylesLoaded); // true / false | ||
* ``` | ||
* | ||
* @returns {boolean} css files loaded? | ||
*/ | ||
export declare const loadExternalStyles: (fontURLs: string[]) => boolean; | ||
|
||
/** | ||
* Call resolve or reject for a given caller | ||
* E.g: | ||
* ``` | ||
* const getStorage = () => Storage.get('my-key'); | ||
* const resolve = (storageData) => console.log(storageData); | ||
* const reject = () => console.log('Error'); | ||
* const timeout = 5000; // 5sec | ||
* promisify(getStorage, resolve, reject, timeout); | ||
* ``` | ||
* | ||
* Default timeout is 10 seconds | ||
*/ | ||
export declare const promisify: ( | ||
caller: () => any, | ||
resolve: (data: any) => void, | ||
reject?: () => void, | ||
_timeout?: number, | ||
) => void; |
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,23 @@ | ||
## Load External Styles (Css) | ||
|
||
Use this feature to load external css files into your application. | ||
|
||
`loadExternalStyles` returns a `boolean` informing whether all css files have already been loaded. | ||
|
||
```tsx | ||
import { loadExternalStyles } from "alem/api"; | ||
|
||
const App = () => { | ||
const stylesLoaded = loadExternalStyles([ | ||
"https://cdn.jsdelivr.net/gh/codemirror/codemirror5/lib/codemirror.css", | ||
]); | ||
|
||
if (!stylesLoaded) { | ||
return <p>Loading...</p>; | ||
} | ||
|
||
return <p>My Nice Content</p>; | ||
}; | ||
|
||
export default App; | ||
``` |
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,4 @@ | ||
export * from "./bos"; | ||
export * from "./router"; | ||
export * from "./store"; | ||
export * from "./theme"; | ||
export * from "./utils"; | ||
export * from "./api"; |
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,5 @@ | ||
- Implement support for Testnet. | ||
- Implement `loadExternalStyles` API to load external css files | ||
- Implement `loadExternalStyles` API to load external css files. - ✔ | ||
- E2E Tests | ||
- Add parameter `parameterName` for `Routes` component. This is going to allow changing the default route param name ("path") that's used to control and watch all routes. - ✔ | ||
- Implement feature to the compiler that changes the consts/lets/vars names to avoid conflicts. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.