@atlaskit/editor-core 172.3.1 → 173.0.0

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 (189) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/cjs/index.js +0 -6
  3. package/dist/cjs/plugins/base/index.js +8 -0
  4. package/dist/cjs/plugins/base/pm-plugins/composition.js +60 -0
  5. package/dist/cjs/plugins/breakout/index.js +5 -4
  6. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +1 -3
  7. package/dist/cjs/plugins/card/pm-plugins/doc.js +8 -1
  8. package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +2 -36
  9. package/dist/cjs/plugins/collab-edit/plugin-state.js +16 -9
  10. package/dist/cjs/plugins/collab-edit/utils.js +16 -2
  11. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +24 -22
  12. package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +20 -15
  13. package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +8 -5
  14. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +3 -3
  15. package/dist/cjs/plugins/paste/actions.js +13 -0
  16. package/dist/cjs/plugins/paste/commands.js +44 -0
  17. package/dist/cjs/plugins/paste/handlers.js +48 -7
  18. package/dist/cjs/plugins/paste/index.js +3 -2
  19. package/dist/cjs/plugins/paste/pm-plugins/main.js +34 -9
  20. package/dist/cjs/plugins/paste/pm-plugins/plugin-factory.js +62 -0
  21. package/dist/cjs/plugins/paste/reducer.js +47 -0
  22. package/dist/cjs/plugins/paste/types.js +5 -0
  23. package/dist/cjs/plugins/placeholder/index.js +3 -1
  24. package/dist/cjs/plugins/placeholder-text/index.js +9 -3
  25. package/dist/cjs/plugins/status/ui/statusPicker.js +4 -1
  26. package/dist/cjs/plugins/table/commands-with-analytics.js +59 -52
  27. package/dist/cjs/plugins/table/index.js +53 -36
  28. package/dist/cjs/plugins/table/toolbar.js +136 -20
  29. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
  30. package/dist/cjs/plugins/tasks-and-decisions/commands.js +1 -16
  31. package/dist/cjs/plugins/type-ahead/constants.js +3 -1
  32. package/dist/cjs/plugins/type-ahead/messages.js +16 -1
  33. package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +1 -1
  34. package/dist/cjs/plugins/type-ahead/pm-plugins/reducer.js +2 -2
  35. package/dist/cjs/plugins/type-ahead/ui/AssistiveText.js +143 -0
  36. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +59 -11
  37. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +156 -31
  38. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +55 -29
  39. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +3 -3
  40. package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -2
  41. package/dist/cjs/plugins/type-ahead/utils.js +1 -1
  42. package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +8 -0
  43. package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +2 -6
  44. package/dist/cjs/ui/PortalProvider/index.js +26 -32
  45. package/dist/cjs/utils/index.js +8 -1
  46. package/dist/cjs/version-wrapper.js +1 -1
  47. package/dist/cjs/version.json +1 -1
  48. package/dist/es2019/index.js +1 -1
  49. package/dist/es2019/plugins/base/index.js +5 -0
  50. package/dist/es2019/plugins/base/pm-plugins/composition.js +45 -0
  51. package/dist/es2019/plugins/breakout/index.js +5 -4
  52. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +1 -3
  53. package/dist/es2019/plugins/card/pm-plugins/doc.js +10 -1
  54. package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +3 -40
  55. package/dist/es2019/plugins/collab-edit/plugin-state.js +9 -3
  56. package/dist/es2019/plugins/collab-edit/utils.js +17 -3
  57. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +24 -22
  58. package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +15 -7
  59. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +9 -5
  60. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -3
  61. package/dist/es2019/plugins/paste/actions.js +6 -0
  62. package/dist/es2019/plugins/paste/commands.js +27 -0
  63. package/dist/es2019/plugins/paste/handlers.js +50 -8
  64. package/dist/es2019/plugins/paste/index.js +3 -2
  65. package/dist/es2019/plugins/paste/pm-plugins/main.js +29 -6
  66. package/dist/es2019/plugins/paste/pm-plugins/plugin-factory.js +33 -0
  67. package/dist/es2019/plugins/paste/reducer.js +24 -0
  68. package/dist/es2019/plugins/paste/types.js +1 -0
  69. package/dist/es2019/plugins/placeholder/index.js +2 -1
  70. package/dist/es2019/plugins/placeholder-text/index.js +13 -3
  71. package/dist/es2019/plugins/status/ui/statusPicker.js +5 -1
  72. package/dist/es2019/plugins/table/commands-with-analytics.js +6 -3
  73. package/dist/es2019/plugins/table/index.js +22 -4
  74. package/dist/es2019/plugins/table/toolbar.js +118 -14
  75. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
  76. package/dist/es2019/plugins/tasks-and-decisions/commands.js +0 -9
  77. package/dist/es2019/plugins/type-ahead/constants.js +1 -0
  78. package/dist/es2019/plugins/type-ahead/messages.js +16 -1
  79. package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +1 -1
  80. package/dist/es2019/plugins/type-ahead/pm-plugins/reducer.js +2 -2
  81. package/dist/es2019/plugins/type-ahead/ui/AssistiveText.js +95 -0
  82. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +49 -12
  83. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +143 -29
  84. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +64 -31
  85. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +3 -3
  86. package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -2
  87. package/dist/es2019/plugins/type-ahead/utils.js +1 -1
  88. package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +17 -0
  89. package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +2 -5
  90. package/dist/es2019/ui/PortalProvider/index.js +5 -8
  91. package/dist/es2019/utils/index.js +6 -0
  92. package/dist/es2019/version-wrapper.js +1 -1
  93. package/dist/es2019/version.json +1 -1
  94. package/dist/esm/index.js +1 -1
  95. package/dist/esm/plugins/base/index.js +7 -0
  96. package/dist/esm/plugins/base/pm-plugins/composition.js +45 -0
  97. package/dist/esm/plugins/breakout/index.js +5 -4
  98. package/dist/esm/plugins/breakout/ui/LayoutButton.js +1 -3
  99. package/dist/esm/plugins/card/pm-plugins/doc.js +8 -1
  100. package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +3 -37
  101. package/dist/esm/plugins/collab-edit/plugin-state.js +9 -3
  102. package/dist/esm/plugins/collab-edit/utils.js +17 -3
  103. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +24 -22
  104. package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +20 -15
  105. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +8 -5
  106. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -3
  107. package/dist/esm/plugins/paste/actions.js +6 -0
  108. package/dist/esm/plugins/paste/commands.js +31 -0
  109. package/dist/esm/plugins/paste/handlers.js +46 -8
  110. package/dist/esm/plugins/paste/index.js +3 -2
  111. package/dist/esm/plugins/paste/pm-plugins/main.js +27 -6
  112. package/dist/esm/plugins/paste/pm-plugins/plugin-factory.js +46 -0
  113. package/dist/esm/plugins/paste/reducer.js +34 -0
  114. package/dist/esm/plugins/paste/types.js +1 -0
  115. package/dist/esm/plugins/placeholder/index.js +2 -1
  116. package/dist/esm/plugins/placeholder-text/index.js +9 -3
  117. package/dist/esm/plugins/status/ui/statusPicker.js +4 -1
  118. package/dist/esm/plugins/table/commands-with-analytics.js +56 -49
  119. package/dist/esm/plugins/table/index.js +54 -37
  120. package/dist/esm/plugins/table/toolbar.js +124 -15
  121. package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
  122. package/dist/esm/plugins/tasks-and-decisions/commands.js +0 -12
  123. package/dist/esm/plugins/type-ahead/constants.js +1 -0
  124. package/dist/esm/plugins/type-ahead/messages.js +16 -1
  125. package/dist/esm/plugins/type-ahead/pm-plugins/main.js +1 -1
  126. package/dist/esm/plugins/type-ahead/pm-plugins/reducer.js +2 -2
  127. package/dist/esm/plugins/type-ahead/ui/AssistiveText.js +129 -0
  128. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +56 -12
  129. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +151 -32
  130. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +54 -31
  131. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +3 -3
  132. package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -2
  133. package/dist/esm/plugins/type-ahead/utils.js +1 -1
  134. package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +7 -0
  135. package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +2 -5
  136. package/dist/esm/ui/PortalProvider/index.js +26 -35
  137. package/dist/esm/utils/index.js +4 -0
  138. package/dist/esm/version-wrapper.js +1 -1
  139. package/dist/esm/version.json +1 -1
  140. package/dist/types/index.d.ts +1 -1
  141. package/dist/types/plugins/base/pm-plugins/composition.d.ts +8 -0
  142. package/dist/types/plugins/code-block/pm-plugins/ide-ux.d.ts +1 -4
  143. package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +2 -0
  144. package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +1 -0
  145. package/dist/types/plugins/paste/actions.d.ts +15 -0
  146. package/dist/types/plugins/paste/commands.d.ts +16 -0
  147. package/dist/types/plugins/paste/handlers.d.ts +1 -1
  148. package/dist/types/plugins/paste/pm-plugins/main.d.ts +3 -3
  149. package/dist/types/plugins/paste/pm-plugins/plugin-factory.d.ts +3 -0
  150. package/dist/types/plugins/paste/reducer.d.ts +3 -0
  151. package/dist/types/plugins/paste/types.d.ts +6 -0
  152. package/dist/types/plugins/table/commands-with-analytics.d.ts +5 -5
  153. package/dist/types/plugins/tasks-and-decisions/commands.d.ts +0 -2
  154. package/dist/types/plugins/type-ahead/constants.d.ts +1 -0
  155. package/dist/types/plugins/type-ahead/messages.d.ts +15 -0
  156. package/dist/types/plugins/type-ahead/ui/AssistiveText.d.ts +33 -0
  157. package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +3 -0
  158. package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +6 -3
  159. package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +2 -2
  160. package/dist/types/plugins/type-ahead/ui/TypeAheadPopup.d.ts +1 -1
  161. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  162. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  163. package/dist/types/utils/index.d.ts +1 -0
  164. package/dist/types-ts4.0/index.d.ts +1 -1
  165. package/dist/types-ts4.0/plugins/base/pm-plugins/composition.d.ts +8 -0
  166. package/dist/types-ts4.0/plugins/code-block/pm-plugins/ide-ux.d.ts +1 -4
  167. package/dist/types-ts4.0/plugins/floating-toolbar/ui/Dropdown.d.ts +2 -0
  168. package/dist/types-ts4.0/plugins/floating-toolbar/ui/DropdownMenu.d.ts +1 -0
  169. package/dist/types-ts4.0/plugins/paste/actions.d.ts +15 -0
  170. package/dist/types-ts4.0/plugins/paste/commands.d.ts +16 -0
  171. package/dist/types-ts4.0/plugins/paste/handlers.d.ts +1 -1
  172. package/dist/types-ts4.0/plugins/paste/pm-plugins/main.d.ts +3 -3
  173. package/dist/types-ts4.0/plugins/paste/pm-plugins/plugin-factory.d.ts +3 -0
  174. package/dist/types-ts4.0/plugins/paste/reducer.d.ts +3 -0
  175. package/dist/types-ts4.0/plugins/paste/types.d.ts +6 -0
  176. package/dist/types-ts4.0/plugins/table/commands-with-analytics.d.ts +5 -5
  177. package/dist/types-ts4.0/plugins/tasks-and-decisions/commands.d.ts +0 -2
  178. package/dist/types-ts4.0/plugins/type-ahead/constants.d.ts +1 -0
  179. package/dist/types-ts4.0/plugins/type-ahead/messages.d.ts +15 -0
  180. package/dist/types-ts4.0/plugins/type-ahead/ui/AssistiveText.d.ts +33 -0
  181. package/dist/types-ts4.0/plugins/type-ahead/ui/InputQuery.d.ts +3 -0
  182. package/dist/types-ts4.0/plugins/type-ahead/ui/TypeAheadList.d.ts +6 -3
  183. package/dist/types-ts4.0/plugins/type-ahead/ui/TypeAheadListItem.d.ts +2 -2
  184. package/dist/types-ts4.0/plugins/type-ahead/ui/TypeAheadPopup.d.ts +1 -1
  185. package/dist/types-ts4.0/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  186. package/dist/types-ts4.0/ui/ContentStyles/index.d.ts +2 -2
  187. package/dist/types-ts4.0/utils/index.d.ts +1 -0
  188. package/package.json +31 -32
  189. package/report.api.md +161 -49
@@ -1,11 +1,11 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
 
3
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
4
4
 
5
5
  /** @jsx jsx */
6
- import React, { useCallback, useMemo, useRef, useLayoutEffect } from 'react';
6
+ import React, { useCallback, useMemo, useLayoutEffect } from 'react';
7
7
  import { css, jsx } from '@emotion/react';
8
- import { DN600, N200, N800 } from '@atlaskit/theme/colors';
8
+ import { DN600, N200, N800, N30, B100 } from '@atlaskit/theme/colors';
9
9
  import { themed } from '@atlaskit/theme/components';
10
10
  import { borderRadius } from '@atlaskit/theme/constants';
11
11
  import { ButtonItem } from '@atlaskit/menu';
@@ -28,9 +28,23 @@ var itemText = function itemText(theme) {
28
28
  };
29
29
 
30
30
  var itemAfter = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n"])));
31
- var hidden = {
32
- overflow: 'hidden'
31
+ var customRenderItemDivStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n overflow: hidden;\n &:hover {\n background-color: ", ";\n }\n &:focus {\n box-shadow: inset 0px 0px 0px 2px ", ";\n outline: none;\n }\n"])), token('color.background.selected', N30), token('color.border.focused', B100));
32
+ /**
33
+ * This CSS emulates the desired behaviour with :focus-visible for firefox.
34
+ * Firefox unfortunately does not register keyboard focus if user mouseDown and drag a typeahead item
35
+ * resulting in focus-visible style not drawn.
36
+ */
37
+
38
+ var selectionFrame = {
39
+ '& > button:focus': {
40
+ boxShadow: "inset 0px 0px 0px 2px ".concat(token('color.border.focused', B100)),
41
+ outline: 'none',
42
+ '&:active': {
43
+ boxShadow: 'none'
44
+ }
45
+ }
33
46
  };
47
+ var selectedStyle = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n background-color: ", ";\n"])), token('color.background.selected', N30));
34
48
  var FallbackIcon = /*#__PURE__*/React.memo(function (_ref) {
35
49
  var label = _ref.label;
36
50
  return jsx(IconFallback, null);
@@ -40,31 +54,16 @@ var noop = function noop() {};
40
54
 
41
55
  export var TypeAheadListItem = function TypeAheadListItem(_ref2) {
42
56
  var item = _ref2.item,
57
+ itemsLength = _ref2.itemsLength,
43
58
  selectedIndex = _ref2.selectedIndex,
44
- onItemHover = _ref2.onItemHover,
45
59
  onItemClick = _ref2.onItemClick,
46
60
  itemIndex = _ref2.itemIndex;
47
- var isSelected = itemIndex === selectedIndex; // It's possible for onMouseMove to be called multiple times in quick
48
- // succession because the mousemove event can fire very rapidly. This
49
- // provides an additional safety net to prevent that.
50
61
 
51
- var mouseMoveCalled = useRef(false);
52
- var onMouseMove = useCallback(function () {
53
- if (isSelected || mouseMoveCalled.current) {
54
- return;
55
- }
56
-
57
- mouseMoveCalled.current = true;
58
- onItemHover({
59
- item: item,
60
- index: itemIndex
61
- });
62
- }, [item, itemIndex, onItemHover, isSelected]);
63
- useLayoutEffect(function () {
64
- if (!isSelected) {
65
- mouseMoveCalled.current = false;
66
- }
67
- }, [isSelected]);
62
+ /**
63
+ * To select and highlight the first Item when no item is selected
64
+ * However selectedIndex remains -1, So that user does not skip the first item when down arrow key is used from typeahead query(inputQuery.tsx)
65
+ */
66
+ var isSelected = itemIndex === selectedIndex || selectedIndex === -1 && itemIndex === 0;
68
67
  var icon = item.icon,
69
68
  title = item.title,
70
69
  customRenderItem = item.render;
@@ -78,39 +77,63 @@ export var TypeAheadListItem = function TypeAheadListItem(_ref2) {
78
77
  var insertSelectedItem = useCallback(function () {
79
78
  onItemClick(SelectItemMode.SELECTED, itemIndex);
80
79
  }, [onItemClick, itemIndex]);
80
+ var customItemRef = /*#__PURE__*/React.createRef();
81
+ var buttonItemRef = /*#__PURE__*/React.createRef();
82
+ var shouldUpdateFocus = selectedIndex === itemIndex;
83
+ useLayoutEffect(function () {
84
+ if (shouldUpdateFocus) {
85
+ var _customItemRef$curren;
86
+
87
+ customItemRef === null || customItemRef === void 0 ? void 0 : (_customItemRef$curren = customItemRef.current) === null || _customItemRef$curren === void 0 ? void 0 : _customItemRef$curren.focus();
88
+ }
89
+ }, [customItemRef, shouldUpdateFocus]);
90
+ useLayoutEffect(function () {
91
+ if (shouldUpdateFocus) {
92
+ var _buttonItemRef$curren;
93
+
94
+ buttonItemRef === null || buttonItemRef === void 0 ? void 0 : (_buttonItemRef$curren = buttonItemRef.current) === null || _buttonItemRef$curren === void 0 ? void 0 : _buttonItemRef$curren.focus();
95
+ }
96
+ }, [buttonItemRef, shouldUpdateFocus]);
81
97
  var customItem = useMemo(function () {
82
98
  if (!customRenderItem) {
83
99
  return null;
84
100
  }
85
101
 
86
102
  var Comp = customRenderItem;
103
+ var listItemClasses = [customRenderItemDivStyle, isSelected && selectedStyle];
87
104
  return jsx("div", {
88
105
  "aria-selected": isSelected,
89
106
  "aria-label": title,
90
107
  role: "option",
108
+ "aria-setsize": itemsLength,
91
109
  tabIndex: 0,
92
- style: hidden,
93
- onMouseMove: onMouseMove
110
+ css: listItemClasses,
111
+ className: "ak-typeahead-item ".concat(isSelected ? 'typeahead-selected-item' : '') //CSS classes added for test cases purpose
112
+ ,
113
+ ref: customItemRef
94
114
  }, jsx(Comp, {
95
115
  onClick: insertSelectedItem,
96
- isSelected: isSelected,
116
+ isSelected: false //The selection styles are handled in the parent div instead. Hence isSelected is made false always.
117
+ ,
97
118
  onHover: noop
98
119
  }));
99
- }, [customRenderItem, insertSelectedItem, onMouseMove, isSelected, title]);
120
+ }, [customRenderItem, insertSelectedItem, isSelected, title, customItemRef, itemsLength]);
100
121
 
101
122
  if (customItem) {
102
123
  return customItem;
103
124
  }
104
125
 
105
126
  return jsx("span", {
106
- onMouseMove: onMouseMove
127
+ css: selectionFrame
107
128
  }, jsx(ButtonItem, {
108
129
  onClick: insertSelectedItem,
109
130
  iconBefore: elementIcon,
110
131
  isSelected: isSelected,
111
132
  "aria-selected": isSelected,
112
133
  "aria-label": item.title,
134
+ "aria-setsize": itemsLength,
113
135
  role: "option",
136
+ ref: buttonItemRef,
114
137
  description: item.description
115
138
  }, jsx("div", {
116
139
  css: itemBody
@@ -41,7 +41,6 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
41
41
  popupsScrollableElement = props.popupsScrollableElement,
42
42
  items = props.items,
43
43
  selectedIndex = props.selectedIndex,
44
- setSelectedItem = props.setSelectedItem,
45
44
  onItemInsert = props.onItemInsert,
46
45
  fireAnalyticsCallback = props.fireAnalyticsCallback,
47
46
  isEmptyQuery = props.isEmptyQuery;
@@ -175,9 +174,10 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
175
174
  }), jsx(TypeAheadList, {
176
175
  items: items,
177
176
  selectedIndex: selectedIndex,
178
- onItemHover: setSelectedItem,
179
177
  onItemClick: onItemInsert,
180
- fitHeight: fitHeight
178
+ fitHeight: fitHeight,
179
+ editorView: editorView,
180
+ decorationElement: anchorElement
181
181
  })));
182
182
  });
183
183
  TypeAheadPopup.displayName = 'TypeAheadPopup';
@@ -120,6 +120,9 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
120
120
  cancel: cancel,
121
121
  forceFocus: shouldFocusCursorInsideQuery,
122
122
  onUndoRedo: onUndoRedo,
123
- reopenQuery: reopenQuery
123
+ reopenQuery: reopenQuery,
124
+ editorView: editorView,
125
+ items: items
124
126
  });
125
- });
127
+ });
128
+ WrapperTypeAhead.displayName = 'WrapperTypeAhead';
@@ -87,7 +87,7 @@ export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
87
87
  var selectedIndex = typeAheadState.selectedIndex,
88
88
  items = typeAheadState.items;
89
89
  var stats = typeAheadState.stats instanceof StatsModifier ? typeAheadState.stats : new StatsModifier();
90
- var nextIndex = 0;
90
+ var nextIndex;
91
91
 
92
92
  if (direction === 'next') {
93
93
  stats.increaseArrowDown();
@@ -15,6 +15,7 @@ import { DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
15
15
  import { addAnalytics } from '../../plugins/analytics/utils';
16
16
  import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, ACTION } from '../../plugins/analytics';
17
17
  import { toolbarMessages } from './toolbar-messages';
18
+ import { insideTable, isInLayoutColumn } from '../../utils';
18
19
  var alignmentIcons = [{
19
20
  id: 'editor.media.alignLeft',
20
21
  value: 'align-start',
@@ -88,6 +89,12 @@ var makeAlign = function makeAlign(layout, nodeType) {
88
89
  // setNodeMarkup is called
89
90
 
90
91
  tr.setSelection(NodeSelection.create(tr.doc, state.selection.from));
92
+ var paragraph = tr.doc.type.schema.nodes.paragraph; // see https://product-fabric.atlassian.net/browse/ED-15518 insert a new paragraph when an embedded card is wrapped left or right
93
+
94
+ if (layout.startsWith('wrap') && paragraph && !tr.doc.nodeAt(state.selection.to) && (insideTable(state) || isInLayoutColumn(state))) {
95
+ tr.insert(state.selection.to, paragraph.createAndFill());
96
+ }
97
+
91
98
  dispatch(addAnalytics(state, tr, {
92
99
  eventType: EVENT_TYPE.TRACK,
93
100
  action: ACTION.SELECTED,
@@ -3,7 +3,6 @@ import React from 'react';
3
3
  import AtlaskitTheme from '@atlaskit/theme/components';
4
4
  import { CHANNEL } from '@atlaskit/theme/constants';
5
5
  import { ThemeProvider } from '@emotion/react';
6
- import { ThemeProvider as DeprectateStyledComponentsProvider } from 'styled-components';
7
6
  export function PortalProviderThemeProviders(props) {
8
7
  var children = props.children,
9
8
  mode = props.mode;
@@ -29,11 +28,9 @@ export function PortalProviderThemeProviders(props) {
29
28
  mode: mode
30
29
  };
31
30
  }, [mode]);
32
- return /*#__PURE__*/React.createElement(DeprectateStyledComponentsProvider, {
33
- theme: styledComponentsAndEmotionTheme
34
- }, /*#__PURE__*/React.createElement(ThemeProvider, {
31
+ return /*#__PURE__*/React.createElement(ThemeProvider, {
35
32
  theme: styledComponentsAndEmotionTheme
36
33
  }, /*#__PURE__*/React.createElement(AtlaskitTheme.Provider, {
37
34
  value: atlaskitTheme
38
- }, children)));
35
+ }, children));
39
36
  }
@@ -50,8 +50,6 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
50
50
  _createClass(PortalProviderAPI, [{
51
51
  key: "render",
52
52
  value: function render(children, container) {
53
- var _this2 = this;
54
-
55
53
  var hasAnalyticsContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
56
54
  var hasIntlContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
57
55
  this.portals.set(container, {
@@ -59,14 +57,10 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
59
57
  hasAnalyticsContext: hasAnalyticsContext,
60
58
  hasIntlContext: hasIntlContext
61
59
  });
62
-
63
- var childrenWithThemeProviders = function childrenWithThemeProviders() {
64
- return /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
65
- mode: _this2.themeMode
66
- }, children());
67
- };
68
-
69
- var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
60
+ var childrenWithThemeProviders = /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
61
+ mode: this.themeMode
62
+ }, children());
63
+ var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders) : childrenWithThemeProviders;
70
64
 
71
65
  if (hasIntlContext) {
72
66
  wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
@@ -82,36 +76,33 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
82
76
  }, {
83
77
  key: "forceUpdate",
84
78
  value: function forceUpdate(_ref) {
85
- var _this3 = this;
79
+ var _this2 = this;
86
80
 
87
81
  var intl = _ref.intl,
88
82
  themeMode = _ref.themeMode;
89
83
  this.intl = intl;
90
84
  this.themeMode = themeMode;
91
85
  this.portals.forEach(function (portal, container) {
92
- if (!portal.hasAnalyticsContext && !_this3.useAnalyticsContext && !portal.hasIntlContext) {
86
+ if (!portal.hasAnalyticsContext && !_this2.useAnalyticsContext && !portal.hasIntlContext) {
93
87
  return;
94
88
  }
95
89
 
96
90
  var wrappedChildren = portal.children();
91
+ var childrenWithThemeProviders = /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
92
+ mode: themeMode
93
+ }, wrappedChildren);
97
94
 
98
- var childrenWithThemeProviders = function childrenWithThemeProviders() {
99
- return /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
100
- mode: themeMode
101
- }, wrappedChildren);
102
- };
103
-
104
- if (portal.hasAnalyticsContext && _this3.useAnalyticsContext) {
105
- wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders());
95
+ if (portal.hasAnalyticsContext && _this2.useAnalyticsContext) {
96
+ wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders);
106
97
  }
107
98
 
108
99
  if (portal.hasIntlContext) {
109
100
  wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
110
- value: _this3.intl
111
- }, childrenWithThemeProviders());
101
+ value: _this2.intl
102
+ }, childrenWithThemeProviders);
112
103
  }
113
104
 
114
- unstable_renderSubtreeIntoContainer(_this3.context, wrappedChildren, container);
105
+ unstable_renderSubtreeIntoContainer(_this2.context, wrappedChildren, container);
115
106
  });
116
107
  }
117
108
  }, {
@@ -157,13 +148,13 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
157
148
  var _super2 = _createSuper(BasePortalProvider);
158
149
 
159
150
  function BasePortalProvider(props) {
160
- var _this4;
151
+ var _this3;
161
152
 
162
153
  _classCallCheck(this, BasePortalProvider);
163
154
 
164
- _this4 = _super2.call(this, props);
165
- _this4.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext, props.themeMode);
166
- return _this4;
155
+ _this3 = _super2.call(this, props);
156
+ _this3.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext, props.themeMode);
157
+ return _this3;
167
158
  }
168
159
 
169
160
  _createClass(BasePortalProvider, [{
@@ -204,24 +195,24 @@ export var PortalRenderer = /*#__PURE__*/function (_React$Component2) {
204
195
  var _super3 = _createSuper(PortalRenderer);
205
196
 
206
197
  function PortalRenderer(props) {
207
- var _this5;
198
+ var _this4;
208
199
 
209
200
  _classCallCheck(this, PortalRenderer);
210
201
 
211
- _this5 = _super3.call(this, props);
202
+ _this4 = _super3.call(this, props);
212
203
 
213
- _defineProperty(_assertThisInitialized(_this5), "handleUpdate", function (portals) {
214
- return _this5.setState({
204
+ _defineProperty(_assertThisInitialized(_this4), "handleUpdate", function (portals) {
205
+ return _this4.setState({
215
206
  portals: portals
216
207
  });
217
208
  });
218
209
 
219
- props.portalProviderAPI.setContext(_assertThisInitialized(_this5));
220
- props.portalProviderAPI.on('update', _this5.handleUpdate);
221
- _this5.state = {
210
+ props.portalProviderAPI.setContext(_assertThisInitialized(_this4));
211
+ props.portalProviderAPI.on('update', _this4.handleUpdate);
212
+ _this4.state = {
222
213
  portals: new Map()
223
214
  };
224
- return _this5;
215
+ return _this4;
225
216
  }
226
217
 
227
218
  _createClass(PortalRenderer, [{
@@ -515,6 +515,10 @@ export var isInListItem = function isInListItem(state) {
515
515
  export var hasOpenEnd = function hasOpenEnd(slice) {
516
516
  return slice.openStart > 0 || slice.openEnd > 0;
517
517
  };
518
+ export var isInsideBlockQuote = function isInsideBlockQuote(state) {
519
+ var blockquote = state.schema.nodes.blockquote;
520
+ return hasParentNodeOfType(blockquote)(state.selection);
521
+ };
518
522
  export function filterChildrenBetween(doc, from, to, predicate) {
519
523
  var results = [];
520
524
  doc.nodesBetween(from, to, function (node, pos, parent) {
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "172.3.1";
2
+ export var version = "173.0.0";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "172.3.1",
3
+ "version": "173.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -42,7 +42,7 @@ export type { InputMethodToolbar as TextFormattingInputMethodToolbar, InputMetho
42
42
  export { insertBlockType, insertBlockTypesWithAnalytics, setBlockType, setBlockTypeWithAnalytics, } from './plugins/block-type/commands';
43
43
  export type { InputMethod as BlockTypeInputMethod } from './plugins/block-type/commands';
44
44
  export { createTable } from './plugins/table/commands';
45
- export { insertTaskDecision, insertTaskDecisionCommand, } from './plugins/tasks-and-decisions/commands';
45
+ export { insertTaskDecisionCommand } from './plugins/tasks-and-decisions/commands';
46
46
  export type { TaskDecisionInputMethod } from './plugins/tasks-and-decisions/types';
47
47
  export { EventDispatcher } from './event-dispatcher';
48
48
  export { pluginKey as statusPluginKey } from './plugins/status/plugin';
@@ -0,0 +1,8 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { EditorState } from 'prosemirror-state';
3
+ interface CompositionPluginState {
4
+ isComposing: boolean;
5
+ }
6
+ export declare const isComposing: (state: EditorState) => any;
7
+ declare const _default: () => SafePlugin<CompositionPluginState, any>;
8
+ export default _default;
@@ -1,6 +1,3 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- interface CodeBlockIDEKeyBindingsPluginState {
3
- isComposing: boolean;
4
- }
5
- declare const _default: SafePlugin<CodeBlockIDEKeyBindingsPluginState, any>;
2
+ declare const _default: SafePlugin<any, any>;
6
3
  export default _default;
@@ -14,6 +14,8 @@ export interface Props {
14
14
  disabled?: boolean;
15
15
  tooltip?: string;
16
16
  buttonTestId?: string;
17
+ dropdownWidth?: number;
18
+ showSelected?: boolean;
17
19
  }
18
20
  export interface State {
19
21
  isOpen: boolean;
@@ -10,6 +10,7 @@ export interface Props {
10
10
  hide: Function;
11
11
  dispatchCommand: Function;
12
12
  items: Array<DropdownOptionT<Function>>;
13
+ showSelected?: boolean;
13
14
  }
14
15
  declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
15
16
  WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
@@ -0,0 +1,15 @@
1
+ export declare enum PastePluginActionTypes {
2
+ START_TRACKING_PASTED_MACRO_POSITIONS = "START_TRACKING_PASTED_MACRO_POSITIONS",
3
+ STOP_TRACKING_PASTED_MACRO_POSITIONS = "STOP_TRACKING_PASTED_MACRO_POSITIONS"
4
+ }
5
+ export interface StartTrackingPastedMacroPositions {
6
+ type: PastePluginActionTypes.START_TRACKING_PASTED_MACRO_POSITIONS;
7
+ pastedMacroPositions: {
8
+ [key: string]: number;
9
+ };
10
+ }
11
+ export interface StopTrackingPastedMacroPositions {
12
+ type: PastePluginActionTypes.STOP_TRACKING_PASTED_MACRO_POSITIONS;
13
+ pastedMacroPositionKeys: string[];
14
+ }
15
+ export declare type PastePluginAction = StartTrackingPastedMacroPositions | StopTrackingPastedMacroPositions;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Use this to register macro link positions during a paste operation, that you
3
+ * want to track in a document over time, through any document changes.
4
+ *
5
+ * @param positions a map of string keys (custom position references) and position values e.g. { ['my-key-1']: 11 }
6
+ *
7
+ * **Context**: This is neccessary if there is an async process or an unknown period of time
8
+ * between obtaining an original position, and wanting to know about what its final eventual
9
+ * value. In that scenario, positions will need to be actively tracked and mapped in plugin
10
+ * state so that they can be mapped through any other independent document change transactions being
11
+ * dispatched to the editor that could affect their value.
12
+ */
13
+ export declare const startTrackingPastedMacroPositions: (pastedMacroPositions: {
14
+ [key: string]: number;
15
+ }) => import("@atlaskit/editor-common/types").Command;
16
+ export declare const stopTrackingPastedMacroPositions: (pastedMacroPositionKeys: string[]) => import("@atlaskit/editor-common/types").Command;
@@ -14,7 +14,7 @@ export declare function handleMacroAutoConvert(text: string, slice: Slice, cards
14
14
  export declare function handleCodeBlock(text: string): Command;
15
15
  export declare function handleMediaSingle(inputMethod: InputMethodInsertMedia): (slice: Slice) => Command;
16
16
  export declare function handleExpandPasteInTable(slice: Slice): Command;
17
- export declare function handleMarkdown(markdownSlice: Slice): Command;
17
+ export declare function handleMarkdown(markdownSlice: Slice, from?: number, to?: number): Command;
18
18
  export declare function handleParagraphBlockMarks(state: EditorState, slice: Slice): Slice<any>;
19
19
  /**
20
20
  * ED-6300: When a nested list is pasted in a table cell and the slice has openStart > openEnd,
@@ -1,9 +1,9 @@
1
1
  import { Schema } from 'prosemirror-model';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import { PluginKey } from 'prosemirror-state';
4
3
  import { CardOptions } from '@atlaskit/editor-common/card';
5
4
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
5
  import { DispatchAnalyticsEvent } from '../../analytics';
7
- export declare const stateKey: PluginKey<any, any>;
6
+ export { pluginKey as stateKey } from './plugin-factory';
8
7
  export { md } from '../md';
9
- export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, plainTextPasteLinkification?: boolean, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<any, any>;
8
+ import type { Dispatch } from '../../../event-dispatcher';
9
+ export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, plainTextPasteLinkification?: boolean, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("../types").PastePluginState, Schema<any, any>>;
@@ -0,0 +1,3 @@
1
+ import { PluginKey } from 'prosemirror-state';
2
+ export declare const pluginKey: PluginKey<any, any>;
3
+ export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("../types").PastePluginState | ((state: import("prosemirror-state").EditorState<any>) => import("../types").PastePluginState)) => import("prosemirror-state").SafeStateField<import("../types").PastePluginState, import("prosemirror-model").Schema<any, any>>, createCommand: <A = import("../actions").PastePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState<any>>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction<any>, state: import("prosemirror-state").EditorState<any>) => import("prosemirror-state").Transaction<any>) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState<any>) => import("../types").PastePluginState;
@@ -0,0 +1,3 @@
1
+ import { PastePluginState as State } from './types';
2
+ import { PastePluginAction as Action } from './actions';
3
+ export declare const reducer: (state: State, action: Action) => State;
@@ -0,0 +1,6 @@
1
+ export interface PastePluginState {
2
+ /** map of pasted macro link positions that will to be mapped through incoming transactions */
3
+ pastedMacroPositions: {
4
+ [key: string]: number;
5
+ };
6
+ }
@@ -7,9 +7,9 @@ import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
7
7
  import { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
8
8
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
9
9
  export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB, targetCellPosition?: number | undefined) => import("@atlaskit/editor-common/types").Command;
10
- export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => import("@atlaskit/editor-common/types").Command;
11
- export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => import("@atlaskit/editor-common/types").Command;
12
- export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (cellColor: string, targetCellPosition?: number | undefined) => import("@atlaskit/editor-common/types").Command;
10
+ export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => import("@atlaskit/editor-common/types").Command;
11
+ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => import("@atlaskit/editor-common/types").Command;
12
+ export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, cellColor: string, targetCellPosition?: number | undefined) => import("@atlaskit/editor-common/types").Command;
13
13
  export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
14
14
  export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => import("@atlaskit/editor-common/types").Command;
15
15
  export declare const insertColumnWithAnalytics: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB, position: number) => import("@atlaskit/editor-common/types").Command;
@@ -21,6 +21,6 @@ export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAn
21
21
  export declare const toggleHeaderColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => import("@atlaskit/editor-common/types").Command;
22
22
  export declare const toggleNumberColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => import("@atlaskit/editor-common/types").Command;
23
23
  export declare const toggleTableLayoutWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => import("@atlaskit/editor-common/types").Command;
24
- export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU, columnIndex: number, sortOrder: SortOrder) => import("@atlaskit/editor-common/types").Command;
25
- export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU, { resizeState, table, attributes }: ResizeStateWithAnalytics) => import("@atlaskit/editor-common/types").Command;
24
+ export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, columnIndex: number, sortOrder: SortOrder) => import("@atlaskit/editor-common/types").Command;
25
+ export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB, { resizeState, table, attributes }: ResizeStateWithAnalytics) => import("@atlaskit/editor-common/types").Command;
26
26
  export declare const wrapTableInExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => import("@atlaskit/editor-common/types").Command;
@@ -1,5 +1,4 @@
1
1
  import { NodeType, ResolvedPos, Schema } from 'prosemirror-model';
2
- import { EditorView } from 'prosemirror-view';
3
2
  import { EditorState, Selection, Transaction } from 'prosemirror-state';
4
3
  import { Command } from '../../types';
5
4
  import { INPUT_METHOD } from '../analytics';
@@ -9,7 +8,6 @@ export declare const getListTypes: (listType: TaskDecisionListType, schema: Sche
9
8
  list: NodeType;
10
9
  item: NodeType;
11
10
  };
12
- export declare const insertTaskDecision: (view: EditorView, listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, listLocalId?: string | undefined, itemLocalId?: string | undefined) => Command;
13
11
  export declare const insertTaskDecisionAction: (state: EditorState, listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator | undefined, listLocalId?: string | undefined, itemLocalId?: string | undefined) => Transaction;
14
12
  export declare const insertTaskDecisionCommand: (listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator | undefined, listLocalId?: string | undefined, itemLocalId?: string | undefined) => Command;
15
13
  export declare const insertTaskDecisionWithAnalytics: (state: EditorState, listType: TaskDecisionListType, inputMethod: TaskDecisionInputMethod, addAndCreateList: AddItemTransactionCreator, addToList?: AddItemTransactionCreator | undefined, listLocalId?: string | undefined, itemLocalId?: string | undefined) => Transaction | null;
@@ -1,6 +1,7 @@
1
1
  export declare const TYPE_AHEAD_DECORATION_KEY = "typeahead_decoration_key";
2
2
  export declare const TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = "typeaheadDecoration";
3
3
  export declare const TYPE_AHEAD_POPUP_CONTENT_CLASS = "fabric-editor-typeahead";
4
+ export declare const TYPE_AHEAD_DECORATION_ELEMENT_ID = "typeahaed_decoration_element_id";
4
5
  export declare enum NavigationDirection {
5
6
  LEFT = -1,
6
7
  RIGHT = 1
@@ -4,4 +4,19 @@ export declare const typeAheadListMessages: {
4
4
  defaultMessage: string;
5
5
  description: string;
6
6
  };
7
+ inputQueryAssistiveLabel: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ searchResultsLabel: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ noSearchResultsLabel: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
7
22
  };
@@ -0,0 +1,33 @@
1
+ /** @jsx jsx */
2
+ /// <reference types="lodash" />
3
+ import debounce from 'lodash/debounce';
4
+ import React from 'react';
5
+ import { jsx } from '@emotion/react';
6
+ declare type Cancelable = ReturnType<typeof debounce>;
7
+ declare type AssistiveTextProps = {
8
+ assistiveText: string;
9
+ isInFocus: boolean;
10
+ id: string;
11
+ statusDebounceMillis?: number;
12
+ debounce?: boolean;
13
+ };
14
+ declare type AssistiveTextState = {
15
+ bump: boolean;
16
+ debounced: boolean;
17
+ silenced: boolean;
18
+ };
19
+ declare class AssistveTextComponent extends React.Component<AssistiveTextProps, AssistiveTextState> {
20
+ static defaultProps: AssistiveTextProps;
21
+ debounceStatusUpdate: (() => void) & Cancelable;
22
+ state: {
23
+ bump: boolean;
24
+ debounced: boolean;
25
+ silenced: boolean;
26
+ };
27
+ componentWillMount(): void;
28
+ componentWillUnmount(): void;
29
+ componentWillReceiveProps(): void;
30
+ render(): jsx.JSX.Element;
31
+ }
32
+ export declare const AssistiveText: typeof AssistveTextComponent;
33
+ export {};
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
+ import type { EditorView } from 'prosemirror-view';
3
4
  import { CloseSelectionOptions } from '../constants';
4
5
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
5
6
  declare type InputQueryProps = {
@@ -18,6 +19,8 @@ declare type InputQueryProps = {
18
19
  forceFocus: boolean;
19
20
  onUndoRedo?: (inputType: 'historyUndo' | 'historyRedo') => boolean;
20
21
  reopenQuery?: string;
22
+ editorView: EditorView;
23
+ items: any[];
21
24
  };
22
25
  export declare const InputQuery: React.FC<InputQueryProps>;
23
26
  export {};