-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
46 changed files
with
133 additions
and
221 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "lib" | ||
"outDir": "dist" | ||
}, | ||
"include": [ | ||
"./src/" | ||
] | ||
"include": ["src"] | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,17 @@ | ||
import { runInAction } from 'mobx'; | ||
import renderer from './renderer'; | ||
|
||
if (typeof window !== 'undefined') { | ||
(window as any).SimulatorRenderer = renderer; | ||
} | ||
|
||
window.addEventListener('beforeunload', () => { | ||
runInAction(() => { | ||
(window as any).LCSimulatorHost = null; | ||
renderer.dispose?.(); | ||
(window as any).SimulatorRenderer = null; | ||
(window as any).ReactDOM.unmountComponentAtNode(document.getElementById('app')); | ||
}); | ||
}); | ||
|
||
export default renderer; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,17 +0,0 @@ | ||
import { runInAction } from 'mobx'; | ||
import renderer from './renderer'; | ||
|
||
if (typeof window !== 'undefined') { | ||
(window as any).SimulatorRenderer = renderer; | ||
} | ||
|
||
window.addEventListener('beforeunload', () => { | ||
runInAction(() => { | ||
(window as any).LCSimulatorHost = null; | ||
renderer.dispose?.(); | ||
(window as any).SimulatorRenderer = null; | ||
(window as any).ReactDOM.unmountComponentAtNode(document.getElementById('app')); | ||
}); | ||
}); | ||
|
||
export default renderer; | ||
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,30 @@ | ||
import { defineConfig } from 'vite'; | ||
import { resolve } from 'node:path'; | ||
import react from '@vitejs/plugin-react'; | ||
import { devDependencies, peerDependencies } from './package.json'; | ||
|
||
const externals = [...Object.keys(devDependencies), ...Object.keys(peerDependencies)]; | ||
|
||
export default defineConfig({ | ||
build: { | ||
lib: { | ||
// Could also be a dictionary or array of multiple entry points | ||
entry: resolve(import.meta.dirname, 'src/index.ts'), | ||
name: 'LowCodeSimulatorReactRenderer', | ||
formats: ['es', 'cjs', 'iife'], | ||
// the proper extensions will be added | ||
fileName: 'SimulatorReactRenderer', | ||
}, | ||
rollupOptions: { | ||
external: externals, | ||
output: { | ||
// for UMD | ||
globals: { | ||
react: 'React', | ||
'react-dom': 'ReactDOM', | ||
}, | ||
}, | ||
}, | ||
}, | ||
plugins: [react()], | ||
}); |
Empty file.
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.