-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdk: export more types, add showSidebar option and vm.editor.setCurre…
…ntFile (#1837) * fix vm.editor.getUrl returning an object and not a string * improve types of the RDC class * export all types from src/interfaces.ts * refactor URL param generation * add showSidebar option * sdk: add experimental vm.editor.setCurrentFile * bump version to 1.7.0-alpha.3
- Loading branch information
Florens Verschelde
authored
Apr 18, 2022
1 parent
6fdafac
commit 07604d2
Showing
13 changed files
with
333 additions
and
205 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,33 @@ | ||
/** | ||
* Number of milliseconds between attempts to get a response from an embedded frame | ||
*/ | ||
export const CONNECT_INTERVAL = 500; | ||
|
||
/** | ||
* How many times should we try to get an init response from an embedded frame | ||
*/ | ||
export const CONNECT_MAX_ATTEMPTS = 20; | ||
|
||
/** | ||
* Default height attribute for iframes | ||
*/ | ||
export const DEFAULT_FRAME_HEIGHT = 300; | ||
|
||
/** | ||
* Origin of the StackBlitz instance | ||
*/ | ||
export const DEFAULT_ORIGIN = 'https://stackblitz.com'; | ||
|
||
/** | ||
* List of supported template names. | ||
*/ | ||
export const PROJECT_TEMPLATES = [ | ||
'angular-cli', | ||
'create-react-app', | ||
'html', | ||
'javascript', | ||
'node', | ||
'polymer', | ||
'typescript', | ||
'vue', | ||
] as const; |
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,40 @@ | ||
export type { Project, OpenOptions, EmbedOptions } from './interfaces'; | ||
export type { VM } from './VM'; | ||
import { | ||
connect, | ||
embedGithubProject, | ||
embedProject, | ||
embedProjectId, | ||
openGithubProject, | ||
openProject, | ||
openProjectId, | ||
} from './lib'; | ||
|
||
import * as StackBlitzSDK from './lib'; | ||
export default StackBlitzSDK; | ||
// Explicitly export public types (vs using `export * from './interfaces'`), | ||
// so that additions to interfaces don't become a part of our public API by mistake. | ||
export type { | ||
Project, | ||
ProjectOptions, | ||
ProjectDependencies, | ||
ProjectFiles, | ||
ProjectSettings, | ||
ProjectTemplate, | ||
EmbedOptions, | ||
OpenOptions, | ||
OpenFileOption, | ||
UiThemeOption, | ||
UiViewOption, | ||
} from './interfaces'; | ||
export type { FsDiff, VM } from './vm'; | ||
|
||
// Export a single object with methods, for compatibility with UMD and CommonJS. | ||
// Ideally we would also have named exports, but that can create incompatibilities | ||
// with some bundlers, and microbundle doesn't support it: | ||
// https://github.com/developit/microbundle/issues/712 | ||
export default { | ||
connect, | ||
embedGithubProject, | ||
embedProject, | ||
embedProjectId, | ||
openGithubProject, | ||
openProject, | ||
openProjectId, | ||
}; |
Oops, something went wrong.