@block-kit/plugin 1.0.1 → 1.0.3
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/dist/es/align/{align/index.js → index.js} +1 -1
- package/dist/es/background/{background/index.js → index.js} +1 -1
- package/dist/es/bold/{bold/index.js → index.js} +1 -1
- package/dist/es/bullet-list/{bullet-list/index.js → index.js} +7 -7
- package/dist/es/bullet-list/utils/{bullet-list/utils/is.js → is.js} +1 -1
- package/dist/es/divider/{divider/index.js → index.js} +5 -5
- package/dist/es/emoji/{emoji/index.js → index.js} +2 -2
- package/dist/es/font-color/{font-color/index.js → index.js} +1 -1
- package/dist/es/font-size/{font-size/index.js → index.js} +1 -1
- package/dist/es/heading/{heading/index.js → index.js} +1 -1
- package/dist/es/image/{image/index.js → index.js} +7 -7
- package/dist/es/image/view/{image/view/image.js → image.js} +3 -3
- package/dist/es/image/view/{image/view/wrapper.js → wrapper.js} +3 -2
- package/dist/es/indent/{indent/index.js → index.js} +3 -3
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.js +50 -50
- package/dist/es/inline-code/{inline-code/index.js → index.js} +2 -2
- package/dist/es/italic/{italic/index.js → index.js} +1 -1
- package/dist/es/line-height/{line-height/index.js → index.js} +1 -1
- package/dist/es/link/{link/index.js → index.js} +3 -3
- package/dist/es/link/view/{link/view/a.js → a.js} +1 -1
- package/dist/es/mention/{mention/index.js → index.js} +2 -2
- package/dist/es/mention/modules/{mention/modules/suggest.js → suggest.js} +6 -6
- package/dist/es/mention/view/{mention/view/suggest.js → suggest.js} +4 -4
- package/dist/es/order-list/{order-list/index.js → index.js} +9 -9
- package/dist/es/order-list/utils/is.js +12 -0
- package/dist/es/order-list/utils/{order-list/utils/serial.js → serial.js} +2 -2
- package/dist/es/order-list/view/{order-list/view/list.js → list.js} +1 -1
- package/dist/es/quote/{quote/index.js → index.js} +4 -4
- package/dist/es/shared/modules/{shared/modules/selection.js → selection.js} +1 -1
- package/dist/es/shortcut/{shortcut/index.js → index.js} +8 -8
- package/dist/es/shortcut/modules/{shortcut/modules/preset.js → preset.js} +3 -3
- package/dist/es/strike/{strike/index.js → index.js} +1 -1
- package/dist/es/toolbar/context/{toolbar/context/basic.js → basic.js} +6 -6
- package/dist/es/toolbar/context/{toolbar/context/float.js → float.js} +1 -1
- package/dist/es/toolbar/index.d.ts +1 -1
- package/dist/es/toolbar/index.js +45 -0
- package/dist/es/toolbar/modules/{toolbar/modules/align.js → align.js} +9 -5
- package/dist/es/toolbar/modules/{toolbar/modules/bold.js → bold.js} +3 -3
- package/dist/es/toolbar/modules/{toolbar/modules/bullet-list.js → bullet-list.js} +4 -4
- package/dist/es/toolbar/modules/{toolbar/modules/divider.js → divider.js} +3 -3
- package/dist/es/toolbar/modules/{toolbar/modules/emoji.js → emoji.js} +5 -4
- package/dist/es/toolbar/modules/{toolbar/modules/font-color.js → font-color.js} +7 -6
- package/dist/es/toolbar/modules/{toolbar/modules/font-size.js → font-size.js} +7 -5
- package/dist/es/toolbar/modules/{toolbar/modules/heading.js → heading.js} +9 -5
- package/dist/es/toolbar/modules/{toolbar/modules/history.js → history.js} +3 -2
- package/dist/es/toolbar/modules/{toolbar/modules/image.js → image.js} +3 -3
- package/dist/es/toolbar/modules/{toolbar/modules/inline-code.js → inline-code.js} +3 -3
- package/dist/es/toolbar/modules/{toolbar/modules/italic.js → italic.js} +3 -3
- package/dist/es/toolbar/modules/{toolbar/modules/line-height.js → line-height.js} +7 -5
- package/dist/es/toolbar/modules/{toolbar/modules/link.js → link.js} +16 -6
- package/dist/es/toolbar/modules/{toolbar/modules/order-list.js → order-list.js} +4 -4
- package/dist/es/toolbar/modules/{toolbar/modules/quote.js → quote.js} +3 -3
- package/dist/es/toolbar/modules/{toolbar/modules/strike.js → strike.js} +3 -3
- package/dist/es/toolbar/modules/{toolbar/modules/underline.js → underline.js} +3 -3
- package/dist/es/toolbar/types/index.js +7 -0
- package/dist/es/{node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs.js → tslib.es6-910e0469.js} +1 -1
- package/dist/es/underline/{underline/index.js → index.js} +1 -1
- package/dist/lib/bullet-list/index.js +1 -1
- package/dist/lib/divider/index.js +1 -1
- package/dist/lib/emoji/index.js +1 -1
- package/dist/lib/image/index.js +2 -2
- package/dist/lib/image/view/image.js +6 -2
- package/dist/lib/image/view/wrapper.js +7 -2
- package/dist/lib/indent/index.js +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/inline-code/index.js +1 -1
- package/dist/lib/link/index.js +1 -1
- package/dist/lib/mention/modules/suggest.js +2 -2
- package/dist/lib/order-list/index.js +1 -1
- package/dist/lib/quote/index.js +1 -1
- package/dist/lib/shared/modules/selection.js +1 -1
- package/dist/lib/shortcut/index.js +4 -4
- package/dist/lib/toolbar/context/basic.js +4 -4
- package/dist/lib/toolbar/index.d.ts +1 -1
- package/dist/lib/toolbar/index.js +2 -2
- package/dist/lib/toolbar/modules/align.js +18 -6
- package/dist/lib/toolbar/modules/bold.js +6 -2
- package/dist/lib/toolbar/modules/bullet-list.js +6 -2
- package/dist/lib/toolbar/modules/emoji.js +4 -2
- package/dist/lib/toolbar/modules/font-color.js +10 -4
- package/dist/lib/toolbar/modules/font-size.js +11 -3
- package/dist/lib/toolbar/modules/heading.js +18 -6
- package/dist/lib/toolbar/modules/history.js +8 -2
- package/dist/lib/toolbar/modules/image.js +6 -2
- package/dist/lib/toolbar/modules/inline-code.js +6 -2
- package/dist/lib/toolbar/modules/italic.js +6 -2
- package/dist/lib/toolbar/modules/line-height.js +11 -3
- package/dist/lib/toolbar/modules/link.js +24 -7
- package/dist/lib/toolbar/modules/order-list.js +6 -2
- package/dist/lib/toolbar/modules/quote.js +6 -2
- package/dist/lib/toolbar/modules/strike.js +6 -2
- package/dist/lib/toolbar/modules/underline.js +6 -2
- package/package.json +6 -5
- package/dist/es/order-list/utils/order-list/utils/is.js +0 -12
- package/dist/es/toolbar/toolbar/index.js +0 -45
- package/dist/es/toolbar/types/toolbar/types/index.js +0 -7
- /package/dist/es/align/types/{align/types/index.js → index.js} +0 -0
- /package/dist/es/background/types/{background/types/index.js → index.js} +0 -0
- /package/dist/es/bold/types/{bold/types/index.js → index.js} +0 -0
- /package/dist/es/bullet-list/types/{bullet-list/types/index.js → index.js} +0 -0
- /package/dist/es/bullet-list/view/{bullet-list/view/list.js → list.js} +0 -0
- /package/dist/es/divider/types/{divider/types/index.js → index.js} +0 -0
- /package/dist/es/emoji/types/{emoji/types/index.js → index.js} +0 -0
- /package/dist/es/font-color/types/{font-color/types/index.js → index.js} +0 -0
- /package/dist/es/font-size/types/{font-size/types/index.js → index.js} +0 -0
- /package/dist/es/heading/types/{heading/types/index.js → index.js} +0 -0
- /package/dist/es/image/types/{image/types/index.js → index.js} +0 -0
- /package/dist/es/indent/types/{indent/types/index.js → index.js} +0 -0
- /package/dist/es/inline-code/types/{inline-code/types/index.js → index.js} +0 -0
- /package/dist/es/italic/types/{italic/types/index.js → index.js} +0 -0
- /package/dist/es/line-height/types/{line-height/types/index.js → index.js} +0 -0
- /package/dist/es/link/types/{link/types/index.js → index.js} +0 -0
- /package/dist/es/mention/types/{mention/types/index.js → index.js} +0 -0
- /package/dist/es/mention/utils/{mention/utils/constant.js → constant.js} +0 -0
- /package/dist/es/order-list/types/{order-list/types/index.js → index.js} +0 -0
- /package/dist/es/order-list/utils/{order-list/utils/format.js → format.js} +0 -0
- /package/dist/es/quote/types/{quote/types/index.js → index.js} +0 -0
- /package/dist/es/shared/components/{shared/components/selection.js → selection.js} +0 -0
- /package/dist/es/shared/icons/{shared/icons/divider.js → divider.js} +0 -0
- /package/dist/es/shared/icons/{shared/icons/emoji.js → emoji.js} +0 -0
- /package/dist/es/shared/icons/{shared/icons/font-color.js → font-color.js} +0 -0
- /package/dist/es/shared/icons/{shared/icons/font-size.js → font-size.js} +0 -0
- /package/dist/es/shared/icons/{shared/icons/justify.js → justify.js} +0 -0
- /package/dist/es/shared/icons/{shared/icons/line-height.js → line-height.js} +0 -0
- /package/dist/es/shared/icons/{shared/icons/text.js → text.js} +0 -0
- /package/dist/es/shared/utils/{shared/utils/dom.js → dom.js} +0 -0
- /package/dist/es/shared/utils/{shared/utils/event.js → event.js} +0 -0
- /package/dist/es/shared/utils/{shared/utils/is.js → is.js} +0 -0
- /package/dist/es/shortcut/types/{shortcut/types/index.js → index.js} +0 -0
- /package/dist/es/strike/types/{strike/types/index.js → index.js} +0 -0
- /package/dist/es/toolbar/context/{toolbar/context/provider.js → provider.js} +0 -0
- /package/dist/es/toolbar/modules/{toolbar/modules/cut.js → cut.js} +0 -0
- /package/dist/es/toolbar/utils/{toolbar/utils/marks.js → marks.js} +0 -0
- /package/dist/es/underline/types/{underline/types/index.js → index.js} +0 -0
- /package/dist/lib/{tslib.es6-82029525.js → tslib.es6-9953fd0d.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isMatchHTMLTag, applyMarker } from '@block-kit/core';
|
|
2
2
|
import { EditorPlugin } from '@block-kit/react';
|
|
3
3
|
import { isHTMLElement, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { BOLD_KEY } from '
|
|
4
|
+
import { BOLD_KEY } from './types/index.js';
|
|
5
5
|
|
|
6
6
|
class BoldPlugin extends EditorPlugin {
|
|
7
7
|
destroy() { }
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { __decorate } from '
|
|
1
|
+
import { _ as __decorate } from '../tslib.es6-910e0469.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { EDITOR_EVENT, RawPoint, Point } from '@block-kit/core';
|
|
4
4
|
import { Delta } from '@block-kit/delta';
|
|
5
5
|
import { EditorPlugin } from '@block-kit/react';
|
|
6
6
|
import { Bind, KEY_CODE, NIL } from '@block-kit/utils';
|
|
7
|
-
import { INDENT_LEVEL_KEY } from '
|
|
8
|
-
import { preventContextEvent } from '
|
|
9
|
-
import { isKeyCode, isEmptyLine } from '
|
|
10
|
-
import { BULLET_LIST_KEY, LIST_TYPE_KEY, BULLET_LIST_TYPE } from '
|
|
11
|
-
import { isBulletList } from '
|
|
12
|
-
import { BulletListView } from '
|
|
7
|
+
import { INDENT_LEVEL_KEY } from '../indent/types/index.js';
|
|
8
|
+
import { preventContextEvent } from '../shared/utils/dom.js';
|
|
9
|
+
import { isKeyCode, isEmptyLine } from '../shared/utils/is.js';
|
|
10
|
+
import { BULLET_LIST_KEY, LIST_TYPE_KEY, BULLET_LIST_TYPE } from './types/index.js';
|
|
11
|
+
import { isBulletList } from './utils/is.js';
|
|
12
|
+
import { BulletListView } from './view/list.js';
|
|
13
13
|
|
|
14
14
|
class BulletListPlugin extends EditorPlugin {
|
|
15
15
|
constructor(editor) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { __decorate } from '
|
|
1
|
+
import { _ as __decorate } from '../tslib.es6-910e0469.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Point, Range } from '@block-kit/core';
|
|
4
4
|
import { Delta } from '@block-kit/delta';
|
|
5
5
|
import { EditorPlugin, Void } from '@block-kit/react';
|
|
6
6
|
import { Bind, TRULY } from '@block-kit/utils';
|
|
7
|
-
import { SelectionHOC } from '
|
|
8
|
-
import { SelectionPlugin } from '
|
|
9
|
-
import { isEmptyLine } from '
|
|
10
|
-
import { DIVIDER_KEY } from '
|
|
7
|
+
import { SelectionHOC } from '../shared/components/selection.js';
|
|
8
|
+
import { SelectionPlugin } from '../shared/modules/selection.js';
|
|
9
|
+
import { isEmptyLine } from '../shared/utils/is.js';
|
|
10
|
+
import { DIVIDER_KEY } from './types/index.js';
|
|
11
11
|
|
|
12
12
|
class DividerPlugin extends EditorPlugin {
|
|
13
13
|
constructor(editor) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from '
|
|
1
|
+
import { _ as __decorate } from '../tslib.es6-910e0469.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { RawRange } from '@block-kit/core';
|
|
4
4
|
import { Delta } from '@block-kit/delta';
|
|
@@ -6,7 +6,7 @@ import { EditorPlugin, Embed } from '@block-kit/react';
|
|
|
6
6
|
import { Bind } from '@block-kit/utils';
|
|
7
7
|
import data from '@emoji-mart/data';
|
|
8
8
|
import { init } from 'emoji-mart';
|
|
9
|
-
import { EMOJI_KEY } from '
|
|
9
|
+
import { EMOJI_KEY } from './types/index.js';
|
|
10
10
|
|
|
11
11
|
class EmojiPlugin extends EditorPlugin {
|
|
12
12
|
constructor(editor) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EditorPlugin } from '@block-kit/react';
|
|
2
2
|
import { Styles } from '@block-kit/utils';
|
|
3
|
-
import { FONT_SIZE_KEY } from '
|
|
3
|
+
import { FONT_SIZE_KEY } from './types/index.js';
|
|
4
4
|
|
|
5
5
|
class FontSizePlugin extends EditorPlugin {
|
|
6
6
|
destroy() { }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { EditorPlugin } from '@block-kit/react';
|
|
3
|
-
import { HEADING_KEY } from '
|
|
3
|
+
import { HEADING_KEY } from './types/index.js';
|
|
4
4
|
|
|
5
5
|
class HeadingPlugin extends EditorPlugin {
|
|
6
6
|
destroy() { }
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { __decorate, __awaiter } from '
|
|
1
|
+
import { _ as __decorate, a as __awaiter } from '../tslib.es6-910e0469.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Point, Range, RawRange, APPLY_SOURCE } from '@block-kit/core';
|
|
4
4
|
import { Delta } from '@block-kit/delta';
|
|
5
5
|
import { EditorPlugin } from '@block-kit/react';
|
|
6
6
|
import { Bind, sleep, TRULY } from '@block-kit/utils';
|
|
7
|
-
import { SelectionPlugin } from '
|
|
8
|
-
import { getMountDOM } from '
|
|
9
|
-
import { isEmptyLine } from '
|
|
10
|
-
import { IMAGE_KEY, LOADING_STATUS, IMAGE_SRC, IMAGE_STATUS } from '
|
|
11
|
-
import { ImageView } from '
|
|
7
|
+
import { SelectionPlugin } from '../shared/modules/selection.js';
|
|
8
|
+
import { getMountDOM } from '../shared/utils/dom.js';
|
|
9
|
+
import { isEmptyLine } from '../shared/utils/is.js';
|
|
10
|
+
import { IMAGE_KEY, LOADING_STATUS, IMAGE_SRC, IMAGE_STATUS } from './types/index.js';
|
|
11
|
+
import { ImageView } from './view/image.js';
|
|
12
12
|
|
|
13
13
|
class ImagePlugin extends EditorPlugin {
|
|
14
14
|
constructor(editor) {
|
|
@@ -100,7 +100,7 @@ class ImagePlugin extends EditorPlugin {
|
|
|
100
100
|
for (let i = 0; i < packIndex.length; i++) {
|
|
101
101
|
const file = files[i];
|
|
102
102
|
const refIndex = packIndex[i];
|
|
103
|
-
const ref = editor.
|
|
103
|
+
const ref = editor.tracer.pack(RawRange.from(refIndex, 0));
|
|
104
104
|
// 独立并行上传, 且独立 unpack
|
|
105
105
|
this.uploadImage(file)
|
|
106
106
|
.then(res => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import IconLoading from '@arco-design/web-react/icon/react-icon/IconLoading';
|
|
3
3
|
import { RawRange, APPLY_SOURCE } from '@block-kit/core';
|
|
4
4
|
import { Delta } from '@block-kit/delta';
|
|
5
5
|
import { Void } from '@block-kit/react';
|
|
6
6
|
import { Styles } from '@block-kit/utils';
|
|
7
|
-
import { SelectionHOC } from '
|
|
8
|
-
import { IMAGE_SRC, IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_STATUS, LOADING_STATUS, IMAGE_SCALE } from '
|
|
7
|
+
import { SelectionHOC } from '../../shared/components/selection.js';
|
|
8
|
+
import { IMAGE_SRC, IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_STATUS, LOADING_STATUS, IMAGE_SCALE } from '../types/index.js';
|
|
9
9
|
import { ImageWrapper } from './wrapper.js';
|
|
10
10
|
|
|
11
11
|
const ImageView = props => {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import Image from '@arco-design/web-react/es/Image';
|
|
3
|
+
import '@arco-design/web-react/es/Image/style';
|
|
3
4
|
import { RawRange } from '@block-kit/core';
|
|
4
5
|
import { Delta } from '@block-kit/delta';
|
|
5
6
|
import { useReadonly } from '@block-kit/react';
|
|
6
7
|
import { cs, throttle } from '@block-kit/utils';
|
|
7
8
|
import { useState, useRef, Fragment as Fragment$1 } from 'react';
|
|
8
|
-
import { IMAGE_WIDTH, IMAGE_HEIGHT } from '
|
|
9
|
+
import { IMAGE_WIDTH, IMAGE_HEIGHT } from '../types/index.js';
|
|
9
10
|
|
|
10
11
|
const Preview = Image.Preview;
|
|
11
12
|
const ImageWrapper = props => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { __decorate } from '
|
|
1
|
+
import { _ as __decorate } from '../tslib.es6-910e0469.js';
|
|
2
2
|
import { EDITOR_EVENT, RawPoint, Point } from '@block-kit/core';
|
|
3
3
|
import { Delta } from '@block-kit/delta';
|
|
4
4
|
import { EditorPlugin } from '@block-kit/react';
|
|
5
5
|
import { Bind, KEY_CODE } from '@block-kit/utils';
|
|
6
|
-
import { isKeyCode } from '
|
|
7
|
-
import { INDENT_LEVEL_KEY } from '
|
|
6
|
+
import { isKeyCode } from '../shared/utils/is.js';
|
|
7
|
+
import { INDENT_LEVEL_KEY } from './types/index.js';
|
|
8
8
|
|
|
9
9
|
class IndentPlugin extends EditorPlugin {
|
|
10
10
|
constructor(editor) {
|
package/dist/es/index.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export { Shortcut } from "./shortcut";
|
|
|
43
43
|
export type { ShortcutFunc, ShortcutFuncMap } from "./shortcut/types";
|
|
44
44
|
export { StrikePlugin } from "./strike/index";
|
|
45
45
|
export { STRIKE_KEY } from "./strike/types";
|
|
46
|
-
export { FloatToolbar,
|
|
46
|
+
export { FloatToolbar, Toolbar, ToolBarMixin } from "./toolbar";
|
|
47
47
|
export type { ToolbarContextType } from "./toolbar/context/provider";
|
|
48
48
|
export { ToolbarContext, useToolbarContext } from "./toolbar/context/provider";
|
|
49
49
|
export { UnderlinePlugin } from "./underline/index";
|
package/dist/es/index.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
export { AlignPlugin } from './align/
|
|
2
|
-
export { ALIGN_KEY } from './align/types/
|
|
3
|
-
export { BackgroundPlugin } from './background/
|
|
4
|
-
export { BACKGROUND_KEY } from './background/types/
|
|
5
|
-
export { BoldPlugin } from './bold/
|
|
6
|
-
export { BOLD_KEY } from './bold/types/
|
|
7
|
-
export { BulletListPlugin } from './bullet-list/
|
|
8
|
-
export { BULLET_LIST_KEY, BULLET_LIST_TYPE, LIST_TYPE_KEY } from './bullet-list/types/
|
|
9
|
-
export { DividerPlugin } from './divider/
|
|
10
|
-
export { DIVIDER_KEY } from './divider/types/
|
|
11
|
-
export { EmojiPlugin } from './emoji/
|
|
12
|
-
export { EMOJI_KEY } from './emoji/types/
|
|
13
|
-
export { FontColorPlugin } from './font-color/
|
|
14
|
-
export { FONT_COLOR_KEY } from './font-color/types/
|
|
15
|
-
export { FontSizePlugin } from './font-size/
|
|
16
|
-
export { FONT_SIZE_KEY } from './font-size/types/
|
|
17
|
-
export { HeadingPlugin } from './heading/
|
|
18
|
-
export { HEADING_KEY } from './heading/types/
|
|
19
|
-
export { ImagePlugin } from './image/
|
|
20
|
-
export { IMAGE_HEIGHT, IMAGE_KEY, IMAGE_SCALE, IMAGE_SRC, IMAGE_STATUS, IMAGE_WIDTH, LOADING_STATUS, MIN_WIDTH } from './image/types/
|
|
21
|
-
export { IndentPlugin } from './indent/
|
|
22
|
-
export { INDENT_LEVEL_KEY } from './indent/types/
|
|
23
|
-
export { InlineCodePlugin } from './inline-code/
|
|
24
|
-
export { INLINE_CODE } from './inline-code/types/
|
|
25
|
-
export { ItalicPlugin } from './italic/
|
|
26
|
-
export { ITALIC_KEY } from './italic/types/
|
|
27
|
-
export { LineHeightPlugin } from './line-height/
|
|
28
|
-
export { LINE_HEIGHT_KEY } from './line-height/types/
|
|
29
|
-
export { LinkPlugin } from './link/
|
|
30
|
-
export { LINK_BLANK_KEY, LINK_KEY, LINK_TEMP_KEY } from './link/types/
|
|
31
|
-
export { MentionPlugin } from './mention/
|
|
32
|
-
export { SuggestModule } from './mention/modules/
|
|
33
|
-
export { MENTION_KEY, MENTION_NAME } from './mention/types/
|
|
34
|
-
export { OrderListPlugin } from './order-list/
|
|
35
|
-
export { LIST_RESTART_KEY, LIST_START_KEY, ORDER_LIST_KEY, ORDER_LIST_TYPE } from './order-list/types/
|
|
36
|
-
export { QuotePlugin } from './quote/
|
|
37
|
-
export { QUOTE_KEY } from './quote/types/
|
|
38
|
-
export { SelectionHOC } from './shared/components/
|
|
39
|
-
export { SelectionPlugin } from './shared/modules/
|
|
40
|
-
export { getMountDOM, preventContextEvent, scrollIfNeeded, setMountDOM } from './shared/utils/
|
|
41
|
-
export { isEmptyLine, isKeyCode } from './shared/utils/
|
|
42
|
-
export { Shortcut } from './shortcut/
|
|
43
|
-
export { StrikePlugin } from './strike/
|
|
44
|
-
export { STRIKE_KEY } from './strike/types/
|
|
45
|
-
export {
|
|
46
|
-
export { ToolbarContext, useToolbarContext } from './toolbar/context/
|
|
47
|
-
export { UnderlinePlugin } from './underline/
|
|
48
|
-
export { UNDERLINE_KEY } from './underline/types/
|
|
49
|
-
export { FloatToolbar } from './toolbar/context/
|
|
50
|
-
export { Toolbar } from './toolbar/context/
|
|
1
|
+
export { AlignPlugin } from './align/index.js';
|
|
2
|
+
export { ALIGN_KEY } from './align/types/index.js';
|
|
3
|
+
export { BackgroundPlugin } from './background/index.js';
|
|
4
|
+
export { BACKGROUND_KEY } from './background/types/index.js';
|
|
5
|
+
export { BoldPlugin } from './bold/index.js';
|
|
6
|
+
export { BOLD_KEY } from './bold/types/index.js';
|
|
7
|
+
export { BulletListPlugin } from './bullet-list/index.js';
|
|
8
|
+
export { BULLET_LIST_KEY, BULLET_LIST_TYPE, LIST_TYPE_KEY } from './bullet-list/types/index.js';
|
|
9
|
+
export { DividerPlugin } from './divider/index.js';
|
|
10
|
+
export { DIVIDER_KEY } from './divider/types/index.js';
|
|
11
|
+
export { EmojiPlugin } from './emoji/index.js';
|
|
12
|
+
export { EMOJI_KEY } from './emoji/types/index.js';
|
|
13
|
+
export { FontColorPlugin } from './font-color/index.js';
|
|
14
|
+
export { FONT_COLOR_KEY } from './font-color/types/index.js';
|
|
15
|
+
export { FontSizePlugin } from './font-size/index.js';
|
|
16
|
+
export { FONT_SIZE_KEY } from './font-size/types/index.js';
|
|
17
|
+
export { HeadingPlugin } from './heading/index.js';
|
|
18
|
+
export { HEADING_KEY } from './heading/types/index.js';
|
|
19
|
+
export { ImagePlugin } from './image/index.js';
|
|
20
|
+
export { IMAGE_HEIGHT, IMAGE_KEY, IMAGE_SCALE, IMAGE_SRC, IMAGE_STATUS, IMAGE_WIDTH, LOADING_STATUS, MIN_WIDTH } from './image/types/index.js';
|
|
21
|
+
export { IndentPlugin } from './indent/index.js';
|
|
22
|
+
export { INDENT_LEVEL_KEY } from './indent/types/index.js';
|
|
23
|
+
export { InlineCodePlugin } from './inline-code/index.js';
|
|
24
|
+
export { INLINE_CODE } from './inline-code/types/index.js';
|
|
25
|
+
export { ItalicPlugin } from './italic/index.js';
|
|
26
|
+
export { ITALIC_KEY } from './italic/types/index.js';
|
|
27
|
+
export { LineHeightPlugin } from './line-height/index.js';
|
|
28
|
+
export { LINE_HEIGHT_KEY } from './line-height/types/index.js';
|
|
29
|
+
export { LinkPlugin } from './link/index.js';
|
|
30
|
+
export { LINK_BLANK_KEY, LINK_KEY, LINK_TEMP_KEY } from './link/types/index.js';
|
|
31
|
+
export { MentionPlugin } from './mention/index.js';
|
|
32
|
+
export { SuggestModule } from './mention/modules/suggest.js';
|
|
33
|
+
export { MENTION_KEY, MENTION_NAME } from './mention/types/index.js';
|
|
34
|
+
export { OrderListPlugin } from './order-list/index.js';
|
|
35
|
+
export { LIST_RESTART_KEY, LIST_START_KEY, ORDER_LIST_KEY, ORDER_LIST_TYPE } from './order-list/types/index.js';
|
|
36
|
+
export { QuotePlugin } from './quote/index.js';
|
|
37
|
+
export { QUOTE_KEY } from './quote/types/index.js';
|
|
38
|
+
export { SelectionHOC } from './shared/components/selection.js';
|
|
39
|
+
export { SelectionPlugin } from './shared/modules/selection.js';
|
|
40
|
+
export { getMountDOM, preventContextEvent, scrollIfNeeded, setMountDOM } from './shared/utils/dom.js';
|
|
41
|
+
export { isEmptyLine, isKeyCode } from './shared/utils/is.js';
|
|
42
|
+
export { Shortcut } from './shortcut/index.js';
|
|
43
|
+
export { StrikePlugin } from './strike/index.js';
|
|
44
|
+
export { STRIKE_KEY } from './strike/types/index.js';
|
|
45
|
+
export { ToolBarMixin } from './toolbar/index.js';
|
|
46
|
+
export { ToolbarContext, useToolbarContext } from './toolbar/context/provider.js';
|
|
47
|
+
export { UnderlinePlugin } from './underline/index.js';
|
|
48
|
+
export { UNDERLINE_KEY } from './underline/types/index.js';
|
|
49
|
+
export { FloatToolbar } from './toolbar/context/float.js';
|
|
50
|
+
export { Toolbar } from './toolbar/context/basic.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __decorate } from '
|
|
1
|
+
import { _ as __decorate } from '../tslib.es6-910e0469.js';
|
|
2
2
|
import { Priority } from '@block-kit/core';
|
|
3
3
|
import { EditorPlugin } from '@block-kit/react';
|
|
4
|
-
import { INLINE_CODE } from '
|
|
4
|
+
import { INLINE_CODE } from './types/index.js';
|
|
5
5
|
|
|
6
6
|
class InlineCodePlugin extends EditorPlugin {
|
|
7
7
|
destroy() { }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isMatchHTMLTag, applyMarker } from '@block-kit/core';
|
|
2
2
|
import { EditorPlugin } from '@block-kit/react';
|
|
3
3
|
import { isHTMLElement, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { ITALIC_KEY } from '
|
|
4
|
+
import { ITALIC_KEY } from './types/index.js';
|
|
5
5
|
|
|
6
6
|
class ItalicPlugin extends EditorPlugin {
|
|
7
7
|
destroy() { }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { __decorate } from '
|
|
1
|
+
import { _ as __decorate } from '../tslib.es6-910e0469.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { InjectWrapKeys, EditorPlugin } from '@block-kit/react';
|
|
4
4
|
import { Bind } from '@block-kit/utils';
|
|
5
|
-
import { LINK_KEY, LINK_TEMP_KEY } from '
|
|
6
|
-
import { A } from '
|
|
5
|
+
import { LINK_KEY, LINK_TEMP_KEY } from './types/index.js';
|
|
6
|
+
import { A } from './view/a.js';
|
|
7
7
|
|
|
8
8
|
class LinkPlugin extends EditorPlugin {
|
|
9
9
|
constructor(editor) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useReadonly } from '@block-kit/react';
|
|
3
3
|
import { CTRL_KEY } from '@block-kit/utils';
|
|
4
|
-
import { LINK_KEY, LINK_BLANK_KEY } from '
|
|
4
|
+
import { LINK_KEY, LINK_BLANK_KEY } from '../types/index.js';
|
|
5
5
|
|
|
6
6
|
const A = props => {
|
|
7
7
|
const { attrs } = props;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { EditorPlugin, Embed } from '@block-kit/react';
|
|
3
|
-
import { SuggestModule } from '
|
|
4
|
-
import { MENTION_KEY, MENTION_NAME } from '
|
|
3
|
+
import { SuggestModule } from './modules/suggest.js';
|
|
4
|
+
import { MENTION_KEY, MENTION_NAME } from './types/index.js';
|
|
5
5
|
|
|
6
6
|
class MentionPlugin extends EditorPlugin {
|
|
7
7
|
constructor(editor) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { __decorate } from '
|
|
1
|
+
import { _ as __decorate } from '../../tslib.es6-910e0469.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Point, EDITOR_EVENT, relativeTo, Range } from '@block-kit/core';
|
|
4
4
|
import { deltaToText, Delta } from '@block-kit/delta';
|
|
5
5
|
import { Bind, KEY_CODE } from '@block-kit/utils';
|
|
6
6
|
import ReactDOM from 'react-dom';
|
|
7
|
-
import { getMountDOM } from '
|
|
8
|
-
import { isKeyCode } from '
|
|
9
|
-
import { SUGGEST_OFFSET } from '
|
|
10
|
-
import { Suggest } from '
|
|
7
|
+
import { getMountDOM } from '../../shared/utils/dom.js';
|
|
8
|
+
import { isKeyCode } from '../../shared/utils/is.js';
|
|
9
|
+
import { SUGGEST_OFFSET } from '../utils/constant.js';
|
|
10
|
+
import { Suggest } from '../view/suggest.js';
|
|
11
11
|
|
|
12
12
|
class SuggestModule {
|
|
13
13
|
constructor(editor) {
|
|
@@ -58,7 +58,7 @@ class SuggestModule {
|
|
|
58
58
|
this.unmountSuggestPanel();
|
|
59
59
|
return void 0;
|
|
60
60
|
}
|
|
61
|
-
const ops = this.editor.
|
|
61
|
+
const ops = this.editor.lookup.getFragment(new Range(this.point, current.end));
|
|
62
62
|
if (!ops)
|
|
63
63
|
return void 0;
|
|
64
64
|
const text = deltaToText(new Delta(ops));
|
|
@@ -4,10 +4,10 @@ import { Delta } from '@block-kit/delta';
|
|
|
4
4
|
import { KEY_CODE, TRULY, preventNativeEvent, cs } from '@block-kit/utils';
|
|
5
5
|
import { useMemoFn } from '@block-kit/utils/dist/es/hooks';
|
|
6
6
|
import { useRef, useState, useMemo, useEffect } from 'react';
|
|
7
|
-
import { scrollIfNeeded, preventContextEvent } from '
|
|
8
|
-
import { isKeyCode } from '
|
|
9
|
-
import { MENTION_KEY, MENTION_NAME } from '
|
|
10
|
-
import { DATA } from '
|
|
7
|
+
import { scrollIfNeeded, preventContextEvent } from '../../shared/utils/dom.js';
|
|
8
|
+
import { isKeyCode } from '../../shared/utils/is.js';
|
|
9
|
+
import { MENTION_KEY, MENTION_NAME } from '../types/index.js';
|
|
10
|
+
import { DATA } from '../utils/constant.js';
|
|
11
11
|
|
|
12
12
|
const Suggest = props => {
|
|
13
13
|
const { controller } = props;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { __decorate } from '
|
|
1
|
+
import { _ as __decorate } from '../tslib.es6-910e0469.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { EDITOR_EVENT, RawPoint, Point } from '@block-kit/core';
|
|
4
4
|
import { Delta } from '@block-kit/delta';
|
|
5
5
|
import { EditorPlugin } from '@block-kit/react';
|
|
6
6
|
import { Bind, KEY_CODE, NIL } from '@block-kit/utils';
|
|
7
|
-
import { LIST_TYPE_KEY } from '
|
|
8
|
-
import { INDENT_LEVEL_KEY } from '
|
|
9
|
-
import { preventContextEvent } from '
|
|
10
|
-
import { isKeyCode, isEmptyLine } from '
|
|
11
|
-
import { ORDER_LIST_KEY, LIST_START_KEY, LIST_RESTART_KEY, ORDER_LIST_TYPE } from '
|
|
12
|
-
import { isOrderList } from '
|
|
13
|
-
import { applyNewOrderList } from '
|
|
14
|
-
import { OrderListView } from '
|
|
7
|
+
import { LIST_TYPE_KEY } from '../bullet-list/types/index.js';
|
|
8
|
+
import { INDENT_LEVEL_KEY } from '../indent/types/index.js';
|
|
9
|
+
import { preventContextEvent } from '../shared/utils/dom.js';
|
|
10
|
+
import { isKeyCode, isEmptyLine } from '../shared/utils/is.js';
|
|
11
|
+
import { ORDER_LIST_KEY, LIST_START_KEY, LIST_RESTART_KEY, ORDER_LIST_TYPE } from './types/index.js';
|
|
12
|
+
import { isOrderList } from './utils/is.js';
|
|
13
|
+
import { applyNewOrderList } from './utils/serial.js';
|
|
14
|
+
import { OrderListView } from './view/list.js';
|
|
15
15
|
|
|
16
16
|
class OrderListPlugin extends EditorPlugin {
|
|
17
17
|
constructor(editor) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LIST_TYPE_KEY } from '../../bullet-list/types/index.js';
|
|
2
|
+
import { ORDER_LIST_TYPE } from '../types/index.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 检查有序列表
|
|
6
|
+
* @param attrs
|
|
7
|
+
*/
|
|
8
|
+
const isOrderList = (attrs) => {
|
|
9
|
+
return attrs[LIST_TYPE_KEY] === ORDER_LIST_TYPE;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { isOrderList };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Delta } from '@block-kit/delta';
|
|
2
|
-
import { INDENT_LEVEL_KEY } from '
|
|
3
|
-
import { LIST_RESTART_KEY, LIST_START_KEY } from '
|
|
2
|
+
import { INDENT_LEVEL_KEY } from '../../indent/types/index.js';
|
|
3
|
+
import { LIST_RESTART_KEY, LIST_START_KEY } from '../types/index.js';
|
|
4
4
|
import { isOrderList } from './is.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { preventNativeEvent, cs } from '@block-kit/utils';
|
|
3
|
-
import { formatListLevel } from '
|
|
3
|
+
import { formatListLevel } from '../utils/format.js';
|
|
4
4
|
|
|
5
5
|
const OrderListView = props => {
|
|
6
6
|
const { level, start, children } = props;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { __decorate } from '
|
|
1
|
+
import { _ as __decorate } from '../tslib.es6-910e0469.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { EDITOR_EVENT, RawPoint, Point } from '@block-kit/core';
|
|
4
4
|
import { Delta } from '@block-kit/delta';
|
|
5
5
|
import { InjectWrapKeys, EditorPlugin } from '@block-kit/react';
|
|
6
6
|
import { Bind, KEY_CODE, NIL, TRULY } from '@block-kit/utils';
|
|
7
|
-
import { preventContextEvent } from '
|
|
8
|
-
import { isKeyCode, isEmptyLine } from '
|
|
9
|
-
import { QUOTE_KEY } from '
|
|
7
|
+
import { preventContextEvent } from '../shared/utils/dom.js';
|
|
8
|
+
import { isKeyCode, isEmptyLine } from '../shared/utils/is.js';
|
|
9
|
+
import { QUOTE_KEY } from './types/index.js';
|
|
10
10
|
|
|
11
11
|
class QuotePlugin extends EditorPlugin {
|
|
12
12
|
constructor(editor) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { __decorate } from '
|
|
1
|
+
import { _ as __decorate } from '../tslib.es6-910e0469.js';
|
|
2
2
|
import { CorePlugin, EDITOR_EVENT } from '@block-kit/core';
|
|
3
3
|
import { Bind } from '@block-kit/utils';
|
|
4
|
-
import { PLUGIN_EVENTS } from '
|
|
5
|
-
import { filterLineMarkMap, filterMarkMap } from '
|
|
6
|
-
import { PRESET_SHORTCUT } from '
|
|
7
|
-
import { SHORTCUT_KEY } from '
|
|
4
|
+
import { PLUGIN_EVENTS } from '../shared/utils/event.js';
|
|
5
|
+
import { filterLineMarkMap, filterMarkMap } from '../toolbar/utils/marks.js';
|
|
6
|
+
import { PRESET_SHORTCUT } from './modules/preset.js';
|
|
7
|
+
import { SHORTCUT_KEY } from './types/index.js';
|
|
8
8
|
|
|
9
9
|
class Shortcut extends CorePlugin {
|
|
10
10
|
constructor(editor, config) {
|
|
@@ -29,15 +29,15 @@ class Shortcut extends CorePlugin {
|
|
|
29
29
|
const { start, end } = current;
|
|
30
30
|
const lineMarkMap = filterLineMarkMap(lines.slice(start.line, end.line + 1).map(line => line.attributes));
|
|
31
31
|
if (current.isCollapsed) {
|
|
32
|
-
return Object.assign(Object.assign({}, this.editor.
|
|
32
|
+
return Object.assign(Object.assign({}, this.editor.lookup.marks), lineMarkMap);
|
|
33
33
|
}
|
|
34
34
|
const ops = [];
|
|
35
35
|
if (current.isCollapsed) {
|
|
36
|
-
const op = this.editor.
|
|
36
|
+
const op = this.editor.lookup.getOpAtPoint(current.start);
|
|
37
37
|
op && ops.push(op);
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
|
-
const fragment = this.editor.
|
|
40
|
+
const fragment = this.editor.lookup.getFragment();
|
|
41
41
|
fragment && ops.push(...fragment);
|
|
42
42
|
}
|
|
43
43
|
const markMap = filterMarkMap(ops);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CTRL_KEY, KEY_CODE, NIL, TRULY } from '@block-kit/utils';
|
|
2
|
-
import { BOLD_KEY } from '
|
|
3
|
-
import { ITALIC_KEY } from '
|
|
4
|
-
import { isKeyCode } from '
|
|
2
|
+
import { BOLD_KEY } from '../../bold/types/index.js';
|
|
3
|
+
import { ITALIC_KEY } from '../../italic/types/index.js';
|
|
4
|
+
import { isKeyCode } from '../../shared/utils/is.js';
|
|
5
5
|
|
|
6
6
|
const PRESET_SHORTCUT = {
|
|
7
7
|
[BOLD_KEY]: (event, payload) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isMatchHTMLTag, applyMarker } from '@block-kit/core';
|
|
2
2
|
import { EditorPlugin } from '@block-kit/react';
|
|
3
3
|
import { isHTMLElement, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { STRIKE_KEY } from '
|
|
4
|
+
import { STRIKE_KEY } from './types/index.js';
|
|
5
5
|
|
|
6
6
|
class StrikePlugin extends EditorPlugin {
|
|
7
7
|
destroy() { }
|
|
@@ -4,11 +4,11 @@ import { useEditorStatic } from '@block-kit/react';
|
|
|
4
4
|
import { cs } from '@block-kit/utils';
|
|
5
5
|
import { useMemoFn } from '@block-kit/utils/dist/es/hooks';
|
|
6
6
|
import { forwardRef, useState, useEffect } from 'react';
|
|
7
|
-
import { PLUGIN_EVENTS } from '
|
|
8
|
-
import { filterLineMarkMap, filterMarkMap } from '
|
|
7
|
+
import { PLUGIN_EVENTS } from '../../shared/utils/event.js';
|
|
8
|
+
import { filterLineMarkMap, filterMarkMap } from '../utils/marks.js';
|
|
9
9
|
import { ToolbarContext } from './provider.js';
|
|
10
10
|
|
|
11
|
-
const Toolbar = forwardRef((props, ref) => {
|
|
11
|
+
const Toolbar = /*#__PURE__*/ forwardRef((props, ref) => {
|
|
12
12
|
const { editor } = useEditorStatic();
|
|
13
13
|
const [keys, setKeys] = useState({});
|
|
14
14
|
const refreshMarks = useMemoFn(() => {
|
|
@@ -21,16 +21,16 @@ const Toolbar = forwardRef((props, ref) => {
|
|
|
21
21
|
const { start, end } = current;
|
|
22
22
|
const lineMarkMap = filterLineMarkMap(lines.slice(start.line, end.line + 1).map(line => line.attributes));
|
|
23
23
|
if (current.isCollapsed) {
|
|
24
|
-
setKeys(Object.assign(Object.assign({}, editor.
|
|
24
|
+
setKeys(Object.assign(Object.assign({}, editor.lookup.marks), lineMarkMap));
|
|
25
25
|
return void 0;
|
|
26
26
|
}
|
|
27
27
|
const ops = [];
|
|
28
28
|
if (current.isCollapsed) {
|
|
29
|
-
const op = editor.
|
|
29
|
+
const op = editor.lookup.getOpAtPoint(current.start);
|
|
30
30
|
op && ops.push(op);
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
|
-
const fragment = editor.
|
|
33
|
+
const fragment = editor.lookup.getFragment();
|
|
34
34
|
fragment && ops.push(...fragment);
|
|
35
35
|
}
|
|
36
36
|
const markMap = filterMarkMap(ops);
|