Skip to content

Commit

Permalink
⚙️ docs - remove mention plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ila-park committed Mar 22, 2024
1 parent 93dd1aa commit 73ef3cd
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 33 deletions.
2 changes: 0 additions & 2 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@
"@edybara/font-family": "*",
"@edybara/heading": "*",
"@edybara/hr": "*",
"@edybara/image": "*",
"@edybara/italic": "*",
"@edybara/link": "*",
"@edybara/mention": "*",
"@edybara/menubar": "*",
"@edybara/paragraph": "*",
"@edybara/preset": "*",
Expand Down
2 changes: 0 additions & 2 deletions packages/docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@edybara/flat-list": ["../flat-list/src/index.ts"],
"@edybara/flat-task-list": ["../flat-task-list/src/index.ts"],
"@edybara/tables": ["../tables/src/index.ts"],
"@edybara/image": ["../image/src/index.ts"],
"@edybara/link": ["../link/src/index.ts"],
"@edybara/core": ["../core/src/index.ts"],
"@edybara/codeblock": ["../codeblock/src/index.ts"],
Expand All @@ -38,7 +37,6 @@
"@edybara/superscript": ["../superscript/src/index.ts"],
"@edybara/text-color": ["../text-color/src/index.ts"],
"@edybara/underline": ["../underline/src/index.ts"],
"@edybara/mention": ["../_wip_mention/src/index.ts"],
"@edybara/ui": ["../ui/src/index.ts"],
"@edybara/menubar": ["../menubar/src/index.ts"],
"@edybara/preset": ["../preset/src/index.ts"]
Expand Down
1 change: 0 additions & 1 deletion packages/preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@edybara/image": "*",
"@edybara/italic": "*",
"@edybara/link": "*",
"@edybara/mention": "*",
"@edybara/menubar": "*",
"@edybara/paragraph": "*",
"@edybara/strikethrough": "*",
Expand Down
30 changes: 15 additions & 15 deletions packages/preset/src/plugins/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ import {
EdybaraLinkPluginConfigs,
edybaraLinkPlugins,
} from '@edybara/link';
import {
EDIM_MENTION_DEFAULT_MARK_NAME,
EdybaraMentionPluginConfigs,
edybaraMentionPlugins,
} from '@edybara/mention';
// import {
// EDIM_MENTION_DEFAULT_MARK_NAME,
// EdybaraMentionPluginConfigs,
// edybaraMentionPlugins,
// } from '@edybara/mention';
import { EDIM_TEXT_COLOR_DEFAULT_MARK_NAME } from '@edybara/text-color';

/**
Expand Down Expand Up @@ -126,7 +126,7 @@ export interface EdybaraPresetPluginConfigs {
subscript?: EdybaraSubscriptPluginConfigs | null;
superscript?: EdybaraSuperscriptPluginConfigs | null;
link?: EdybaraLinkPluginConfigs | null;
mention?: EdybaraMentionPluginConfigs | null;
// mention?: EdybaraMentionPluginConfigs | null;

/**
* @default true
Expand Down Expand Up @@ -193,9 +193,9 @@ const getDefaultConfigs = (
link: {
markType: schema.marks[EDIM_LINK_DEFAULT_MARK_NAME],
},
mention: {
markType: schema.marks[EDIM_MENTION_DEFAULT_MARK_NAME],
},
// mention: {
// markType: schema.marks[EDIM_MENTION_DEFAULT_MARK_NAME],
// },
menubar: {
textType: {
paragraphNodeType: schema.nodes[EDIM_PARAGRAPH_DEFAULT_NODE_NAME],
Expand Down Expand Up @@ -242,9 +242,9 @@ const getDefaultConfigs = (
link: {
linkMarkType: schema.marks[EDIM_LINK_DEFAULT_MARK_NAME],
},
mention: {
mentionMarkType: schema.marks[EDIM_MENTION_DEFAULT_MARK_NAME],
},
// mention: {
// mentionMarkType: schema.marks[EDIM_MENTION_DEFAULT_MARK_NAME],
// },
},
};
};
Expand Down Expand Up @@ -323,9 +323,9 @@ export const edybaraPresetPlugins = (
plugins.push(...edybaraLinkPlugins(mergedConfigs.link));
}

if (mergedConfigs.mention) {
plugins.push(...edybaraMentionPlugins(mergedConfigs.mention));
}
// if (mergedConfigs.mention) {
// plugins.push(...edybaraMentionPlugins(mergedConfigs.mention));
// }

if (mergedConfigs.menubar) {
plugins.push(...edybaraMenubarPlugins(mergedConfigs.menubar));
Expand Down
26 changes: 16 additions & 10 deletions packages/preset/src/schemas/preset.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { MarkSpec, NodeSpec, Schema } from 'prosemirror-model';
import { edybaraBaseNodes } from '@edybara/core';
import { EdybaraHeadingNodeConfigs, edybaraHeadingNodes } from '@edybara/heading';
import {
EdybaraHeadingNodeConfigs,
edybaraHeadingNodes,
} from '@edybara/heading';
import {
EdybaraParagraphNodeConfigs,
edybaraParagraphNodes,
Expand Down Expand Up @@ -59,7 +62,10 @@ import {
EdybaraCodeBlockNodeConfigs,
edybaraCodeBlockNodes,
} from '@edybara/codeblock';
import { EdybaraMentionMarkConfigs, edybaraMentionMarks } from '@edybara/mention';
// import {
// EdybaraMentionMarkConfigs,
// edybaraMentionMarks,
// } from '@edybara/mention';
import { EdybaraTableNodeConfigs, edybaraTableNodes } from '@edybara/tables';

export interface EdybaraPresetSchemaConfigs {
Expand All @@ -85,7 +91,7 @@ export interface EdybaraPresetSchemaConfigs {
fontFamily?: EdybaraFontFamilyMarkConfigs | null;
textColor?: EdybaraTextColorMarkConfigs | null;
link?: EdybaraLinkMarkConfigs | null;
mention?: EdybaraMentionMarkConfigs | null;
// mention?: EdybaraMentionMarkConfigs | null;
}

const DEFAULT_CONFIGS: Required<EdybaraPresetSchemaConfigs> = {
Expand Down Expand Up @@ -117,7 +123,7 @@ const DEFAULT_CONFIGS: Required<EdybaraPresetSchemaConfigs> = {
fontFamily: {},
textColor: {},
link: {},
mention: {},
// mention: {},
};

export const edybaraPresetSchema = (configs?: EdybaraPresetSchemaConfigs) => {
Expand Down Expand Up @@ -283,12 +289,12 @@ export const edybaraPresetSchema = (configs?: EdybaraPresetSchemaConfigs) => {
};
}

if (mergedConfigs.mention) {
spec.marks = {
...spec.marks,
...edybaraMentionMarks(mergedConfigs.mention),
};
}
// if (mergedConfigs.mention) {
// spec.marks = {
// ...spec.marks,
// ...edybaraMentionMarks(mergedConfigs.mention),
// };
// }

return new Schema(spec);
};
3 changes: 0 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2643,7 +2643,6 @@ __metadata:
"@edybara/image": "npm:*"
"@edybara/italic": "npm:*"
"@edybara/link": "npm:*"
"@edybara/mention": "npm:*"
"@edybara/menubar": "npm:*"
"@edybara/paragraph": "npm:*"
"@edybara/strikethrough": "npm:*"
Expand Down Expand Up @@ -6296,10 +6295,8 @@ __metadata:
"@edybara/font-family": "npm:*"
"@edybara/heading": "npm:*"
"@edybara/hr": "npm:*"
"@edybara/image": "npm:*"
"@edybara/italic": "npm:*"
"@edybara/link": "npm:*"
"@edybara/mention": "npm:*"
"@edybara/menubar": "npm:*"
"@edybara/paragraph": "npm:*"
"@edybara/preset": "npm:*"
Expand Down

0 comments on commit 73ef3cd

Please sign in to comment.