@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
|
@@ -5,7 +5,7 @@ import { cs } from '@block-kit/utils';
|
|
|
5
5
|
import { useMemoFn } from '@block-kit/utils/dist/es/hooks';
|
|
6
6
|
import { useRef, useState, useEffect, useMemo } from 'react';
|
|
7
7
|
import ReactDOM from 'react-dom';
|
|
8
|
-
import { getMountDOM } from '
|
|
8
|
+
import { getMountDOM } from '../../shared/utils/dom.js';
|
|
9
9
|
import { Toolbar } from './basic.js';
|
|
10
10
|
|
|
11
11
|
const FloatToolbar = props => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export { Toolbar } from "./context/basic";
|
|
3
3
|
export { FloatToolbar } from "./context/float";
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const ToolBarMixin: {
|
|
5
5
|
Cut: import("react").FC;
|
|
6
6
|
Bold: import("react").FC;
|
|
7
7
|
Link: import("react").FC<{
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Align } from './modules/align.js';
|
|
2
|
+
import { Bold } from './modules/bold.js';
|
|
3
|
+
import { BulletList } from './modules/bullet-list.js';
|
|
4
|
+
import { Cut } from './modules/cut.js';
|
|
5
|
+
import { Divider } from './modules/divider.js';
|
|
6
|
+
import { Emoji } from './modules/emoji.js';
|
|
7
|
+
import { FontColor } from './modules/font-color.js';
|
|
8
|
+
import { FontSize } from './modules/font-size.js';
|
|
9
|
+
import { Heading } from './modules/heading.js';
|
|
10
|
+
import { History } from './modules/history.js';
|
|
11
|
+
import { Image } from './modules/image.js';
|
|
12
|
+
import { InlineCode } from './modules/inline-code.js';
|
|
13
|
+
import { Italic } from './modules/italic.js';
|
|
14
|
+
import { LineHeight } from './modules/line-height.js';
|
|
15
|
+
import { Link } from './modules/link.js';
|
|
16
|
+
import { OrderList } from './modules/order-list.js';
|
|
17
|
+
import { Quote } from './modules/quote.js';
|
|
18
|
+
import { Strike } from './modules/strike.js';
|
|
19
|
+
import { Underline } from './modules/underline.js';
|
|
20
|
+
export { Toolbar } from './context/basic.js';
|
|
21
|
+
export { FloatToolbar } from './context/float.js';
|
|
22
|
+
|
|
23
|
+
const ToolBarMixin = {
|
|
24
|
+
Cut,
|
|
25
|
+
Bold,
|
|
26
|
+
Link,
|
|
27
|
+
Quote,
|
|
28
|
+
Image,
|
|
29
|
+
Align,
|
|
30
|
+
Emoji,
|
|
31
|
+
Italic,
|
|
32
|
+
Strike,
|
|
33
|
+
History,
|
|
34
|
+
Heading,
|
|
35
|
+
Divider,
|
|
36
|
+
FontSize,
|
|
37
|
+
FontColor,
|
|
38
|
+
OrderList,
|
|
39
|
+
Underline,
|
|
40
|
+
BulletList,
|
|
41
|
+
InlineCode,
|
|
42
|
+
LineHeight,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { ToolBarMixin };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import Trigger from '@arco-design/web-react/es/Trigger';
|
|
3
|
+
import '@arco-design/web-react/es/Trigger/style';
|
|
4
|
+
import IconAlignCenter from '@arco-design/web-react/icon/react-icon/IconAlignCenter';
|
|
5
|
+
import IconAlignLeft from '@arco-design/web-react/icon/react-icon/IconAlignLeft';
|
|
6
|
+
import IconAlignRight from '@arco-design/web-react/icon/react-icon/IconAlignRight';
|
|
7
|
+
import IconDown from '@arco-design/web-react/icon/react-icon/IconDown';
|
|
4
8
|
import { NIL } from '@block-kit/utils';
|
|
5
|
-
import { ALIGN_KEY } from '
|
|
6
|
-
import { JustifyIcon } from '
|
|
7
|
-
import { useToolbarContext } from '
|
|
9
|
+
import { ALIGN_KEY } from '../../align/types/index.js';
|
|
10
|
+
import { JustifyIcon } from '../../shared/icons/justify.js';
|
|
11
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
8
12
|
|
|
9
13
|
const MAP = {
|
|
10
14
|
left: jsx(IconAlignLeft, {}),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import IconBold from '@arco-design/web-react/icon/react-icon/IconBold';
|
|
3
3
|
import { cs, NIL, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { BOLD_KEY } from '
|
|
5
|
-
import { useToolbarContext } from '
|
|
4
|
+
import { BOLD_KEY } from '../../bold/types/index.js';
|
|
5
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
6
6
|
|
|
7
7
|
const Bold = () => {
|
|
8
8
|
const { keys, refreshMarks, editor } = useToolbarContext();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import IconUnorderedList from '@arco-design/web-react/icon/react-icon/IconUnorderedList';
|
|
3
3
|
import { cs, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { BULLET_LIST_KEY } from '
|
|
5
|
-
import { isBulletList } from '
|
|
6
|
-
import { useToolbarContext } from '
|
|
4
|
+
import { BULLET_LIST_KEY } from '../../bullet-list/types/index.js';
|
|
5
|
+
import { isBulletList } from '../../bullet-list/utils/is.js';
|
|
6
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
7
7
|
|
|
8
8
|
const BulletList = () => {
|
|
9
9
|
const { keys, refreshMarks, editor } = useToolbarContext();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { cs, TRULY } from '@block-kit/utils';
|
|
3
|
-
import { DIVIDER_KEY } from '
|
|
4
|
-
import { DividerIcon } from '
|
|
5
|
-
import { useToolbarContext } from '
|
|
3
|
+
import { DIVIDER_KEY } from '../../divider/types/index.js';
|
|
4
|
+
import { DividerIcon } from '../../shared/icons/divider.js';
|
|
5
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
6
6
|
|
|
7
7
|
const Divider = () => {
|
|
8
8
|
const { refreshMarks, editor } = useToolbarContext();
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import Trigger from '@arco-design/web-react/es/Trigger';
|
|
3
|
+
import '@arco-design/web-react/es/Trigger/style';
|
|
3
4
|
import Picker from '@emoji-mart/react';
|
|
4
5
|
import { cs } from '@block-kit/utils';
|
|
5
|
-
import { EMOJI_KEY } from '
|
|
6
|
-
import { EmojiIcon } from '
|
|
7
|
-
import { useToolbarContext } from '
|
|
6
|
+
import { EMOJI_KEY } from '../../emoji/types/index.js';
|
|
7
|
+
import { EmojiIcon } from '../../shared/icons/emoji.js';
|
|
8
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
8
9
|
|
|
9
10
|
const Emoji = () => {
|
|
10
11
|
const { editor } = useToolbarContext();
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import Trigger from '@arco-design/web-react/es/Trigger';
|
|
3
|
+
import '@arco-design/web-react/es/Trigger/style';
|
|
4
|
+
import IconDown from '@arco-design/web-react/icon/react-icon/IconDown';
|
|
4
5
|
import { cs } from '@block-kit/utils';
|
|
5
|
-
import { BACKGROUND_KEY } from '
|
|
6
|
-
import { FONT_COLOR_KEY } from '
|
|
7
|
-
import { FontColorIcon } from '
|
|
8
|
-
import { useToolbarContext } from '
|
|
6
|
+
import { BACKGROUND_KEY } from '../../background/types/index.js';
|
|
7
|
+
import { FONT_COLOR_KEY } from '../../font-color/types/index.js';
|
|
8
|
+
import { FontColorIcon } from '../../shared/icons/font-color.js';
|
|
9
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
9
10
|
|
|
10
11
|
const COLOR = [
|
|
11
12
|
"",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import Trigger from '@arco-design/web-react/es/Trigger';
|
|
3
|
+
import '@arco-design/web-react/es/Trigger/style';
|
|
4
|
+
import IconCheck from '@arco-design/web-react/icon/react-icon/IconCheck';
|
|
5
|
+
import IconDown from '@arco-design/web-react/icon/react-icon/IconDown';
|
|
4
6
|
import { NIL } from '@block-kit/utils';
|
|
5
7
|
import { useRef } from 'react';
|
|
6
|
-
import { FONT_SIZE_KEY } from '
|
|
7
|
-
import { FontSizeIcon } from '
|
|
8
|
-
import { useToolbarContext } from '
|
|
8
|
+
import { FONT_SIZE_KEY } from '../../font-size/types/index.js';
|
|
9
|
+
import { FontSizeIcon } from '../../shared/icons/font-size.js';
|
|
10
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
9
11
|
|
|
10
12
|
const STEP = Array(10)
|
|
11
13
|
.fill(null)
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import Trigger from '@arco-design/web-react/es/Trigger';
|
|
3
|
+
import '@arco-design/web-react/es/Trigger/style';
|
|
4
|
+
import IconDown from '@arco-design/web-react/icon/react-icon/IconDown';
|
|
5
|
+
import IconH1 from '@arco-design/web-react/icon/react-icon/IconH1';
|
|
6
|
+
import IconH2 from '@arco-design/web-react/icon/react-icon/IconH2';
|
|
7
|
+
import IconH3 from '@arco-design/web-react/icon/react-icon/IconH3';
|
|
4
8
|
import { NIL } from '@block-kit/utils';
|
|
5
|
-
import { HEADING_KEY } from '
|
|
6
|
-
import { TextIcon } from '
|
|
7
|
-
import { useToolbarContext } from '
|
|
9
|
+
import { HEADING_KEY } from '../../heading/types/index.js';
|
|
10
|
+
import { TextIcon } from '../../shared/icons/text.js';
|
|
11
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
8
12
|
|
|
9
13
|
const MAP = {
|
|
10
14
|
h1: jsx(IconH1, {}),
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import IconRedo from '@arco-design/web-react/icon/react-icon/IconRedo';
|
|
3
|
+
import IconUndo from '@arco-design/web-react/icon/react-icon/IconUndo';
|
|
3
4
|
import { EDITOR_EVENT } from '@block-kit/core';
|
|
4
5
|
import { cs } from '@block-kit/utils';
|
|
5
6
|
import { useMemoFn } from '@block-kit/utils/dist/es/hooks';
|
|
6
7
|
import { useState, useEffect, Fragment } from 'react';
|
|
7
|
-
import { useToolbarContext } from '
|
|
8
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
8
9
|
|
|
9
10
|
const History = () => {
|
|
10
11
|
const { editor, refreshMarks } = useToolbarContext();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import IconImage from '@arco-design/web-react/icon/react-icon/IconImage';
|
|
3
3
|
import { cs, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { IMAGE_KEY } from '
|
|
5
|
-
import { useToolbarContext } from '
|
|
4
|
+
import { IMAGE_KEY } from '../../image/types/index.js';
|
|
5
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
6
6
|
|
|
7
7
|
const Image = () => {
|
|
8
8
|
const { refreshMarks, editor } = useToolbarContext();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import IconCode from '@arco-design/web-react/icon/react-icon/IconCode';
|
|
3
3
|
import { cs, NIL, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { INLINE_CODE } from '
|
|
5
|
-
import { useToolbarContext } from '
|
|
4
|
+
import { INLINE_CODE } from '../../inline-code/types/index.js';
|
|
5
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
6
6
|
|
|
7
7
|
const InlineCode = () => {
|
|
8
8
|
const { keys, refreshMarks, editor } = useToolbarContext();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import IconItalic from '@arco-design/web-react/icon/react-icon/IconItalic';
|
|
3
3
|
import { cs, NIL, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { ITALIC_KEY } from '
|
|
5
|
-
import { useToolbarContext } from '
|
|
4
|
+
import { ITALIC_KEY } from '../../italic/types/index.js';
|
|
5
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
6
6
|
|
|
7
7
|
const Italic = () => {
|
|
8
8
|
const { keys, refreshMarks, editor } = useToolbarContext();
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import Trigger from '@arco-design/web-react/es/Trigger';
|
|
3
|
+
import '@arco-design/web-react/es/Trigger/style';
|
|
4
|
+
import IconCheck from '@arco-design/web-react/icon/react-icon/IconCheck';
|
|
5
|
+
import IconDown from '@arco-design/web-react/icon/react-icon/IconDown';
|
|
4
6
|
import { NIL } from '@block-kit/utils';
|
|
5
|
-
import { LINE_HEIGHT_KEY } from '
|
|
6
|
-
import { LineHeightIcon } from '
|
|
7
|
-
import { useToolbarContext } from '
|
|
7
|
+
import { LINE_HEIGHT_KEY } from '../../line-height/types/index.js';
|
|
8
|
+
import { LineHeightIcon } from '../../shared/icons/line-height.js';
|
|
9
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
8
10
|
|
|
9
11
|
const STEP = [...Array.from({ length: 11 }, (_, i) => i * 0.1 + 1.5), 3].map(v => v.toFixed(1).toString());
|
|
10
12
|
const LineHeight = () => {
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import Button from '@arco-design/web-react/es/Button';
|
|
3
|
+
import '@arco-design/web-react/es/Button/style';
|
|
4
|
+
import Form from '@arco-design/web-react/es/Form';
|
|
5
|
+
import '@arco-design/web-react/es/Form/style';
|
|
6
|
+
import Input from '@arco-design/web-react/es/Input';
|
|
7
|
+
import '@arco-design/web-react/es/Input/style';
|
|
8
|
+
import Switch from '@arco-design/web-react/es/Switch';
|
|
9
|
+
import '@arco-design/web-react/es/Switch/style';
|
|
10
|
+
import Trigger from '@arco-design/web-react/es/Trigger';
|
|
11
|
+
import '@arco-design/web-react/es/Trigger/style';
|
|
3
12
|
import useForm from '@arco-design/web-react/es/Form/useForm';
|
|
4
|
-
import
|
|
13
|
+
import IconLink from '@arco-design/web-react/icon/react-icon/IconLink';
|
|
14
|
+
import IconRight from '@arco-design/web-react/icon/react-icon/IconRight';
|
|
5
15
|
import { APPLY_SOURCE, EDITOR_EVENT } from '@block-kit/core';
|
|
6
16
|
import { cs, TRULY, NIL } from '@block-kit/utils';
|
|
7
17
|
import { useState, useEffect } from 'react';
|
|
8
|
-
import { LINK_KEY, LINK_BLANK_KEY, LINK_TEMP_KEY } from '
|
|
9
|
-
import { useToolbarContext } from '
|
|
18
|
+
import { LINK_KEY, LINK_BLANK_KEY, LINK_TEMP_KEY } from '../../link/types/index.js';
|
|
19
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
10
20
|
|
|
11
21
|
const Link = props => {
|
|
12
22
|
const [form] = useForm();
|
|
@@ -27,9 +37,9 @@ const Link = props => {
|
|
|
27
37
|
// 折叠选区的情况下则插入文本
|
|
28
38
|
if (!insert)
|
|
29
39
|
return void 0;
|
|
30
|
-
editor.
|
|
40
|
+
editor.lookup.marks = Object.assign(Object.assign({}, editor.lookup.marks), { [LINK_KEY]: filteredHref });
|
|
31
41
|
if (blank) {
|
|
32
|
-
editor.
|
|
42
|
+
editor.lookup.marks[LINK_BLANK_KEY] = TRULY;
|
|
33
43
|
}
|
|
34
44
|
editor.perform.insertText(sel, insert);
|
|
35
45
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import IconOrderedList from '@arco-design/web-react/icon/react-icon/IconOrderedList';
|
|
3
3
|
import { cs, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { ORDER_LIST_KEY } from '
|
|
5
|
-
import { isOrderList } from '
|
|
6
|
-
import { useToolbarContext } from '
|
|
4
|
+
import { ORDER_LIST_KEY } from '../../order-list/types/index.js';
|
|
5
|
+
import { isOrderList } from '../../order-list/utils/is.js';
|
|
6
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
7
7
|
|
|
8
8
|
const OrderList = () => {
|
|
9
9
|
const { keys, refreshMarks, editor } = useToolbarContext();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import IconQuote from '@arco-design/web-react/icon/react-icon/IconQuote';
|
|
3
3
|
import { cs, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { QUOTE_KEY } from '
|
|
5
|
-
import { useToolbarContext } from '
|
|
4
|
+
import { QUOTE_KEY } from '../../quote/types/index.js';
|
|
5
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
6
6
|
|
|
7
7
|
const Quote = () => {
|
|
8
8
|
const { keys, refreshMarks, editor } = useToolbarContext();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import IconStrikethrough from '@arco-design/web-react/icon/react-icon/IconStrikethrough';
|
|
3
3
|
import { cs, NIL, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { STRIKE_KEY } from '
|
|
5
|
-
import { useToolbarContext } from '
|
|
4
|
+
import { STRIKE_KEY } from '../../strike/types/index.js';
|
|
5
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
6
6
|
|
|
7
7
|
const Strike = () => {
|
|
8
8
|
const { keys, refreshMarks, editor } = useToolbarContext();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import IconUnderline from '@arco-design/web-react/icon/react-icon/IconUnderline';
|
|
3
3
|
import { cs, NIL, TRULY } from '@block-kit/utils';
|
|
4
|
-
import { UNDERLINE_KEY } from '
|
|
5
|
-
import { useToolbarContext } from '
|
|
4
|
+
import { UNDERLINE_KEY } from '../../underline/types/index.js';
|
|
5
|
+
import { useToolbarContext } from '../context/provider.js';
|
|
6
6
|
|
|
7
7
|
const Underline = () => {
|
|
8
8
|
const { keys, refreshMarks, editor } = useToolbarContext();
|
|
@@ -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 { UNDERLINE_KEY } from '
|
|
4
|
+
import { UNDERLINE_KEY } from './types/index.js';
|
|
5
5
|
|
|
6
6
|
class UnderlinePlugin extends EditorPlugin {
|
|
7
7
|
destroy() { }
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-9953fd0d.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@block-kit/core');
|
|
8
8
|
var delta = require('@block-kit/delta');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-9953fd0d.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@block-kit/core');
|
|
8
8
|
var delta = require('@block-kit/delta');
|
package/dist/lib/emoji/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-9953fd0d.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@block-kit/core');
|
|
8
8
|
var delta = require('@block-kit/delta');
|
package/dist/lib/image/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-9953fd0d.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@block-kit/core');
|
|
8
8
|
var delta = require('@block-kit/delta');
|
|
@@ -104,7 +104,7 @@ class ImagePlugin extends react.EditorPlugin {
|
|
|
104
104
|
for (let i = 0; i < packIndex.length; i++) {
|
|
105
105
|
const file = files[i];
|
|
106
106
|
const refIndex = packIndex[i];
|
|
107
|
-
const ref = editor.
|
|
107
|
+
const ref = editor.tracer.pack(core.RawRange.from(refIndex, 0));
|
|
108
108
|
// 独立并行上传, 且独立 unpack
|
|
109
109
|
this.uploadImage(file)
|
|
110
110
|
.then(res => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var
|
|
6
|
+
var IconLoading = require('@arco-design/web-react/icon/react-icon-cjs/IconLoading');
|
|
7
7
|
var core = require('@block-kit/core');
|
|
8
8
|
var delta = require('@block-kit/delta');
|
|
9
9
|
var react = require('@block-kit/react');
|
|
@@ -12,6 +12,10 @@ var shared_components_selection = require('../../shared/components/selection.js'
|
|
|
12
12
|
var image_types_index = require('../types/index.js');
|
|
13
13
|
var image_view_wrapper = require('./wrapper.js');
|
|
14
14
|
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var IconLoading__default = /*#__PURE__*/_interopDefaultLegacy(IconLoading);
|
|
18
|
+
|
|
15
19
|
const ImageView = props => {
|
|
16
20
|
const { selection, context, editor } = props;
|
|
17
21
|
const attrs = context.attributes || {};
|
|
@@ -37,7 +41,7 @@ const ImageView = props => {
|
|
|
37
41
|
const delta$1 = new delta.Delta().retain(rawRange.start).retain(rawRange.len, next);
|
|
38
42
|
editor.state.apply(delta$1, { source: core.APPLY_SOURCE.NO_UNDO, autoCaret: false });
|
|
39
43
|
};
|
|
40
|
-
return (jsxRuntime.jsxs(react.Void, { className: "block-kit-image-container", context: context, children: [status === image_types_index.LOADING_STATUS.LOADING && (jsxRuntime.jsx("div", { className: "block-kit-image-loading", children: jsxRuntime.jsx(
|
|
44
|
+
return (jsxRuntime.jsxs(react.Void, { className: "block-kit-image-container", context: context, children: [status === image_types_index.LOADING_STATUS.LOADING && (jsxRuntime.jsx("div", { className: "block-kit-image-loading", children: jsxRuntime.jsx(IconLoading__default["default"], {}) })), jsxRuntime.jsx(shared_components_selection.SelectionHOC, { selection: selection, leaf: context.leafState, children: jsxRuntime.jsx(image_view_wrapper.ImageWrapper, { editor: props.editor, src: src, leaf: context.leafState, children: jsxRuntime.jsx("img", { className: "block-kit-image", src: src, onLoad: onImageLoad, width: utils.Styles.pixelate(width), height: utils.Styles.pixelate(height) }) }) })] }));
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
exports.ImageView = ImageView;
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var
|
|
6
|
+
var Image = require('@arco-design/web-react/lib/Image');
|
|
7
|
+
require('@arco-design/web-react/lib/Image/style');
|
|
7
8
|
var core = require('@block-kit/core');
|
|
8
9
|
var delta = require('@block-kit/delta');
|
|
9
10
|
var react = require('@block-kit/react');
|
|
@@ -11,7 +12,11 @@ var utils = require('@block-kit/utils');
|
|
|
11
12
|
var React = require('react');
|
|
12
13
|
var image_types_index = require('../types/index.js');
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image);
|
|
18
|
+
|
|
19
|
+
const Preview = Image__default["default"].Preview;
|
|
15
20
|
const ImageWrapper = props => {
|
|
16
21
|
const { readonly } = react.useReadonly();
|
|
17
22
|
const [src, setImage] = React.useState("");
|
package/dist/lib/indent/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-9953fd0d.js');
|
|
6
6
|
var core = require('@block-kit/core');
|
|
7
7
|
var delta = require('@block-kit/delta');
|
|
8
8
|
var react = require('@block-kit/react');
|
package/dist/lib/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/lib/index.js
CHANGED
|
@@ -118,7 +118,7 @@ exports.isKeyCode = shared_utils_is.isKeyCode;
|
|
|
118
118
|
exports.Shortcut = shortcut_index.Shortcut;
|
|
119
119
|
exports.StrikePlugin = strike_index.StrikePlugin;
|
|
120
120
|
exports.STRIKE_KEY = strike_types_index.STRIKE_KEY;
|
|
121
|
-
exports.
|
|
121
|
+
exports.ToolBarMixin = toolbar_index.ToolBarMixin;
|
|
122
122
|
exports.ToolbarContext = toolbar_context_provider.ToolbarContext;
|
|
123
123
|
exports.useToolbarContext = toolbar_context_provider.useToolbarContext;
|
|
124
124
|
exports.UnderlinePlugin = underline_index.UnderlinePlugin;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-9953fd0d.js');
|
|
6
6
|
var core = require('@block-kit/core');
|
|
7
7
|
var react = require('@block-kit/react');
|
|
8
8
|
var inlineCode_types_index = require('./types/index.js');
|
package/dist/lib/link/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-9953fd0d.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var react = require('@block-kit/react');
|
|
8
8
|
var utils = require('@block-kit/utils');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-9953fd0d.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@block-kit/core');
|
|
8
8
|
var delta = require('@block-kit/delta');
|
|
@@ -66,7 +66,7 @@ class SuggestModule {
|
|
|
66
66
|
this.unmountSuggestPanel();
|
|
67
67
|
return void 0;
|
|
68
68
|
}
|
|
69
|
-
const ops = this.editor.
|
|
69
|
+
const ops = this.editor.lookup.getFragment(new core.Range(this.point, current.end));
|
|
70
70
|
if (!ops)
|
|
71
71
|
return void 0;
|
|
72
72
|
const text = delta.deltaToText(new delta.Delta(ops));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-9953fd0d.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@block-kit/core');
|
|
8
8
|
var delta = require('@block-kit/delta');
|
package/dist/lib/quote/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-9953fd0d.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@block-kit/core');
|
|
8
8
|
var delta = require('@block-kit/delta');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-9953fd0d.js');
|
|
6
6
|
var core = require('@block-kit/core');
|
|
7
7
|
var utils = require('@block-kit/utils');
|
|
8
8
|
|