Skip to content

Commit

Permalink
feat: support dynamic editor components
Browse files Browse the repository at this point in the history
  • Loading branch information
acaldas committed Oct 14, 2024
1 parent 25a119d commit 997d649
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 35 deletions.
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
</head>
<body>
<div id="app"></div>
<script type="importmap">
{
"imports":
{
"react": "https://esm.sh/react",
"react/": "https://esm.sh/react/",
"react-dom": "https://esm.sh/react-dom",
"react-dom/": "https://esm.sh/react-dom/"
}
}
</script>
<script type="module" src="/src/renderer.ts"></script>
</body>
</html>
99 changes: 74 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@electron-forge/publisher-electron-release-server": "^6.2.1",
"@electron-forge/publisher-github": "^7.2.0",
"@playwright/test": "^1.41.2",
"@powerhousedao/design-system": "^1.0.0",
"@powerhousedao/design-system": "^1.2.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.2.4",
Expand All @@ -79,9 +79,9 @@
"autoprefixer": "^10.4.14",
"cypress": "^13.11.0",
"did-key-creator": "^1.2.0",
"document-drive": "^1.0.0-alpha.102",
"document-model": "^2.1.0",
"document-model-libs": "^1.93.1",
"document-drive": "^1.0.2",
"document-model": "^2.2.0",
"document-model-libs": "^1.94.0",
"electron": "30.0.0",
"electron-is-dev": "^3.0.1",
"electron-playwright-helpers": "^1.7.1",
Expand Down
3 changes: 2 additions & 1 deletion src/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { atom, createStore } from 'jotai';
import { atomWithStorage } from 'src/store/utils';
import { themeAtom } from './theme';

export type Store = ReturnType<typeof createStore>;

Expand All @@ -9,4 +10,4 @@ export const sidebarCollapsedAtom = atomWithStorage('sidebar-collapsed', false);
export const sidebarDisableHoverStyles = atom(false);

export * from './theme';
export default { sidebarCollapsedAtom };
export default { sidebarCollapsedAtom, themeAtom };
5 changes: 4 additions & 1 deletion studio/esbuild.studio.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { build } from 'esbuild';
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const dirname =
import.meta.dirname || path.dirname(fileURLToPath(import.meta.url));

const dirname = import.meta.dirname;
const outdir = path.resolve(dirname, '../dist/studio');

function copyCLIScript() {
Expand Down
3 changes: 0 additions & 3 deletions studio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ export async function startServer() {
port: PORT,
open: true,
},
optimizeDeps: {
include: [],
},
plugins: [
viteConnectDevStudioPlugin(),
viteEnvs({
Expand Down
9 changes: 8 additions & 1 deletion vite.renderer.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,14 @@ export default defineConfig(({ mode }) => {
? `${chunk.name}.js`
: 'assets/[name].[hash].js',
},
external: ['node:crypto'],
external: [
'node:crypto',
'react',
'react/jsx-runtime',
'react/jsx-dev-runtime',
'react-dom',
'react-dom/client',
],
},
},
resolve: {
Expand Down

0 comments on commit 997d649

Please sign in to comment.