@atlaskit/editor-core 189.4.0 → 189.4.2

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.
Files changed (131) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/plugins/index.js +0 -14
  3. package/dist/cjs/presets/universal.js +4 -2
  4. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +7 -3
  5. package/dist/cjs/version-wrapper.js +1 -1
  6. package/dist/es2019/plugins/index.js +0 -2
  7. package/dist/es2019/presets/universal.js +3 -1
  8. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +7 -3
  9. package/dist/es2019/version-wrapper.js +1 -1
  10. package/dist/esm/plugins/index.js +0 -2
  11. package/dist/esm/presets/universal.js +3 -1
  12. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +7 -3
  13. package/dist/esm/version-wrapper.js +1 -1
  14. package/dist/types/plugins/index.d.ts +0 -2
  15. package/dist/types-ts4.5/plugins/index.d.ts +0 -2
  16. package/package.json +11 -5
  17. package/dist/cjs/plugins/insert-block/index.js +0 -165
  18. package/dist/cjs/plugins/insert-block/types.js +0 -5
  19. package/dist/cjs/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -152
  20. package/dist/cjs/plugins/insert-block/ui/ElementBrowser/types.js +0 -5
  21. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -42
  22. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -42
  23. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -66
  24. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -217
  25. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -49
  26. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -565
  27. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -250
  28. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -12
  29. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -20
  30. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -30
  31. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -11
  32. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -5
  33. package/dist/cjs/plugins/toolbar-lists-indentation/index.js +0 -91
  34. package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +0 -56
  35. package/dist/cjs/plugins/toolbar-lists-indentation/types.js +0 -5
  36. package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +0 -135
  37. package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +0 -168
  38. package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +0 -63
  39. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +0 -53
  40. package/dist/es2019/plugins/insert-block/index.js +0 -159
  41. package/dist/es2019/plugins/insert-block/types.js +0 -1
  42. package/dist/es2019/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -150
  43. package/dist/es2019/plugins/insert-block/ui/ElementBrowser/types.js +0 -1
  44. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -35
  45. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -35
  46. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -59
  47. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -198
  48. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -37
  49. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -558
  50. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -201
  51. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -1
  52. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -8
  53. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -22
  54. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -16
  55. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -1
  56. package/dist/es2019/plugins/toolbar-lists-indentation/index.js +0 -86
  57. package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +0 -53
  58. package/dist/es2019/plugins/toolbar-lists-indentation/types.js +0 -1
  59. package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +0 -123
  60. package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +0 -158
  61. package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +0 -58
  62. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +0 -46
  63. package/dist/esm/plugins/insert-block/index.js +0 -158
  64. package/dist/esm/plugins/insert-block/types.js +0 -1
  65. package/dist/esm/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -146
  66. package/dist/esm/plugins/insert-block/ui/ElementBrowser/types.js +0 -1
  67. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -35
  68. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -35
  69. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -59
  70. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -210
  71. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -41
  72. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -560
  73. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -243
  74. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -1
  75. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -13
  76. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -24
  77. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -4
  78. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -1
  79. package/dist/esm/plugins/toolbar-lists-indentation/index.js +0 -83
  80. package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +0 -50
  81. package/dist/esm/plugins/toolbar-lists-indentation/types.js +0 -1
  82. package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +0 -124
  83. package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +0 -161
  84. package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +0 -56
  85. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +0 -47
  86. package/dist/types/plugins/insert-block/index.d.ts +0 -16
  87. package/dist/types/plugins/insert-block/types.d.ts +0 -45
  88. package/dist/types/plugins/insert-block/ui/ElementBrowser/InsertMenu.d.ts +0 -4
  89. package/dist/types/plugins/insert-block/ui/ElementBrowser/types.d.ts +0 -22
  90. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +0 -28
  91. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +0 -18
  92. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +0 -30
  93. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -39
  94. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +0 -16
  95. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +0 -46
  96. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +0 -34
  97. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/messages.d.ts +0 -1
  98. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.d.ts +0 -1
  99. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +0 -2
  100. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/styles.d.ts +0 -1
  101. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -59
  102. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +0 -33
  103. package/dist/types/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +0 -19
  104. package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +0 -20
  105. package/dist/types/plugins/toolbar-lists-indentation/ui/Toolbar.d.ts +0 -4
  106. package/dist/types/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.d.ts +0 -9
  107. package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +0 -26
  108. package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +0 -9
  109. package/dist/types-ts4.5/plugins/insert-block/index.d.ts +0 -16
  110. package/dist/types-ts4.5/plugins/insert-block/types.d.ts +0 -45
  111. package/dist/types-ts4.5/plugins/insert-block/ui/ElementBrowser/InsertMenu.d.ts +0 -4
  112. package/dist/types-ts4.5/plugins/insert-block/ui/ElementBrowser/types.d.ts +0 -22
  113. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +0 -28
  114. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +0 -18
  115. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +0 -30
  116. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -42
  117. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +0 -16
  118. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +0 -46
  119. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +0 -34
  120. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/messages.d.ts +0 -1
  121. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.d.ts +0 -1
  122. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +0 -2
  123. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/styles.d.ts +0 -1
  124. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -59
  125. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/index.d.ts +0 -33
  126. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +0 -19
  127. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/types.d.ts +0 -20
  128. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/Toolbar.d.ts +0 -4
  129. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.d.ts +0 -9
  130. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/index.d.ts +0 -26
  131. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +0 -9
@@ -1,161 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- /** @jsx jsx */
3
- import { jsx } from '@emotion/react';
4
- import React from 'react';
5
- import { useIntl } from 'react-intl-next';
6
- import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
7
- import BulletListIcon from '@atlaskit/icon/glyph/editor/bullet-list';
8
- import { toggleBulletList as toggleBulletListKeymap, toggleOrderedList as toggleOrderedListKeymap, indent as toggleIndentKeymap, outdent as toggleOutdentKeymap, tooltip } from '../../../keymaps';
9
- import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
10
- import ToolbarButton from '../../../ui/ToolbarButton';
11
- import { shortcutStyle } from '../../../ui/styles';
12
- import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
13
- import { wrapperStyle, separatorStyles } from '@atlaskit/editor-common/styles';
14
- import { listMessages, indentationMessages } from '@atlaskit/editor-common/messages';
15
- export function ToolbarDropdown(props) {
16
- var _useIntl = useIntl(),
17
- formatMessage = _useIntl.formatMessage;
18
- var disabled = props.disabled,
19
- isReducedSpacing = props.isReducedSpacing,
20
- bulletListActive = props.bulletListActive,
21
- orderedListActive = props.orderedListActive,
22
- popupsMountPoint = props.popupsMountPoint,
23
- popupsBoundariesElement = props.popupsBoundariesElement,
24
- popupsScrollableElement = props.popupsScrollableElement,
25
- onItemActivated = props.onItemActivated;
26
- var _React$useState = React.useState(false),
27
- _React$useState2 = _slicedToArray(_React$useState, 2),
28
- isDropdownOpen = _React$useState2[0],
29
- setIsDropdownOpen = _React$useState2[1];
30
- var _React$useState3 = React.useState(false),
31
- _React$useState4 = _slicedToArray(_React$useState3, 2),
32
- isOpenedByKeyboard = _React$useState4[0],
33
- setOpenedByKeyboard = _React$useState4[1];
34
- var labelLists = formatMessage(listMessages.lists);
35
- var onOpenChange = function onOpenChange(attrs) {
36
- setIsDropdownOpen(attrs.isDropdownOpen);
37
- };
38
- var handleTriggerClick = function handleTriggerClick() {
39
- onOpenChange({
40
- isDropdownOpen: !isDropdownOpen
41
- });
42
- };
43
- var handleOnKeyDown = function handleOnKeyDown(event) {
44
- if (event.key === 'Enter' || event.key === ' ') {
45
- event.preventDefault();
46
- setIsDropdownOpen(!isDropdownOpen);
47
- setOpenedByKeyboard(true);
48
- }
49
- };
50
- var items = useItems(props);
51
- var handleOnItemActivated = function handleOnItemActivated(_ref) {
52
- var item = _ref.item,
53
- _ref$shouldCloseMenu = _ref.shouldCloseMenu,
54
- shouldCloseMenu = _ref$shouldCloseMenu === void 0 ? true : _ref$shouldCloseMenu;
55
- setIsDropdownOpen(!shouldCloseMenu);
56
- return onItemActivated({
57
- editorView: props.editorView,
58
- buttonName: item.value.name
59
- });
60
- };
61
- return jsx("span", {
62
- css: wrapperStyle
63
- }, jsx(DropdownMenu, {
64
- items: items,
65
- onItemActivated: handleOnItemActivated,
66
- mountTo: popupsMountPoint,
67
- boundariesElement: popupsBoundariesElement,
68
- scrollableElement: popupsScrollableElement,
69
- isOpen: isDropdownOpen,
70
- onOpenChange: onOpenChange,
71
- fitHeight: 188,
72
- fitWidth: 175,
73
- shouldUseDefaultRole: true,
74
- shouldFocusFirstItem: function shouldFocusFirstItem() {
75
- if (isOpenedByKeyboard) {
76
- setOpenedByKeyboard(false);
77
- }
78
- return isOpenedByKeyboard;
79
- }
80
- }, jsx(ToolbarButton, {
81
- spacing: isReducedSpacing ? 'none' : 'default',
82
- selected: bulletListActive || orderedListActive,
83
- "aria-expanded": isDropdownOpen,
84
- "aria-haspopup": true,
85
- "aria-label": labelLists,
86
- disabled: disabled,
87
- onClick: handleTriggerClick,
88
- onKeyDown: handleOnKeyDown,
89
- title: labelLists,
90
- iconBefore: jsx("span", {
91
- css: wrapperStyle
92
- }, jsx(BulletListIcon, {
93
- label: labelLists
94
- }), jsx("span", {
95
- css: expandIconWrapperStyle
96
- }, jsx(ExpandIcon, {
97
- label: ""
98
- })))
99
- })), jsx("span", {
100
- css: separatorStyles
101
- }));
102
- }
103
- function useItems(props) {
104
- var _useIntl2 = useIntl(),
105
- formatMessage = _useIntl2.formatMessage;
106
- var labelUnorderedList = formatMessage(listMessages.unorderedList);
107
- var labelOrderedList = formatMessage(listMessages.orderedList);
108
- var items = [{
109
- key: 'unorderedList',
110
- content: labelUnorderedList,
111
- value: {
112
- name: 'bullet_list'
113
- },
114
- isDisabled: props.bulletListDisabled,
115
- isActive: Boolean(props.bulletListActive),
116
- elemAfter: jsx("div", {
117
- css: shortcutStyle
118
- }, tooltip(toggleBulletListKeymap))
119
- }, {
120
- key: 'orderedList',
121
- content: labelOrderedList,
122
- value: {
123
- name: 'ordered_list'
124
- },
125
- isDisabled: props.orderedListDisabled,
126
- isActive: Boolean(props.orderedListActive),
127
- elemAfter: jsx("div", {
128
- css: shortcutStyle
129
- }, tooltip(toggleOrderedListKeymap))
130
- }];
131
- if (props.showIndentationButtons) {
132
- var labelIndent = formatMessage(indentationMessages.indent);
133
- var labelOutdent = formatMessage(indentationMessages.outdent);
134
- items.push({
135
- key: 'outdent',
136
- content: labelOutdent,
137
- value: {
138
- name: 'outdent'
139
- },
140
- isDisabled: props.outdentDisabled,
141
- isActive: false,
142
- elemAfter: jsx("div", {
143
- css: shortcutStyle
144
- }, tooltip(toggleOutdentKeymap))
145
- }, {
146
- key: 'indent',
147
- content: labelIndent,
148
- value: {
149
- name: 'indent'
150
- },
151
- isDisabled: props.indentDisabled,
152
- isActive: false,
153
- elemAfter: jsx("div", {
154
- css: shortcutStyle
155
- }, tooltip(toggleIndentKeymap))
156
- });
157
- }
158
- return [{
159
- items: items
160
- }];
161
- }
@@ -1,56 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { onItemActivated } from './onItemActivated';
4
- import { ToolbarDropdown } from './ToolbarDropdown';
5
- import { Toolbar } from './Toolbar';
6
- export default function ToolbarListsIndentation(props) {
7
- var disabled = props.disabled,
8
- isSmall = props.isSmall,
9
- isReducedSpacing = props.isReducedSpacing,
10
- bulletListActive = props.bulletListActive,
11
- bulletListDisabled = props.bulletListDisabled,
12
- orderedListActive = props.orderedListActive,
13
- orderedListDisabled = props.orderedListDisabled,
14
- showIndentationButtons = props.showIndentationButtons,
15
- popupsMountPoint = props.popupsMountPoint,
16
- popupsBoundariesElement = props.popupsBoundariesElement,
17
- popupsScrollableElement = props.popupsScrollableElement,
18
- indentDisabled = props.indentDisabled,
19
- outdentDisabled = props.outdentDisabled,
20
- indentationStateNode = props.indentationStateNode,
21
- featureFlags = props.featureFlags,
22
- pluginInjectionApi = props.pluginInjectionApi;
23
- if (isSmall) {
24
- return jsx(ToolbarDropdown, {
25
- editorView: props.editorView,
26
- isReducedSpacing: isReducedSpacing,
27
- popupsMountPoint: popupsMountPoint,
28
- popupsBoundariesElement: popupsBoundariesElement,
29
- popupsScrollableElement: popupsScrollableElement,
30
- bulletListActive: bulletListActive,
31
- bulletListDisabled: bulletListDisabled,
32
- showIndentationButtons: showIndentationButtons,
33
- orderedListActive: orderedListActive,
34
- orderedListDisabled: orderedListDisabled,
35
- indentDisabled: indentDisabled,
36
- outdentDisabled: outdentDisabled,
37
- disabled: disabled,
38
- onItemActivated: onItemActivated(pluginInjectionApi, indentationStateNode),
39
- featureFlags: featureFlags
40
- });
41
- }
42
- return jsx(Toolbar, {
43
- editorView: props.editorView,
44
- isReducedSpacing: isReducedSpacing,
45
- bulletListActive: bulletListActive,
46
- bulletListDisabled: bulletListDisabled,
47
- showIndentationButtons: showIndentationButtons,
48
- orderedListActive: orderedListActive,
49
- orderedListDisabled: orderedListDisabled,
50
- indentDisabled: indentDisabled,
51
- outdentDisabled: outdentDisabled,
52
- disabled: disabled,
53
- onItemActivated: onItemActivated(pluginInjectionApi, indentationStateNode),
54
- featureFlags: featureFlags
55
- });
56
- }
@@ -1,47 +0,0 @@
1
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- export var onItemActivated = function onItemActivated(pluginInjectionApi, indentationStateNode) {
3
- return function (_ref) {
4
- var buttonName = _ref.buttonName,
5
- editorView = _ref.editorView;
6
- switch (buttonName) {
7
- case 'bullet_list':
8
- pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.toggleBulletList(INPUT_METHOD.TOOLBAR));
9
- break;
10
- case 'ordered_list':
11
- pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.toggleOrderedList(INPUT_METHOD.TOOLBAR));
12
- break;
13
- case 'indent':
14
- {
15
- var node = indentationStateNode;
16
- if (node === 'paragraph_heading') {
17
- var _pluginInjectionApi$i;
18
- pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$i = pluginInjectionApi.indentation) === null || _pluginInjectionApi$i === void 0 || _pluginInjectionApi$i.actions.indentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
19
- }
20
- if (node === 'list') {
21
- pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.indentList(INPUT_METHOD.TOOLBAR));
22
- }
23
- if (node === 'taskList') {
24
- var _pluginInjectionApi$t;
25
- pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$t = pluginInjectionApi.taskDecision) === null || _pluginInjectionApi$t === void 0 || _pluginInjectionApi$t.actions.indentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
26
- }
27
- break;
28
- }
29
- case 'outdent':
30
- {
31
- var _node = indentationStateNode;
32
- if (_node === 'paragraph_heading') {
33
- var _pluginInjectionApi$i2;
34
- pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$i2 = pluginInjectionApi.indentation) === null || _pluginInjectionApi$i2 === void 0 || _pluginInjectionApi$i2.actions.outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
35
- }
36
- if (_node === 'list') {
37
- pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.outdentList(INPUT_METHOD.TOOLBAR));
38
- }
39
- if (_node === 'taskList') {
40
- var _pluginInjectionApi$t2;
41
- pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$t2 = pluginInjectionApi.taskDecision) === null || _pluginInjectionApi$t2 === void 0 || _pluginInjectionApi$t2.actions.outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
42
- }
43
- break;
44
- }
45
- }
46
- };
47
- };
@@ -1,16 +0,0 @@
1
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
- import type { InsertBlockPluginDependencies } from './types';
3
- export interface InsertBlockOptions {
4
- allowTables?: boolean;
5
- allowExpand?: boolean;
6
- insertMenuItems?: any;
7
- horizontalRuleEnabled?: boolean;
8
- nativeStatusSupported?: boolean;
9
- replacePlusMenuWithElementBrowser?: boolean;
10
- showElementBrowserLink?: boolean;
11
- }
12
- declare const insertBlockPlugin: NextEditorPlugin<'insertBlock', {
13
- pluginConfiguration: InsertBlockOptions | undefined;
14
- dependencies: InsertBlockPluginDependencies;
15
- }>;
16
- export default insertBlockPlugin;
@@ -1,45 +0,0 @@
1
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
3
- import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
4
- import type { DatePlugin } from '@atlaskit/editor-plugin-date';
5
- import type { TablePlugin } from '@atlaskit/editor-plugin-table';
6
- import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
7
- import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
8
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
9
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
10
- import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
11
- import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
12
- import type { CodeBlockPlugin } from '@atlaskit/editor-plugin-code-block';
13
- import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
14
- import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
15
- import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
16
- import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
17
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
18
- import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
19
- import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
20
- import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
21
- import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
22
- import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
23
- export type InsertBlockPluginDependencies = [
24
- OptionalPlugin<FeatureFlagsPlugin>,
25
- TypeAheadPlugin,
26
- OptionalPlugin<TablePlugin>,
27
- OptionalPlugin<HyperlinkPlugin>,
28
- OptionalPlugin<DatePlugin>,
29
- OptionalPlugin<BlockTypePlugin>,
30
- OptionalPlugin<AnalyticsPlugin>,
31
- OptionalPlugin<ImageUploadPlugin>,
32
- OptionalPlugin<EmojiPlugin>,
33
- OptionalPlugin<QuickInsertPlugin>,
34
- OptionalPlugin<RulePlugin>,
35
- OptionalPlugin<CodeBlockPlugin>,
36
- OptionalPlugin<PanelPlugin>,
37
- OptionalPlugin<MediaPlugin>,
38
- OptionalPlugin<MentionsPlugin>,
39
- OptionalPlugin<StatusPlugin>,
40
- OptionalPlugin<LayoutPlugin>,
41
- OptionalPlugin<ExpandPlugin>,
42
- OptionalPlugin<PlaceholderTextPlugin>,
43
- OptionalPlugin<ExtensionPlugin>,
44
- OptionalPlugin<TasksAndDecisionsPlugin>
45
- ];
@@ -1,4 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import type { InsertMenuProps } from './types';
3
- declare const InsertMenu: ({ editorView, dropdownItems, showElementBrowserLink, onInsert, toggleVisiblity, pluginInjectionApi, }: InsertMenuProps) => jsx.JSX.Element;
4
- export default InsertMenu;
@@ -1,22 +0,0 @@
1
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
4
- import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
5
- import type { InsertBlockPluginDependencies } from '../../types';
6
- import type { BlockMenuItem } from '../ToolbarInsertBlock/create-items';
7
- type SimpleEventHandler<T> = (event?: T) => void;
8
- export interface InsertMenuProps {
9
- dropdownItems: BlockMenuItem[];
10
- editorView: EditorView;
11
- showElementBrowserLink: boolean;
12
- toggleVisiblity: SimpleEventHandler<MouseEvent | KeyboardEvent>;
13
- onInsert: OnInsert;
14
- pluginInjectionApi: PluginInjectionAPIWithDependencies<InsertBlockPluginDependencies> | undefined;
15
- }
16
- export type SvgGetterParams = {
17
- name: string;
18
- };
19
- export type OnInsert = ({ item }: {
20
- item: MenuItem;
21
- }) => Transaction;
22
- export {};
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { BlockMenuItem } from './create-items';
4
- import type { OnInsert } from '../ElementBrowser/types';
5
- import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
6
- import type { InsertBlockPluginDependencies } from '../../types';
7
- type SimpleEventHandler<T> = (event?: T) => void;
8
- export interface BlockInsertElementBrowserProps {
9
- disabled: boolean;
10
- editorView: EditorView;
11
- items: BlockMenuItem[];
12
- spacing: 'none' | 'default';
13
- label: string;
14
- open: boolean;
15
- popupsBoundariesElement?: HTMLElement;
16
- popupsMountPoint?: HTMLElement;
17
- popupsScrollableElement?: HTMLElement;
18
- plusButtonRef?: HTMLElement;
19
- showElementBrowserLink: boolean;
20
- onRef(el: HTMLElement): void;
21
- onClick: React.MouseEventHandler;
22
- onKeyDown?: React.KeyboardEventHandler;
23
- onInsert: OnInsert;
24
- togglePlusMenuVisibility: SimpleEventHandler<MouseEvent | KeyboardEvent>;
25
- pluginInjectionApi: PluginInjectionAPIWithDependencies<InsertBlockPluginDependencies> | undefined;
26
- }
27
- export declare const BlockInsertElementBrowser: React.FC<BlockInsertElementBrowserProps>;
28
- export {};
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import type { BlockMenuItem } from './create-items';
3
- export interface BlockInsertMenuLegacyProps {
4
- disabled: boolean;
5
- spacing: 'none' | 'default';
6
- label: string;
7
- open: boolean;
8
- items: BlockMenuItem[];
9
- popupsMountPoint?: HTMLElement;
10
- popupsBoundariesElement?: HTMLElement;
11
- popupsScrollableElement?: HTMLElement;
12
- onClick: React.MouseEventHandler;
13
- onKeyDown?: React.KeyboardEventHandler;
14
- onRef(el: HTMLElement): void;
15
- onItemActivated(attrs: any): void;
16
- onOpenChange(attrs: any): void;
17
- }
18
- export declare const BlockInsertMenuLegacy: React.FC<BlockInsertMenuLegacyProps>;
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { OnInsert } from '../ElementBrowser/types';
4
- import type { BlockMenuItem } from './create-items';
5
- import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
6
- import type { InsertBlockPluginDependencies } from '../../types';
7
- export interface BlockInsertMenuProps {
8
- disabled: boolean;
9
- editorView: EditorView;
10
- items: BlockMenuItem[];
11
- label: string;
12
- open: boolean;
13
- plusButtonRef?: HTMLElement;
14
- popupsBoundariesElement?: HTMLElement;
15
- popupsMountPoint?: HTMLElement;
16
- popupsScrollableElement?: HTMLElement;
17
- replacePlusMenuWithElementBrowser: boolean;
18
- spacing: 'none' | 'default';
19
- showElementBrowserLink: boolean;
20
- onRef(el: HTMLElement): void;
21
- onPlusButtonRef(el: HTMLElement): void;
22
- onClick: React.MouseEventHandler;
23
- onItemActivated(attrs: any): void;
24
- onInsert: OnInsert;
25
- onOpenChange(attrs: any): void;
26
- togglePlusMenuVisibility(): void;
27
- onKeyDown?: React.KeyboardEventHandler;
28
- pluginInjectionApi: PluginInjectionAPIWithDependencies<InsertBlockPluginDependencies> | undefined;
29
- }
30
- export declare const BlockInsertMenu: React.FC<BlockInsertMenuProps>;
@@ -1,39 +0,0 @@
1
- /// <reference types="react" />
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
- import type { Schema } from '@atlaskit/editor-prosemirror/model';
4
- import type { EmojiProvider } from '@atlaskit/emoji/resource';
5
- import type { BlockType } from '@atlaskit/editor-plugin-block-type';
6
- import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
7
- export interface CreateItemsConfig {
8
- isTypeAheadAllowed?: boolean;
9
- tableSupported?: boolean;
10
- mediaUploadsEnabled?: boolean;
11
- mediaSupported?: boolean;
12
- imageUploadSupported?: boolean;
13
- imageUploadEnabled?: boolean;
14
- mentionsSupported?: boolean;
15
- mentionsDisabled?: boolean;
16
- availableWrapperBlockTypes?: BlockType[];
17
- actionSupported?: boolean;
18
- decisionSupported?: boolean;
19
- linkSupported?: boolean;
20
- linkDisabled?: boolean;
21
- emojiDisabled?: boolean;
22
- nativeStatusSupported?: boolean;
23
- dateEnabled?: boolean;
24
- placeholderTextEnabled?: boolean;
25
- horizontalRuleEnabled?: boolean;
26
- layoutSectionEnabled?: boolean;
27
- showElementBrowserLink?: boolean;
28
- expandEnabled?: boolean;
29
- insertMenuItems?: MenuItem[];
30
- emojiProvider?: Promise<EmojiProvider>;
31
- schema: Schema;
32
- numberOfButtons: number;
33
- formatMessage: WrappedComponentProps['intl']['formatMessage'];
34
- isNewMenuEnabled?: boolean;
35
- }
36
- export interface BlockMenuItem extends MenuItem {
37
- title: JSX.Element | null;
38
- }
39
- export declare const createItems: import("memoize-one").MemoizedFn<(config: CreateItemsConfig) => readonly [BlockMenuItem[], BlockMenuItem[]]>;
@@ -1,16 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import type { ToolbarButtonRef } from '@atlaskit/editor-common/ui-menu';
4
- export interface DropDownButtonProps {
5
- label: string;
6
- selected: boolean;
7
- disabled?: boolean;
8
- 'aria-expanded': React.AriaAttributes['aria-expanded'];
9
- 'aria-haspopup': React.AriaAttributes['aria-haspopup'];
10
- 'aria-keyshortcuts'?: React.AriaAttributes['aria-keyshortcuts'];
11
- onClick: React.MouseEventHandler;
12
- onKeyDown?: React.KeyboardEventHandler;
13
- spacing: 'none' | 'default';
14
- handleRef(el: ToolbarButtonRef): void;
15
- }
16
- export declare const DropDownButton: React.StatelessComponent<DropDownButtonProps>;
@@ -1,46 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/react';
4
- import type { WrappedComponentProps } from 'react-intl-next';
5
- import type { Props, State } from './types';
6
- export declare class ToolbarInsertBlock extends React.PureComponent<Props & WrappedComponentProps, State> {
7
- private dropdownButtonRef?;
8
- private emojiButtonRef?;
9
- private plusButtonRef?;
10
- state: State;
11
- static getDerivedStateFromProps(props: Props & WrappedComponentProps, state: State): State | null;
12
- componentDidUpdate(prevProps: Props): void;
13
- private onOpenChange;
14
- private togglePlusMenuVisibility;
15
- private toggleEmojiPicker;
16
- private handleEmojiPressEscape;
17
- private handleEmojiClickOutside;
18
- private renderPopup;
19
- private handleEmojiButtonRef;
20
- private handlePlusButtonRef;
21
- private handleDropDownButtonRef;
22
- render(): jsx.JSX.Element | null;
23
- private handleClick;
24
- private handleOpenByKeyboard;
25
- private toggleLinkPanel;
26
- private insertMention;
27
- private insertTable;
28
- private createDate;
29
- private createPlaceholderText;
30
- private insertLayoutColumns;
31
- private createStatus;
32
- private openMediaPicker;
33
- private insertTaskDecision;
34
- private insertHorizontalRule;
35
- private insertExpand;
36
- private insertBlockType;
37
- private handleSelectedEmoji;
38
- private openElementBrowser;
39
- private onItemActivated;
40
- private insertToolbarMenuItem;
41
- private insertInsertMenuItem;
42
- }
43
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
44
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
45
- };
46
- export default _default;
@@ -1,34 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
4
- export interface CreateInit {
5
- content: string;
6
- disabled: boolean;
7
- tooltipDescription?: string;
8
- 'aria-label'?: React.AriaAttributes['aria-label'];
9
- 'aria-haspopup'?: React.AriaAttributes['aria-haspopup'];
10
- }
11
- export declare const action: (init: CreateInit) => MenuItem;
12
- export declare const link: (init: CreateInit) => MenuItem;
13
- export declare const media: (init: CreateInit) => MenuItem;
14
- export declare const imageUpload: (init: CreateInit) => MenuItem;
15
- export declare const mention: (init: CreateInit) => MenuItem;
16
- export declare const emoji: (init: CreateInit) => MenuItem;
17
- export declare const table: (init: CreateInit) => MenuItem;
18
- export declare const layout: (init: CreateInit) => MenuItem;
19
- export declare const codeblock: (init: CreateInit & {
20
- shortcut?: string;
21
- }) => MenuItem;
22
- export declare const panel: (init: CreateInit & {
23
- shortcut?: string;
24
- }) => MenuItem;
25
- export declare const blockquote: (init: CreateInit & {
26
- shortcut?: string;
27
- }) => MenuItem;
28
- export declare const decision: (init: CreateInit) => MenuItem;
29
- export declare const horizontalrule: (init: CreateInit) => MenuItem;
30
- export declare const expand: (init: CreateInit) => MenuItem;
31
- export declare const date: (init: CreateInit) => MenuItem;
32
- export declare const placeholder: (init: CreateInit) => MenuItem;
33
- export declare const status: (init: CreateInit) => MenuItem;
34
- export declare const more: (init: CreateInit) => MenuItem;
@@ -1 +0,0 @@
1
- export { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
@@ -1 +0,0 @@
1
- export declare const shallowEquals: <T extends {}>([aRaw]: ReadonlyArray<unknown>, [bRaw]: ReadonlyArray<unknown>) => boolean;
@@ -1,2 +0,0 @@
1
- import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
2
- export declare const sortItems: (items: MenuItem[]) => MenuItem[];
@@ -1 +0,0 @@
1
- export declare const triggerWrapper: import("@emotion/react").SerializedStyles;
@@ -1,59 +0,0 @@
1
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { EditorActionsOptions as EditorActions, FeatureFlags, ImageUploadPluginReferenceEvent, Command, PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
4
- import type { EmojiProvider } from '@atlaskit/emoji';
5
- import type { BlockType } from '@atlaskit/editor-plugin-block-type';
6
- import type { MacroProvider } from '@atlaskit/editor-common/provider-factory';
7
- import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
8
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
9
- import type { BlockMenuItem } from './create-items';
10
- import type { InsertBlockPluginDependencies } from '../../types';
11
- export interface Props {
12
- buttons: number;
13
- isReducedSpacing: boolean;
14
- isDisabled?: boolean;
15
- isTypeAheadAllowed?: boolean;
16
- editorView: EditorView;
17
- editorActions?: EditorActions;
18
- tableSupported?: boolean;
19
- actionSupported?: boolean;
20
- decisionSupported?: boolean;
21
- mentionsSupported?: boolean;
22
- mediaUploadsEnabled?: boolean;
23
- mediaSupported?: boolean;
24
- imageUploadSupported?: boolean;
25
- imageUploadEnabled?: boolean;
26
- handleImageUpload?: (event?: ImageUploadPluginReferenceEvent) => Command;
27
- dateEnabled?: boolean;
28
- horizontalRuleEnabled?: boolean;
29
- placeholderTextEnabled?: boolean;
30
- layoutSectionEnabled?: boolean;
31
- expandEnabled?: boolean;
32
- emojiProvider?: Promise<EmojiProvider>;
33
- availableWrapperBlockTypes?: BlockType[];
34
- linkSupported?: boolean;
35
- linkDisabled?: boolean;
36
- emojiDisabled?: boolean;
37
- nativeStatusSupported?: boolean;
38
- popupsMountPoint?: HTMLElement;
39
- popupsBoundariesElement?: HTMLElement;
40
- popupsScrollableElement?: HTMLElement;
41
- insertMenuItems?: MenuItem[];
42
- showElementBrowserLink?: boolean;
43
- showSeparator?: boolean;
44
- replacePlusMenuWithElementBrowser?: boolean;
45
- onShowMediaPicker?: () => void;
46
- onInsertBlockType?: (name: string) => Command;
47
- onInsertMacroFromMacroBrowser?: (macroProvider: MacroProvider, node?: PMNode, isEditing?: boolean) => (view: EditorView) => void;
48
- dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
49
- featureFlags: FeatureFlags;
50
- pluginInjectionApi?: PluginInjectionAPIWithDependencies<InsertBlockPluginDependencies>;
51
- mentionsDisabled?: boolean;
52
- }
53
- export interface State {
54
- isPlusMenuOpen: boolean;
55
- emojiPickerOpen: boolean;
56
- buttons: BlockMenuItem[];
57
- dropdownItems: BlockMenuItem[];
58
- isOpenedByKeyboard: boolean;
59
- }