@atlaskit/editor-core 189.4.0 → 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 +7 -0
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/presets/universal.js +2 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/presets/universal.js +2 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/presets/universal.js +2 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/package.json +2 -1
- 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,250 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.table = exports.status = exports.placeholder = exports.panel = exports.more = exports.mention = exports.media = exports.link = exports.layout = exports.imageUpload = exports.horizontalrule = exports.expand = exports.emoji = exports.decision = exports.date = exports.codeblock = exports.blockquote = exports.action = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _react2 = require("@emotion/react");
|
|
10
|
-
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
11
|
-
var _decision = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/decision"));
|
|
12
|
-
var _task = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/task"));
|
|
13
|
-
var _table = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/table"));
|
|
14
|
-
var _image = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/image"));
|
|
15
|
-
var _mention = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/mention"));
|
|
16
|
-
var _more = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/more"));
|
|
17
|
-
var _link = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/link"));
|
|
18
|
-
var _emoji = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/emoji"));
|
|
19
|
-
var _date = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/date"));
|
|
20
|
-
var _status = _interopRequireDefault(require("@atlaskit/icon/glyph/status"));
|
|
21
|
-
var _chevronRightCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right-circle"));
|
|
22
|
-
var _text = _interopRequireDefault(require("@atlaskit/icon/glyph/media-services/text"));
|
|
23
|
-
var _layoutTwoEqual = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/layout-two-equal"));
|
|
24
|
-
var _horizontalRule = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/horizontal-rule"));
|
|
25
|
-
var _code = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/code"));
|
|
26
|
-
var _info = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/info"));
|
|
27
|
-
var _quote = _interopRequireDefault(require("@atlaskit/icon/glyph/quote"));
|
|
28
|
-
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
29
|
-
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
30
|
-
var _shallowEquals = require("./shallow-equals");
|
|
31
|
-
/** @jsx jsx */
|
|
32
|
-
|
|
33
|
-
var from = function from(init) {
|
|
34
|
-
return {
|
|
35
|
-
content: init.content,
|
|
36
|
-
tooltipDescription: init.tooltipDescription,
|
|
37
|
-
value: {
|
|
38
|
-
name: init.name
|
|
39
|
-
},
|
|
40
|
-
elemBefore: (0, _react2.jsx)(init.Icon, {
|
|
41
|
-
label: init.content
|
|
42
|
-
}),
|
|
43
|
-
elemAfter: init.shortcut ? (0, _react2.jsx)("div", {
|
|
44
|
-
css: _shortcut.shortcutStyle
|
|
45
|
-
}, init.shortcut) : undefined,
|
|
46
|
-
'aria-label': init.shortcut ? init.content + ' ' + init.shortcut : init.content,
|
|
47
|
-
'aria-haspopup': init['aria-haspopup'],
|
|
48
|
-
'aria-keyshortcuts': init['aria-keyshortcuts'],
|
|
49
|
-
shortcut: init.shortcut,
|
|
50
|
-
isDisabled: init.disabled
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
var mem = function mem(fn) {
|
|
54
|
-
return (0, _memoizeOne.default)(fn, _shallowEquals.shallowEquals);
|
|
55
|
-
};
|
|
56
|
-
var action = exports.action = mem(function (init) {
|
|
57
|
-
return from({
|
|
58
|
-
content: init.content,
|
|
59
|
-
tooltipDescription: init.tooltipDescription,
|
|
60
|
-
disabled: init.disabled,
|
|
61
|
-
name: 'action',
|
|
62
|
-
shortcut: '[]',
|
|
63
|
-
Icon: _task.default,
|
|
64
|
-
'aria-keyshortcuts': '[ ] Space'
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
var link = exports.link = mem(function (init) {
|
|
68
|
-
return from({
|
|
69
|
-
content: init.content,
|
|
70
|
-
tooltipDescription: init.tooltipDescription,
|
|
71
|
-
disabled: init.disabled,
|
|
72
|
-
name: 'link',
|
|
73
|
-
shortcut: (0, _keymaps.tooltip)(_keymaps.addLink),
|
|
74
|
-
Icon: _link.default,
|
|
75
|
-
'aria-haspopup': init['aria-haspopup'],
|
|
76
|
-
'aria-keyshortcuts': (0, _keymaps.getAriaKeyshortcuts)(_keymaps.addLink)
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
var media = exports.media = mem(function (init) {
|
|
80
|
-
return from({
|
|
81
|
-
content: init.content,
|
|
82
|
-
tooltipDescription: init.tooltipDescription,
|
|
83
|
-
disabled: init.disabled,
|
|
84
|
-
name: 'media',
|
|
85
|
-
Icon: _image.default
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
var imageUpload = exports.imageUpload = mem(function (init) {
|
|
89
|
-
return from({
|
|
90
|
-
content: init.content,
|
|
91
|
-
tooltipDescription: init.tooltipDescription,
|
|
92
|
-
disabled: init.disabled,
|
|
93
|
-
name: 'image upload',
|
|
94
|
-
Icon: _image.default
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
var mention = exports.mention = mem(function (init) {
|
|
98
|
-
return from({
|
|
99
|
-
content: init.content,
|
|
100
|
-
tooltipDescription: init.tooltipDescription,
|
|
101
|
-
disabled: init.disabled,
|
|
102
|
-
name: 'mention',
|
|
103
|
-
Icon: _mention.default,
|
|
104
|
-
shortcut: '@',
|
|
105
|
-
'aria-haspopup': init['aria-haspopup'],
|
|
106
|
-
'aria-keyshortcuts': 'Shift+2 Space'
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
var emoji = exports.emoji = mem(function (init) {
|
|
110
|
-
return from({
|
|
111
|
-
content: init.content,
|
|
112
|
-
tooltipDescription: init.tooltipDescription,
|
|
113
|
-
disabled: init.disabled,
|
|
114
|
-
name: 'emoji',
|
|
115
|
-
Icon: _emoji.default,
|
|
116
|
-
shortcut: ':',
|
|
117
|
-
'aria-haspopup': init['aria-haspopup'],
|
|
118
|
-
'aria-keyshortcuts': 'Shift+;'
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
var table = exports.table = mem(function (init) {
|
|
122
|
-
return from({
|
|
123
|
-
content: init.content,
|
|
124
|
-
tooltipDescription: init.tooltipDescription,
|
|
125
|
-
disabled: init.disabled,
|
|
126
|
-
name: 'table',
|
|
127
|
-
Icon: _table.default,
|
|
128
|
-
shortcut: (0, _keymaps.tooltip)(_keymaps.toggleTable),
|
|
129
|
-
'aria-keyshortcuts': (0, _keymaps.getAriaKeyshortcuts)(_keymaps.toggleTable)
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
var layout = exports.layout = mem(function (init) {
|
|
133
|
-
return from({
|
|
134
|
-
content: init.content,
|
|
135
|
-
tooltipDescription: init.tooltipDescription,
|
|
136
|
-
disabled: init.disabled,
|
|
137
|
-
name: 'layout',
|
|
138
|
-
Icon: _layoutTwoEqual.default
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
var codeblock = exports.codeblock = mem(function (init) {
|
|
142
|
-
return from({
|
|
143
|
-
content: init.content,
|
|
144
|
-
tooltipDescription: init.tooltipDescription,
|
|
145
|
-
disabled: init.disabled,
|
|
146
|
-
name: 'codeblock',
|
|
147
|
-
Icon: _code.default,
|
|
148
|
-
shortcut: init.shortcut,
|
|
149
|
-
'aria-keyshortcuts': (0, _keymaps.getAriaKeyshortcuts)(init.shortcut)
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
var panel = exports.panel = mem(function (init) {
|
|
153
|
-
return from({
|
|
154
|
-
content: init.content,
|
|
155
|
-
tooltipDescription: init.tooltipDescription,
|
|
156
|
-
disabled: init.disabled,
|
|
157
|
-
name: 'panel',
|
|
158
|
-
Icon: _info.default,
|
|
159
|
-
shortcut: init.shortcut,
|
|
160
|
-
'aria-keyshortcuts': (0, _keymaps.getAriaKeyshortcuts)(init.shortcut)
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
var blockquote = exports.blockquote = mem(function (init) {
|
|
164
|
-
return from({
|
|
165
|
-
content: init.content,
|
|
166
|
-
tooltipDescription: init.tooltipDescription,
|
|
167
|
-
disabled: init.disabled,
|
|
168
|
-
name: 'blockquote',
|
|
169
|
-
Icon: _quote.default,
|
|
170
|
-
shortcut: init.shortcut,
|
|
171
|
-
'aria-keyshortcuts': 'Shift+. Space'
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
var decision = exports.decision = mem(function (init) {
|
|
175
|
-
return from({
|
|
176
|
-
content: init.content,
|
|
177
|
-
tooltipDescription: init.tooltipDescription,
|
|
178
|
-
disabled: init.disabled,
|
|
179
|
-
name: 'decision',
|
|
180
|
-
Icon: _decision.default,
|
|
181
|
-
shortcut: '<>',
|
|
182
|
-
'aria-keyshortcuts': 'Shift+, Shift+. Space'
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
var horizontalrule = exports.horizontalrule = mem(function (init) {
|
|
186
|
-
return from({
|
|
187
|
-
content: init.content,
|
|
188
|
-
tooltipDescription: init.tooltipDescription,
|
|
189
|
-
disabled: init.disabled,
|
|
190
|
-
name: 'horizontalrule',
|
|
191
|
-
Icon: _horizontalRule.default,
|
|
192
|
-
shortcut: '---',
|
|
193
|
-
'aria-keyshortcuts': '- - -'
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
var expand = exports.expand = mem(function (init) {
|
|
197
|
-
return from({
|
|
198
|
-
content: init.content,
|
|
199
|
-
tooltipDescription: init.tooltipDescription,
|
|
200
|
-
disabled: init.disabled,
|
|
201
|
-
name: 'expand',
|
|
202
|
-
Icon: _chevronRightCircle.default
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
var date = exports.date = mem(function (init) {
|
|
206
|
-
return from({
|
|
207
|
-
content: init.content,
|
|
208
|
-
tooltipDescription: init.tooltipDescription,
|
|
209
|
-
disabled: init.disabled,
|
|
210
|
-
name: 'date',
|
|
211
|
-
Icon: _date.default,
|
|
212
|
-
shortcut: '//',
|
|
213
|
-
'aria-keyshortcuts': '/ / Enter'
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
var placeholder = exports.placeholder = mem(function (init) {
|
|
217
|
-
return from({
|
|
218
|
-
content: init.content,
|
|
219
|
-
tooltipDescription: init.tooltipDescription,
|
|
220
|
-
disabled: init.disabled,
|
|
221
|
-
name: 'placeholder text',
|
|
222
|
-
Icon: function Icon() {
|
|
223
|
-
return (0, _react2.jsx)(_text.default, {
|
|
224
|
-
label: ""
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
var status = exports.status = mem(function (init) {
|
|
230
|
-
return from({
|
|
231
|
-
content: init.content,
|
|
232
|
-
tooltipDescription: init.tooltipDescription,
|
|
233
|
-
disabled: init.disabled,
|
|
234
|
-
name: 'status',
|
|
235
|
-
Icon: _status.default
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
var more = exports.more = mem(function (init) {
|
|
239
|
-
return from({
|
|
240
|
-
content: init.content,
|
|
241
|
-
tooltipDescription: init.tooltipDescription,
|
|
242
|
-
disabled: init.disabled,
|
|
243
|
-
name: 'macro',
|
|
244
|
-
Icon: function Icon() {
|
|
245
|
-
return (0, _react2.jsx)(_more.default, {
|
|
246
|
-
label: ""
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "messages", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _messages.toolbarInsertBlockMessages;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.shallowEquals = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var shallowEquals = exports.shallowEquals = function shallowEquals(_ref, _ref2) {
|
|
10
|
-
var _ref3 = (0, _slicedToArray2.default)(_ref, 1),
|
|
11
|
-
aRaw = _ref3[0];
|
|
12
|
-
var _ref4 = (0, _slicedToArray2.default)(_ref2, 1),
|
|
13
|
-
bRaw = _ref4[0];
|
|
14
|
-
var a = aRaw;
|
|
15
|
-
var b = bRaw;
|
|
16
|
-
return !Object.keys(a).some(function (key) {
|
|
17
|
-
var k = key;
|
|
18
|
-
return a[k] !== b[k];
|
|
19
|
-
});
|
|
20
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.sortItems = void 0;
|
|
7
|
-
var endPositionNames = ['macro-browser', 'slash-onboarding'];
|
|
8
|
-
var isMacro = function isMacro(item) {
|
|
9
|
-
return typeof item.content === 'string' && item.content.includes('macro');
|
|
10
|
-
};
|
|
11
|
-
var sortItems = exports.sortItems = function sortItems(items) {
|
|
12
|
-
return items.sort(function (a, b) {
|
|
13
|
-
if (endPositionNames.includes(a.value.name) && endPositionNames.includes(b.value.name)) {
|
|
14
|
-
return endPositionNames.indexOf(a.value.name) - endPositionNames.indexOf(b.value.name);
|
|
15
|
-
}
|
|
16
|
-
if (endPositionNames.includes(b.value.name)) {
|
|
17
|
-
return -1;
|
|
18
|
-
}
|
|
19
|
-
if (endPositionNames.includes(a.value.name)) {
|
|
20
|
-
return 1;
|
|
21
|
-
}
|
|
22
|
-
if (isMacro(a) && !isMacro(b)) {
|
|
23
|
-
return 1;
|
|
24
|
-
}
|
|
25
|
-
if (isMacro(b) && !isMacro(a)) {
|
|
26
|
-
return -1;
|
|
27
|
-
}
|
|
28
|
-
return a.content < b.content ? -1 : 1;
|
|
29
|
-
});
|
|
30
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.triggerWrapper = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _templateObject;
|
|
11
|
-
var triggerWrapper = exports.triggerWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 42px;\n\n display: flex;\n align-items: center;\n\n > div,\n > span {\n display: flex;\n }\n\n > div > div {\n display: flex;\n }\n"])));
|
|
@@ -1,159 +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
|
-
const 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 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 () => false;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
const insertBlockPlugin = ({
|
|
40
|
-
config: options = {},
|
|
41
|
-
api
|
|
42
|
-
}) => {
|
|
43
|
-
var _api$featureFlags;
|
|
44
|
-
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
45
|
-
return {
|
|
46
|
-
name: 'insertBlock',
|
|
47
|
-
primaryToolbarComponent({
|
|
48
|
-
editorView,
|
|
49
|
-
editorActions,
|
|
50
|
-
dispatchAnalyticsEvent,
|
|
51
|
-
providerFactory,
|
|
52
|
-
popupsMountPoint,
|
|
53
|
-
popupsBoundariesElement,
|
|
54
|
-
popupsScrollableElement,
|
|
55
|
-
toolbarSize,
|
|
56
|
-
disabled,
|
|
57
|
-
isToolbarReducedSpacing,
|
|
58
|
-
isLastItem
|
|
59
|
-
}) {
|
|
60
|
-
const renderNode = providers => {
|
|
61
|
-
return /*#__PURE__*/React.createElement(ToolbarInsertBlockWithInjectionApi, {
|
|
62
|
-
pluginInjectionApi: api,
|
|
63
|
-
editorView: editorView,
|
|
64
|
-
editorActions: editorActions,
|
|
65
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
66
|
-
providerFactory: providerFactory,
|
|
67
|
-
popupsMountPoint: popupsMountPoint,
|
|
68
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
69
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
70
|
-
toolbarSize: toolbarSize,
|
|
71
|
-
disabled: disabled,
|
|
72
|
-
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
73
|
-
isLastItem: isLastItem,
|
|
74
|
-
featureFlags: featureFlags,
|
|
75
|
-
providers: providers,
|
|
76
|
-
options: options
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
80
|
-
providerFactory: providerFactory,
|
|
81
|
-
providers: ['emojiProvider'],
|
|
82
|
-
renderNode: renderNode
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
function ToolbarInsertBlockWithInjectionApi({
|
|
88
|
-
editorView,
|
|
89
|
-
editorActions,
|
|
90
|
-
dispatchAnalyticsEvent,
|
|
91
|
-
popupsMountPoint,
|
|
92
|
-
popupsBoundariesElement,
|
|
93
|
-
popupsScrollableElement,
|
|
94
|
-
toolbarSize,
|
|
95
|
-
disabled,
|
|
96
|
-
isToolbarReducedSpacing,
|
|
97
|
-
isLastItem,
|
|
98
|
-
providers,
|
|
99
|
-
pluginInjectionApi,
|
|
100
|
-
options,
|
|
101
|
-
featureFlags
|
|
102
|
-
}) {
|
|
103
|
-
var _ref, _ref2, _pluginInjectionApi$i, _pluginInjectionApi$c, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
|
|
104
|
-
const buttons = toolbarSizeToButtons(toolbarSize);
|
|
105
|
-
const {
|
|
106
|
-
dateState,
|
|
107
|
-
hyperlinkState,
|
|
108
|
-
imageUploadState,
|
|
109
|
-
mentionState,
|
|
110
|
-
emojiState,
|
|
111
|
-
blockTypeState,
|
|
112
|
-
mediaState,
|
|
113
|
-
typeAheadState,
|
|
114
|
-
placeholderTextState
|
|
115
|
-
} = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText']);
|
|
116
|
-
return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
|
|
117
|
-
pluginInjectionApi: pluginInjectionApi,
|
|
118
|
-
buttons: buttons,
|
|
119
|
-
isReducedSpacing: isToolbarReducedSpacing,
|
|
120
|
-
isDisabled: disabled,
|
|
121
|
-
isTypeAheadAllowed: Boolean(typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isAllowed),
|
|
122
|
-
editorView: editorView,
|
|
123
|
-
tableSupported: !!editorView.state.schema.nodes.table,
|
|
124
|
-
actionSupported: !!editorView.state.schema.nodes.taskItem,
|
|
125
|
-
mentionsSupported: !!(mentionState && mentionState.mentionProvider),
|
|
126
|
-
mentionsDisabled: !!(mentionState && !mentionState.canInsertMention),
|
|
127
|
-
decisionSupported: !!editorView.state.schema.nodes.decisionItem,
|
|
128
|
-
dateEnabled: !!dateState,
|
|
129
|
-
placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
|
|
130
|
-
layoutSectionEnabled: Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.layout),
|
|
131
|
-
expandEnabled: !!options.allowExpand,
|
|
132
|
-
mediaUploadsEnabled: (_ref = mediaState && mediaState.allowsUploads) !== null && _ref !== void 0 ? _ref : undefined,
|
|
133
|
-
onShowMediaPicker: (_ref2 = mediaState && mediaState.showMediaPicker) !== null && _ref2 !== void 0 ? _ref2 : undefined,
|
|
134
|
-
mediaSupported: !!mediaState,
|
|
135
|
-
imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
|
|
136
|
-
imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
|
|
137
|
-
handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$i = pluginInjectionApi.imageUpload) === null || _pluginInjectionApi$i === void 0 ? void 0 : _pluginInjectionApi$i.actions.startUpload,
|
|
138
|
-
availableWrapperBlockTypes: blockTypeState && blockTypeState.availableWrapperBlockTypes,
|
|
139
|
-
linkSupported: !!hyperlinkState,
|
|
140
|
-
linkDisabled: !hyperlinkState || !hyperlinkState.canInsertLink || !!hyperlinkState.activeLinkMark,
|
|
141
|
-
emojiDisabled: !emojiState || !emojiState.emojiProvider,
|
|
142
|
-
emojiProvider: providers.emojiProvider,
|
|
143
|
-
nativeStatusSupported: options.nativeStatusSupported,
|
|
144
|
-
horizontalRuleEnabled: options.horizontalRuleEnabled,
|
|
145
|
-
onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.codeBlock) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.insertCodeBlock, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$p = pluginInjectionApi.panel) === null || _pluginInjectionApi$p === void 0 ? void 0 : _pluginInjectionApi$p.actions.insertPanel, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$b = pluginInjectionApi.blockType) === null || _pluginInjectionApi$b === void 0 ? void 0 : _pluginInjectionApi$b.actions.insertBlockQuote),
|
|
146
|
-
onInsertMacroFromMacroBrowser: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e = pluginInjectionApi.extension) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.actions.insertMacroFromMacroBrowser,
|
|
147
|
-
popupsMountPoint: popupsMountPoint,
|
|
148
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
149
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
150
|
-
insertMenuItems: options.insertMenuItems,
|
|
151
|
-
editorActions: editorActions,
|
|
152
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
153
|
-
replacePlusMenuWithElementBrowser: options.replacePlusMenuWithElementBrowser,
|
|
154
|
-
showElementBrowserLink: options.showElementBrowserLink,
|
|
155
|
-
showSeparator: !isLastItem && toolbarSize <= ToolbarSize.S,
|
|
156
|
-
featureFlags: featureFlags
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
export default insertBlockPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
|
|
4
|
-
import { useCallback, useState } from 'react';
|
|
5
|
-
import { css, jsx } from '@emotion/react';
|
|
6
|
-
// AFP-2532 TODO: Fix automatic suppressions below
|
|
7
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
8
|
-
import { borderRadius } from '@atlaskit/theme';
|
|
9
|
-
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
10
|
-
import { IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
11
|
-
import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
12
|
-
import { ElementBrowser, ELEMENT_ITEM_HEIGHT } from '@atlaskit/editor-common/element-browser';
|
|
13
|
-
const InsertMenu = ({
|
|
14
|
-
editorView,
|
|
15
|
-
dropdownItems,
|
|
16
|
-
showElementBrowserLink,
|
|
17
|
-
onInsert,
|
|
18
|
-
toggleVisiblity,
|
|
19
|
-
pluginInjectionApi
|
|
20
|
-
}) => {
|
|
21
|
-
var _pluginInjectionApi$q6, _pluginInjectionApi$q7, _pluginInjectionApi$q8;
|
|
22
|
-
const [itemCount, setItemCount] = useState(0);
|
|
23
|
-
const transform = useCallback(item => ({
|
|
24
|
-
title: item.content,
|
|
25
|
-
description: item.tooltipDescription,
|
|
26
|
-
keyshortcut: item.shortcut,
|
|
27
|
-
icon: () => getSvgIconForItem({
|
|
28
|
-
name: item.value.name
|
|
29
|
-
}) || item.elemBefore,
|
|
30
|
-
/**
|
|
31
|
-
* @note This transformed items action is only used when a quick insert item has been
|
|
32
|
-
* called from the quick insert menu and a search has not been performed.
|
|
33
|
-
*/
|
|
34
|
-
action: () => onInsert({
|
|
35
|
-
item
|
|
36
|
-
}),
|
|
37
|
-
// "insertInsertMenuItem" expects these 2 properties.
|
|
38
|
-
onClick: item.onClick,
|
|
39
|
-
value: item.value
|
|
40
|
-
}), [onInsert]);
|
|
41
|
-
const quickInsertDropdownItems = dropdownItems.map(transform);
|
|
42
|
-
const viewMoreItem = showElementBrowserLink ? quickInsertDropdownItems.pop() : undefined;
|
|
43
|
-
const onInsertItem = useCallback(item => {
|
|
44
|
-
var _pluginInjectionApi$q;
|
|
45
|
-
toggleVisiblity();
|
|
46
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 ? void 0 : _pluginInjectionApi$q.actions.insertItem(item)(editorView.state, editorView.dispatch);
|
|
47
|
-
}, [editorView, toggleVisiblity, pluginInjectionApi]);
|
|
48
|
-
const getItems = useCallback((query, category) => {
|
|
49
|
-
let result;
|
|
50
|
-
/**
|
|
51
|
-
* @warning The results if there is a query are not the same as the results if there is no query.
|
|
52
|
-
* For example: If you have a typed panel and then select the panel item then it will call a different action
|
|
53
|
-
* than is specified on the editor plugins quick insert
|
|
54
|
-
* @see above transform function for more details.
|
|
55
|
-
*/
|
|
56
|
-
if (query) {
|
|
57
|
-
var _pluginInjectionApi$q2, _pluginInjectionApi$q3;
|
|
58
|
-
result = (_pluginInjectionApi$q2 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q3 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q3 === void 0 ? void 0 : _pluginInjectionApi$q3.actions.getSuggestions({
|
|
59
|
-
query,
|
|
60
|
-
category
|
|
61
|
-
})) !== null && _pluginInjectionApi$q2 !== void 0 ? _pluginInjectionApi$q2 : [];
|
|
62
|
-
} else {
|
|
63
|
-
var _pluginInjectionApi$q4, _pluginInjectionApi$q5;
|
|
64
|
-
const featuredQuickInsertSuggestions = (_pluginInjectionApi$q4 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q5 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q5 === void 0 ? void 0 : _pluginInjectionApi$q5.actions.getSuggestions({
|
|
65
|
-
category,
|
|
66
|
-
featuredItems: true
|
|
67
|
-
})) !== null && _pluginInjectionApi$q4 !== void 0 ? _pluginInjectionApi$q4 : [];
|
|
68
|
-
result = quickInsertDropdownItems.concat(featuredQuickInsertSuggestions);
|
|
69
|
-
}
|
|
70
|
-
setItemCount(result.length);
|
|
71
|
-
return result;
|
|
72
|
-
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q6 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q6 === void 0 ? void 0 : _pluginInjectionApi$q6.actions, quickInsertDropdownItems]);
|
|
73
|
-
const emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q7 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q7 === void 0 ? void 0 : (_pluginInjectionApi$q8 = _pluginInjectionApi$q7.sharedState.currentState()) === null || _pluginInjectionApi$q8 === void 0 ? void 0 : _pluginInjectionApi$q8.emptyStateHandler;
|
|
74
|
-
return jsx("div", {
|
|
75
|
-
css: insertMenuWrapper(itemCount)
|
|
76
|
-
}, jsx(ElementBrowserWrapper, {
|
|
77
|
-
handleClickOutside: toggleVisiblity,
|
|
78
|
-
handleEscapeKeydown: toggleVisiblity,
|
|
79
|
-
closeOnTab: true
|
|
80
|
-
}, jsx(ElementBrowser, {
|
|
81
|
-
mode: "inline",
|
|
82
|
-
getItems: getItems,
|
|
83
|
-
emptyStateHandler: emptyStateHandler,
|
|
84
|
-
onInsertItem: onInsertItem,
|
|
85
|
-
showSearch: true,
|
|
86
|
-
showCategories: false
|
|
87
|
-
// On page resize we want the InlineElementBrowser to show updated tools/overflow items
|
|
88
|
-
,
|
|
89
|
-
key: quickInsertDropdownItems.length,
|
|
90
|
-
viewMoreItem: viewMoreItem
|
|
91
|
-
})));
|
|
92
|
-
};
|
|
93
|
-
const getSvgIconForItem = ({
|
|
94
|
-
name
|
|
95
|
-
}) => {
|
|
96
|
-
const Icon = {
|
|
97
|
-
codeblock: IconCode,
|
|
98
|
-
panel: IconPanel,
|
|
99
|
-
blockquote: IconQuote,
|
|
100
|
-
decision: IconDecision,
|
|
101
|
-
horizontalrule: IconDivider,
|
|
102
|
-
expand: IconExpand,
|
|
103
|
-
date: IconDate,
|
|
104
|
-
status: IconStatus
|
|
105
|
-
}[name];
|
|
106
|
-
return Icon ? jsx(Icon, {
|
|
107
|
-
label: ""
|
|
108
|
-
}) : undefined;
|
|
109
|
-
};
|
|
110
|
-
const getInsertMenuHeight = ({
|
|
111
|
-
itemCount
|
|
112
|
-
}) => {
|
|
113
|
-
// Figure based on visuals to exclude the searchbar, padding/margin, and the ViewMore item.
|
|
114
|
-
const EXTRA_SPACE_EXCLUDING_ELEMENTLIST = 112;
|
|
115
|
-
if (itemCount > 0 && itemCount < 6) {
|
|
116
|
-
return itemCount * ELEMENT_ITEM_HEIGHT + EXTRA_SPACE_EXCLUDING_ELEMENTLIST;
|
|
117
|
-
}
|
|
118
|
-
return 560; // For showing 6 Elements.
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const insertMenuWrapper = itemCount => css`
|
|
122
|
-
display: flex;
|
|
123
|
-
flex-direction: column;
|
|
124
|
-
width: 320px;
|
|
125
|
-
height: ${getInsertMenuHeight({
|
|
126
|
-
itemCount
|
|
127
|
-
})}px;
|
|
128
|
-
background-color: ${`var(--ds-surface-overlay, ${N0})`};
|
|
129
|
-
border-radius: ${borderRadius()}px;
|
|
130
|
-
box-shadow: ${`var(--ds-shadow-overlay, ${`0 0 0 1px ${N30A},
|
|
131
|
-
0 2px 1px ${N30A},
|
|
132
|
-
0 0 20px -6px ${N60A}`})`};
|
|
133
|
-
`;
|
|
134
|
-
const flexWrapperStyles = css`
|
|
135
|
-
display: flex;
|
|
136
|
-
flex: 1;
|
|
137
|
-
box-sizing: border-box;
|
|
138
|
-
overflow: hidden;
|
|
139
|
-
`;
|
|
140
|
-
const FlexWrapper = props => {
|
|
141
|
-
const {
|
|
142
|
-
children,
|
|
143
|
-
...divProps
|
|
144
|
-
} = props;
|
|
145
|
-
return jsx("div", _extends({
|
|
146
|
-
css: flexWrapperStyles
|
|
147
|
-
}, divProps), children);
|
|
148
|
-
};
|
|
149
|
-
const ElementBrowserWrapper = withOuterListeners(FlexWrapper);
|
|
150
|
-
export default InsertMenu;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js
DELETED
|
@@ -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 const 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
|
-
};
|