@atlaskit/editor-core 189.3.38 → 189.4.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/CHANGELOG.md +17 -0
- package/dist/cjs/plugins/extension/commands.js +9 -2
- package/dist/cjs/plugins/extension/index.js +15 -1
- package/dist/cjs/plugins/extension/pm-plugins/main.js +2 -1
- package/dist/cjs/plugins/extension/toolbar.js +1 -1
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +1 -8
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionComponent.js +29 -10
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionNodeWrapper.js +7 -0
- package/dist/cjs/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +154 -0
- package/dist/cjs/plugins/extension/utils.js +6 -4
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/presets/universal.js +2 -1
- package/dist/cjs/ui/ContentStyles/extension.js +2 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/extension/commands.js +10 -3
- package/dist/es2019/plugins/extension/index.js +16 -2
- package/dist/es2019/plugins/extension/pm-plugins/main.js +2 -1
- package/dist/es2019/plugins/extension/toolbar.js +1 -1
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +1 -8
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionComponent.js +29 -10
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionNodeWrapper.js +7 -0
- package/dist/es2019/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +159 -0
- package/dist/es2019/plugins/extension/utils.js +6 -4
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/presets/universal.js +2 -1
- package/dist/es2019/ui/ContentStyles/extension.js +6 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/extension/commands.js +9 -2
- package/dist/esm/plugins/extension/index.js +16 -2
- package/dist/esm/plugins/extension/pm-plugins/main.js +2 -1
- package/dist/esm/plugins/extension/toolbar.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +1 -8
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +29 -10
- package/dist/esm/plugins/extension/ui/Extension/ExtensionNodeWrapper.js +7 -0
- package/dist/esm/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +146 -0
- package/dist/esm/plugins/extension/utils.js +6 -4
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/presets/universal.js +2 -1
- package/dist/esm/ui/ContentStyles/extension.js +2 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/extension/commands.d.ts +2 -0
- package/dist/types/plugins/extension/ui/Extension/ExtensionComponent.d.ts +1 -0
- package/dist/types/plugins/extension/ui/Extension/ExtensionNodeWrapper.d.ts +7 -0
- package/dist/types/plugins/extension/ui/Extension/MultiBodiedExtension/index.d.ts +16 -0
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/extension/commands.d.ts +2 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/ExtensionComponent.d.ts +1 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/ExtensionNodeWrapper.d.ts +7 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/MultiBodiedExtension/index.d.ts +16 -0
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/package.json +7 -6
- package/dist/cjs/plugins/insert-block/index.js +0 -165
- package/dist/cjs/plugins/insert-block/types.js +0 -5
- package/dist/cjs/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -152
- package/dist/cjs/plugins/insert-block/ui/ElementBrowser/types.js +0 -5
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -42
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -42
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -66
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -217
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -49
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -565
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -250
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -12
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -20
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -30
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -11
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -5
- package/dist/es2019/plugins/insert-block/index.js +0 -159
- package/dist/es2019/plugins/insert-block/types.js +0 -1
- package/dist/es2019/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -150
- package/dist/es2019/plugins/insert-block/ui/ElementBrowser/types.js +0 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -35
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -35
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -59
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -198
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -37
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -558
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -201
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -8
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -22
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -16
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -1
- package/dist/esm/plugins/insert-block/index.js +0 -158
- package/dist/esm/plugins/insert-block/types.js +0 -1
- package/dist/esm/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -146
- package/dist/esm/plugins/insert-block/ui/ElementBrowser/types.js +0 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -35
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -35
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -59
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -210
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -41
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -560
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -243
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -13
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -24
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -4
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -1
- package/dist/types/plugins/insert-block/index.d.ts +0 -16
- package/dist/types/plugins/insert-block/types.d.ts +0 -45
- package/dist/types/plugins/insert-block/ui/ElementBrowser/InsertMenu.d.ts +0 -4
- package/dist/types/plugins/insert-block/ui/ElementBrowser/types.d.ts +0 -22
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +0 -28
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +0 -18
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +0 -30
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -39
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +0 -16
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +0 -46
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +0 -34
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/messages.d.ts +0 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.d.ts +0 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +0 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/styles.d.ts +0 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -59
- package/dist/types-ts4.5/plugins/insert-block/index.d.ts +0 -16
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +0 -45
- package/dist/types-ts4.5/plugins/insert-block/ui/ElementBrowser/InsertMenu.d.ts +0 -4
- package/dist/types-ts4.5/plugins/insert-block/ui/ElementBrowser/types.d.ts +0 -22
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +0 -28
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +0 -18
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +0 -30
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -42
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +0 -16
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +0 -46
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +0 -34
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/messages.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +0 -2
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/styles.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -59
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import memoizeOne from 'memoize-one';
|
|
5
|
-
import DecisionIcon from '@atlaskit/icon/glyph/editor/decision';
|
|
6
|
-
import TaskIcon from '@atlaskit/icon/glyph/editor/task';
|
|
7
|
-
import TableIcon from '@atlaskit/icon/glyph/editor/table';
|
|
8
|
-
import EditorImageIcon from '@atlaskit/icon/glyph/editor/image';
|
|
9
|
-
import MentionIcon from '@atlaskit/icon/glyph/editor/mention';
|
|
10
|
-
import EditorMoreIcon from '@atlaskit/icon/glyph/editor/more';
|
|
11
|
-
import LinkIcon from '@atlaskit/icon/glyph/editor/link';
|
|
12
|
-
import EmojiIcon from '@atlaskit/icon/glyph/editor/emoji';
|
|
13
|
-
import DateIcon from '@atlaskit/icon/glyph/editor/date';
|
|
14
|
-
import StatusIcon from '@atlaskit/icon/glyph/status';
|
|
15
|
-
import ExpandNodeIcon from '@atlaskit/icon/glyph/chevron-right-circle';
|
|
16
|
-
import PlaceholderTextIcon from '@atlaskit/icon/glyph/media-services/text';
|
|
17
|
-
import LayoutTwoEqualIcon from '@atlaskit/icon/glyph/editor/layout-two-equal';
|
|
18
|
-
import HorizontalRuleIcon from '@atlaskit/icon/glyph/editor/horizontal-rule';
|
|
19
|
-
import CodeIcon from '@atlaskit/icon/glyph/editor/code';
|
|
20
|
-
import InfoIcon from '@atlaskit/icon/glyph/editor/info';
|
|
21
|
-
import QuoteIcon from '@atlaskit/icon/glyph/quote';
|
|
22
|
-
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
23
|
-
import { tooltip, addLink, toggleTable } from '@atlaskit/editor-common/keymaps';
|
|
24
|
-
import { shallowEquals } from './shallow-equals';
|
|
25
|
-
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
26
|
-
const from = init => ({
|
|
27
|
-
content: init.content,
|
|
28
|
-
tooltipDescription: init.tooltipDescription,
|
|
29
|
-
value: {
|
|
30
|
-
name: init.name
|
|
31
|
-
},
|
|
32
|
-
elemBefore: jsx(init.Icon, {
|
|
33
|
-
label: init.content
|
|
34
|
-
}),
|
|
35
|
-
elemAfter: init.shortcut ? jsx("div", {
|
|
36
|
-
css: shortcutStyle
|
|
37
|
-
}, init.shortcut) : undefined,
|
|
38
|
-
'aria-label': init.shortcut ? init.content + ' ' + init.shortcut : init.content,
|
|
39
|
-
'aria-haspopup': init['aria-haspopup'],
|
|
40
|
-
'aria-keyshortcuts': init['aria-keyshortcuts'],
|
|
41
|
-
shortcut: init.shortcut,
|
|
42
|
-
isDisabled: init.disabled
|
|
43
|
-
});
|
|
44
|
-
const mem = fn => memoizeOne(fn, shallowEquals);
|
|
45
|
-
export const action = mem(init => {
|
|
46
|
-
return from({
|
|
47
|
-
content: init.content,
|
|
48
|
-
tooltipDescription: init.tooltipDescription,
|
|
49
|
-
disabled: init.disabled,
|
|
50
|
-
name: 'action',
|
|
51
|
-
shortcut: '[]',
|
|
52
|
-
Icon: TaskIcon,
|
|
53
|
-
'aria-keyshortcuts': '[ ] Space'
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
export const link = mem(init => from({
|
|
57
|
-
content: init.content,
|
|
58
|
-
tooltipDescription: init.tooltipDescription,
|
|
59
|
-
disabled: init.disabled,
|
|
60
|
-
name: 'link',
|
|
61
|
-
shortcut: tooltip(addLink),
|
|
62
|
-
Icon: LinkIcon,
|
|
63
|
-
'aria-haspopup': init['aria-haspopup'],
|
|
64
|
-
'aria-keyshortcuts': getAriaKeyshortcuts(addLink)
|
|
65
|
-
}));
|
|
66
|
-
export const media = mem(init => from({
|
|
67
|
-
content: init.content,
|
|
68
|
-
tooltipDescription: init.tooltipDescription,
|
|
69
|
-
disabled: init.disabled,
|
|
70
|
-
name: 'media',
|
|
71
|
-
Icon: EditorImageIcon
|
|
72
|
-
}));
|
|
73
|
-
export const imageUpload = mem(init => from({
|
|
74
|
-
content: init.content,
|
|
75
|
-
tooltipDescription: init.tooltipDescription,
|
|
76
|
-
disabled: init.disabled,
|
|
77
|
-
name: 'image upload',
|
|
78
|
-
Icon: EditorImageIcon
|
|
79
|
-
}));
|
|
80
|
-
export const mention = mem(init => from({
|
|
81
|
-
content: init.content,
|
|
82
|
-
tooltipDescription: init.tooltipDescription,
|
|
83
|
-
disabled: init.disabled,
|
|
84
|
-
name: 'mention',
|
|
85
|
-
Icon: MentionIcon,
|
|
86
|
-
shortcut: '@',
|
|
87
|
-
'aria-haspopup': init['aria-haspopup'],
|
|
88
|
-
'aria-keyshortcuts': 'Shift+2 Space'
|
|
89
|
-
}));
|
|
90
|
-
export const emoji = mem(init => from({
|
|
91
|
-
content: init.content,
|
|
92
|
-
tooltipDescription: init.tooltipDescription,
|
|
93
|
-
disabled: init.disabled,
|
|
94
|
-
name: 'emoji',
|
|
95
|
-
Icon: EmojiIcon,
|
|
96
|
-
shortcut: ':',
|
|
97
|
-
'aria-haspopup': init['aria-haspopup'],
|
|
98
|
-
'aria-keyshortcuts': 'Shift+;'
|
|
99
|
-
}));
|
|
100
|
-
export const table = mem(init => from({
|
|
101
|
-
content: init.content,
|
|
102
|
-
tooltipDescription: init.tooltipDescription,
|
|
103
|
-
disabled: init.disabled,
|
|
104
|
-
name: 'table',
|
|
105
|
-
Icon: TableIcon,
|
|
106
|
-
shortcut: tooltip(toggleTable),
|
|
107
|
-
'aria-keyshortcuts': getAriaKeyshortcuts(toggleTable)
|
|
108
|
-
}));
|
|
109
|
-
export const layout = mem(init => from({
|
|
110
|
-
content: init.content,
|
|
111
|
-
tooltipDescription: init.tooltipDescription,
|
|
112
|
-
disabled: init.disabled,
|
|
113
|
-
name: 'layout',
|
|
114
|
-
Icon: LayoutTwoEqualIcon
|
|
115
|
-
}));
|
|
116
|
-
export const codeblock = mem(init => from({
|
|
117
|
-
content: init.content,
|
|
118
|
-
tooltipDescription: init.tooltipDescription,
|
|
119
|
-
disabled: init.disabled,
|
|
120
|
-
name: 'codeblock',
|
|
121
|
-
Icon: CodeIcon,
|
|
122
|
-
shortcut: init.shortcut,
|
|
123
|
-
'aria-keyshortcuts': getAriaKeyshortcuts(init.shortcut)
|
|
124
|
-
}));
|
|
125
|
-
export const panel = mem(init => from({
|
|
126
|
-
content: init.content,
|
|
127
|
-
tooltipDescription: init.tooltipDescription,
|
|
128
|
-
disabled: init.disabled,
|
|
129
|
-
name: 'panel',
|
|
130
|
-
Icon: InfoIcon,
|
|
131
|
-
shortcut: init.shortcut,
|
|
132
|
-
'aria-keyshortcuts': getAriaKeyshortcuts(init.shortcut)
|
|
133
|
-
}));
|
|
134
|
-
export const blockquote = mem(init => from({
|
|
135
|
-
content: init.content,
|
|
136
|
-
tooltipDescription: init.tooltipDescription,
|
|
137
|
-
disabled: init.disabled,
|
|
138
|
-
name: 'blockquote',
|
|
139
|
-
Icon: QuoteIcon,
|
|
140
|
-
shortcut: init.shortcut,
|
|
141
|
-
'aria-keyshortcuts': 'Shift+. Space'
|
|
142
|
-
}));
|
|
143
|
-
export const decision = mem(init => from({
|
|
144
|
-
content: init.content,
|
|
145
|
-
tooltipDescription: init.tooltipDescription,
|
|
146
|
-
disabled: init.disabled,
|
|
147
|
-
name: 'decision',
|
|
148
|
-
Icon: DecisionIcon,
|
|
149
|
-
shortcut: '<>',
|
|
150
|
-
'aria-keyshortcuts': 'Shift+, Shift+. Space'
|
|
151
|
-
}));
|
|
152
|
-
export const horizontalrule = mem(init => from({
|
|
153
|
-
content: init.content,
|
|
154
|
-
tooltipDescription: init.tooltipDescription,
|
|
155
|
-
disabled: init.disabled,
|
|
156
|
-
name: 'horizontalrule',
|
|
157
|
-
Icon: HorizontalRuleIcon,
|
|
158
|
-
shortcut: '---',
|
|
159
|
-
'aria-keyshortcuts': '- - -'
|
|
160
|
-
}));
|
|
161
|
-
export const expand = mem(init => from({
|
|
162
|
-
content: init.content,
|
|
163
|
-
tooltipDescription: init.tooltipDescription,
|
|
164
|
-
disabled: init.disabled,
|
|
165
|
-
name: 'expand',
|
|
166
|
-
Icon: ExpandNodeIcon
|
|
167
|
-
}));
|
|
168
|
-
export const date = mem(init => from({
|
|
169
|
-
content: init.content,
|
|
170
|
-
tooltipDescription: init.tooltipDescription,
|
|
171
|
-
disabled: init.disabled,
|
|
172
|
-
name: 'date',
|
|
173
|
-
Icon: DateIcon,
|
|
174
|
-
shortcut: '//',
|
|
175
|
-
'aria-keyshortcuts': '/ / Enter'
|
|
176
|
-
}));
|
|
177
|
-
export const placeholder = mem(init => from({
|
|
178
|
-
content: init.content,
|
|
179
|
-
tooltipDescription: init.tooltipDescription,
|
|
180
|
-
disabled: init.disabled,
|
|
181
|
-
name: 'placeholder text',
|
|
182
|
-
Icon: () => jsx(PlaceholderTextIcon, {
|
|
183
|
-
label: ""
|
|
184
|
-
})
|
|
185
|
-
}));
|
|
186
|
-
export const status = mem(init => from({
|
|
187
|
-
content: init.content,
|
|
188
|
-
tooltipDescription: init.tooltipDescription,
|
|
189
|
-
disabled: init.disabled,
|
|
190
|
-
name: 'status',
|
|
191
|
-
Icon: StatusIcon
|
|
192
|
-
}));
|
|
193
|
-
export const more = mem(init => from({
|
|
194
|
-
content: init.content,
|
|
195
|
-
tooltipDescription: init.tooltipDescription,
|
|
196
|
-
disabled: init.disabled,
|
|
197
|
-
name: 'macro',
|
|
198
|
-
Icon: () => jsx(EditorMoreIcon, {
|
|
199
|
-
label: ""
|
|
200
|
-
})
|
|
201
|
-
}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const endPositionNames = ['macro-browser', 'slash-onboarding'];
|
|
2
|
-
const isMacro = item => typeof item.content === 'string' && item.content.includes('macro');
|
|
3
|
-
export const sortItems = items => {
|
|
4
|
-
return items.sort((a, b) => {
|
|
5
|
-
if (endPositionNames.includes(a.value.name) && endPositionNames.includes(b.value.name)) {
|
|
6
|
-
return endPositionNames.indexOf(a.value.name) - endPositionNames.indexOf(b.value.name);
|
|
7
|
-
}
|
|
8
|
-
if (endPositionNames.includes(b.value.name)) {
|
|
9
|
-
return -1;
|
|
10
|
-
}
|
|
11
|
-
if (endPositionNames.includes(a.value.name)) {
|
|
12
|
-
return 1;
|
|
13
|
-
}
|
|
14
|
-
if (isMacro(a) && !isMacro(b)) {
|
|
15
|
-
return 1;
|
|
16
|
-
}
|
|
17
|
-
if (isMacro(b) && !isMacro(a)) {
|
|
18
|
-
return -1;
|
|
19
|
-
}
|
|
20
|
-
return a.content < b.content ? -1 : 1;
|
|
21
|
-
});
|
|
22
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
|
|
4
|
-
import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
|
|
5
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
|
-
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
7
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
8
|
-
var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize) {
|
|
9
|
-
switch (toolbarSize) {
|
|
10
|
-
case ToolbarSize.XXL:
|
|
11
|
-
case ToolbarSize.XL:
|
|
12
|
-
case ToolbarSize.L:
|
|
13
|
-
case ToolbarSize.M:
|
|
14
|
-
return 7;
|
|
15
|
-
case ToolbarSize.S:
|
|
16
|
-
return 2;
|
|
17
|
-
default:
|
|
18
|
-
return 0;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
|
|
23
|
-
* @param name Block name
|
|
24
|
-
*/
|
|
25
|
-
function handleInsertBlockType(insertCodeBlock, insertPanel, insertBlockQuote) {
|
|
26
|
-
return function (name) {
|
|
27
|
-
if (name === CODE_BLOCK.name && insertCodeBlock) {
|
|
28
|
-
return insertCodeBlock(INPUT_METHOD.TOOLBAR);
|
|
29
|
-
}
|
|
30
|
-
if (name === PANEL.name && insertPanel) {
|
|
31
|
-
return insertPanel(INPUT_METHOD.TOOLBAR);
|
|
32
|
-
}
|
|
33
|
-
if (name === BLOCK_QUOTE.name && insertBlockQuote) {
|
|
34
|
-
return insertBlockQuote(INPUT_METHOD.TOOLBAR);
|
|
35
|
-
}
|
|
36
|
-
return function () {
|
|
37
|
-
return false;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
42
|
-
var _api$featureFlags;
|
|
43
|
-
var _ref$config = _ref.config,
|
|
44
|
-
options = _ref$config === void 0 ? {} : _ref$config,
|
|
45
|
-
api = _ref.api;
|
|
46
|
-
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
47
|
-
return {
|
|
48
|
-
name: 'insertBlock',
|
|
49
|
-
primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
|
|
50
|
-
var editorView = _ref2.editorView,
|
|
51
|
-
editorActions = _ref2.editorActions,
|
|
52
|
-
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
53
|
-
providerFactory = _ref2.providerFactory,
|
|
54
|
-
popupsMountPoint = _ref2.popupsMountPoint,
|
|
55
|
-
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
56
|
-
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
57
|
-
toolbarSize = _ref2.toolbarSize,
|
|
58
|
-
disabled = _ref2.disabled,
|
|
59
|
-
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
|
|
60
|
-
isLastItem = _ref2.isLastItem;
|
|
61
|
-
var renderNode = function renderNode(providers) {
|
|
62
|
-
return /*#__PURE__*/React.createElement(ToolbarInsertBlockWithInjectionApi, {
|
|
63
|
-
pluginInjectionApi: api,
|
|
64
|
-
editorView: editorView,
|
|
65
|
-
editorActions: editorActions,
|
|
66
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
67
|
-
providerFactory: providerFactory,
|
|
68
|
-
popupsMountPoint: popupsMountPoint,
|
|
69
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
70
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
71
|
-
toolbarSize: toolbarSize,
|
|
72
|
-
disabled: disabled,
|
|
73
|
-
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
74
|
-
isLastItem: isLastItem,
|
|
75
|
-
featureFlags: featureFlags,
|
|
76
|
-
providers: providers,
|
|
77
|
-
options: options
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
81
|
-
providerFactory: providerFactory,
|
|
82
|
-
providers: ['emojiProvider'],
|
|
83
|
-
renderNode: renderNode
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
function ToolbarInsertBlockWithInjectionApi(_ref3) {
|
|
89
|
-
var _ref4, _ref5, _pluginInjectionApi$i, _pluginInjectionApi$c, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
|
|
90
|
-
var editorView = _ref3.editorView,
|
|
91
|
-
editorActions = _ref3.editorActions,
|
|
92
|
-
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
93
|
-
popupsMountPoint = _ref3.popupsMountPoint,
|
|
94
|
-
popupsBoundariesElement = _ref3.popupsBoundariesElement,
|
|
95
|
-
popupsScrollableElement = _ref3.popupsScrollableElement,
|
|
96
|
-
toolbarSize = _ref3.toolbarSize,
|
|
97
|
-
disabled = _ref3.disabled,
|
|
98
|
-
isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing,
|
|
99
|
-
isLastItem = _ref3.isLastItem,
|
|
100
|
-
providers = _ref3.providers,
|
|
101
|
-
pluginInjectionApi = _ref3.pluginInjectionApi,
|
|
102
|
-
options = _ref3.options,
|
|
103
|
-
featureFlags = _ref3.featureFlags;
|
|
104
|
-
var buttons = toolbarSizeToButtons(toolbarSize);
|
|
105
|
-
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText']),
|
|
106
|
-
dateState = _useSharedPluginState.dateState,
|
|
107
|
-
hyperlinkState = _useSharedPluginState.hyperlinkState,
|
|
108
|
-
imageUploadState = _useSharedPluginState.imageUploadState,
|
|
109
|
-
mentionState = _useSharedPluginState.mentionState,
|
|
110
|
-
emojiState = _useSharedPluginState.emojiState,
|
|
111
|
-
blockTypeState = _useSharedPluginState.blockTypeState,
|
|
112
|
-
mediaState = _useSharedPluginState.mediaState,
|
|
113
|
-
typeAheadState = _useSharedPluginState.typeAheadState,
|
|
114
|
-
placeholderTextState = _useSharedPluginState.placeholderTextState;
|
|
115
|
-
return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
|
|
116
|
-
pluginInjectionApi: pluginInjectionApi,
|
|
117
|
-
buttons: buttons,
|
|
118
|
-
isReducedSpacing: isToolbarReducedSpacing,
|
|
119
|
-
isDisabled: disabled,
|
|
120
|
-
isTypeAheadAllowed: Boolean(typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isAllowed),
|
|
121
|
-
editorView: editorView,
|
|
122
|
-
tableSupported: !!editorView.state.schema.nodes.table,
|
|
123
|
-
actionSupported: !!editorView.state.schema.nodes.taskItem,
|
|
124
|
-
mentionsSupported: !!(mentionState && mentionState.mentionProvider),
|
|
125
|
-
mentionsDisabled: !!(mentionState && !mentionState.canInsertMention),
|
|
126
|
-
decisionSupported: !!editorView.state.schema.nodes.decisionItem,
|
|
127
|
-
dateEnabled: !!dateState,
|
|
128
|
-
placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
|
|
129
|
-
layoutSectionEnabled: Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.layout),
|
|
130
|
-
expandEnabled: !!options.allowExpand,
|
|
131
|
-
mediaUploadsEnabled: (_ref4 = mediaState && mediaState.allowsUploads) !== null && _ref4 !== void 0 ? _ref4 : undefined,
|
|
132
|
-
onShowMediaPicker: (_ref5 = mediaState && mediaState.showMediaPicker) !== null && _ref5 !== void 0 ? _ref5 : undefined,
|
|
133
|
-
mediaSupported: !!mediaState,
|
|
134
|
-
imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
|
|
135
|
-
imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
|
|
136
|
-
handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$i = pluginInjectionApi.imageUpload) === null || _pluginInjectionApi$i === void 0 ? void 0 : _pluginInjectionApi$i.actions.startUpload,
|
|
137
|
-
availableWrapperBlockTypes: blockTypeState && blockTypeState.availableWrapperBlockTypes,
|
|
138
|
-
linkSupported: !!hyperlinkState,
|
|
139
|
-
linkDisabled: !hyperlinkState || !hyperlinkState.canInsertLink || !!hyperlinkState.activeLinkMark,
|
|
140
|
-
emojiDisabled: !emojiState || !emojiState.emojiProvider,
|
|
141
|
-
emojiProvider: providers.emojiProvider,
|
|
142
|
-
nativeStatusSupported: options.nativeStatusSupported,
|
|
143
|
-
horizontalRuleEnabled: options.horizontalRuleEnabled,
|
|
144
|
-
onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.codeBlock) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.insertCodeBlock, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$p = pluginInjectionApi.panel) === null || _pluginInjectionApi$p === void 0 ? void 0 : _pluginInjectionApi$p.actions.insertPanel, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$b = pluginInjectionApi.blockType) === null || _pluginInjectionApi$b === void 0 ? void 0 : _pluginInjectionApi$b.actions.insertBlockQuote),
|
|
145
|
-
onInsertMacroFromMacroBrowser: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.extension) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.actions.insertMacroFromMacroBrowser,
|
|
146
|
-
popupsMountPoint: popupsMountPoint,
|
|
147
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
148
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
149
|
-
insertMenuItems: options.insertMenuItems,
|
|
150
|
-
editorActions: editorActions,
|
|
151
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
152
|
-
replacePlusMenuWithElementBrowser: options.replacePlusMenuWithElementBrowser,
|
|
153
|
-
showElementBrowserLink: options.showElementBrowserLink,
|
|
154
|
-
showSeparator: !isLastItem && toolbarSize <= ToolbarSize.S,
|
|
155
|
-
featureFlags: featureFlags
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
export default insertBlockPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
-
var _excluded = ["children"];
|
|
6
|
-
var _templateObject, _templateObject2;
|
|
7
|
-
/** @jsx jsx */
|
|
8
|
-
|
|
9
|
-
import { useCallback, useState } from 'react';
|
|
10
|
-
import { css, jsx } from '@emotion/react';
|
|
11
|
-
// AFP-2532 TODO: Fix automatic suppressions below
|
|
12
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
13
|
-
import { borderRadius } from '@atlaskit/theme';
|
|
14
|
-
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
15
|
-
import { IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
16
|
-
import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
17
|
-
import { ElementBrowser, ELEMENT_ITEM_HEIGHT } from '@atlaskit/editor-common/element-browser';
|
|
18
|
-
var InsertMenu = function InsertMenu(_ref) {
|
|
19
|
-
var _pluginInjectionApi$q6, _pluginInjectionApi$q7;
|
|
20
|
-
var editorView = _ref.editorView,
|
|
21
|
-
dropdownItems = _ref.dropdownItems,
|
|
22
|
-
showElementBrowserLink = _ref.showElementBrowserLink,
|
|
23
|
-
onInsert = _ref.onInsert,
|
|
24
|
-
toggleVisiblity = _ref.toggleVisiblity,
|
|
25
|
-
pluginInjectionApi = _ref.pluginInjectionApi;
|
|
26
|
-
var _useState = useState(0),
|
|
27
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
-
itemCount = _useState2[0],
|
|
29
|
-
setItemCount = _useState2[1];
|
|
30
|
-
var transform = useCallback(function (item) {
|
|
31
|
-
return {
|
|
32
|
-
title: item.content,
|
|
33
|
-
description: item.tooltipDescription,
|
|
34
|
-
keyshortcut: item.shortcut,
|
|
35
|
-
icon: function icon() {
|
|
36
|
-
return getSvgIconForItem({
|
|
37
|
-
name: item.value.name
|
|
38
|
-
}) || item.elemBefore;
|
|
39
|
-
},
|
|
40
|
-
/**
|
|
41
|
-
* @note This transformed items action is only used when a quick insert item has been
|
|
42
|
-
* called from the quick insert menu and a search has not been performed.
|
|
43
|
-
*/
|
|
44
|
-
action: function action() {
|
|
45
|
-
return onInsert({
|
|
46
|
-
item: item
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
// "insertInsertMenuItem" expects these 2 properties.
|
|
50
|
-
onClick: item.onClick,
|
|
51
|
-
value: item.value
|
|
52
|
-
};
|
|
53
|
-
}, [onInsert]);
|
|
54
|
-
var quickInsertDropdownItems = dropdownItems.map(transform);
|
|
55
|
-
var viewMoreItem = showElementBrowserLink ? quickInsertDropdownItems.pop() : undefined;
|
|
56
|
-
var onInsertItem = useCallback(function (item) {
|
|
57
|
-
var _pluginInjectionApi$q;
|
|
58
|
-
toggleVisiblity();
|
|
59
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 || _pluginInjectionApi$q.actions.insertItem(item)(editorView.state, editorView.dispatch);
|
|
60
|
-
}, [editorView, toggleVisiblity, pluginInjectionApi]);
|
|
61
|
-
var getItems = useCallback(function (query, category) {
|
|
62
|
-
var result;
|
|
63
|
-
/**
|
|
64
|
-
* @warning The results if there is a query are not the same as the results if there is no query.
|
|
65
|
-
* For example: If you have a typed panel and then select the panel item then it will call a different action
|
|
66
|
-
* than is specified on the editor plugins quick insert
|
|
67
|
-
* @see above transform function for more details.
|
|
68
|
-
*/
|
|
69
|
-
if (query) {
|
|
70
|
-
var _pluginInjectionApi$q2, _pluginInjectionApi$q3;
|
|
71
|
-
result = (_pluginInjectionApi$q2 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q3 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q3 === void 0 ? void 0 : _pluginInjectionApi$q3.actions.getSuggestions({
|
|
72
|
-
query: query,
|
|
73
|
-
category: category
|
|
74
|
-
})) !== null && _pluginInjectionApi$q2 !== void 0 ? _pluginInjectionApi$q2 : [];
|
|
75
|
-
} else {
|
|
76
|
-
var _pluginInjectionApi$q4, _pluginInjectionApi$q5;
|
|
77
|
-
var featuredQuickInsertSuggestions = (_pluginInjectionApi$q4 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q5 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q5 === void 0 ? void 0 : _pluginInjectionApi$q5.actions.getSuggestions({
|
|
78
|
-
category: category,
|
|
79
|
-
featuredItems: true
|
|
80
|
-
})) !== null && _pluginInjectionApi$q4 !== void 0 ? _pluginInjectionApi$q4 : [];
|
|
81
|
-
result = quickInsertDropdownItems.concat(featuredQuickInsertSuggestions);
|
|
82
|
-
}
|
|
83
|
-
setItemCount(result.length);
|
|
84
|
-
return result;
|
|
85
|
-
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q6 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q6 === void 0 ? void 0 : _pluginInjectionApi$q6.actions, quickInsertDropdownItems]);
|
|
86
|
-
var emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q7 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q7 === void 0 || (_pluginInjectionApi$q7 = _pluginInjectionApi$q7.sharedState.currentState()) === null || _pluginInjectionApi$q7 === void 0 ? void 0 : _pluginInjectionApi$q7.emptyStateHandler;
|
|
87
|
-
return jsx("div", {
|
|
88
|
-
css: insertMenuWrapper(itemCount)
|
|
89
|
-
}, jsx(ElementBrowserWrapper, {
|
|
90
|
-
handleClickOutside: toggleVisiblity,
|
|
91
|
-
handleEscapeKeydown: toggleVisiblity,
|
|
92
|
-
closeOnTab: true
|
|
93
|
-
}, jsx(ElementBrowser, {
|
|
94
|
-
mode: "inline",
|
|
95
|
-
getItems: getItems,
|
|
96
|
-
emptyStateHandler: emptyStateHandler,
|
|
97
|
-
onInsertItem: onInsertItem,
|
|
98
|
-
showSearch: true,
|
|
99
|
-
showCategories: false
|
|
100
|
-
// On page resize we want the InlineElementBrowser to show updated tools/overflow items
|
|
101
|
-
,
|
|
102
|
-
key: quickInsertDropdownItems.length,
|
|
103
|
-
viewMoreItem: viewMoreItem
|
|
104
|
-
})));
|
|
105
|
-
};
|
|
106
|
-
var getSvgIconForItem = function getSvgIconForItem(_ref2) {
|
|
107
|
-
var name = _ref2.name;
|
|
108
|
-
var Icon = {
|
|
109
|
-
codeblock: IconCode,
|
|
110
|
-
panel: IconPanel,
|
|
111
|
-
blockquote: IconQuote,
|
|
112
|
-
decision: IconDecision,
|
|
113
|
-
horizontalrule: IconDivider,
|
|
114
|
-
expand: IconExpand,
|
|
115
|
-
date: IconDate,
|
|
116
|
-
status: IconStatus
|
|
117
|
-
}[name];
|
|
118
|
-
return Icon ? jsx(Icon, {
|
|
119
|
-
label: ""
|
|
120
|
-
}) : undefined;
|
|
121
|
-
};
|
|
122
|
-
var getInsertMenuHeight = function getInsertMenuHeight(_ref3) {
|
|
123
|
-
var itemCount = _ref3.itemCount;
|
|
124
|
-
// Figure based on visuals to exclude the searchbar, padding/margin, and the ViewMore item.
|
|
125
|
-
var EXTRA_SPACE_EXCLUDING_ELEMENTLIST = 112;
|
|
126
|
-
if (itemCount > 0 && itemCount < 6) {
|
|
127
|
-
return itemCount * ELEMENT_ITEM_HEIGHT + EXTRA_SPACE_EXCLUDING_ELEMENTLIST;
|
|
128
|
-
}
|
|
129
|
-
return 560; // For showing 6 Elements.
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
var insertMenuWrapper = function insertMenuWrapper(itemCount) {
|
|
133
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n width: 320px;\n height: ", "px;\n background-color: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n"])), getInsertMenuHeight({
|
|
134
|
-
itemCount: itemCount
|
|
135
|
-
}), "var(--ds-surface-overlay, ".concat(N0, ")"), borderRadius(), "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(N30A, ",\n 0 2px 1px ").concat(N30A, ",\n 0 0 20px -6px ").concat(N60A), ")"));
|
|
136
|
-
};
|
|
137
|
-
var flexWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n box-sizing: border-box;\n overflow: hidden;\n"])));
|
|
138
|
-
var FlexWrapper = function FlexWrapper(props) {
|
|
139
|
-
var children = props.children,
|
|
140
|
-
divProps = _objectWithoutProperties(props, _excluded);
|
|
141
|
-
return jsx("div", _extends({
|
|
142
|
-
css: flexWrapperStyles
|
|
143
|
-
}, divProps), children);
|
|
144
|
-
};
|
|
145
|
-
var ElementBrowserWrapper = withOuterListeners(FlexWrapper);
|
|
146
|
-
export default InsertMenu;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Popup } from '@atlaskit/editor-common/ui';
|
|
3
|
-
import InsertMenu from '../ElementBrowser/InsertMenu';
|
|
4
|
-
import { DropDownButton } from './dropdown-button';
|
|
5
|
-
export var BlockInsertElementBrowser = function BlockInsertElementBrowser(props) {
|
|
6
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, props.open && /*#__PURE__*/React.createElement(Popup, {
|
|
7
|
-
target: props.plusButtonRef,
|
|
8
|
-
fitHeight: 500,
|
|
9
|
-
fitWidth: 350,
|
|
10
|
-
offset: [0, 3],
|
|
11
|
-
mountTo: props.popupsMountPoint,
|
|
12
|
-
boundariesElement: props.popupsBoundariesElement,
|
|
13
|
-
scrollableElement: props.popupsScrollableElement,
|
|
14
|
-
preventOverflow: true,
|
|
15
|
-
alignX: "right"
|
|
16
|
-
}, /*#__PURE__*/React.createElement(InsertMenu, {
|
|
17
|
-
editorView: props.editorView,
|
|
18
|
-
dropdownItems: props.items,
|
|
19
|
-
onInsert: props.onInsert,
|
|
20
|
-
toggleVisiblity: props.togglePlusMenuVisibility,
|
|
21
|
-
showElementBrowserLink: props.showElementBrowserLink,
|
|
22
|
-
pluginInjectionApi: props.pluginInjectionApi
|
|
23
|
-
})), /*#__PURE__*/React.createElement(DropDownButton, {
|
|
24
|
-
"aria-expanded": props.open,
|
|
25
|
-
"aria-haspopup": true,
|
|
26
|
-
handleRef: props.onRef,
|
|
27
|
-
selected: props.open,
|
|
28
|
-
disabled: props.disabled,
|
|
29
|
-
onClick: props.onClick,
|
|
30
|
-
onKeyDown: props.onKeyDown,
|
|
31
|
-
spacing: props.spacing,
|
|
32
|
-
label: props.label,
|
|
33
|
-
"aria-keyshortcuts": "/"
|
|
34
|
-
}));
|
|
35
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
4
|
-
import { DropDownButton } from './dropdown-button';
|
|
5
|
-
export var BlockInsertMenuLegacy = function BlockInsertMenuLegacy(props) {
|
|
6
|
-
var items = props.items;
|
|
7
|
-
var dropdownItems = React.useMemo(function () {
|
|
8
|
-
return [{
|
|
9
|
-
items: items
|
|
10
|
-
}];
|
|
11
|
-
}, [items]);
|
|
12
|
-
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
13
|
-
items: dropdownItems,
|
|
14
|
-
onItemActivated: props.onItemActivated,
|
|
15
|
-
onOpenChange: props.onOpenChange,
|
|
16
|
-
mountTo: props.popupsMountPoint,
|
|
17
|
-
boundariesElement: props.popupsBoundariesElement,
|
|
18
|
-
scrollableElement: props.popupsScrollableElement,
|
|
19
|
-
isOpen: props.open,
|
|
20
|
-
fitHeight: 188,
|
|
21
|
-
fitWidth: 175,
|
|
22
|
-
zIndex: akEditorMenuZIndex
|
|
23
|
-
}, /*#__PURE__*/React.createElement(DropDownButton, {
|
|
24
|
-
"aria-expanded": props.open,
|
|
25
|
-
"aria-haspopup": true,
|
|
26
|
-
handleRef: props.onRef,
|
|
27
|
-
selected: props.open,
|
|
28
|
-
disabled: props.disabled,
|
|
29
|
-
onClick: props.onClick,
|
|
30
|
-
onKeyDown: props.onKeyDown,
|
|
31
|
-
spacing: props.spacing,
|
|
32
|
-
label: props.label,
|
|
33
|
-
"aria-keyshortcuts": "/"
|
|
34
|
-
}));
|
|
35
|
-
};
|