Skip to content

Commit a39fc98

Browse files
authored
Wip monaco newsandbox (#350)
* monaco / upgrade blocknote * clean package json + local blocknote * wip monaco * wip * wip * fix * wip * disable contentdom * wip * blocknote 0.8.0 * fix package lock * extract execution from editor and introduce new kind of sandbox * wip * styles * monaco fix * improve compile system * fix * fix import documents * fix types * eslint * package lock * fix package lock * downgrade typescript eslint * fix monaco selections * fix build * fix mode * fix build * fix tests * fix * fix * fix tests * fix imports * update lockfile * fix pw * iframe params via hash * tmp disable test * fix * reenable bg syncer test
1 parent 005f56e commit a39fc98

File tree

229 files changed

+9770
-8104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+9770
-8104
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ jobs:
105105
env:
106106
CI: true
107107

108+
- name: Build packages (vite react)
109+
run: npm run build:react
110+
env:
111+
CI: true
112+
MODE: development
113+
108114
- name: Lint
109115
run: npm run lint
110116
env:

package-lock.json

Lines changed: 4101 additions & 2283 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"packages/shared-test",
1818
"packages/engine",
1919
"packages/parsers",
20+
"packages/frame",
2021
"packages/editor",
2122
"packages/server"
2223
],
@@ -30,7 +31,7 @@
3031
"unittest:vitest": "npm run unittest:vitest --workspaces",
3132
"wip:unittest:vitest:coverage": "vitest run --coverage -r packages/xxx",
3233
"build": "npm run build --workspaces",
33-
"build:react": "npm run build:react --workspaces",
34+
"build:react": "npm run build:react --workspace=packages/editor",
3435
"lint": "npm run lint --workspaces",
3536
"watch": "npm run build && npm run --parallel watch",
3637
"start": "npm run start-react",

packages/editor/.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/editor/package.json

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,68 +24,47 @@
2424
"@atlaskit/textfield": "^5.6.3",
2525
"@atlaskit/tree": "^8.8.5",
2626
"@atlaskit/user-picker": "^10.4.0",
27-
"@blocknote/core": "^0.8.2",
28-
"@blocknote/react": "^0.8.2",
29-
"@deck.gl/aggregation-layers": "^8.6.4",
30-
"@deck.gl/core": "^8.6.4",
31-
"@deck.gl/layers": "^8.6.4",
32-
"@deck.gl/react": "^8.6.4",
3327
"@emotion/react": "^11.4.0",
34-
"@loaders.gl/core": "^3.0.12",
35-
"@loaders.gl/images": "^3.0.12",
3628
"@supabase/auth-ui-react": "^0.4.2",
3729
"@supabase/auth-ui-shared": "^0.1.6",
3830
"@supabase/supabase-js": "^2.26.0",
3931
"@syncedstore/yjs-reactive-bindings": "^0.5.1",
4032
"@tippyjs/react": "^4.2.6",
41-
"@tiptap/extension-collaboration": "^2.0.0-beta.38",
42-
"@tiptap/extension-collaboration-cursor": "^2.0.0-beta.37",
4333
"@typecell-org/util": "^0.0.3",
4434
"@typecell-org/shared": "^0.0.3",
4535
"@typecell-org/engine": "^0.0.3",
4636
"@typecell-org/parsers": "^0.0.3",
47-
"@typescript/vfs": "^1.3.4",
37+
"@typecell-org/frame": "^0.0.3",
4838
"classnames": "^2.3.1",
4939
"filebridge-client": "^0.1.5",
5040
"fractional-indexing": "^2.0.0",
5141
"lodash": "^4.17.21",
52-
"lz-string": "^1.4.4",
53-
"markdown-it": "^12.0.2",
5442
"mobx": "^6.2.0",
5543
"mobx-react-lite": "^3.2.0",
56-
"monaco-editor": "^0.35.0",
5744
"penpal": "^6.1.0",
58-
"prettier": "2.4.1",
59-
"probe.gl": "^3.1.4",
6045
"react": "^18.2.0",
6146
"react-avatar": "^3.10.0",
6247
"react-dnd": "^14.0.2",
6348
"react-dnd-html5-backend": "^14.0.0",
6449
"react-dom": "^18.2.0",
6550
"react-error-overlay": "^6.0.9",
6651
"react-icons": "^4.6.0",
67-
"react-inspector": "^6.0.1",
6852
"react-intl-next": "npm:react-intl@^5.18.1",
6953
"react-router-dom": "^6.10.0",
70-
"history": "^5.3.0",
71-
"string.prototype.replaceall": "^1.0.5",
7254
"tippy.js": "^6.3.1",
73-
"typescript": "5.0.4",
74-
"uuid": "^8.3.2",
7555
"vscode-lib": "^0.1.2",
7656
"web-vitals": "^1.0.1",
7757
"y-indexeddb": "9.0.6",
78-
"y-monaco": "^0.1.4",
7958
"y-protocols": "^1.0.5",
80-
"y-webrtc": "^10.2.5",
59+
"y-websocket": "^1.5.0",
8160
"yjs": "^13.6.4"
8261
},
8362
"scripts": {
8463
"copytypes:self": "tsc --declaration --emitDeclarationOnly --noEmit false --composite false --declarationDir ./public/types/@typecell-org/editor",
8564
"copytypes:externaldep": "mkdir -p public/types/$npm_config_pkgname && cp -rf ../../node_modules/$npm_config_pkgname/. public/types/$npm_config_pkgname",
8665
"copytypes:allexternaldeps": "npm run copytypes:externaldep --pkgname=@types/react && npm run copytypes:externaldep --pkgname=@types/scheduler && npm run copytypes:externaldep --pkgname=@types/prop-types && npm run copytypes:externaldep --pkgname=csstype",
8766
"copytypes:dep": "mkdir -p public/types/@typecell-org/$npm_config_pkgname && cp -rf ../$npm_config_pkgname/types/. public/types/@typecell-org/$npm_config_pkgname",
88-
"copytypes:alldeps": "npm run copytypes:dep --pkgname=util && npm run copytypes:dep --pkgname=engine",
67+
"copytypes:alldeps": "npm run copytypes:dep --pkgname=util && npm run copytypes:dep --pkgname=engine && npm run copytypes:dep --pkgname=frame",
8968
"copytypes": "npm run copytypes:self && npm run copytypes:alldeps && npm run copytypes:allexternaldeps",
9069
"start": "npm run copytypes && npm run vite:dev",
9170
"copy-docs": "node copy-docs.mjs > public/_docs/index.json",
@@ -102,12 +81,11 @@
10281
"vite:dev": "vite",
10382
"vite:build": "vite build --mode=$MODE",
10483
"vite:preview": "vite preview",
105-
"preview": "npm run build:react && npm run vite:preview"
84+
"preview": "npm run vite:preview"
10685
},
10786
"eslintConfig": {
10887
"extends": [
109-
"react-app",
110-
"react-app/jest"
88+
"../shared/.eslintrc.cjs"
11189
]
11290
},
11391
"browserslist": {
@@ -127,18 +105,15 @@
127105
"@playwright/experimental-ct-react": "^1.33.0",
128106
"@typecell-org/shared-test": "^0.0.3",
129107
"@types/lodash": "^4.14.168",
130-
"@types/markdown-it": "^10.0.3",
131108
"@types/node": "^16.0.0",
132-
"@types/prettier": "^2.6.4",
133109
"@types/react": "^18.0.25",
134110
"@types/react-dom": "^18.0.9",
135111
"@types/speakingurl": "^13.0.2",
136-
"@types/uuid": "^8.3.0",
137112
"@vitejs/plugin-react": "^4.0.0",
138113
"connect-history-api-fallback": "^2.0.0",
114+
"chai": "^4.3.7",
139115
"cross-env": "^7.0.3",
140116
"eslint": "^8.21.0",
141-
"eslint-config-react-app": "^7.0.1",
142117
"glob": "^7.2.0",
143118
"jsdom": "^20.0.0",
144119
"playwright-test": "^11.0.4",

packages/editor/src/@types/y-monaco.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ declare module "y-monaco" {
66
ytext: Y.Text,
77
model: monaco.editor.ITextModel,
88
editors?: Set<monaco.editor.IStandaloneCodeEditor>,
9+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
910
awareness?: any
1011
);
1112
destroy();

packages/editor/src/app/App.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Main from "./main/Main";
1313
import { AILanding } from "./main/components/startscreen/AILanding";
1414
import { StartScreen } from "./main/components/startscreen/StartScreen";
1515
import { DocumentRoute } from "./routes/document";
16+
import { SupabaseSessionStore } from "./supabase-auth/SupabaseSessionStore";
1617
import { supabaseAuthProvider } from "./supabase-auth/supabaseAuthProvider";
1718

1819
const Wrapper = observer((props: { sessionStore: SessionStore }) => {
@@ -64,14 +65,20 @@ export const App = observer(
6465
</Route>
6566
<Route
6667
path="/register"
67-
element={props.authProvider.routes.register(sessionStore as any)}
68+
element={props.authProvider.routes.register(
69+
sessionStore as SupabaseSessionStore
70+
)}
6871
/>
6972
<Route path="/recover" element={<div>Not implemented yet</div>} />
7073
<Route
7174
path="/login"
72-
element={props.authProvider.routes.login(sessionStore as any)}
75+
element={props.authProvider.routes.login(
76+
sessionStore as SupabaseSessionStore
77+
)}
7378
/>
74-
{props.authProvider.routes.additionalRoutes(sessionStore as any)}
79+
{props.authProvider.routes.additionalRoutes(
80+
sessionStore as SupabaseSessionStore
81+
)}
7582
{/* todo: notfound? */}
7683
</Route>
7784
</Routes>

packages/editor/src/app/GlobalNavigateRef.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NavigateFunction } from "react-router-dom";
22

3-
export let navigateRef: { current: NavigateFunction | undefined } = {
3+
export const navigateRef: { current: NavigateFunction | undefined } = {
44
current: undefined,
55
};
66

packages/editor/src/app/documentRenderers/DocumentView.tsx

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
12
import { observer } from "mobx-react-lite";
23
import * as React from "react";
34
import { useState } from "react";
45
import { Identifier } from "../../identifiers/Identifier";
56
import { DocConnection } from "../../store/DocConnection";
6-
import PluginResource from "../../store/PluginResource";
7+
78
import ProjectResource from "../../store/ProjectResource";
89

910
// import { MenuBar } from "../maidocn/components/menuBar/MenuBar";
@@ -14,8 +15,7 @@ import ProfileResource from "../../store/ProfileResource";
1415
import { SessionStore } from "../../store/local/SessionStore";
1516
import { DocumentMenu } from "../main/components/documentMenu/DocumentMenu";
1617
import { MenuBar } from "../main/components/menuBar/MenuBar";
17-
import NotebookRenderer from "./notebook/NotebookRenderer";
18-
import PluginRenderer from "./plugin/PluginRenderer";
18+
1919
import ProfileRenderer from "./profile/ProfileRenderer";
2020
import ProjectContainer from "./project/ProjectContainer";
2121
import ProjectRenderer from "./project/ProjectRenderer";
@@ -88,22 +88,7 @@ const DocumentView = observer((props: Props) => {
8888
return <div>Loading</div>;
8989
}
9090
if (connection.doc.type === "!notebook") {
91-
const doc = connection.doc.doc;
92-
93-
return (
94-
<div className={styles.view}>
95-
{!props.hideDocumentMenu && (
96-
<DocumentMenu
97-
document={doc}
98-
sessionStore={props.sessionStore}></DocumentMenu>
99-
)}
100-
<NotebookRenderer
101-
key={connection.doc.id}
102-
document={doc}
103-
sessionStore={props.sessionStore}
104-
/>
105-
</div>
106-
);
91+
throw new Error("Notebook not implemented");
10792
} else if (connection.doc.type === "!project") {
10893
if (props.isNested) {
10994
return (
@@ -150,12 +135,7 @@ const DocumentView = observer((props: Props) => {
150135
</div>
151136
);
152137
} else if (connection.doc.type === "!plugin") {
153-
return (
154-
<PluginRenderer
155-
key={connection.doc.id}
156-
plugin={connection.doc.getSpecificType(PluginResource)!}
157-
/>
158-
);
138+
throw new Error("Plugin not implemented");
159139
} else if (connection.doc.type === "!profile") {
160140
return (
161141
<ProfileRenderer

0 commit comments

Comments
 (0)