@milkdown/plugin-slash 5.1.0 → 5.2.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/lib/index.cjs.js +69 -0
- package/lib/index.cjs.js.map +1 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.es.js +516 -0
- package/lib/index.es.js.map +1 -0
- package/package.json +18 -8
- package/lib/config.js +0 -115
- package/lib/config.js.map +0 -1
- package/lib/index.js +0 -19
- package/lib/index.js.map +0 -1
- package/lib/item.js +0 -7
- package/lib/item.js.map +0 -1
- package/lib/prose-plugin/dropdown.js +0 -32
- package/lib/prose-plugin/dropdown.js.map +0 -1
- package/lib/prose-plugin/index.js +0 -15
- package/lib/prose-plugin/index.js.map +0 -1
- package/lib/prose-plugin/input.js +0 -103
- package/lib/prose-plugin/input.js.map +0 -1
- package/lib/prose-plugin/props.js +0 -72
- package/lib/prose-plugin/props.js.map +0 -1
- package/lib/prose-plugin/status.js +0 -26
- package/lib/prose-plugin/status.js.map +0 -1
- package/lib/prose-plugin/view.js +0 -52
- package/lib/prose-plugin/view.js.map +0 -1
- package/lib/style.js +0 -62
- package/lib/style.js.map +0 -1
- package/lib/utility.js +0 -50
- package/lib/utility.js.map +0 -1
package/lib/config.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
|
-
/* Copyright 2021, Milkdown by Mirone. */
|
|
3
|
-
import { commandsCtx, schemaCtx, themeToolCtx } from '@milkdown/core';
|
|
4
|
-
import { InsertHr, InsertImage, InsertTable, TurnIntoCodeFence, TurnIntoHeading, TurnIntoTaskList, WrapInBlockquote, WrapInBulletList, WrapInOrderedList, } from '@milkdown/preset-gfm';
|
|
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
|
-
};
|
|
115
|
-
//# sourceMappingURL=config.js.map
|
package/lib/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,GAAG,E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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.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
|
-
import { AtomList, createPlugin } from '@milkdown/utils';
|
|
3
|
-
import { defaultConfig } from './config';
|
|
4
|
-
import { createSlashPlugin } from './prose-plugin';
|
|
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;
|
|
10
|
-
return {
|
|
11
|
-
prosePlugins: (_, ctx) => {
|
|
12
|
-
const config = slashConfig(ctx);
|
|
13
|
-
const plugin = createSlashPlugin(utils, config);
|
|
14
|
-
return [plugin];
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
export const slash = AtomList.create([slashPlugin()]);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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.js
DELETED
package/lib/item.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,32 +0,0 @@
|
|
|
1
|
-
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
|
-
import scrollIntoView from 'smooth-scroll-into-view-if-needed';
|
|
3
|
-
export const renderDropdown = (status, dropdownElement, listeners) => {
|
|
4
|
-
const { actions } = status.get();
|
|
5
|
-
if (!actions.length) {
|
|
6
|
-
dropdownElement.classList.add('hide');
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
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($);
|
|
20
|
-
});
|
|
21
|
-
dropdownElement.classList.remove('hide');
|
|
22
|
-
actions[0].$.classList.add('active');
|
|
23
|
-
requestAnimationFrame(() => {
|
|
24
|
-
scrollIntoView(actions[0].$, {
|
|
25
|
-
scrollMode: 'if-needed',
|
|
26
|
-
block: 'nearest',
|
|
27
|
-
inline: 'nearest',
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
return true;
|
|
31
|
-
};
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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,15 +0,0 @@
|
|
|
1
|
-
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
|
-
import { Plugin, PluginKey } from '@milkdown/prose';
|
|
3
|
-
import { createProps } from './props';
|
|
4
|
-
import { createStatus } from './status';
|
|
5
|
-
import { createView } from './view';
|
|
6
|
-
export const key = 'MILKDOWN_PLUGIN_SLASH';
|
|
7
|
-
export const createSlashPlugin = (utils, builder) => {
|
|
8
|
-
const status = createStatus(builder);
|
|
9
|
-
return new Plugin({
|
|
10
|
-
key: new PluginKey(key),
|
|
11
|
-
props: createProps(status, utils),
|
|
12
|
-
view: (view) => createView(status, view, utils),
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prose-plugin/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIpD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,CAAC,MAAM,GAAG,GAAG,uBAAuB,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAY,EAAE,OAA4B,EAAE,EAAE;IAC5E,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAErC,OAAO,IAAI,MAAM,CAAC;QACd,GAAG,EAAE,IAAI,SAAS,CAAC,GAAG,CAAC;QACvB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC;QACjC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC;KAClD,CAAC,CAAC;AACP,CAAC,CAAC"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
|
-
import scrollIntoView from 'smooth-scroll-into-view-if-needed';
|
|
3
|
-
export const createMouseManager = () => {
|
|
4
|
-
let mouseLock = false;
|
|
5
|
-
return {
|
|
6
|
-
isLock: () => mouseLock,
|
|
7
|
-
lock: () => {
|
|
8
|
-
mouseLock = true;
|
|
9
|
-
},
|
|
10
|
-
unlock: () => {
|
|
11
|
-
mouseLock = false;
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export const handleMouseMove = (mouseManager) => () => {
|
|
16
|
-
mouseManager.unlock();
|
|
17
|
-
};
|
|
18
|
-
export const handleMouseEnter = (status, mouseManager) => (e) => {
|
|
19
|
-
if (mouseManager.isLock())
|
|
20
|
-
return;
|
|
21
|
-
const { actions } = status.get();
|
|
22
|
-
const active = actions.findIndex((x) => x.$.classList.contains('active'));
|
|
23
|
-
if (active >= 0) {
|
|
24
|
-
actions[active].$.classList.remove('active');
|
|
25
|
-
}
|
|
26
|
-
const { target } = e;
|
|
27
|
-
if (!(target instanceof HTMLElement))
|
|
28
|
-
return;
|
|
29
|
-
target.classList.add('active');
|
|
30
|
-
};
|
|
31
|
-
export const handleMouseLeave = () => (e) => {
|
|
32
|
-
const { target } = e;
|
|
33
|
-
if (!(target instanceof HTMLElement))
|
|
34
|
-
return;
|
|
35
|
-
target.classList.remove('active');
|
|
36
|
-
};
|
|
37
|
-
export const handleClick = (status, view, dropdownElement) => (e) => {
|
|
38
|
-
const { target } = e;
|
|
39
|
-
if (!(target instanceof HTMLElement))
|
|
40
|
-
return;
|
|
41
|
-
if (!view)
|
|
42
|
-
return;
|
|
43
|
-
const stop = () => {
|
|
44
|
-
e.stopPropagation();
|
|
45
|
-
e.preventDefault();
|
|
46
|
-
};
|
|
47
|
-
const { actions } = status.get();
|
|
48
|
-
const el = Object.values(actions).find(({ $ }) => $.contains(target));
|
|
49
|
-
if (!el) {
|
|
50
|
-
if (status.isEmpty())
|
|
51
|
-
return;
|
|
52
|
-
status.clear();
|
|
53
|
-
dropdownElement.classList.add('hide');
|
|
54
|
-
stop();
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
stop();
|
|
58
|
-
el.command(view.state, view.dispatch, view);
|
|
59
|
-
};
|
|
60
|
-
export const handleKeydown = (status, view, dropdownElement, mouseManager) => (e) => {
|
|
61
|
-
if (!(e instanceof KeyboardEvent))
|
|
62
|
-
return;
|
|
63
|
-
if (!mouseManager.isLock())
|
|
64
|
-
mouseManager.lock();
|
|
65
|
-
const { key } = e;
|
|
66
|
-
if (status.isEmpty())
|
|
67
|
-
return;
|
|
68
|
-
if (!['ArrowDown', 'ArrowUp', 'Enter', 'Escape'].includes(key))
|
|
69
|
-
return;
|
|
70
|
-
const { actions } = status.get();
|
|
71
|
-
let active = actions.findIndex(({ $ }) => $.classList.contains('active'));
|
|
72
|
-
if (active < 0)
|
|
73
|
-
active = 0;
|
|
74
|
-
const moveActive = (next) => {
|
|
75
|
-
actions[active].$.classList.remove('active');
|
|
76
|
-
actions[next].$.classList.add('active');
|
|
77
|
-
scrollIntoView(actions[next].$, {
|
|
78
|
-
scrollMode: 'if-needed',
|
|
79
|
-
block: 'nearest',
|
|
80
|
-
inline: 'nearest',
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
if (key === 'ArrowDown') {
|
|
84
|
-
const next = active === actions.length - 1 ? 0 : active + 1;
|
|
85
|
-
moveActive(next);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (key === 'ArrowUp') {
|
|
89
|
-
const next = active === 0 ? actions.length - 1 : active - 1;
|
|
90
|
-
moveActive(next);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
if (key === 'Escape') {
|
|
94
|
-
if (status.isEmpty())
|
|
95
|
-
return;
|
|
96
|
-
status.clear();
|
|
97
|
-
dropdownElement.classList.add('hide');
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
actions[active].command(view.state, view.dispatch, view);
|
|
101
|
-
actions[active].$.classList.remove('active');
|
|
102
|
-
};
|
|
103
|
-
//# sourceMappingURL=input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/prose-plugin/input.ts"],"names":[],"mappings":"AAAA,yCAAyC;AAGzC,OAAO,cAAc,MAAM,mCAAmC,CAAC;AAI/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,OAAO;QACH,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS;QACvB,IAAI,EAAE,GAAG,EAAE;YACP,SAAS,GAAG,IAAI,CAAC;QACrB,CAAC;QACD,MAAM,EAAE,GAAG,EAAE;YACT,SAAS,GAAG,KAAK,CAAC;QACtB,CAAC;KACJ,CAAC;AACN,CAAC,CAAC;AAGF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,YAA0B,EAAE,EAAE,CAAC,GAAG,EAAE;IAChE,YAAY,CAAC,MAAM,EAAE,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,YAA0B,EAAE,EAAE,CAAC,CAAC,CAAa,EAAE,EAAE;IAC9F,IAAI,YAAY,CAAC,MAAM,EAAE;QAAE,OAAO;IAClC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAA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,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjD,CAAC,CAAC"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
|
-
import { css } from '@emotion/css';
|
|
3
|
-
import { Decoration, DecorationSet, findParentNode } from '@milkdown/prose';
|
|
4
|
-
const createEmptyStyle = ({ font, palette }) => css `
|
|
5
|
-
position: relative;
|
|
6
|
-
&::before {
|
|
7
|
-
position: absolute;
|
|
8
|
-
cursor: text;
|
|
9
|
-
font-family: ${font.typography};
|
|
10
|
-
font-size: 0.875rem;
|
|
11
|
-
color: ${palette('neutral', 0.6)};
|
|
12
|
-
content: attr(data-text);
|
|
13
|
-
height: 100%;
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
const createSlashStyle = () => css `
|
|
19
|
-
&::before {
|
|
20
|
-
left: 0.5rem;
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
export const createProps = (status, utils) => {
|
|
24
|
-
const emptyStyle = utils.getStyle(createEmptyStyle);
|
|
25
|
-
const slashStyle = utils.getStyle(createSlashStyle);
|
|
26
|
-
return {
|
|
27
|
-
handleKeyDown: (_, event) => {
|
|
28
|
-
if (status.isEmpty()) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
if (!(event instanceof KeyboardEvent)) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
if (!['ArrowUp', 'ArrowDown', 'Enter'].includes(event.key)) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
return true;
|
|
38
|
-
},
|
|
39
|
-
decorations: (state) => {
|
|
40
|
-
const paragraph = findParentNode(({ type }) => type.name === 'paragraph')(state.selection);
|
|
41
|
-
if (!paragraph ||
|
|
42
|
-
paragraph.node.childCount > 1 ||
|
|
43
|
-
state.selection.$from.parentOffset !== paragraph.node.textContent.length) {
|
|
44
|
-
status.clear();
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const { placeholder, actions } = status.update({
|
|
48
|
-
parentNode: state.selection.$from.node(state.selection.$from.depth - 1),
|
|
49
|
-
isTopLevel: state.selection.$from.depth === 1,
|
|
50
|
-
content: paragraph.node.textContent,
|
|
51
|
-
state,
|
|
52
|
-
});
|
|
53
|
-
if (!placeholder) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
const createDecoration = (text, className) => {
|
|
57
|
-
const pos = paragraph.pos;
|
|
58
|
-
return DecorationSet.create(state.doc, [
|
|
59
|
-
Decoration.node(pos, pos + paragraph.node.nodeSize, {
|
|
60
|
-
class: className.filter((x) => x).join(' '),
|
|
61
|
-
'data-text': text,
|
|
62
|
-
}),
|
|
63
|
-
]);
|
|
64
|
-
};
|
|
65
|
-
if (actions.length) {
|
|
66
|
-
return createDecoration(placeholder, [emptyStyle, slashStyle, 'empty-node', 'is-slash']);
|
|
67
|
-
}
|
|
68
|
-
return createDecoration(placeholder, [emptyStyle, 'empty-node']);
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=props.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../src/prose-plugin/props.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,aAAa,EAA2B,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAOrG,MAAM,gBAAgB,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAa,EAAE,EAAE,CAAC,GAAG,CAAA;;;;;uBAKvC,IAAI,CAAC,UAAU;;iBAErB,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;;;;;;CAMvC,CAAC;AAEF,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,GAAG,C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KAAK,GAAG,CAAC,CAAC;gBACvE,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;gBAC7C,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,WAAW;gBACnC,KAAK;aACR,CAAC,CAAC;YAEH,IAAI,CAAC,WAAW,EAAE;gBACd,OAAO,IAAI,CAAC;aACf;YAED,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,SAAiC,EAAE,EAAE;gBACzE,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC;gBAC1B,OAAO,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;oBACnC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE;wBAChD,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;wBAC3C,WAAW,EAAE,IAAI;qBACpB,CAAC;iBACL,CAAC,CAAC;YACP,CAAC,CAAC;YAEF,IAAI,OAAO,CAAC,MAAM,EAAE;gBAChB,OAAO,gBAAgB,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;aAC5F;YAED,OAAO,gBAAgB,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC;QACrE,CAAC;KACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { transformAction } from '../item';
|
|
2
|
-
const createStatusCtx = () => {
|
|
3
|
-
return {
|
|
4
|
-
placeholder: null,
|
|
5
|
-
actions: [],
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export const createStatus = (builder) => {
|
|
9
|
-
const statusCtx = createStatusCtx();
|
|
10
|
-
return {
|
|
11
|
-
get: () => statusCtx,
|
|
12
|
-
clear: () => {
|
|
13
|
-
statusCtx.placeholder = null;
|
|
14
|
-
statusCtx.actions = [];
|
|
15
|
-
},
|
|
16
|
-
update: (builderParams) => {
|
|
17
|
-
var _a, _b;
|
|
18
|
-
const config = builder(builderParams);
|
|
19
|
-
statusCtx.placeholder = (_a = config === null || config === void 0 ? void 0 : config.placeholder) !== null && _a !== void 0 ? _a : null;
|
|
20
|
-
statusCtx.actions = ((_b = config === null || config === void 0 ? void 0 : config.actions) !== null && _b !== void 0 ? _b : []).map(transformAction);
|
|
21
|
-
return statusCtx;
|
|
22
|
-
},
|
|
23
|
-
isEmpty: () => statusCtx.actions.length === 0,
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=status.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/prose-plugin/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,eAAe,EAAE,MAAM,SAAS,CAAC;AAOlD,MAAM,eAAe,GAAG,GAAc,EAAE;IACpC,OAAO;QACH,WAAW,EAAE,IAAI;QACjB,OAAO,EAAE,EAAE;KACd,CAAC;AACN,CAAC,CAAC;AAIF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAA4B,EAAE,EAAE;IACzD,MAAM,SAAS,GAAG,eAAe,EAAE,CAAC;IAEpC,OAAO;QACH,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS;QACpB,KAAK,EAAE,GAAG,EAAE;YACR,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC;YAC7B,SAAS,CAAC,OAAO,GAAG,EAAE,CAAC;QAC3B,CAAC;QACD,MAAM,EAAE,CAAC,aAAwC,EAAE,EAAE;;YACjD,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;YACtC,SAAS,CAAC,WAAW,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,mCAAI,IAAI,CAAC;YACpD,SAAS,CAAC,OAAO,GAAG,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YACjE,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;KAChD,CAAC;AACN,CAAC,CAAC"}
|
package/lib/prose-plugin/view.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
|
-
import { calculateNodePosition } from '@milkdown/prose';
|
|
3
|
-
import { createDropdown } from '../utility';
|
|
4
|
-
import { renderDropdown } from './dropdown';
|
|
5
|
-
import { createMouseManager, handleClick, handleKeydown, handleMouseEnter, handleMouseLeave, handleMouseMove, } from './input';
|
|
6
|
-
const calculatePosition = (view, dropdownElement) => {
|
|
7
|
-
calculateNodePosition(view, dropdownElement, (selected, target, parent) => {
|
|
8
|
-
let left = selected.left - parent.left;
|
|
9
|
-
let top = selected.bottom - parent.top + 14;
|
|
10
|
-
if (left < 0) {
|
|
11
|
-
left = 0;
|
|
12
|
-
}
|
|
13
|
-
if (window.innerHeight - selected.bottom < target.height) {
|
|
14
|
-
top = selected.top - parent.top - target.height - 14;
|
|
15
|
-
}
|
|
16
|
-
return [top, left];
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
export const createView = (status, view, utils) => {
|
|
20
|
-
const wrapper = view.dom.parentNode;
|
|
21
|
-
if (!wrapper)
|
|
22
|
-
return {};
|
|
23
|
-
const dropdownElement = createDropdown(utils);
|
|
24
|
-
const mouseManager = createMouseManager();
|
|
25
|
-
wrapper.appendChild(dropdownElement);
|
|
26
|
-
const _mouseMove = handleMouseMove(mouseManager);
|
|
27
|
-
const _mouseDown = handleClick(status, view, dropdownElement);
|
|
28
|
-
const _keydown = handleKeydown(status, view, dropdownElement, mouseManager);
|
|
29
|
-
const _mouseEnter = handleMouseEnter(status, mouseManager);
|
|
30
|
-
const _mouseLeave = handleMouseLeave();
|
|
31
|
-
wrapper.addEventListener('mousemove', _mouseMove);
|
|
32
|
-
wrapper.addEventListener('mousedown', _mouseDown);
|
|
33
|
-
wrapper.addEventListener('keydown', _keydown);
|
|
34
|
-
return {
|
|
35
|
-
update: (view) => {
|
|
36
|
-
const show = renderDropdown(status, dropdownElement, {
|
|
37
|
-
mouseEnter: _mouseEnter,
|
|
38
|
-
mouseLeave: _mouseLeave,
|
|
39
|
-
});
|
|
40
|
-
if (!show)
|
|
41
|
-
return;
|
|
42
|
-
calculatePosition(view, dropdownElement);
|
|
43
|
-
},
|
|
44
|
-
destroy: () => {
|
|
45
|
-
wrapper.removeEventListener('mousemove', _mouseMove);
|
|
46
|
-
wrapper.removeEventListener('mousedown', _mouseDown);
|
|
47
|
-
wrapper.removeEventListener('keydown', _keydown);
|
|
48
|
-
dropdownElement.remove();
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=view.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/prose-plugin/view.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,qBAAqB,EAAc,MAAM,iBAAiB,CAAC;AAGpE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACH,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAClB,MAAM,SAAS,CAAC;AAGjB,MAAM,iBAAiB,GAAG,CAAC,IAAgB,EAAE,eAA4B,EAAE,EAAE;IACzE,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QACtE,IAAI,IAA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CAAC,CAAC;IAClD,OAAO,CAAC,gBAAgB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAClD,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAE9C,OAAO;QACH,MAAM,EAAE,CAAC,IAAgB,EAAE,EAAE;YACzB,MAAM,IAAI,GAAG,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE;gBACjD,UAAU,EAAE,WAA4B;gBACxC,UAAU,EAAE,WAA4B;aAC3C,CAAC,CAAC;YAEH,IAAI,CAAC,IAAI;gBAAE,OAAO;YAElB,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,EAAE,GAAG,EAAE;YACV,OAAO,CAAC,mBAAmB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;YACrD,OAAO,CAAC,mBAAmB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;YACrD,OAAO,CAAC,mBAAmB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YACjD,eAAe,CAAC,MAAM,EAAE,CAAC;QAC7B,CAAC;KACJ,CAAC;AACN,CAAC,CAAC"}
|
package/lib/style.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/* Copyright 2021, Milkdown by Mirone. */
|
|
2
|
-
import { css } from '@emotion/css';
|
|
3
|
-
const itemStyle = ({ font, palette }) => {
|
|
4
|
-
return css `
|
|
5
|
-
.slash-dropdown-item {
|
|
6
|
-
display: flex;
|
|
7
|
-
gap: 2rem;
|
|
8
|
-
height: 3rem;
|
|
9
|
-
padding: 0 1rem;
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: flex-start;
|
|
12
|
-
cursor: pointer;
|
|
13
|
-
line-height: 2;
|
|
14
|
-
font-family: ${font.typography};
|
|
15
|
-
font-size: 0.875rem;
|
|
16
|
-
|
|
17
|
-
transition: all 0.2s ease-in-out;
|
|
18
|
-
|
|
19
|
-
&,
|
|
20
|
-
.icon {
|
|
21
|
-
color: ${palette('neutral', 0.87)};
|
|
22
|
-
transition: all 0.2s ease-in-out;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&.hide {
|
|
26
|
-
display: none;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&.active {
|
|
30
|
-
background: ${palette('secondary', 0.12)};
|
|
31
|
-
&,
|
|
32
|
-
.icon {
|
|
33
|
-
color: ${palette('primary')};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
};
|
|
38
|
-
export const injectStyle = (themeTool) => {
|
|
39
|
-
var _a, _b, _c;
|
|
40
|
-
const { mixin, size, palette } = themeTool;
|
|
41
|
-
const style = css `
|
|
42
|
-
width: 20.5rem;
|
|
43
|
-
max-height: 20.5rem;
|
|
44
|
-
overflow-y: auto;
|
|
45
|
-
${(_a = mixin.border) === null || _a === void 0 ? void 0 : _a.call(mixin)};
|
|
46
|
-
border-radius: ${size.radius};
|
|
47
|
-
position: absolute;
|
|
48
|
-
background: ${palette('surface')};
|
|
49
|
-
|
|
50
|
-
${(_b = mixin.shadow) === null || _b === void 0 ? void 0 : _b.call(mixin)};
|
|
51
|
-
|
|
52
|
-
&.hide {
|
|
53
|
-
display: none;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
${(_c = mixin.scrollbar) === null || _c === void 0 ? void 0 : _c.call(mixin)};
|
|
57
|
-
|
|
58
|
-
${itemStyle(themeTool)}
|
|
59
|
-
`;
|
|
60
|
-
return style;
|
|
61
|
-
};
|
|
62
|
-
//# sourceMappingURL=style.js.map
|
package/lib/style.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAa,EAAE,EAAE;IAC/C,OAAO,GAAG,CAAA;;;;;;;;;;2BAUa,IAAI,CAAC,UAAU;;;;;;;yBAOjB,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC;;;;;;;;;8BASnB,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC;;;6BAG3B,OAAO,CAAC,SAAS,CAAC;;;aAGlC,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,SAAoB,EAAE,EAAE;;IAChD,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;IAC3C,MAAM,KAAK,GAAG,GAAG,CAAA;;;;UAIX,MAAA,KAAK,CAAC,MAAM,+CAAZ,KAAK,CAAW;yBACD,IAAI,CAAC,MAAM;;sBAEd,OAAO,CAAC,SAAS,CAAC;;UAE9B,MAAA,KAAK,CAAC,MAAM,+CAAZ,KAAK,CAAW;;;;;;UAMhB,MAAA,KAAK,CAAC,SAAS,+CAAf,KAAK,CAAc;;UAEnB,SAAS,CAAC,SAAS,CAAC;KACzB,CAAC;IACF,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC"}
|
package/lib/utility.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { injectStyle } from './style';
|
|
2
|
-
export const createDropdown = (utils) => {
|
|
3
|
-
const div = document.createElement('div');
|
|
4
|
-
div.setAttribute('role', 'listbox');
|
|
5
|
-
div.setAttribute('tabindex', '-1');
|
|
6
|
-
const style = utils.getStyle(injectStyle);
|
|
7
|
-
if (style) {
|
|
8
|
-
div.classList.add(style);
|
|
9
|
-
}
|
|
10
|
-
div.classList.add('slash-dropdown', 'hide');
|
|
11
|
-
return div;
|
|
12
|
-
};
|
|
13
|
-
export const createDropdownItem = (themeTool, text, icon, options) => {
|
|
14
|
-
var _a;
|
|
15
|
-
const textClassName = (_a = options === null || options === void 0 ? void 0 : options.textClassName) !== null && _a !== void 0 ? _a : 'text';
|
|
16
|
-
const div = document.createElement('div');
|
|
17
|
-
div.setAttribute('role', 'option');
|
|
18
|
-
div.classList.add('slash-dropdown-item');
|
|
19
|
-
const iconSpan = themeTool.slots.icon(icon);
|
|
20
|
-
const textSpan = document.createElement('span');
|
|
21
|
-
textSpan.textContent = text;
|
|
22
|
-
textSpan.className = textClassName;
|
|
23
|
-
div.appendChild(iconSpan);
|
|
24
|
-
div.appendChild(textSpan);
|
|
25
|
-
return div;
|
|
26
|
-
};
|
|
27
|
-
export const getDepth = (node) => {
|
|
28
|
-
let cur = node;
|
|
29
|
-
let depth = 0;
|
|
30
|
-
while (cur.childCount) {
|
|
31
|
-
cur = cur.child(0);
|
|
32
|
-
depth += 1;
|
|
33
|
-
}
|
|
34
|
-
return depth;
|
|
35
|
-
};
|
|
36
|
-
const cleanUp = (state, dispatch) => {
|
|
37
|
-
const { selection } = state;
|
|
38
|
-
const { $from } = selection;
|
|
39
|
-
const tr = state.tr.deleteRange($from.start(), $from.pos);
|
|
40
|
-
dispatch === null || dispatch === void 0 ? void 0 : dispatch(tr);
|
|
41
|
-
return false;
|
|
42
|
-
};
|
|
43
|
-
export const cleanUpAndCreateNode = (createCommand) => (state, dispatch, view) => {
|
|
44
|
-
if (view) {
|
|
45
|
-
cleanUp(state, dispatch, view);
|
|
46
|
-
createCommand();
|
|
47
|
-
}
|
|
48
|
-
return true;
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=utility.js.map
|
package/lib/utility.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../src/utility.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAY,EAAE,EAAE;IAC3C,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1C,GAAG,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;I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