@milkdown/plugin-slash 4.14.2 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -59
- package/lib/config.d.ts +20 -2
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +112 -81
- package/lib/config.js.map +1 -1
- package/lib/index.d.ts +22 -16
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +13 -18
- package/lib/index.js.map +1 -1
- package/lib/item.d.ts +2 -5
- package/lib/item.d.ts.map +1 -1
- package/lib/item.js +0 -2
- package/lib/item.js.map +1 -1
- package/lib/prose-plugin/dropdown.d.ts +6 -2
- package/lib/prose-plugin/dropdown.d.ts.map +1 -1
- package/lib/prose-plugin/dropdown.js +16 -23
- package/lib/prose-plugin/dropdown.js.map +1 -1
- package/lib/prose-plugin/index.d.ts +3 -4
- package/lib/prose-plugin/index.d.ts.map +1 -1
- package/lib/prose-plugin/index.js +4 -6
- package/lib/prose-plugin/index.js.map +1 -1
- package/lib/prose-plugin/input.d.ts +1 -2
- package/lib/prose-plugin/input.d.ts.map +1 -1
- package/lib/prose-plugin/input.js +18 -16
- package/lib/prose-plugin/input.js.map +1 -1
- package/lib/prose-plugin/props.d.ts +3 -3
- package/lib/prose-plugin/props.d.ts.map +1 -1
- package/lib/prose-plugin/props.js +21 -27
- package/lib/prose-plugin/props.js.map +1 -1
- package/lib/prose-plugin/status.d.ts +6 -12
- package/lib/prose-plugin/status.d.ts.map +1 -1
- package/lib/prose-plugin/status.js +16 -24
- package/lib/prose-plugin/status.js.map +1 -1
- package/lib/prose-plugin/view.d.ts +1 -2
- package/lib/prose-plugin/view.d.ts.map +1 -1
- package/lib/prose-plugin/view.js +6 -10
- package/lib/prose-plugin/view.js.map +1 -1
- package/lib/utility.d.ts +1 -2
- package/lib/utility.d.ts.map +1 -1
- package/lib/utility.js +0 -1
- package/lib/utility.js.map +1 -1
- package/package.json +3 -3
- package/src/config.ts +134 -82
- package/src/index.ts +17 -34
- package/src/item.ts +2 -7
- package/src/prose-plugin/dropdown.ts +22 -25
- package/src/prose-plugin/index.ts +7 -13
- package/src/prose-plugin/input.ts +19 -17
- package/src/prose-plugin/props.ts +26 -35
- package/src/prose-plugin/status.ts +19 -30
- package/src/prose-plugin/view.ts +6 -11
- package/src/utility.ts +1 -3
package/README.md
CHANGED
|
@@ -19,77 +19,60 @@ Editor.make().use(nord).use(commonmark).use(slash).create();
|
|
|
19
19
|
|
|
20
20
|
## config
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Configure the slash plugin placeholders & items with custom status builder.
|
|
23
23
|
|
|
24
24
|
Example:
|
|
25
25
|
|
|
26
26
|
```typescript
|
|
27
|
-
import { slashPlugin, slash, createDropdownItem,
|
|
27
|
+
import { slashPlugin, slash, createDropdownItem, defaultActions } from '@milkdown/plugin-slash';
|
|
28
|
+
import { themeToolCtx, commandsCtx } from '@milkdown/core';
|
|
28
29
|
|
|
29
30
|
Editor.make().use(
|
|
30
31
|
slash.configure(slashPlugin, {
|
|
31
|
-
config: (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
32
|
+
config: (ctx) => {
|
|
33
|
+
// Get default slash plugin items
|
|
34
|
+
const actions = defaultActions(ctx);
|
|
35
|
+
|
|
36
|
+
// Define a status builder
|
|
37
|
+
return ({ isTopLevel, content, parentNode }) => {
|
|
38
|
+
// You can only show something at root level
|
|
39
|
+
if (!isTopLevel) return null;
|
|
40
|
+
|
|
41
|
+
// Empty content ? Set your custom empty placeholder !
|
|
42
|
+
if (!content) {
|
|
43
|
+
return { placeholder: 'Type / to use the slash commands...' };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Define the placeholder & actions (dropdown items) you want to display depending on content
|
|
47
|
+
if (content.startsWith('/')) {
|
|
48
|
+
// Add some actions depending on your content's parent node
|
|
49
|
+
if (parentNode.type.name === 'customNode') {
|
|
50
|
+
actions.push({
|
|
51
|
+
id: 'custom',
|
|
52
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Custom', 'h1'),
|
|
53
|
+
command: () => ctx.get(commandsCtx).call(/* Add custom command here */),
|
|
54
|
+
keyword: ['custom'],
|
|
55
|
+
enable: () => true,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return content === '/'
|
|
60
|
+
? {
|
|
61
|
+
placeholder: 'Type to filter...',
|
|
62
|
+
actions,
|
|
63
|
+
}
|
|
64
|
+
: {
|
|
65
|
+
actions: actions.filter(({ keyword }) =>
|
|
66
|
+
keyword.some((key) => key.includes(content.slice(1).toLocaleLowerCase())),
|
|
67
|
+
),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
};
|
|
61
71
|
},
|
|
62
72
|
}),
|
|
63
73
|
);
|
|
64
74
|
```
|
|
65
75
|
|
|
66
|
-
## shouldDisplay
|
|
67
|
-
|
|
68
|
-
Control wether the slash dropdown list should be displayed.
|
|
69
|
-
|
|
70
|
-
Example:
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
import { slashPlugin, slash } from '@milkdown/plugin-slash';
|
|
74
|
-
|
|
75
|
-
Editor.make().use(
|
|
76
|
-
slash.configure(slashPlugin, {
|
|
77
|
-
shouldDisplay: (parent, state) => {
|
|
78
|
-
const noMoreThanOne = parent.node.childCount <= 1;
|
|
79
|
-
const isTopLevel = state.selection.$from.depth === 1;
|
|
80
|
-
return noMoreThanOne && isTopLevel;
|
|
81
|
-
},
|
|
82
|
-
}),
|
|
83
|
-
);
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
`shouldDisplay` will only be triggered when selection is in paragraph node.
|
|
87
|
-
|
|
88
|
-
- parent:
|
|
89
|
-
Paragraph node which holds the current text node.
|
|
90
|
-
- state:
|
|
91
|
-
Current editor state.
|
|
92
|
-
|
|
93
76
|
# License
|
|
94
77
|
|
|
95
78
|
Milkdown is open sourced software licensed under [MIT license](https://github.com/Saul-Mirone/milkdown/blob/main/LICENSE).
|
package/lib/config.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="prosemirror-model" />
|
|
2
|
+
import type { Ctx } from '@milkdown/ctx';
|
|
3
|
+
import { EditorState, Node } from '@milkdown/prose';
|
|
4
|
+
import { WrappedAction } from './item';
|
|
5
|
+
declare type Nullable<T> = T | null | undefined;
|
|
6
|
+
export declare type StatusConfig = {
|
|
7
|
+
placeholder?: Nullable<string>;
|
|
8
|
+
actions?: Nullable<WrappedAction[]>;
|
|
9
|
+
};
|
|
10
|
+
export declare type StatusConfigBuilderParams = {
|
|
11
|
+
content: string;
|
|
12
|
+
isTopLevel: boolean;
|
|
13
|
+
parentNode: Node;
|
|
14
|
+
state: EditorState;
|
|
15
|
+
};
|
|
16
|
+
export declare type StatusConfigBuilder = (params: StatusConfigBuilderParams) => Nullable<StatusConfig>;
|
|
17
|
+
export declare type Config = (ctx: Ctx) => StatusConfigBuilder;
|
|
18
|
+
export declare const defaultActions: (ctx: Ctx, input?: string) => WrappedAction[];
|
|
19
|
+
export declare const defaultConfig: Config;
|
|
20
|
+
export {};
|
|
3
21
|
//# sourceMappingURL=config.d.ts.map
|
package/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAYzC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGvC,aAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAExC,oBAAY,YAAY,GAAG;IACvB,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC;CACvC,CAAC;AAEF,oBAAY,yBAAyB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,IAAI,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,oBAAY,mBAAmB,GAAG,CAAC,MAAM,EAAE,yBAAyB,KAAK,QAAQ,CAAC,YAAY,CAAC,CAAC;AAEhG,oBAAY,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,mBAAmB,CAAC;AAEvD,eAAO,MAAM,cAAc,QAAS,GAAG,qBAAgB,aAAa,EAuFnE,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAqB3B,CAAC"}
|
package/lib/config.js
CHANGED
|
@@ -1,84 +1,115 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
1
2
|
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
|
-
import { commandsCtx, themeToolCtx } from '@milkdown/core';
|
|
3
|
+
import { commandsCtx, schemaCtx, themeToolCtx } from '@milkdown/core';
|
|
3
4
|
import { InsertHr, InsertImage, InsertTable, TurnIntoCodeFence, TurnIntoHeading, TurnIntoTaskList, WrapInBlockquote, WrapInBulletList, WrapInOrderedList, } from '@milkdown/preset-gfm';
|
|
4
|
-
import { createDropdownItem
|
|
5
|
-
export const
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
5
|
+
import { createDropdownItem } from './utility';
|
|
6
|
+
export const defaultActions = (ctx, input = '/') => {
|
|
7
|
+
const { nodes } = ctx.get(schemaCtx);
|
|
8
|
+
const actions = [
|
|
9
|
+
{
|
|
10
|
+
id: 'h1',
|
|
11
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Large Heading', 'h1'),
|
|
12
|
+
command: () => ctx.get(commandsCtx).call(TurnIntoHeading, 1),
|
|
13
|
+
keyword: ['h1', 'large heading'],
|
|
14
|
+
typeName: 'heading',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: 'h2',
|
|
18
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Medium Heading', 'h2'),
|
|
19
|
+
command: () => ctx.get(commandsCtx).call(TurnIntoHeading, 2),
|
|
20
|
+
keyword: ['h2', 'medium heading'],
|
|
21
|
+
typeName: 'heading',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'h3',
|
|
25
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Small Heading', 'h3'),
|
|
26
|
+
command: () => ctx.get(commandsCtx).call(TurnIntoHeading, 3),
|
|
27
|
+
keyword: ['h3', 'small heading'],
|
|
28
|
+
typeName: 'heading',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'bulletList',
|
|
32
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Bullet List', 'bulletList'),
|
|
33
|
+
command: () => ctx.get(commandsCtx).call(WrapInBulletList),
|
|
34
|
+
keyword: ['bullet list', 'ul'],
|
|
35
|
+
typeName: 'bullet_list',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'orderedList',
|
|
39
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Ordered List', 'orderedList'),
|
|
40
|
+
command: () => ctx.get(commandsCtx).call(WrapInOrderedList),
|
|
41
|
+
keyword: ['ordered list', 'ol'],
|
|
42
|
+
typeName: 'ordered_list',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'taskList',
|
|
46
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Task List', 'taskList'),
|
|
47
|
+
command: () => ctx.get(commandsCtx).call(TurnIntoTaskList),
|
|
48
|
+
keyword: ['task list', 'task'],
|
|
49
|
+
typeName: 'task_list_item',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 'image',
|
|
53
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Image', 'image'),
|
|
54
|
+
command: () => ctx.get(commandsCtx).call(InsertImage),
|
|
55
|
+
keyword: ['image'],
|
|
56
|
+
typeName: 'image',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'blockquote',
|
|
60
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Quote', 'quote'),
|
|
61
|
+
command: () => ctx.get(commandsCtx).call(WrapInBlockquote),
|
|
62
|
+
keyword: ['quote', 'blockquote'],
|
|
63
|
+
typeName: 'blockquote',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'table',
|
|
67
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Table', 'table'),
|
|
68
|
+
command: () => ctx.get(commandsCtx).call(InsertTable),
|
|
69
|
+
keyword: ['table'],
|
|
70
|
+
typeName: 'table',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'code',
|
|
74
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Code Fence', 'code'),
|
|
75
|
+
command: () => ctx.get(commandsCtx).call(TurnIntoCodeFence),
|
|
76
|
+
keyword: ['code'],
|
|
77
|
+
typeName: 'fence',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'divider',
|
|
81
|
+
dom: createDropdownItem(ctx.get(themeToolCtx), 'Divide Line', 'divider'),
|
|
82
|
+
command: () => ctx.get(commandsCtx).call(InsertHr),
|
|
83
|
+
keyword: ['divider', 'hr'],
|
|
84
|
+
typeName: 'hr',
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
const userInput = input.slice(1).toLocaleLowerCase();
|
|
88
|
+
return actions
|
|
89
|
+
.filter((action) => !!nodes[action.typeName] && action.keyword.some((keyword) => keyword.includes(userInput)))
|
|
90
|
+
.map((_a) => {
|
|
91
|
+
var { keyword, typeName } = _a, action = __rest(_a, ["keyword", "typeName"]);
|
|
92
|
+
return action;
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
export const defaultConfig = (ctx) => {
|
|
96
|
+
return ({ content, isTopLevel }) => {
|
|
97
|
+
if (!isTopLevel)
|
|
98
|
+
return null;
|
|
99
|
+
if (!content) {
|
|
100
|
+
return { placeholder: 'Type / to use the slash commands...' };
|
|
101
|
+
}
|
|
102
|
+
if (content.startsWith('/')) {
|
|
103
|
+
return content === '/'
|
|
104
|
+
? {
|
|
105
|
+
placeholder: 'Type to filter...',
|
|
106
|
+
actions: defaultActions(ctx),
|
|
107
|
+
}
|
|
108
|
+
: {
|
|
109
|
+
actions: defaultActions(ctx, content),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
84
115
|
//# sourceMappingURL=config.js.map
|
package/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";AAAA,yCAAyC;AACzC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EACH,QAAQ,EACR,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GACpB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAoB/C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAE,KAAK,GAAG,GAAG,EAAmB,EAAE;IACrE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,OAAO,GAAmE;QAC5E;YACI,EAAE,EAAE,IAAI;YACR,G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SAAS,CAAC,CAAC,CAAC;SAC7G,GAAG,CAAC,CAAC,EAAgC,EAAE,EAAE;YAApC,EAAE,OAAO,EAAE,QAAQ,OAAa,EAAR,MAAM,cAA9B,uBAAgC,CAAF;QAAO,OAAA,MAAM,CAAA;KAAA,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAW,CAAC,GAAG,EAAE,EAAE;IACzC,OAAO,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;QAC/B,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAE7B,IAAI,CAAC,OAAO,EAAE;YACV,OAAO,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;SACjE;QAED,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACzB,OAAO,OAAO,KAAK,GAAG;gBAClB,CAAC,CAAC;oBACI,WAAW,EAAE,mBAAmB;oBAChC,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC;iBAC/B;gBACH,CAAC,CAAC;oBACI,OAAO,EAAE,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC;iBACxC,CAAC;SACX;QAED,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
export { CursorStatus } from './prose-plugin/status';
|
|
7
|
-
export { createDropdownItem, nodeExists } from './utility';
|
|
8
|
-
export declare type SlashConfig = (utils: Utils) => WrappedAction[];
|
|
1
|
+
import { AtomList } from '@milkdown/utils';
|
|
2
|
+
import type { Config } from './config';
|
|
3
|
+
export type { Config, StatusConfig, StatusConfigBuilder, StatusConfigBuilderParams } from './config';
|
|
4
|
+
export { defaultActions, defaultConfig } from './config';
|
|
5
|
+
export { createDropdownItem } from './utility';
|
|
9
6
|
export declare type Options = {
|
|
10
|
-
|
|
11
|
-
config: SlashConfig;
|
|
12
|
-
placeholder: {
|
|
13
|
-
[CursorStatus.Empty]: string;
|
|
14
|
-
[CursorStatus.Slash]: string;
|
|
15
|
-
};
|
|
7
|
+
config: Config;
|
|
16
8
|
};
|
|
17
|
-
export declare const slashPlugin: import("@milkdown/utils/lib/types").
|
|
18
|
-
|
|
9
|
+
export declare const slashPlugin: import("@milkdown/utils/lib/types").WithExtend<string, Options, {
|
|
10
|
+
[x: string]: import("prosemirror-model").NodeType<any>;
|
|
11
|
+
} & {
|
|
12
|
+
[x: string]: import("prosemirror-model").MarkType<any>;
|
|
13
|
+
}, {
|
|
14
|
+
schema?: ((ctx: import("@milkdown/ctx").Ctx) => {
|
|
15
|
+
node?: Record<string, import("@milkdown/core").NodeSchema> | undefined;
|
|
16
|
+
mark?: Record<string, import("@milkdown/core").MarkSchema> | undefined;
|
|
17
|
+
}) | undefined;
|
|
18
|
+
view?: ((ctx: import("@milkdown/ctx").Ctx) => Partial<{
|
|
19
|
+
[x: string]: import("@milkdown/prose").NodeViewFactory;
|
|
20
|
+
} & {
|
|
21
|
+
[x: string]: import("@milkdown/prose").MarkViewFactory;
|
|
22
|
+
}>) | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const slash: AtomList<import("@milkdown/utils/lib/types").Metadata<import("@milkdown/utils/lib/types").GetPlugin<string, Options>> & import("@milkdown/ctx").MilkdownPlugin>;
|
|
19
25
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAgB,MAAM,iBAAiB,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIvC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrG,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,oBAAY,OAAO,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;EAYtB,CAAC;AAEH,eAAO,MAAM,KAAK,iKAAmC,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
|
+
import { AtomList, createPlugin } from '@milkdown/utils';
|
|
3
|
+
import { defaultConfig } from './config';
|
|
3
4
|
import { createSlashPlugin } from './prose-plugin';
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _a, _b, _c;
|
|
10
|
-
const slashConfig = (_a = options === null || options === void 0 ? void 0 : options.config) !== null && _a !== void 0 ? _a : config;
|
|
11
|
-
const placeholder = Object.assign({ [CursorStatus.Empty]: 'Type / to use the slash commands...', [CursorStatus.Slash]: 'Type to filter...' }, ((_b = options === null || options === void 0 ? void 0 : options.placeholder) !== null && _b !== void 0 ? _b : {}));
|
|
12
|
-
const cfg = slashConfig(utils);
|
|
13
|
-
const shouldDisplay = (_c = options === null || options === void 0 ? void 0 : options.shouldDisplay) !== null && _c !== void 0 ? _c : ((parent, state) => {
|
|
14
|
-
const isTopLevel = state.selection.$from.depth === 1;
|
|
15
|
-
return parent.node.childCount <= 1 && isTopLevel;
|
|
16
|
-
});
|
|
17
|
-
const plugin = createSlashPlugin(utils, cfg, placeholder, shouldDisplay);
|
|
5
|
+
export { defaultActions, defaultConfig } from './config';
|
|
6
|
+
export { createDropdownItem } from './utility';
|
|
7
|
+
export const slashPlugin = createPlugin((utils, options) => {
|
|
8
|
+
var _a;
|
|
9
|
+
const slashConfig = (_a = options === null || options === void 0 ? void 0 : options.config) !== null && _a !== void 0 ? _a : defaultConfig;
|
|
18
10
|
return {
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
prosePlugins: (_, ctx) => {
|
|
12
|
+
const config = slashConfig(ctx);
|
|
13
|
+
const plugin = createSlashPlugin(utils, config);
|
|
14
|
+
return [plugin];
|
|
15
|
+
},
|
|
21
16
|
};
|
|
22
17
|
});
|
|
23
18
|
export const slash = AtomList.create([slashPlugin()]);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAM/C,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;;IACxE,MAAM,WAAW,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,aAAa,CAAC;IAErD,OAAO;QACH,YAAY,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;YACrB,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;YAEhC,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAEhD,OAAO,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC;KACJ,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC"}
|
package/lib/item.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type { Command
|
|
1
|
+
import type { Command } from '@milkdown/prose';
|
|
2
2
|
export declare type Action = {
|
|
3
3
|
id: string;
|
|
4
4
|
$: HTMLElement;
|
|
5
|
-
keyword: string[];
|
|
6
5
|
command: Command;
|
|
7
|
-
enable: (schema: Schema) => boolean;
|
|
8
6
|
};
|
|
9
|
-
export declare type WrappedAction = Pick<Action, '
|
|
10
|
-
enable: (schema: Schema) => boolean;
|
|
7
|
+
export declare type WrappedAction = Pick<Action, 'id'> & {
|
|
11
8
|
command: () => void;
|
|
12
9
|
dom: HTMLElement;
|
|
13
10
|
};
|
package/lib/item.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../src/item.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../src/item.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAI/C,oBAAY,MAAM,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,WAAW,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,oBAAY,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG;IAC7C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,GAAG,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,eAAe,WAAY,aAAa,KAAG,MAItD,CAAC"}
|
package/lib/item.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { cleanUpAndCreateNode } from './utility';
|
|
2
2
|
export const transformAction = (action) => ({
|
|
3
3
|
id: action.id,
|
|
4
|
-
keyword: action.keyword,
|
|
5
4
|
$: action.dom,
|
|
6
5
|
command: cleanUpAndCreateNode(action.command),
|
|
7
|
-
enable: action.enable,
|
|
8
6
|
});
|
|
9
7
|
//# sourceMappingURL=item.js.map
|
package/lib/item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sourceRoot":"","sources":["../src/item.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"item.js","sourceRoot":"","sources":["../src/item.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAajD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAqB,EAAU,EAAE,CAAC,CAAC;IAC/D,EAAE,EAAE,MAAM,CAAC,EAAE;IACb,CAAC,EAAE,MAAM,CAAC,GAAG;IACb,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC;CAChD,CAAC,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { Action } from '../item';
|
|
2
1
|
import { Status } from './status';
|
|
3
|
-
|
|
2
|
+
declare type Listeners = {
|
|
3
|
+
mouseEnter: EventListener;
|
|
4
|
+
mouseLeave: EventListener;
|
|
5
|
+
};
|
|
6
|
+
export declare const renderDropdown: (status: Status, dropdownElement: HTMLElement, listeners: Listeners) => boolean;
|
|
7
|
+
export {};
|
|
4
8
|
//# sourceMappingURL=dropdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/prose-plugin/dropdown.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/prose-plugin/dropdown.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,aAAK,SAAS,GAAG;IACb,UAAU,EAAE,aAAa,CAAC;IAC1B,UAAU,EAAE,aAAa,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,cAAc,WAAY,MAAM,mBAAmB,WAAW,aAAa,SAAS,KAAG,OAmCnG,CAAC"}
|
|
@@ -1,34 +1,27 @@
|
|
|
1
1
|
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
2
|
import scrollIntoView from 'smooth-scroll-into-view-if-needed';
|
|
3
|
-
export const renderDropdown = (status, dropdownElement,
|
|
4
|
-
const {
|
|
5
|
-
if (!
|
|
3
|
+
export const renderDropdown = (status, dropdownElement, listeners) => {
|
|
4
|
+
const { actions } = status.get();
|
|
5
|
+
if (!actions.length) {
|
|
6
6
|
dropdownElement.classList.add('hide');
|
|
7
7
|
return false;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
.
|
|
20
|
-
item.$.classList.remove('hide');
|
|
21
|
-
return item;
|
|
9
|
+
dropdownElement.childNodes.forEach((child) => {
|
|
10
|
+
child.removeEventListener('mouseenter', listeners.mouseEnter);
|
|
11
|
+
child.removeEventListener('mouseleave', listeners.mouseLeave);
|
|
12
|
+
});
|
|
13
|
+
// Reset dropdownElement children
|
|
14
|
+
dropdownElement.textContent = '';
|
|
15
|
+
actions.forEach(({ $ }) => {
|
|
16
|
+
$.classList.remove('active');
|
|
17
|
+
$.addEventListener('mouseenter', listeners.mouseEnter);
|
|
18
|
+
$.addEventListener('mouseleave', listeners.mouseLeave);
|
|
19
|
+
dropdownElement.appendChild($);
|
|
22
20
|
});
|
|
23
|
-
status.setActions(activeList);
|
|
24
|
-
if (activeList.length === 0) {
|
|
25
|
-
dropdownElement.classList.add('hide');
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
21
|
dropdownElement.classList.remove('hide');
|
|
29
|
-
|
|
22
|
+
actions[0].$.classList.add('active');
|
|
30
23
|
requestAnimationFrame(() => {
|
|
31
|
-
scrollIntoView(
|
|
24
|
+
scrollIntoView(actions[0].$, {
|
|
32
25
|
scrollMode: 'if-needed',
|
|
33
26
|
block: 'nearest',
|
|
34
27
|
inline: 'nearest',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../src/prose-plugin/dropdown.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,cAAc,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../src/prose-plugin/dropdown.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,cAAc,MAAM,mCAAmC,CAAC;AAS/D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,eAA4B,EAAE,SAAoB,EAAW,EAAE;IAC1G,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;IAEjC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QACjB,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO,KAAK,CAAC;KAChB;IAED,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACzC,KAAK,CAAC,mBAAmB,CAAC,YAAY,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;QAC9D,KAAK,CAAC,mBAAmB,CAAC,YAAY,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,iCAAiC;IACjC,eAAe,CAAC,WAAW,GAAG,EAAE,CAAC;IAEjC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE;QACtB,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC,CAAC,gBAAgB,CAAC,YAAY,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;QACvD,CAAC,CAAC,gBAAgB,CAAC,YAAY,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;QACvD,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEzC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrC,qBAAqB,CAAC,GAAG,EAAE;QACvB,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YACzB,UAAU,EAAE,WAAW;YACvB,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,SAAS;SACpB,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Plugin } from '@milkdown/prose';
|
|
2
2
|
import { Utils } from '@milkdown/utils';
|
|
3
|
-
import {
|
|
4
|
-
import { CursorStatus } from './status';
|
|
3
|
+
import type { StatusConfigBuilder } from '..';
|
|
5
4
|
export declare const key = "MILKDOWN_PLUGIN_SLASH";
|
|
6
|
-
export declare const createSlashPlugin: (utils: Utils,
|
|
5
|
+
export declare const createSlashPlugin: (utils: Utils, builder: StatusConfigBuilder) => Plugin<any, any>;
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prose-plugin/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prose-plugin/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAa,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,IAAI,CAAC;AAK9C,eAAO,MAAM,GAAG,0BAA0B,CAAC;AAE3C,eAAO,MAAM,iBAAiB,UAAW,KAAK,WAAW,mBAAmB,qBAQ3E,CAAC"}
|