Skip to content

Commit

Permalink
wip: refactor list (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue authored Feb 16, 2023
1 parent c94dcc1 commit 5d8646d
Show file tree
Hide file tree
Showing 17 changed files with 179 additions and 774 deletions.
6 changes: 6 additions & 0 deletions .changeset/early-beans-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rino.app/editor": minor
"@rino.app/electron": minor
---

Rewrite list
3 changes: 2 additions & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"@remirror/extension-hard-break": "^2.0.11",
"@remirror/extension-heading": "^2.0.11",
"@remirror/extension-horizontal-rule": "^2.0.11",
"@remirror/extension-list": "^2.0.14",
"@remirror/extension-paragraph": "^2.0.11",
"@remirror/extension-placeholder": "^2.0.12",
"@remirror/extension-react-component": "^2.0.11",
Expand All @@ -66,9 +65,11 @@
"mdast-util-gfm-strikethrough": "^1.0.3",
"micromark-extension-gfm-autolink-literal": "^1.0.3",
"micromark-extension-gfm-strikethrough": "^1.0.4",
"prosemirror-flat-list": "^0.0.16",
"prosemirror-tables": "^1.3.2",
"prosemirror-view": "^1.30.1",
"remirror": "^2.0.24",
"remirror-extension-flat-list": "^0.0.16",
"unstated-next": "^1.1.0"
},
"peerDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions packages/editor/src/components/theme/base.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import "prosemirror-flat-list/dist/style.css"

import { css } from "@emotion/css"
import { extensionListStyledCss } from "@remirror/styles/emotion"

export const EDITOR_THEME_BASE = css`
${extensionListStyledCss}
/**
* disable margin-collapsing https://stackoverflow.com/a/19719427
*/
Expand Down
19 changes: 3 additions & 16 deletions packages/editor/src/components/wysiwyg/wysiwyg-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,25 @@ import type { TextExtension } from "@remirror/extension-text"
import { CorePreset, corePreset } from "@remirror/preset-core"

import {
type MarkdownNodeExtension,
buildCodeMirrorOptions,
RinoBlockquoteExtension,
RinoBulletListExtension,
RinoCodeMirrorExtension,
RinoFileExtension,
RinoHardBreakExtension,
RinoHeadingExtension,
RinoHorizontalRuleExtension,
RinoInlineDecorationExtension,
RinoInlineMarkExtension,
RinoListItemExtension,
RinoListItemSharedExtension,
RinoListExtension,
RinoMarkExtension,
rinoMarkExtensions,
RinoOrderedListExtension,
RinoParagraphExtension,
RinoTableCellExtension,
RinoTableExtension,
RinoTableHeaderCellExtension,
RinoTableRowExtension,
RinoTaskListExtension,
RinoTaskListItemExtension,
RinoTextExtension,
type MarkdownNodeExtension,
} from "../../extensions"
import { WysiwygOptions } from "../types"

Expand All @@ -50,13 +45,7 @@ function createRinoMarkdownNodeExtensions() {
new RinoCodeMirrorExtension(buildCodeMirrorOptions({ onlyMarkdown: false })),
new RinoBlockquoteExtension(),
new RinoHeadingExtension({}),

new RinoTaskListExtension(),
new RinoTaskListItemExtension(),
new RinoListItemExtension({}),
new RinoBulletListExtension({}),
new RinoOrderedListExtension(),

new RinoListExtension(),
new RinoTableExtension(),
new RinoTableRowExtension(),
new RinoTableCellExtension(),
Expand All @@ -76,7 +65,6 @@ export type WysiwygExtension =
| FindExtension
| RinoInlineMarkExtension
| RinoInlineDecorationExtension
| RinoListItemSharedExtension
| RinoFileExtension

export function createWysiwygExtension({ imageFileHandler }: WysiwygOptions): Array<WysiwygExtension> {
Expand All @@ -103,7 +91,6 @@ export function createWysiwygExtension({ imageFileHandler }: WysiwygOptions): Ar
new FindExtension(),
new RinoInlineMarkExtension(),
new RinoInlineDecorationExtension(),
new RinoListItemSharedExtension(),
new RinoFileExtension({ imageFileHandler }),
]
}
2 changes: 1 addition & 1 deletion packages/editor/src/extensions/list/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./list-extension"
export * from "./rino-list-extensions"
235 changes: 0 additions & 235 deletions packages/editor/src/extensions/list/list-extension.ts

This file was deleted.

Loading

0 comments on commit 5d8646d

Please sign in to comment.