Skip to content

Commit

Permalink
🔨 connect pm dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
winetree94 committed May 8, 2024
1 parent a44b8bf commit 2f8d8fd
Show file tree
Hide file tree
Showing 197 changed files with 361 additions and 571 deletions.
9 changes: 2 additions & 7 deletions packages/_wip_command/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@
"dependencies": {
"@edybara/core": "*",
"@edybara/mention": "*",
"@edybara/pm": "*",
"@edybara/tables": "*",
"@edybara/ui": "*",
"preact": "*",
"prosemirror-commands": "*",
"prosemirror-inputrules": "*",
"prosemirror-keymap": "*",
"prosemirror-model": "*",
"prosemirror-state": "*",
"prosemirror-view": "*"
"preact": "*"
},
"devDependencies": {
"rimraf": "^5.0.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/_wip_command/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Plugin, PluginKey, PluginView } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
import { Plugin, PluginKey, PluginView } from '@edybara/pm/state';
import { EditorView } from '@edybara/pm/view';

export interface EdybaraCommandPluginConfigs {
view?: (
Expand Down
4 changes: 2 additions & 2 deletions packages/_wip_command/src/views/command.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/unbound-method */
import { render } from 'preact';
import { EditorState, PluginKey } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
import { EditorState, PluginKey } from '@edybara/pm/state';
import { EditorView } from '@edybara/pm/view';
import { EdybaraCommandPluginState, EdybaraCommandPluginView } from '../plugin';
import { addMention } from '@edybara/mention';
import { insertTable } from '@edybara/tables';
Expand Down
4 changes: 1 addition & 3 deletions packages/_wip_emoji/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"types": "dist/index.d.ts",
"dependencies": {
"@edybara/core": "*",
"prosemirror-inputrules": "*",
"prosemirror-keymap": "*",
"prosemirror-model": "*"
"@edybara/pm": "*"
},
"devDependencies": {
"rimraf": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/_wip_emoji/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeSpec } from 'prosemirror-model';
import { NodeSpec } from '@edybara/pm/model';

export interface EmojiAttribute {
data_id: string;
Expand Down
6 changes: 2 additions & 4 deletions packages/_wip_image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
"types": "dist/index.d.ts",
"dependencies": {
"@edybara/core": "*",
"@edybara/pm": "*",
"@edybara/ui": "*",
"preact": "*",
"prosemirror-model": "*",
"prosemirror-state": "*",
"prosemirror-view": "*"
"preact": "*"
},
"devDependencies": {
"rimraf": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/_wip_image/src/commands.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EditorState } from 'prosemirror-state';
import { EditorState } from '@edybara/pm/state';
import { ImagePlaceholderSpec, imagePlaceholderPluginKey } from './placeholder';

export const findPlaceholderPos = (state: EditorState, id: string) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/_wip_image/src/image.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { NodeSpec } from 'prosemirror-model';
import { NodeSpec } from '@edybara/pm/model';
import {
createImagePlaceholderPlugin,
ImagePlaceholderViewProvider,
} from './placeholder';
import { EditorView } from 'prosemirror-view';
import { EditorView } from '@edybara/pm/view';

export interface ImageAttrs {
src: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/_wip_image/src/placeholder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Plugin, PluginKey } from 'prosemirror-state';
import { Decoration, DecorationSet, EditorView } from 'prosemirror-view';
import { Plugin, PluginKey } from '@edybara/pm/state';
import { Decoration, DecorationSet, EditorView } from '@edybara/pm/view';

export interface ImagePlaceholderSpec {
id: string;
Expand Down
7 changes: 2 additions & 5 deletions packages/_wip_mention/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
"types": "dist/index.d.ts",
"dependencies": {
"@edybara/core": "*",
"@edybara/pm": "*",
"@edybara/ui": "*",
"preact": "*",
"prosemirror-inputrules": "*",
"prosemirror-keymap": "*",
"prosemirror-model": "*",
"prosemirror-state": "*"
"preact": "*"
},
"devDependencies": {
"rimraf": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/_wip_mention/src/commands/add-mention.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from 'prosemirror-state';
import { Command } from '@edybara/pm/state';

/**
* To initiate a mention input, insert the @ character.
Expand Down
4 changes: 2 additions & 2 deletions packages/_wip_mention/src/plugins/command.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Plugin as PMPlugin, PluginKey, PluginView } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
import { Plugin as PMPlugin, PluginKey, PluginView } from '@edybara/pm/state';
import { EditorView } from '@edybara/pm/view';
import { getMentionRange } from '../utils';

export interface MentionPluginState {
Expand Down
4 changes: 2 additions & 2 deletions packages/_wip_mention/src/plugins/mention.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MarkType } from 'prosemirror-model';
import { Plugin as PMPlugin } from 'prosemirror-state';
import { MarkType } from '@edybara/pm/model';
import { Plugin as PMPlugin } from '@edybara/pm/state';
import {
EdybaraMentionCommandPluginConfigs,
edybaraMentionCommandPlugins,
Expand Down
2 changes: 1 addition & 1 deletion packages/_wip_mention/src/plugins/unset.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Plugin as PMPlugin } from 'prosemirror-state';
import { Plugin as PMPlugin } from '@edybara/pm/state';

/**
* Provides a feature to unmention when text with mention formatting is partially deleted.
Expand Down
2 changes: 1 addition & 1 deletion packages/_wip_mention/src/schemas/mention.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MarkSpec } from 'prosemirror-model';
import { MarkSpec } from '@edybara/pm/model';

export const EDIM_MENTION_DEFAULT_MARK_NAME = 'mention';

Expand Down
2 changes: 1 addition & 1 deletion packages/_wip_mention/src/utils/get-mention-range.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EditorState } from 'prosemirror-state';
import { EditorState } from '@edybara/pm/state';

export const KEYBOARD_KEY = {
SPACE: ' ',
Expand Down
4 changes: 2 additions & 2 deletions packages/_wip_mention/src/views/mention-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
classes,
html,
} from '@edybara/ui';
import { EditorState, PluginKey } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
import { EditorState, PluginKey } from '@edybara/pm/state';
import { EditorView } from '@edybara/pm/view';
import { render } from 'preact';
import { getMentionRange } from '../utils';
import { useEffect } from 'preact/hooks';
Expand Down
6 changes: 1 addition & 5 deletions packages/blockquote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
"types": "dist/index.d.ts",
"dependencies": {
"@edybara/core": "*",
"prosemirror-commands": "*",
"prosemirror-inputrules": "*",
"prosemirror-keymap": "*",
"prosemirror-model": "*",
"prosemirror-state": "*"
"@edybara/pm": "*"
},
"devDependencies": {
"rimraf": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/blockquote/src/commands/toggle-block-quote.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from 'prosemirror-state';
import { Command } from '@edybara/pm/state';
import { NodePair } from '@edybara/core';

export const toggleBlockquote = (): Command => {
Expand Down
4 changes: 2 additions & 2 deletions packages/blockquote/src/plugins/blockquote.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodeType } from 'prosemirror-model';
import { Plugin as PMPlugin } from 'prosemirror-state';
import { NodeType } from '@edybara/pm/model';
import { Plugin as PMPlugin } from '@edybara/pm/state';
import { edybaraBlockquoteInputRulePlugins } from './input-rules';
import { edybaraBlockquoteKeymapPlugins } from './keymaps';
import { edybaraBlockQuoteMergePlugins } from './merge';
Expand Down
4 changes: 2 additions & 2 deletions packages/blockquote/src/plugins/input-rules.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { inputRules, wrappingInputRule } from 'prosemirror-inputrules';
import { Plugin as PMPlugin } from 'prosemirror-state';
import { NodeType } from 'prosemirror-model';
import { Plugin as PMPlugin } from '@edybara/pm/state';
import { NodeType } from '@edybara/pm/model';

export interface EdybaraBlockquoteInputRulePluginConfigs {
nodeType: NodeType;
Expand Down
6 changes: 3 additions & 3 deletions packages/blockquote/src/plugins/keymaps.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Plugin as PMPlugin } from 'prosemirror-state';
import { NodeType } from 'prosemirror-model';
import { wrapIn } from 'prosemirror-commands';
import { Plugin as PMPlugin } from '@edybara/pm/state';
import { NodeType } from '@edybara/pm/model';
import { wrapIn } from '@edybara/pm/commands';
import { keymap } from 'prosemirror-keymap';

export interface EdybaraBlockquoteKeymapPluginConfigs {
Expand Down
4 changes: 2 additions & 2 deletions packages/blockquote/src/plugins/merge.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodeType } from 'prosemirror-model';
import { Plugin as PMPlugin } from 'prosemirror-state';
import { NodeType } from '@edybara/pm/model';
import { Plugin as PMPlugin } from '@edybara/pm/state';
import { edybaraMergeAdjacentNodePlugins } from '@edybara/core';

export interface EdybaraBlockQuoteMergePluginConfigs {
Expand Down
2 changes: 1 addition & 1 deletion packages/blockquote/src/schemas/block-quote.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeSpec } from 'prosemirror-model';
import { NodeSpec } from '@edybara/pm/model';

export const EDIM_BLOCKQUOTE_NODE_NAME = 'blockquote';

Expand Down
4 changes: 1 addition & 3 deletions packages/bold/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@
},
"dependencies": {
"@edybara/core": "*",
"prosemirror-commands": "*",
"prosemirror-keymap": "*",
"prosemirror-model": "*"
"@edybara/pm": "*"
},
"devDependencies": {
"rimraf": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/bold/src/plugins/bold.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MarkType } from 'prosemirror-model';
import { MarkType } from '@edybara/pm/model';
import { edybaraBoldKeymapPlugins } from './keymap';

export interface EdybaraBoldPluginConfigs {
Expand Down
4 changes: 2 additions & 2 deletions packages/bold/src/plugins/keymap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MarkType } from 'prosemirror-model';
import { MarkType } from '@edybara/pm/model';
import { keymap } from 'prosemirror-keymap';
import { toggleMark } from 'prosemirror-commands';
import { toggleMark } from '@edybara/pm/commands';

export interface EdybaraBoldKeymapPluginConfigs {
markType: MarkType;
Expand Down
2 changes: 1 addition & 1 deletion packages/bold/src/schemas/bold.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MarkSpec } from 'prosemirror-model';
import { MarkSpec } from '@edybara/pm/model';
import { BaseMarkConfigs } from '@edybara/core';

export const EDIM_BOLD_MARK_NAME = 'bold';
Expand Down
5 changes: 1 addition & 4 deletions packages/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
"types": "dist/index.d.ts",
"dependencies": {
"@edybara/core": "*",
"prosemirror-commands": "*",
"prosemirror-inputrules": "*",
"prosemirror-keymap": "*",
"prosemirror-model": "*"
"@edybara/pm": "*"
},
"devDependencies": {
"rimraf": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/code/src/plugins/code.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MarkType } from 'prosemirror-model';
import { MarkType } from '@edybara/pm/model';
import { edybaraCodeKeymapPlugins } from './keymap';
import { edybaraCodeInputRulePlugins } from './input-rules';

Expand Down
4 changes: 2 additions & 2 deletions packages/code/src/plugins/input-rules.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Plugin as PMPlugin } from 'prosemirror-state';
import { Plugin as PMPlugin } from '@edybara/pm/state';
import { InputRule, inputRules } from 'prosemirror-inputrules';
import { MarkType } from 'prosemirror-model';
import { MarkType } from '@edybara/pm/model';

export interface EdybaraCodeInputRulePluginConfigs {
markType: MarkType;
Expand Down
4 changes: 2 additions & 2 deletions packages/code/src/plugins/keymap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MarkType } from 'prosemirror-model';
import { MarkType } from '@edybara/pm/model';
import { keymap } from 'prosemirror-keymap';
import { toggleMark } from 'prosemirror-commands';
import { toggleMark } from '@edybara/pm/commands';

export interface EdybaraCodeKeymapPluginConfigs {
markType: MarkType;
Expand Down
2 changes: 1 addition & 1 deletion packages/code/src/schemas/code.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MarkSpec } from 'prosemirror-model';
import { MarkSpec } from '@edybara/pm/model';

export const EDIM_CODE_MARK_NAME = 'code';

Expand Down
7 changes: 1 addition & 6 deletions packages/codeblock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@
"types": "dist/index.d.ts",
"dependencies": {
"@edybara/core": "*",
"prosemirror-commands": "*",
"prosemirror-inputrules": "*",
"prosemirror-keymap": "*",
"prosemirror-model": "*",
"prosemirror-state": "*",
"prosemirror-utils": "*"
"@edybara/pm": "*"
},
"devDependencies": {
"rimraf": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/codeblock/src/plugins/codeblock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeType } from 'prosemirror-model';
import { NodeType } from '@edybara/pm/model';
import { edybaraCodeBlockInputRulePlugins } from './input-rules';
import { edybaraCodeBlockKeymapPlugins } from './keymap';
import { edybaraCodeBlockMergePlugins } from './merge';
Expand Down
4 changes: 2 additions & 2 deletions packages/codeblock/src/plugins/eject.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Plugin as PMPlugin, TextSelection } from 'prosemirror-state';
import { NodeType } from 'prosemirror-model';
import { Plugin as PMPlugin, TextSelection } from '@edybara/pm/state';
import { NodeType } from '@edybara/pm/model';
import { isInCodeBlock } from '../utils';
import { findParentNode } from 'prosemirror-utils';
import { keymap } from 'prosemirror-keymap';
Expand Down
2 changes: 1 addition & 1 deletion packages/codeblock/src/plugins/input-rules.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeType } from 'prosemirror-model';
import { NodeType } from '@edybara/pm/model';
import { inputRules, textblockTypeInputRule } from 'prosemirror-inputrules';

export interface EdybaraCodeBlockInputRulePluginConfigs {
Expand Down
4 changes: 2 additions & 2 deletions packages/codeblock/src/plugins/keymap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NodeType } from 'prosemirror-model';
import { NodeType } from '@edybara/pm/model';
import { keymap } from 'prosemirror-keymap';
import { setBlockType } from 'prosemirror-commands';
import { setBlockType } from '@edybara/pm/commands';

export interface EdybaraCodeBlockKeymapPluginConfigs {
nodeType: NodeType;
Expand Down
2 changes: 1 addition & 1 deletion packages/codeblock/src/plugins/merge.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeType } from 'prosemirror-model';
import { NodeType } from '@edybara/pm/model';
import { edybaraMergeAdjacentNodePlugins } from '@edybara/core';

export interface EdybaraCodeBlockMergePluginConfigs {
Expand Down
2 changes: 1 addition & 1 deletion packages/codeblock/src/schemas/code-block.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DOMOutputSpec, NodeSpec } from 'prosemirror-model';
import { DOMOutputSpec, NodeSpec } from '@edybara/pm/model';

export const EDIM_CODEBLOCK_NODE_NAME = 'code_block';

Expand Down
4 changes: 2 additions & 2 deletions packages/codeblock/src/utils/is-in-codeblock.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NodeType } from 'prosemirror-model';
import { EditorState } from 'prosemirror-state';
import { NodeType } from '@edybara/pm/model';
import { EditorState } from '@edybara/pm/state';

export const isInCodeBlock = (state: EditorState, nodeType: NodeType) => {
const $head = state.selection.$head;
Expand Down
12 changes: 1 addition & 11 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,7 @@
"style": "styles/core.scss",
"types": "dist/index.d.ts",
"dependencies": {
"prosemirror-commands": "*",
"prosemirror-dropcursor": "*",
"prosemirror-gapcursor": "*",
"prosemirror-history": "*",
"prosemirror-inputrules": "*",
"prosemirror-keymap": "*",
"prosemirror-model": "*",
"prosemirror-state": "*",
"prosemirror-transform": "*",
"prosemirror-utils": "*",
"prosemirror-view": "*"
"@edybara/pm": "*"
},
"devDependencies": {
"rimraf": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/commands/clear-marks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from 'prosemirror-state';
import { Command } from '@edybara/pm/state';

/**
* Remove all marks from the current selection
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/commands/set-text-align.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Command, Transaction } from 'prosemirror-state';
import { Command, Transaction } from '@edybara/pm/state';
import { NodePair } from '../types';
import { Attrs } from 'prosemirror-model';
import { Attrs } from '@edybara/pm/model';

export const TEXT_ALIGNMENT = {
LEFT: 'left',
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/commands/toggle-mark-with-attrs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Attrs, MarkType } from 'prosemirror-model';
import { Command, TextSelection } from 'prosemirror-state';
import { Attrs, MarkType } from '@edybara/pm/model';
import { Command, TextSelection } from '@edybara/pm/state';
import { isInMarks, markApplies } from '../utils';

/// Create a command function that toggles the given mark with the
Expand Down
Loading

0 comments on commit 2f8d8fd

Please sign in to comment.