Skip to content

Commit 3c47567

Browse files
committed
chore!: Update editor to @notea/rich-markdown-editor
editor: I forked Outline's rich-markdown-editor and made a Notea version for it. Now more of the editor-related issues can be fixed. prosemirror-model: Upgraded prosemirror-model to 1.16.1. I don't know why 1.17+ doesn't work (suspecting something with instanceof not working) so this is a hack.
1 parent e5c1d59 commit 3c47567

File tree

11 files changed

+2426
-2243
lines changed

11 files changed

+2426
-2243
lines changed

components/editor/editor.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FC, useEffect, useState } from 'react';
22
import { use100vh } from 'react-div-100vh';
3-
import MarkdownEditor, { Props } from 'rich-markdown-editor';
3+
import MarkdownEditor, { Props } from '@notea/rich-markdown-editor';
44
import { useEditorTheme } from './theme';
55
import useMounted from 'libs/web/hooks/use-mounted';
66
import Tooltip from './tooltip';

components/editor/embeds/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import CsrfTokenState from 'libs/web/state/csrf-token';
22
import { useCallback } from 'react';
3-
import { Props } from 'rich-markdown-editor';
3+
import { Props } from '@notea/rich-markdown-editor';
44
import { Bookmark } from './bookmark';
55
import { Embed } from './embed';
66
import { ReactComponentLike } from 'prop-types';

components/editor/extensions/bracket.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { InputRule } from 'prosemirror-inputrules';
2-
import Mark from 'rich-markdown-editor/dist/marks/Mark';
2+
import Mark from '@notea/rich-markdown-editor/dist/marks/Mark';
33

44
export default class Bracket extends Mark {
55
get name() {

components/editor/extensions/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Extension } from 'rich-markdown-editor';
1+
import { Extension } from '@notea/rich-markdown-editor';
22
import Bracket from './bracket';
33

44
const extensions: Extension[] = [new Bracket()];

components/editor/theme.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useTheme } from 'next-themes';
2-
import { theme } from 'rich-markdown-editor';
3-
import { light, dark } from 'rich-markdown-editor/dist/theme';
2+
import { theme } from '@notea/rich-markdown-editor';
3+
import { light, dark } from '@notea/rich-markdown-editor/dist/styles/theme';
44

55
export const darkTheme: typeof theme = {
66
...dark,

libs/web/editor/link.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import RichMarkdownEditor from 'rich-markdown-editor';
1+
import RichMarkdownEditor from '@notea/rich-markdown-editor';
22

33
type Node = RichMarkdownEditor['view']['state']['doc'];
44

libs/web/state/editor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import PortalState from 'libs/web/state/portal';
1515
import { NoteCacheItem } from 'libs/web/cache';
1616
import noteCache from 'libs/web/cache/note';
1717
import { createContainer } from 'unstated-next';
18-
import MarkdownEditor from 'rich-markdown-editor';
18+
import MarkdownEditor from '@notea/rich-markdown-editor';
1919
import { useDebouncedCallback } from 'use-debounce';
2020
import { ROOT_ID } from 'libs/shared/tree';
2121
import { has } from 'lodash';

libs/web/state/portal.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NoteModel } from 'libs/shared/note';
22
import { useState, useCallback } from 'react';
3-
import RichMarkdownEditor from 'rich-markdown-editor';
3+
import RichMarkdownEditor from '@notea/rich-markdown-editor';
44
import { createContainer } from 'unstated-next';
55

66
const useModalInstance = () => {

next.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
const nextPWA = require('next-pwa');
22
const cache = require('./scripts/cache');
33

4+
const developmentEnv = process.env.NODE_ENV === 'development';
45
const withPWA = nextPWA({
56
// target: process.env.NETLIFY ? 'serverless' : 'server',
67
// mode: process.env.NODE_ENV ?? 'development',
7-
disable: process.env.NODE_ENV === 'development',
8+
disable: developmentEnv,
89
dest: 'public',
910
runtimeCaching: cache,
1011
});

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
]
3131
},
3232
"dependencies": {
33-
"@atlaskit/tree": "^8.3.0",
33+
"@atlaskit/tree": "^8.6.3",
3434
"@aws-sdk/client-s3": "^3.10.0",
3535
"@aws-sdk/s3-request-presigner": "^3.10.0",
3636
"@fontsource/noto-sans": "^4.5.10",
@@ -50,7 +50,7 @@
5050
"localforage": "^1.9.0",
5151
"lodash": "^4.17.21",
5252
"lzutf8": "^0.6.0",
53-
"markdown-link-extractor": "^1.3.0",
53+
"markdown-link-extractor": "^4.0.1",
5454
"md5": "^2.3.0",
5555
"minio": "^7.0.18",
5656
"nanoid": "^3.1.22",
@@ -71,7 +71,7 @@
7171
"react-split": "^2.0.9",
7272
"refractor": "^3.4.0",
7373
"remove-markdown": "^0.3.0",
74-
"rich-markdown-editor": "11.17.4-0",
74+
"@notea/rich-markdown-editor": "11.22.0",
7575
"rosetta": "^1.1.0",
7676
"styled-components": "^5.2.1",
7777
"ua-parser-js": "^0.7.24",
@@ -124,8 +124,8 @@
124124
"resolutions": {
125125
"lodash": "^4.17.21",
126126
"refractor": "^3.4.0",
127-
"prosemirror-model": "1.9.1",
128-
"@types/react": "17.0.39"
127+
"@types/react": "17.0.39",
128+
"prosemirror-model": "1.16.1"
129129
},
130130
"license": "MIT"
131131
}

0 commit comments

Comments
 (0)