@atlaskit/editor-core 189.3.14 → 189.3.16

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 (229) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  3. package/dist/cjs/plugins/analytics/index.js +0 -6
  4. package/dist/cjs/plugins/analytics/utils.js +0 -29
  5. package/dist/cjs/plugins/breakout/index.js +3 -3
  6. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -4
  7. package/dist/cjs/plugins/extension/extension-api.js +3 -3
  8. package/dist/cjs/plugins/extension/index.js +14 -3
  9. package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/actions.js +3 -4
  10. package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/index.js +2 -18
  11. package/dist/cjs/plugins/extension/toolbar.js +1 -1
  12. package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
  13. package/dist/cjs/plugins/find-replace/commands-with-analytics.js +85 -71
  14. package/dist/cjs/plugins/find-replace/index.js +5 -2
  15. package/dist/cjs/plugins/find-replace/keymap.js +4 -4
  16. package/dist/cjs/plugins/index.js +1 -24
  17. package/dist/cjs/plugins/insert-block/index.js +36 -53
  18. package/dist/cjs/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +3 -9
  19. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
  20. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
  21. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +3 -3
  22. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +4 -5
  23. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +7 -8
  24. package/dist/cjs/plugins/paste/handlers.js +3 -3
  25. package/dist/cjs/plugins/paste/pm-plugins/main.js +4 -4
  26. package/dist/cjs/presets/context.js +5 -3
  27. package/dist/cjs/presets/universal.js +12 -8
  28. package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
  29. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
  30. package/dist/cjs/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +11 -8
  31. package/dist/cjs/ui/ContentStyles/index.js +4 -4
  32. package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
  33. package/dist/cjs/use-preset.js +0 -1
  34. package/dist/cjs/version-wrapper.js +1 -1
  35. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  36. package/dist/es2019/plugins/analytics/index.js +1 -1
  37. package/dist/es2019/plugins/analytics/utils.js +0 -24
  38. package/dist/es2019/plugins/breakout/index.js +1 -1
  39. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +1 -1
  40. package/dist/es2019/plugins/extension/extension-api.js +2 -2
  41. package/dist/es2019/plugins/extension/index.js +13 -3
  42. package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/actions.js +2 -2
  43. package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/index.js +1 -14
  44. package/dist/es2019/plugins/extension/toolbar.js +1 -1
  45. package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +20 -19
  46. package/dist/es2019/plugins/find-replace/commands-with-analytics.js +15 -15
  47. package/dist/es2019/plugins/find-replace/index.js +7 -2
  48. package/dist/es2019/plugins/find-replace/keymap.js +4 -4
  49. package/dist/es2019/plugins/index.js +0 -2
  50. package/dist/es2019/plugins/insert-block/index.js +19 -36
  51. package/dist/es2019/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +4 -8
  52. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
  53. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
  54. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -2
  55. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -3
  56. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +2 -2
  57. package/dist/es2019/plugins/paste/handlers.js +4 -3
  58. package/dist/es2019/plugins/paste/pm-plugins/main.js +4 -4
  59. package/dist/es2019/presets/context.js +2 -2
  60. package/dist/es2019/presets/universal.js +10 -6
  61. package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
  62. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
  63. package/dist/es2019/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
  64. package/dist/es2019/ui/ContentStyles/index.js +1 -1
  65. package/dist/es2019/ui/ToolbarFeedback/index.js +2 -2
  66. package/dist/es2019/use-preset.js +0 -1
  67. package/dist/es2019/version-wrapper.js +1 -1
  68. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  69. package/dist/esm/plugins/analytics/index.js +1 -1
  70. package/dist/esm/plugins/analytics/utils.js +0 -28
  71. package/dist/esm/plugins/breakout/index.js +1 -1
  72. package/dist/esm/plugins/breakout/ui/LayoutButton.js +1 -1
  73. package/dist/esm/plugins/extension/extension-api.js +2 -2
  74. package/dist/esm/plugins/extension/index.js +14 -3
  75. package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/actions.js +2 -2
  76. package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/index.js +1 -17
  77. package/dist/esm/plugins/extension/toolbar.js +1 -1
  78. package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
  79. package/dist/esm/plugins/find-replace/commands-with-analytics.js +84 -70
  80. package/dist/esm/plugins/find-replace/index.js +5 -2
  81. package/dist/esm/plugins/find-replace/keymap.js +4 -4
  82. package/dist/esm/plugins/index.js +0 -2
  83. package/dist/esm/plugins/insert-block/index.js +36 -53
  84. package/dist/esm/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +4 -10
  85. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
  86. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
  87. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -2
  88. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -3
  89. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +2 -2
  90. package/dist/esm/plugins/paste/handlers.js +4 -3
  91. package/dist/esm/plugins/paste/pm-plugins/main.js +4 -4
  92. package/dist/esm/presets/context.js +2 -2
  93. package/dist/esm/presets/universal.js +9 -6
  94. package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
  95. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
  96. package/dist/esm/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
  97. package/dist/esm/ui/ContentStyles/index.js +1 -1
  98. package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
  99. package/dist/esm/use-preset.js +0 -1
  100. package/dist/esm/version-wrapper.js +1 -1
  101. package/dist/types/plugins/analytics/index.d.ts +1 -1
  102. package/dist/types/plugins/analytics/utils.d.ts +0 -11
  103. package/dist/types/plugins/extension/extension-api.d.ts +1 -1
  104. package/dist/{types-ts4.5/plugins → types/plugins/extension/pm-plugins}/macro/index.d.ts +1 -4
  105. package/dist/types/plugins/extension/pm-plugins/macro/types.d.ts +4 -0
  106. package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
  107. package/dist/types/plugins/find-replace/commands-with-analytics.d.ts +9 -9
  108. package/dist/types/plugins/find-replace/index.d.ts +5 -3
  109. package/dist/types/plugins/find-replace/keymap.d.ts +2 -1
  110. package/dist/types/plugins/index.d.ts +0 -2
  111. package/dist/types/plugins/insert-block/types.d.ts +4 -2
  112. package/dist/{types-ts4.5 → types/plugins/insert-block}/ui/ElementBrowser/types.d.ts +2 -2
  113. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -1
  114. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -1
  115. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -2
  116. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
  117. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -1
  118. package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -1
  119. package/dist/types/plugins/paste/handlers.d.ts +2 -1
  120. package/dist/types/presets/context.d.ts +2 -2
  121. package/dist/types/presets/default.d.ts +8 -0
  122. package/dist/types/presets/universal.d.ts +5 -0
  123. package/dist/types/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
  124. package/dist/types-ts4.5/plugins/analytics/index.d.ts +1 -1
  125. package/dist/types-ts4.5/plugins/analytics/utils.d.ts +0 -11
  126. package/dist/types-ts4.5/plugins/extension/extension-api.d.ts +1 -1
  127. package/dist/{types/plugins → types-ts4.5/plugins/extension/pm-plugins}/macro/index.d.ts +1 -4
  128. package/dist/types-ts4.5/plugins/extension/pm-plugins/macro/types.d.ts +4 -0
  129. package/dist/types-ts4.5/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
  130. package/dist/types-ts4.5/plugins/find-replace/commands-with-analytics.d.ts +9 -9
  131. package/dist/types-ts4.5/plugins/find-replace/index.d.ts +6 -3
  132. package/dist/types-ts4.5/plugins/find-replace/keymap.d.ts +2 -1
  133. package/dist/types-ts4.5/plugins/index.d.ts +0 -2
  134. package/dist/types-ts4.5/plugins/insert-block/types.d.ts +4 -2
  135. package/dist/{types → types-ts4.5/plugins/insert-block}/ui/ElementBrowser/types.d.ts +2 -2
  136. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -1
  137. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -1
  138. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -2
  139. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
  140. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -1
  141. package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +2 -1
  142. package/dist/types-ts4.5/plugins/paste/handlers.d.ts +2 -1
  143. package/dist/types-ts4.5/presets/context.d.ts +2 -2
  144. package/dist/types-ts4.5/presets/default.d.ts +8 -0
  145. package/dist/types-ts4.5/presets/universal.d.ts +5 -0
  146. package/dist/types-ts4.5/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
  147. package/package.json +5 -9
  148. package/dist/cjs/plugins/breakout/constants.js +0 -10
  149. package/dist/cjs/plugins/expand/commands.js +0 -184
  150. package/dist/cjs/plugins/expand/index.js +0 -111
  151. package/dist/cjs/plugins/expand/nodeviews/index.js +0 -485
  152. package/dist/cjs/plugins/expand/pm-plugins/keymap.js +0 -171
  153. package/dist/cjs/plugins/expand/pm-plugins/main.js +0 -85
  154. package/dist/cjs/plugins/expand/pm-plugins/plugin-factory.js +0 -15
  155. package/dist/cjs/plugins/expand/reducer.js +0 -20
  156. package/dist/cjs/plugins/expand/toolbar.js +0 -59
  157. package/dist/cjs/plugins/expand/ui/ExpandIconButton.js +0 -104
  158. package/dist/cjs/plugins/expand/ui/class-names.js +0 -20
  159. package/dist/cjs/plugins/expand/utils.js +0 -24
  160. package/dist/cjs/ui/ElementBrowser/types.js +0 -5
  161. package/dist/es2019/plugins/breakout/constants.js +0 -4
  162. package/dist/es2019/plugins/expand/commands.js +0 -161
  163. package/dist/es2019/plugins/expand/index.js +0 -95
  164. package/dist/es2019/plugins/expand/nodeviews/index.js +0 -475
  165. package/dist/es2019/plugins/expand/pm-plugins/keymap.js +0 -197
  166. package/dist/es2019/plugins/expand/pm-plugins/main.js +0 -73
  167. package/dist/es2019/plugins/expand/pm-plugins/plugin-factory.js +0 -9
  168. package/dist/es2019/plugins/expand/reducer.js +0 -11
  169. package/dist/es2019/plugins/expand/toolbar.js +0 -52
  170. package/dist/es2019/plugins/expand/ui/ExpandIconButton.js +0 -85
  171. package/dist/es2019/plugins/expand/ui/class-names.js +0 -12
  172. package/dist/es2019/plugins/expand/utils.js +0 -1
  173. package/dist/esm/plugins/breakout/constants.js +0 -4
  174. package/dist/esm/plugins/expand/commands.js +0 -177
  175. package/dist/esm/plugins/expand/index.js +0 -97
  176. package/dist/esm/plugins/expand/nodeviews/index.js +0 -477
  177. package/dist/esm/plugins/expand/pm-plugins/keymap.js +0 -165
  178. package/dist/esm/plugins/expand/pm-plugins/main.js +0 -77
  179. package/dist/esm/plugins/expand/pm-plugins/plugin-factory.js +0 -9
  180. package/dist/esm/plugins/expand/reducer.js +0 -13
  181. package/dist/esm/plugins/expand/toolbar.js +0 -52
  182. package/dist/esm/plugins/expand/ui/ExpandIconButton.js +0 -95
  183. package/dist/esm/plugins/expand/ui/class-names.js +0 -14
  184. package/dist/esm/plugins/expand/utils.js +0 -1
  185. package/dist/esm/plugins/macro/types.js +0 -1
  186. package/dist/esm/ui/ElementBrowser/types.js +0 -1
  187. package/dist/types/plugins/breakout/constants.d.ts +0 -4
  188. package/dist/types/plugins/expand/commands.d.ts +0 -13
  189. package/dist/types/plugins/expand/index.d.ts +0 -31
  190. package/dist/types/plugins/expand/nodeviews/index.d.ts +0 -55
  191. package/dist/types/plugins/expand/pm-plugins/keymap.d.ts +0 -4
  192. package/dist/types/plugins/expand/pm-plugins/main.d.ts +0 -8
  193. package/dist/types/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
  194. package/dist/types/plugins/expand/reducer.d.ts +0 -3
  195. package/dist/types/plugins/expand/toolbar.d.ts +0 -3
  196. package/dist/types/plugins/expand/types.d.ts +0 -9
  197. package/dist/types/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
  198. package/dist/types/plugins/expand/ui/class-names.d.ts +0 -11
  199. package/dist/types/plugins/expand/utils.d.ts +0 -1
  200. package/dist/types/plugins/macro/types.d.ts +0 -4
  201. package/dist/types-ts4.5/plugins/breakout/constants.d.ts +0 -4
  202. package/dist/types-ts4.5/plugins/expand/commands.d.ts +0 -13
  203. package/dist/types-ts4.5/plugins/expand/index.d.ts +0 -31
  204. package/dist/types-ts4.5/plugins/expand/nodeviews/index.d.ts +0 -55
  205. package/dist/types-ts4.5/plugins/expand/pm-plugins/keymap.d.ts +0 -4
  206. package/dist/types-ts4.5/plugins/expand/pm-plugins/main.d.ts +0 -8
  207. package/dist/types-ts4.5/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
  208. package/dist/types-ts4.5/plugins/expand/reducer.d.ts +0 -3
  209. package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +0 -3
  210. package/dist/types-ts4.5/plugins/expand/types.d.ts +0 -9
  211. package/dist/types-ts4.5/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
  212. package/dist/types-ts4.5/plugins/expand/ui/class-names.d.ts +0 -11
  213. package/dist/types-ts4.5/plugins/expand/utils.d.ts +0 -1
  214. package/dist/types-ts4.5/plugins/macro/types.d.ts +0 -4
  215. /package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
  216. /package/dist/cjs/plugins/{expand → extension/pm-plugins/macro}/types.js +0 -0
  217. /package/dist/cjs/plugins/{macro → insert-block/ui/ElementBrowser}/types.js +0 -0
  218. /package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
  219. /package/dist/es2019/plugins/{expand → extension/pm-plugins/macro}/types.js +0 -0
  220. /package/dist/es2019/plugins/{macro → insert-block/ui/ElementBrowser}/types.js +0 -0
  221. /package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
  222. /package/dist/{es2019/ui/ElementBrowser → esm/plugins/extension/pm-plugins/macro}/types.js +0 -0
  223. /package/dist/esm/plugins/{expand → insert-block/ui/ElementBrowser}/types.js +0 -0
  224. /package/dist/types/plugins/{macro → extension/pm-plugins/macro}/actions.d.ts +0 -0
  225. /package/dist/types/plugins/{macro → extension/pm-plugins/macro}/plugin-key.d.ts +0 -0
  226. /package/dist/types/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.d.ts +0 -0
  227. /package/dist/types-ts4.5/plugins/{macro → extension/pm-plugins/macro}/actions.d.ts +0 -0
  228. /package/dist/types-ts4.5/plugins/{macro → extension/pm-plugins/macro}/plugin-key.d.ts +0 -0
  229. /package/dist/types-ts4.5/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.d.ts +0 -0
@@ -1,77 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
3
- import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
4
- import ExpandNodeView from '../nodeviews';
5
- import { setExpandRef } from '../commands';
6
- import { findExpand } from '../utils';
7
- import { expandClassNames } from '../ui/class-names';
8
- import { getPluginState, createPluginState, pluginKey } from './plugin-factory';
9
- export function containsClass(element, className) {
10
- var _element$classList;
11
- return Boolean(element === null || element === void 0 || (_element$classList = element.classList) === null || _element$classList === void 0 ? void 0 : _element$classList.contains(className));
12
- }
13
- export var createPlugin = function createPlugin(dispatch, getIntl) {
14
- var appearance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'full-page';
15
- var useLongPressSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
16
- var featureFlags = arguments.length > 4 ? arguments[4] : undefined;
17
- var api = arguments.length > 5 ? arguments[5] : undefined;
18
- var state = createPluginState(dispatch, {});
19
- var isMobile = appearance === 'mobile';
20
- return new SafePlugin({
21
- state: state,
22
- key: pluginKey,
23
- props: {
24
- nodeViews: {
25
- expand: ExpandNodeView({
26
- getIntl: getIntl,
27
- isMobile: isMobile,
28
- featureFlags: featureFlags,
29
- api: api
30
- }),
31
- nestedExpand: ExpandNodeView({
32
- getIntl: getIntl,
33
- isMobile: isMobile,
34
- featureFlags: featureFlags,
35
- api: api
36
- })
37
- },
38
- handleKeyDown: function handleKeyDown(_view, event) {
39
- return containsClass(event.target, expandClassNames.titleContainer);
40
- },
41
- handleKeyPress: function handleKeyPress(_view, event) {
42
- return containsClass(event.target, expandClassNames.titleContainer);
43
- },
44
- handleScrollToSelection: function handleScrollToSelection() {
45
- return containsClass(document.activeElement, expandClassNames.titleInput);
46
- },
47
- handleClickOn: createSelectionClickHandler(['expand', 'nestedExpand'], function (target) {
48
- return target.classList.contains(expandClassNames.prefix);
49
- }, {
50
- useLongPressSelection: useLongPressSelection
51
- })
52
- },
53
- // @see ED-8027 to follow up on this work-around
54
- filterTransaction: function filterTransaction(tr) {
55
- if (containsClass(document.activeElement, expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric)) {
56
- return false;
57
- }
58
- return true;
59
- },
60
- view: function view(editorView) {
61
- var domAtPos = editorView.domAtPos.bind(editorView);
62
- return {
63
- update: function update(view) {
64
- var state = view.state,
65
- dispatch = view.dispatch;
66
- var node = findExpand(state);
67
- if (node) {
68
- var expandRef = findDomRefAtPos(node.pos, domAtPos);
69
- if (getPluginState(state).expandRef !== expandRef) {
70
- setExpandRef(expandRef)(state, dispatch);
71
- }
72
- }
73
- }
74
- };
75
- }
76
- });
77
- };
@@ -1,9 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import { pluginFactory } from '../../../utils/plugin-state-factory';
3
- import reducer from '../reducer';
4
- export var pluginKey = new PluginKey('expandPlugin');
5
- var _pluginFactory = pluginFactory(pluginKey, reducer),
6
- createPluginState = _pluginFactory.createPluginState,
7
- createCommand = _pluginFactory.createCommand,
8
- getPluginState = _pluginFactory.getPluginState;
9
- export { createPluginState, createCommand, getPluginState };
@@ -1,13 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- export default (function (pluginState, action) {
5
- switch (action.type) {
6
- case 'SET_EXPAND_REF':
7
- return _objectSpread(_objectSpread({}, pluginState), {}, {
8
- expandRef: action.data.ref
9
- });
10
- default:
11
- return pluginState;
12
- }
13
- });
@@ -1,52 +0,0 @@
1
- import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
2
- import commonMessages from '../../messages';
3
- import { deleteExpand } from './commands';
4
- import { getPluginState } from './pm-plugins/plugin-factory';
5
- export var getToolbarConfig = function getToolbarConfig(api) {
6
- return function (state, _ref) {
7
- var _api$decorations$acti, _api$decorations, _api$analytics;
8
- var formatMessage = _ref.formatMessage;
9
- var _ref2 = (_api$decorations$acti = api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {},
10
- hoverDecoration = _ref2.hoverDecoration;
11
- var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
12
- var _getPluginState = getPluginState(state),
13
- expandRef = _getPluginState.expandRef;
14
- if (expandRef) {
15
- var _state$schema$nodes = state.schema.nodes,
16
- nestedExpand = _state$schema$nodes.nestedExpand,
17
- expand = _state$schema$nodes.expand;
18
- return {
19
- title: 'Expand toolbar',
20
- getDomRef: function getDomRef() {
21
- return expandRef;
22
- },
23
- nodeType: [nestedExpand, expand],
24
- offset: [0, 6],
25
- items: [{
26
- type: 'copy-button',
27
- items: [{
28
- state: state,
29
- formatMessage: formatMessage,
30
- nodeType: [nestedExpand, expand]
31
- }, {
32
- type: 'separator'
33
- }]
34
- }, {
35
- id: 'editor.expand.delete',
36
- type: 'button',
37
- appearance: 'danger',
38
- focusEditoronEnter: true,
39
- icon: RemoveIcon,
40
- onClick: deleteExpand(editorAnalyticsAPI),
41
- onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], true),
42
- onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], false),
43
- onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], true),
44
- onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], false),
45
- title: formatMessage(commonMessages.remove),
46
- tabIndex: null
47
- }]
48
- };
49
- }
50
- return;
51
- };
52
- };
@@ -1,95 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
- import _createClass from "@babel/runtime/helpers/createClass";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
- var _excluded = ["buttonStyles"];
10
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
- /** @jsx jsx */
15
- import React, { useCallback } from 'react';
16
- import { jsx } from '@emotion/react';
17
- import Button from '@atlaskit/button/custom-theme-button';
18
- import { expandMessages, expandLayoutWrapperStyle, ExpandLayoutWrapperWithRef } from '@atlaskit/editor-common/ui';
19
- import { akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
20
- import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
21
- import Tooltip from '@atlaskit/tooltip';
22
- import { expandClassNames } from './class-names';
23
- export var withTooltip = function withTooltip(WrapperComponent) {
24
- return /*#__PURE__*/function (_React$Component) {
25
- _inherits(WithSortableColumn, _React$Component);
26
- var _super = _createSuper(WithSortableColumn);
27
- function WithSortableColumn(props) {
28
- _classCallCheck(this, WithSortableColumn);
29
- return _super.call(this, props);
30
- }
31
- _createClass(WithSortableColumn, [{
32
- key: "render",
33
- value: function render() {
34
- var label = this.props.label;
35
- return jsx(Tooltip, {
36
- content: label,
37
- position: "top",
38
- tag: ExpandLayoutWrapperWithRef
39
- }, jsx(WrapperComponent, this.props));
40
- }
41
- }]);
42
- return WithSortableColumn;
43
- }(React.Component);
44
- };
45
- export var CustomButton = function CustomButton(props) {
46
- var label = props.label,
47
- allowInteractiveExpand = props.allowInteractiveExpand;
48
- var useTheme = useCallback(function (currentTheme, themeProps) {
49
- var _currentTheme = currentTheme(themeProps),
50
- buttonStyles = _currentTheme.buttonStyles,
51
- rest = _objectWithoutProperties(_currentTheme, _excluded);
52
- return _objectSpread({
53
- buttonStyles: _objectSpread(_objectSpread({}, buttonStyles), {}, {
54
- height: '100%',
55
- '& svg': {
56
- transform: props.expanded ? 'transform: rotate(90deg);' : 'transform: rotate(0deg);',
57
- transition: "transform 0.2s ".concat(akEditorSwoopCubicBezier, ";")
58
- }
59
- })
60
- }, rest);
61
- }, [props]);
62
- return jsx(Button, {
63
- appearance: "subtle",
64
- className: expandClassNames.iconContainer,
65
- iconBefore: jsx(ChevronRightIcon, {
66
- label: label
67
- }),
68
- shouldFitContainer: true,
69
- theme: useTheme,
70
- isDisabled: !allowInteractiveExpand
71
- });
72
- };
73
- var ButtonWithTooltip = withTooltip(CustomButton);
74
- var ButtonWithoutTooltip = CustomButton;
75
- export var ExpandIconButton = function ExpandIconButton(props) {
76
- var expanded = props.expanded,
77
- intl = props.intl;
78
- var message = expanded ? expandMessages.collapseNode : expandMessages.expandNode;
79
- var label = intl && intl.formatMessage(message) || message.defaultMessage;
80
- // check to ensure device supports any-hover
81
- var supportsAnyHover = !!window.matchMedia ? window.matchMedia('(any-hover: hover)').matches !== window.matchMedia('(any-hover: none)').matches : false;
82
- var hoverEventCheck = supportsAnyHover ? window.matchMedia('(any-hover: hover)').matches : true;
83
-
84
- // hoverEventCheck is to disable tooltips for mobile to prevent incorrect hover state causing issues on iOS
85
- if (props.allowInteractiveExpand && hoverEventCheck) {
86
- return jsx(ButtonWithTooltip, _extends({
87
- label: label
88
- }, props));
89
- }
90
- return jsx("div", {
91
- css: expandLayoutWrapperStyle
92
- }, jsx(ButtonWithoutTooltip, _extends({
93
- label: label
94
- }, props)));
95
- };
@@ -1,14 +0,0 @@
1
- var prefix = 'ak-editor-expand';
2
- export var expandClassNames = {
3
- prefix: prefix,
4
- expanded: "".concat(prefix, "__expanded"),
5
- titleContainer: "".concat(prefix, "__title-container"),
6
- inputContainer: "".concat(prefix, "__input-container"),
7
- iconContainer: "".concat(prefix, "__icon-container"),
8
- icon: "".concat(prefix, "__icon"),
9
- titleInput: "".concat(prefix, "__title-input"),
10
- content: "".concat(prefix, "__content"),
11
- type: function type(_type) {
12
- return "".concat(prefix, "__type-").concat(_type);
13
- }
14
- };
@@ -1 +0,0 @@
1
- export { findExpand, transformSliceToRemoveOpenExpand, transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- export declare const BreakoutCssClassName: {
2
- BREAKOUT_MARK: string;
3
- BREAKOUT_MARK_DOM: string;
4
- };
@@ -1,13 +0,0 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
3
- import type { Command } from '@atlaskit/editor-common/types';
4
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
- export declare const setExpandRef: (ref?: HTMLDivElement | null) => Command;
6
- export declare const deleteExpandAtPos: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (expandNodePos: number, expandNode: PMNode) => Command;
7
- export declare const deleteExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
8
- export declare const updateExpandTitle: (title: string, pos: number, nodeType: NodeType) => Command;
9
- export declare const toggleExpandExpanded: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (pos: number, nodeType: NodeType) => Command;
10
- export declare const createExpandNode: (state: EditorState) => PMNode | null;
11
- export declare const insertExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
12
- export declare const focusTitle: (pos: number) => Command;
13
- export declare const setSelectionInsideExpand: (expandPos: number) => Command;
@@ -1,31 +0,0 @@
1
- import type { NextEditorPlugin, EditorProps } from '../../types';
2
- import { insertExpand } from './commands';
3
- import type { LongPressSelectionPluginOptions, OptionalPlugin } from '@atlaskit/editor-common/types';
4
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
6
- import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
7
- import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
8
- interface ExpandPluginOptions extends LongPressSelectionPluginOptions {
9
- allowInsertion?: boolean;
10
- appearance?: EditorProps['appearance'];
11
- }
12
- export type ExpandPlugin = NextEditorPlugin<'expand', {
13
- pluginConfiguration: ExpandPluginOptions | undefined;
14
- dependencies: [
15
- FeatureFlagsPlugin,
16
- DecorationsPlugin,
17
- SelectionPlugin,
18
- OptionalPlugin<AnalyticsPlugin>
19
- ];
20
- actions: {
21
- insertExpand: ReturnType<typeof insertExpand>;
22
- };
23
- }>;
24
- declare const expandPlugin: ExpandPlugin;
25
- interface ExpandEditorProps {
26
- allowExpand?: EditorProps['allowExpand'];
27
- }
28
- export default expandPlugin;
29
- export type { ExpandPluginState } from './types';
30
- export declare function isExpandInsertionEnabled({ allowExpand }: ExpandEditorProps): boolean;
31
- export { pluginKey } from './pm-plugins/plugin-factory';
@@ -1,55 +0,0 @@
1
- import type { IntlShape } from 'react-intl-next';
2
- import type { EditorView, NodeView, Decoration } from '@atlaskit/editor-prosemirror/view';
3
- import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
- import type { getPosHandlerNode, getPosHandler } from '../../../nodeviews/';
5
- import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
- import type expandPlugin from '../index';
7
- import type { SetSelectionRelativeToNode } from '@atlaskit/editor-common/selection';
8
- export declare class ExpandNodeView implements NodeView {
9
- private selectNearNode;
10
- node: PmNode;
11
- view: EditorView;
12
- dom: HTMLElement;
13
- contentDOM?: HTMLElement;
14
- icon?: HTMLElement | null;
15
- input?: HTMLInputElement | null;
16
- titleContainer?: HTMLElement | null;
17
- content?: HTMLElement | null;
18
- getPos: getPosHandlerNode;
19
- intl: IntlShape;
20
- allowInteractiveExpand: boolean;
21
- isMobile: boolean;
22
- featureFlags: FeatureFlags;
23
- api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
24
- constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, featureFlags: FeatureFlags, selectNearNode: SetSelectionRelativeToNode | undefined, api: ExtractInjectionAPI<typeof expandPlugin> | undefined);
25
- private initHandlers;
26
- private focusTitle;
27
- private handleIconKeyDown;
28
- private renderIcon;
29
- private isAllowInteractiveExpandEnabled;
30
- private handleClick;
31
- private handleInput;
32
- private handleFocus;
33
- private handleTitleKeydown;
34
- private deleteExpand;
35
- private toggleExpand;
36
- private moveToOutsideOfTitle;
37
- private isCollapsed;
38
- private setRightGapCursor;
39
- private setLeftGapCursor;
40
- private handleArrowRightFromTitle;
41
- private handleArrowLeftFromTitle;
42
- stopEvent(event: Event): boolean;
43
- ignoreMutation(mutationRecord: MutationRecord | {
44
- type: 'selection';
45
- target: Element;
46
- }): boolean;
47
- update(node: PmNode, _decorations: readonly Decoration[]): boolean;
48
- destroy(): void;
49
- }
50
- export default function ({ getIntl, isMobile, featureFlags, api, }: {
51
- getIntl: () => IntlShape;
52
- isMobile: boolean;
53
- featureFlags: FeatureFlags;
54
- api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
55
- }): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
@@ -1,4 +0,0 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type expandPlugin from '../index';
4
- export declare function expandKeymap(api: ExtractInjectionAPI<typeof expandPlugin> | undefined): SafePlugin;
@@ -1,8 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { Dispatch } from '../../../event-dispatcher';
3
- import type { EditorAppearance } from '@atlaskit/editor-common/types';
4
- import type { IntlShape } from 'react-intl-next';
5
- import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
- import type expandPlugin from '../index';
7
- export declare function containsClass(element: Element | null, className: string): boolean;
8
- export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, featureFlags: FeatureFlags, api: ExtractInjectionAPI<typeof expandPlugin> | undefined) => SafePlugin<import("../types").ExpandPluginState>;
@@ -1,3 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- export declare const pluginKey: PluginKey<any>;
3
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("..").ExpandPluginState | ((state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState)) => import("prosemirror-state").SafeStateField<import("..").ExpandPluginState>, createCommand: <A = import("../types").ExpandPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState;
@@ -1,3 +0,0 @@
1
- import { ExpandPluginState, ExpandPluginAction } from './types';
2
- declare const _default: (pluginState: ExpandPluginState, action: ExpandPluginAction) => ExpandPluginState;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { FloatingToolbarHandler, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { ExpandPlugin } from '.';
3
- export declare const getToolbarConfig: (api: ExtractInjectionAPI<ExpandPlugin> | undefined) => FloatingToolbarHandler;
@@ -1,9 +0,0 @@
1
- export interface ExpandPluginState {
2
- expandRef?: HTMLDivElement | null;
3
- }
4
- export type ExpandPluginAction = {
5
- type: 'SET_EXPAND_REF';
6
- data: {
7
- ref?: HTMLDivElement | null;
8
- };
9
- };
@@ -1,43 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/react';
4
- import { IntlShape } from 'react-intl-next';
5
- interface ExpandIconButtonProps {
6
- allowInteractiveExpand: boolean;
7
- expanded: boolean;
8
- intl?: IntlShape;
9
- }
10
- interface ExpandIconButtonWithLabelProps extends ExpandIconButtonProps {
11
- label: string;
12
- }
13
- export declare const withTooltip: (WrapperComponent: React.ElementType) => {
14
- new (props: ExpandIconButtonWithLabelProps): {
15
- render(): jsx.JSX.Element;
16
- context: any;
17
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ExpandIconButtonWithLabelProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
18
- forceUpdate(callback?: (() => void) | undefined): void;
19
- readonly props: Readonly<ExpandIconButtonWithLabelProps> & Readonly<{
20
- children?: React.ReactNode;
21
- }>;
22
- state: Readonly<{}>;
23
- refs: {
24
- [key: string]: React.ReactInstance;
25
- };
26
- componentDidMount?(): void;
27
- shouldComponentUpdate?(nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextState: Readonly<{}>, nextContext: any): boolean;
28
- componentWillUnmount?(): void;
29
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
30
- getSnapshotBeforeUpdate?(prevProps: Readonly<ExpandIconButtonWithLabelProps>, prevState: Readonly<{}>): any;
31
- componentDidUpdate?(prevProps: Readonly<ExpandIconButtonWithLabelProps>, prevState: Readonly<{}>, snapshot?: any): void;
32
- componentWillMount?(): void;
33
- UNSAFE_componentWillMount?(): void;
34
- componentWillReceiveProps?(nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextContext: any): void;
35
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextContext: any): void;
36
- componentWillUpdate?(nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextState: Readonly<{}>, nextContext: any): void;
37
- UNSAFE_componentWillUpdate?(nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextState: Readonly<{}>, nextContext: any): void;
38
- };
39
- contextType?: React.Context<any> | undefined;
40
- };
41
- export declare const CustomButton: (props: ExpandIconButtonWithLabelProps) => jsx.JSX.Element;
42
- export declare const ExpandIconButton: (props: ExpandIconButtonProps) => jsx.JSX.Element;
43
- export {};
@@ -1,11 +0,0 @@
1
- export declare const expandClassNames: {
2
- prefix: string;
3
- expanded: string;
4
- titleContainer: string;
5
- inputContainer: string;
6
- iconContainer: string;
7
- icon: string;
8
- titleInput: string;
9
- content: string;
10
- type: (type: string) => string;
11
- };
@@ -1 +0,0 @@
1
- export { findExpand, transformSliceToRemoveOpenExpand, transformSliceNestedExpandToExpand, } from '@atlaskit/editor-common/transforms';
@@ -1,4 +0,0 @@
1
- import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
2
- export type MacroState = {
3
- macroProvider: MacroProvider | null;
4
- };
@@ -1,4 +0,0 @@
1
- export declare const BreakoutCssClassName: {
2
- BREAKOUT_MARK: string;
3
- BREAKOUT_MARK_DOM: string;
4
- };
@@ -1,13 +0,0 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
3
- import type { Command } from '@atlaskit/editor-common/types';
4
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
- export declare const setExpandRef: (ref?: HTMLDivElement | null) => Command;
6
- export declare const deleteExpandAtPos: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (expandNodePos: number, expandNode: PMNode) => Command;
7
- export declare const deleteExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
8
- export declare const updateExpandTitle: (title: string, pos: number, nodeType: NodeType) => Command;
9
- export declare const toggleExpandExpanded: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (pos: number, nodeType: NodeType) => Command;
10
- export declare const createExpandNode: (state: EditorState) => PMNode | null;
11
- export declare const insertExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
12
- export declare const focusTitle: (pos: number) => Command;
13
- export declare const setSelectionInsideExpand: (expandPos: number) => Command;
@@ -1,31 +0,0 @@
1
- import type { NextEditorPlugin, EditorProps } from '../../types';
2
- import { insertExpand } from './commands';
3
- import type { LongPressSelectionPluginOptions, OptionalPlugin } from '@atlaskit/editor-common/types';
4
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
6
- import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
7
- import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
8
- interface ExpandPluginOptions extends LongPressSelectionPluginOptions {
9
- allowInsertion?: boolean;
10
- appearance?: EditorProps['appearance'];
11
- }
12
- export type ExpandPlugin = NextEditorPlugin<'expand', {
13
- pluginConfiguration: ExpandPluginOptions | undefined;
14
- dependencies: [
15
- FeatureFlagsPlugin,
16
- DecorationsPlugin,
17
- SelectionPlugin,
18
- OptionalPlugin<AnalyticsPlugin>
19
- ];
20
- actions: {
21
- insertExpand: ReturnType<typeof insertExpand>;
22
- };
23
- }>;
24
- declare const expandPlugin: ExpandPlugin;
25
- interface ExpandEditorProps {
26
- allowExpand?: EditorProps['allowExpand'];
27
- }
28
- export default expandPlugin;
29
- export type { ExpandPluginState } from './types';
30
- export declare function isExpandInsertionEnabled({ allowExpand }: ExpandEditorProps): boolean;
31
- export { pluginKey } from './pm-plugins/plugin-factory';
@@ -1,55 +0,0 @@
1
- import type { IntlShape } from 'react-intl-next';
2
- import type { EditorView, NodeView, Decoration } from '@atlaskit/editor-prosemirror/view';
3
- import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
- import type { getPosHandlerNode, getPosHandler } from '../../../nodeviews/';
5
- import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
- import type expandPlugin from '../index';
7
- import type { SetSelectionRelativeToNode } from '@atlaskit/editor-common/selection';
8
- export declare class ExpandNodeView implements NodeView {
9
- private selectNearNode;
10
- node: PmNode;
11
- view: EditorView;
12
- dom: HTMLElement;
13
- contentDOM?: HTMLElement;
14
- icon?: HTMLElement | null;
15
- input?: HTMLInputElement | null;
16
- titleContainer?: HTMLElement | null;
17
- content?: HTMLElement | null;
18
- getPos: getPosHandlerNode;
19
- intl: IntlShape;
20
- allowInteractiveExpand: boolean;
21
- isMobile: boolean;
22
- featureFlags: FeatureFlags;
23
- api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
24
- constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, featureFlags: FeatureFlags, selectNearNode: SetSelectionRelativeToNode | undefined, api: ExtractInjectionAPI<typeof expandPlugin> | undefined);
25
- private initHandlers;
26
- private focusTitle;
27
- private handleIconKeyDown;
28
- private renderIcon;
29
- private isAllowInteractiveExpandEnabled;
30
- private handleClick;
31
- private handleInput;
32
- private handleFocus;
33
- private handleTitleKeydown;
34
- private deleteExpand;
35
- private toggleExpand;
36
- private moveToOutsideOfTitle;
37
- private isCollapsed;
38
- private setRightGapCursor;
39
- private setLeftGapCursor;
40
- private handleArrowRightFromTitle;
41
- private handleArrowLeftFromTitle;
42
- stopEvent(event: Event): boolean;
43
- ignoreMutation(mutationRecord: MutationRecord | {
44
- type: 'selection';
45
- target: Element;
46
- }): boolean;
47
- update(node: PmNode, _decorations: readonly Decoration[]): boolean;
48
- destroy(): void;
49
- }
50
- export default function ({ getIntl, isMobile, featureFlags, api, }: {
51
- getIntl: () => IntlShape;
52
- isMobile: boolean;
53
- featureFlags: FeatureFlags;
54
- api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
55
- }): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
@@ -1,4 +0,0 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type expandPlugin from '../index';
4
- export declare function expandKeymap(api: ExtractInjectionAPI<typeof expandPlugin> | undefined): SafePlugin;
@@ -1,8 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { Dispatch } from '../../../event-dispatcher';
3
- import type { EditorAppearance } from '@atlaskit/editor-common/types';
4
- import type { IntlShape } from 'react-intl-next';
5
- import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
- import type expandPlugin from '../index';
7
- export declare function containsClass(element: Element | null, className: string): boolean;
8
- export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, featureFlags: FeatureFlags, api: ExtractInjectionAPI<typeof expandPlugin> | undefined) => SafePlugin<import("../types").ExpandPluginState>;
@@ -1,3 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- export declare const pluginKey: PluginKey<any>;
3
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("..").ExpandPluginState | ((state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState)) => import("prosemirror-state").SafeStateField<import("..").ExpandPluginState>, createCommand: <A = import("../types").ExpandPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState;
@@ -1,3 +0,0 @@
1
- import { ExpandPluginState, ExpandPluginAction } from './types';
2
- declare const _default: (pluginState: ExpandPluginState, action: ExpandPluginAction) => ExpandPluginState;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { FloatingToolbarHandler, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { ExpandPlugin } from '.';
3
- export declare const getToolbarConfig: (api: ExtractInjectionAPI<ExpandPlugin> | undefined) => FloatingToolbarHandler;