Skip to content

Commit

Permalink
fix drawer in hyperbook studio
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebarkmin committed Mar 17, 2024
1 parent 2eca214 commit cfdb112
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/strange-bobcats-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@hyperbook/next-watch": patch
"hyperbook-studio": patch
"@hyperbook/fs": patch
---

Fix drawer in hyperbook-studio
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"version-packages": "changeset version",
"release": "changeset publish",
"platform:web:dev": "pnpm --filter @platforms/web dev",
"platform:vscode:dev": "pnpm --filter hyperbook-studio watch",
"examples:setup": "cd examples && HYPERBOOK_LOCAL_DEV=1 node ../packages/hyperbook/dist/index.js setup",
"examples:build": "cd examples && HYPERBOOK_LOCAL_DEV=1 node ../packages/hyperbook/dist/index.js build",
"website:setup": "cd website && HYPERBOOK_LOCAL_DEV=1 node ../packages/hyperbook/dist/index.js setup",
Expand Down
1 change: 1 addition & 0 deletions packages/fs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export {
VFilePublic,
VFileArchive,
VFileSnippet,
getMarkdown,
} from "./vfile";

export { hyperlibrary, hyperbook, hyperproject, vfile };
2 changes: 1 addition & 1 deletion platforms/vscode/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const App = () => {
}, []);

if (!state) {
return <div>...</div>;
return <div>...Loading</div>;
}

return (
Expand Down
12 changes: 12 additions & 0 deletions platforms/vscode/app/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "@hyperbook/drawer/index.css";
@import "@hyperbook/shell/index.css";
@import "@hyperbook/markdown/katex.css";
@import "@hyperbook/markdown/index.css";
Expand All @@ -23,9 +24,20 @@
@import "@hyperbook/element-online-ide/index.css";
@import "@hyperbook/element-sql-ide/index.css";

html,
body {
padding: 0;
margin: 0;
overflow: hidden;
}

body {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}

body::-webkit-scrollbar {
display: none;
}

#root {
Expand Down
1 change: 1 addition & 0 deletions platforms/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
"webpack-cli": "4.10.0"
},
"dependencies": {
"@hyperbook/drawer": "workspace:*",
"@hyperbook/element-audio": "workspace:*",
"@hyperbook/element-video": "workspace:*",
"@hyperbook/element-alert": "workspace:*",
Expand Down
7 changes: 7 additions & 0 deletions platforms/vscode/src/Preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
VFileGlossary,
vfile,
VFile,
getMarkdown,
} from "@hyperbook/fs";
import { htmlTemplate } from "./html-template";
import { disposeAll } from "./utils/dispose";
Expand Down Expand Up @@ -193,6 +194,12 @@ export default class Preview {
this._vfile
) {
console.log("Partial update");

this._vfile = {
...this._vfile,
markdown: await getMarkdown(this._vfile),
};

this.postMessage({
type: "CHANGE",
payload: await this.getState(false),
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit cfdb112

Please sign in to comment.