@atlaskit/editor-core 189.3.28 → 189.3.30

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 (250) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/create-editor/feature-flags-from-props.js +4 -5
  3. package/dist/cjs/i18n/cs.js +0 -3
  4. package/dist/cjs/i18n/da.js +0 -3
  5. package/dist/cjs/i18n/de.js +0 -3
  6. package/dist/cjs/i18n/en.js +0 -3
  7. package/dist/cjs/i18n/en_GB.js +0 -3
  8. package/dist/cjs/i18n/en_ZZ.js +0 -3
  9. package/dist/cjs/i18n/es.js +0 -3
  10. package/dist/cjs/i18n/fi.js +0 -3
  11. package/dist/cjs/i18n/fr.js +0 -3
  12. package/dist/cjs/i18n/hu.js +0 -3
  13. package/dist/cjs/i18n/it.js +0 -3
  14. package/dist/cjs/i18n/ja.js +0 -3
  15. package/dist/cjs/i18n/ko.js +0 -3
  16. package/dist/cjs/i18n/nb.js +0 -3
  17. package/dist/cjs/i18n/nl.js +0 -3
  18. package/dist/cjs/i18n/pl.js +0 -3
  19. package/dist/cjs/i18n/pt_BR.js +0 -3
  20. package/dist/cjs/i18n/ru.js +0 -3
  21. package/dist/cjs/i18n/sv.js +0 -3
  22. package/dist/cjs/i18n/th.js +0 -3
  23. package/dist/cjs/i18n/tr.js +0 -3
  24. package/dist/cjs/i18n/uk.js +0 -3
  25. package/dist/cjs/i18n/vi.js +0 -3
  26. package/dist/cjs/i18n/zh.js +0 -3
  27. package/dist/cjs/i18n/zh_TW.js +0 -3
  28. package/dist/cjs/plugins/index.js +0 -7
  29. package/dist/cjs/presets/universal.js +2 -1
  30. package/dist/cjs/utils/document.js +0 -6
  31. package/dist/cjs/utils/index.js +0 -6
  32. package/dist/cjs/version-wrapper.js +1 -1
  33. package/dist/es2019/create-editor/feature-flags-from-props.js +4 -5
  34. package/dist/es2019/i18n/cs.js +0 -3
  35. package/dist/es2019/i18n/da.js +0 -3
  36. package/dist/es2019/i18n/de.js +0 -3
  37. package/dist/es2019/i18n/en.js +0 -3
  38. package/dist/es2019/i18n/en_GB.js +0 -3
  39. package/dist/es2019/i18n/en_ZZ.js +0 -3
  40. package/dist/es2019/i18n/es.js +0 -3
  41. package/dist/es2019/i18n/fi.js +0 -3
  42. package/dist/es2019/i18n/fr.js +0 -3
  43. package/dist/es2019/i18n/hu.js +0 -3
  44. package/dist/es2019/i18n/it.js +0 -3
  45. package/dist/es2019/i18n/ja.js +0 -3
  46. package/dist/es2019/i18n/ko.js +0 -3
  47. package/dist/es2019/i18n/nb.js +0 -3
  48. package/dist/es2019/i18n/nl.js +0 -3
  49. package/dist/es2019/i18n/pl.js +0 -3
  50. package/dist/es2019/i18n/pt_BR.js +0 -3
  51. package/dist/es2019/i18n/ru.js +0 -3
  52. package/dist/es2019/i18n/sv.js +0 -3
  53. package/dist/es2019/i18n/th.js +0 -3
  54. package/dist/es2019/i18n/tr.js +0 -3
  55. package/dist/es2019/i18n/uk.js +0 -3
  56. package/dist/es2019/i18n/vi.js +0 -3
  57. package/dist/es2019/i18n/zh.js +0 -3
  58. package/dist/es2019/i18n/zh_TW.js +0 -3
  59. package/dist/es2019/plugins/index.js +0 -1
  60. package/dist/es2019/presets/universal.js +2 -1
  61. package/dist/es2019/utils/document.js +1 -1
  62. package/dist/es2019/utils/index.js +1 -1
  63. package/dist/es2019/version-wrapper.js +1 -1
  64. package/dist/esm/create-editor/feature-flags-from-props.js +4 -5
  65. package/dist/esm/i18n/cs.js +0 -3
  66. package/dist/esm/i18n/da.js +0 -3
  67. package/dist/esm/i18n/de.js +0 -3
  68. package/dist/esm/i18n/en.js +0 -3
  69. package/dist/esm/i18n/en_GB.js +0 -3
  70. package/dist/esm/i18n/en_ZZ.js +0 -3
  71. package/dist/esm/i18n/es.js +0 -3
  72. package/dist/esm/i18n/fi.js +0 -3
  73. package/dist/esm/i18n/fr.js +0 -3
  74. package/dist/esm/i18n/hu.js +0 -3
  75. package/dist/esm/i18n/it.js +0 -3
  76. package/dist/esm/i18n/ja.js +0 -3
  77. package/dist/esm/i18n/ko.js +0 -3
  78. package/dist/esm/i18n/nb.js +0 -3
  79. package/dist/esm/i18n/nl.js +0 -3
  80. package/dist/esm/i18n/pl.js +0 -3
  81. package/dist/esm/i18n/pt_BR.js +0 -3
  82. package/dist/esm/i18n/ru.js +0 -3
  83. package/dist/esm/i18n/sv.js +0 -3
  84. package/dist/esm/i18n/th.js +0 -3
  85. package/dist/esm/i18n/tr.js +0 -3
  86. package/dist/esm/i18n/uk.js +0 -3
  87. package/dist/esm/i18n/vi.js +0 -3
  88. package/dist/esm/i18n/zh.js +0 -3
  89. package/dist/esm/i18n/zh_TW.js +0 -3
  90. package/dist/esm/plugins/index.js +0 -1
  91. package/dist/esm/presets/universal.js +2 -1
  92. package/dist/esm/utils/document.js +1 -1
  93. package/dist/esm/utils/index.js +1 -1
  94. package/dist/esm/version-wrapper.js +1 -1
  95. package/dist/types/i18n/cs.d.ts +0 -3
  96. package/dist/types/i18n/da.d.ts +0 -3
  97. package/dist/types/i18n/de.d.ts +0 -3
  98. package/dist/types/i18n/en.d.ts +0 -3
  99. package/dist/types/i18n/en_GB.d.ts +0 -3
  100. package/dist/types/i18n/en_ZZ.d.ts +0 -3
  101. package/dist/types/i18n/es.d.ts +0 -3
  102. package/dist/types/i18n/fi.d.ts +0 -3
  103. package/dist/types/i18n/fr.d.ts +0 -3
  104. package/dist/types/i18n/hu.d.ts +0 -3
  105. package/dist/types/i18n/it.d.ts +0 -3
  106. package/dist/types/i18n/ja.d.ts +0 -3
  107. package/dist/types/i18n/ko.d.ts +0 -3
  108. package/dist/types/i18n/nb.d.ts +0 -3
  109. package/dist/types/i18n/nl.d.ts +0 -3
  110. package/dist/types/i18n/pl.d.ts +0 -3
  111. package/dist/types/i18n/pt_BR.d.ts +0 -3
  112. package/dist/types/i18n/ru.d.ts +0 -3
  113. package/dist/types/i18n/sv.d.ts +0 -3
  114. package/dist/types/i18n/th.d.ts +0 -3
  115. package/dist/types/i18n/tr.d.ts +0 -3
  116. package/dist/types/i18n/uk.d.ts +0 -3
  117. package/dist/types/i18n/vi.d.ts +0 -3
  118. package/dist/types/i18n/zh.d.ts +0 -3
  119. package/dist/types/i18n/zh_TW.d.ts +0 -3
  120. package/dist/types/plugins/index.d.ts +0 -1
  121. package/dist/types/plugins/insert-block/types.d.ts +2 -2
  122. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -2
  123. package/dist/types/utils/document.d.ts +1 -1
  124. package/dist/types/utils/index.d.ts +1 -1
  125. package/dist/types-ts4.5/i18n/cs.d.ts +0 -3
  126. package/dist/types-ts4.5/i18n/da.d.ts +0 -3
  127. package/dist/types-ts4.5/i18n/de.d.ts +0 -3
  128. package/dist/types-ts4.5/i18n/en.d.ts +0 -3
  129. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -3
  130. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -3
  131. package/dist/types-ts4.5/i18n/es.d.ts +0 -3
  132. package/dist/types-ts4.5/i18n/fi.d.ts +0 -3
  133. package/dist/types-ts4.5/i18n/fr.d.ts +0 -3
  134. package/dist/types-ts4.5/i18n/hu.d.ts +0 -3
  135. package/dist/types-ts4.5/i18n/it.d.ts +0 -3
  136. package/dist/types-ts4.5/i18n/ja.d.ts +0 -3
  137. package/dist/types-ts4.5/i18n/ko.d.ts +0 -3
  138. package/dist/types-ts4.5/i18n/nb.d.ts +0 -3
  139. package/dist/types-ts4.5/i18n/nl.d.ts +0 -3
  140. package/dist/types-ts4.5/i18n/pl.d.ts +0 -3
  141. package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -3
  142. package/dist/types-ts4.5/i18n/ru.d.ts +0 -3
  143. package/dist/types-ts4.5/i18n/sv.d.ts +0 -3
  144. package/dist/types-ts4.5/i18n/th.d.ts +0 -3
  145. package/dist/types-ts4.5/i18n/tr.d.ts +0 -3
  146. package/dist/types-ts4.5/i18n/uk.d.ts +0 -3
  147. package/dist/types-ts4.5/i18n/vi.d.ts +0 -3
  148. package/dist/types-ts4.5/i18n/zh.d.ts +0 -3
  149. package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -3
  150. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  151. package/dist/types-ts4.5/plugins/insert-block/types.d.ts +2 -2
  152. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/index.d.ts +2 -2
  153. package/dist/types-ts4.5/utils/document.d.ts +1 -1
  154. package/dist/types-ts4.5/utils/index.d.ts +1 -1
  155. package/package.json +5 -5
  156. package/dist/cjs/plugins/tasks-and-decisions/commands.js +0 -288
  157. package/dist/cjs/plugins/tasks-and-decisions/index.js +0 -166
  158. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +0 -117
  159. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.js +0 -40
  160. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +0 -211
  161. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/commands.js +0 -96
  162. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/helpers.js +0 -299
  163. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/input-rules.js +0 -94
  164. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +0 -376
  165. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +0 -263
  166. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/plugin-key.js +0 -8
  167. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/types.js +0 -11
  168. package/dist/cjs/plugins/tasks-and-decisions/types.js +0 -5
  169. package/dist/cjs/plugins/tasks-and-decisions/ui/Decision/index.js +0 -51
  170. package/dist/cjs/plugins/tasks-and-decisions/ui/Task/index.js +0 -80
  171. package/dist/cjs/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +0 -137
  172. package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +0 -76
  173. package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +0 -75
  174. package/dist/cjs/plugins/tasks-and-decisions/utils.js +0 -41
  175. package/dist/es2019/plugins/tasks-and-decisions/commands.js +0 -279
  176. package/dist/es2019/plugins/tasks-and-decisions/index.js +0 -155
  177. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +0 -76
  178. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.js +0 -36
  179. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +0 -173
  180. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/commands.js +0 -94
  181. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/helpers.js +0 -316
  182. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/input-rules.js +0 -91
  183. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +0 -370
  184. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +0 -262
  185. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/plugin-key.js +0 -2
  186. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/types.js +0 -5
  187. package/dist/es2019/plugins/tasks-and-decisions/types.js +0 -1
  188. package/dist/es2019/plugins/tasks-and-decisions/ui/Decision/index.js +0 -30
  189. package/dist/es2019/plugins/tasks-and-decisions/ui/Task/index.js +0 -54
  190. package/dist/es2019/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +0 -71
  191. package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +0 -52
  192. package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +0 -51
  193. package/dist/es2019/plugins/tasks-and-decisions/utils.js +0 -32
  194. package/dist/esm/plugins/tasks-and-decisions/commands.js +0 -281
  195. package/dist/esm/plugins/tasks-and-decisions/index.js +0 -156
  196. package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +0 -110
  197. package/dist/esm/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.js +0 -34
  198. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +0 -204
  199. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/commands.js +0 -90
  200. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/helpers.js +0 -285
  201. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/input-rules.js +0 -87
  202. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +0 -368
  203. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +0 -256
  204. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/plugin-key.js +0 -2
  205. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/types.js +0 -5
  206. package/dist/esm/plugins/tasks-and-decisions/types.js +0 -1
  207. package/dist/esm/plugins/tasks-and-decisions/ui/Decision/index.js +0 -44
  208. package/dist/esm/plugins/tasks-and-decisions/ui/Task/index.js +0 -70
  209. package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +0 -128
  210. package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +0 -66
  211. package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +0 -65
  212. package/dist/esm/plugins/tasks-and-decisions/utils.js +0 -30
  213. package/dist/types/plugins/tasks-and-decisions/commands.d.ts +0 -16
  214. package/dist/types/plugins/tasks-and-decisions/index.d.ts +0 -3
  215. package/dist/types/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +0 -10
  216. package/dist/types/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.d.ts +0 -11
  217. package/dist/types/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +0 -14
  218. package/dist/types/plugins/tasks-and-decisions/pm-plugins/commands.d.ts +0 -15
  219. package/dist/types/plugins/tasks-and-decisions/pm-plugins/helpers.d.ts +0 -76
  220. package/dist/types/plugins/tasks-and-decisions/pm-plugins/input-rules.d.ts +0 -6
  221. package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +0 -11
  222. package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -7
  223. package/dist/types/plugins/tasks-and-decisions/pm-plugins/plugin-key.d.ts +0 -2
  224. package/dist/types/plugins/tasks-and-decisions/pm-plugins/types.d.ts +0 -8
  225. package/dist/types/plugins/tasks-and-decisions/types.d.ts +0 -49
  226. package/dist/types/plugins/tasks-and-decisions/ui/Decision/index.d.ts +0 -14
  227. package/dist/types/plugins/tasks-and-decisions/ui/Task/index.d.ts +0 -28
  228. package/dist/types/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.d.ts +0 -29
  229. package/dist/types/plugins/tasks-and-decisions/ui/ToolbarDecision/index.d.ts +0 -23
  230. package/dist/types/plugins/tasks-and-decisions/ui/ToolbarTask/index.d.ts +0 -23
  231. package/dist/types/plugins/tasks-and-decisions/utils.d.ts +0 -4
  232. package/dist/types-ts4.5/plugins/tasks-and-decisions/commands.d.ts +0 -16
  233. package/dist/types-ts4.5/plugins/tasks-and-decisions/index.d.ts +0 -3
  234. package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +0 -10
  235. package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.d.ts +0 -11
  236. package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +0 -14
  237. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/commands.d.ts +0 -15
  238. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/helpers.d.ts +0 -76
  239. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/input-rules.d.ts +0 -6
  240. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +0 -11
  241. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -7
  242. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/plugin-key.d.ts +0 -2
  243. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/types.d.ts +0 -8
  244. package/dist/types-ts4.5/plugins/tasks-and-decisions/types.d.ts +0 -49
  245. package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/Decision/index.d.ts +0 -14
  246. package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/Task/index.d.ts +0 -28
  247. package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.d.ts +0 -29
  248. package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/ToolbarDecision/index.d.ts +0 -23
  249. package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/ToolbarTask/index.d.ts +0 -23
  250. package/dist/types-ts4.5/plugins/tasks-and-decisions/utils.d.ts +0 -4
@@ -1,370 +0,0 @@
1
- import { autoJoin, chainCommands } from '@atlaskit/editor-prosemirror/commands';
2
- import { keymap } from '@atlaskit/editor-prosemirror/keymap';
3
- import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
4
- import { TextSelection } from '@atlaskit/editor-prosemirror/state';
5
- import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
6
- import { findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
7
- import { uuid } from '@atlaskit/adf-schema';
8
- import { filterCommand as filter, isEmptySelectionAtStart, isEmptySelectionAtEnd, deleteEmptyParagraphAndMoveBlockUp } from '@atlaskit/editor-common/utils';
9
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
10
- import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
11
- import { insertTaskDecisionWithAnalytics } from '../commands';
12
- import { joinAtCut, liftSelection, wrapSelectionInTaskList } from './commands';
13
- import { getBlockRange, getCurrentIndentLevel, isActionOrDecisionItem, isActionOrDecisionList, isEmptyTaskDecision, isInsideTask, isInsideTaskOrDecisionItem, liftBlock, walkOut, getTaskItemIndex, isInsideDecision, isTable } from './helpers';
14
- import { normalizeTaskItemsSelection } from '../utils';
15
- import { toggleTaskItemCheckbox } from '../../../keymaps';
16
- const indentationAnalytics = (curIndentLevel, direction, inputMethod) => ({
17
- action: ACTION.FORMATTED,
18
- actionSubject: ACTION_SUBJECT.TEXT,
19
- actionSubjectId: ACTION_SUBJECT_ID.FORMAT_INDENT,
20
- eventType: EVENT_TYPE.TRACK,
21
- attributes: {
22
- inputMethod,
23
- previousIndentationLevel: curIndentLevel,
24
- newIndentLevel: direction === INDENT_DIRECTION.OUTDENT ? curIndentLevel - 1 : curIndentLevel + 1,
25
- direction,
26
- indentType: INDENT_TYPE.TASK_LIST
27
- }
28
- });
29
- const nodeAfter = $pos => $pos.doc.resolve($pos.end()).nodeAfter;
30
- const actionDecisionFollowsOrNothing = $pos => {
31
- const after = nodeAfter($pos);
32
- return !after || isActionOrDecisionItem(after);
33
- };
34
- const joinTaskDecisionFollowing = (state, dispatch) => {
35
- // only run if selection is at end of text, and inside a task or decision item
36
- if (!isEmptySelectionAtEnd(state) || !isInsideTaskOrDecisionItem(state) || !dispatch) {
37
- return false;
38
- }
39
- // look for the node after this current one
40
- const $next = walkOut(state.selection.$from);
41
-
42
- // if there's no taskItem or taskList following, then
43
- // we just do the normal behaviour
44
- const {
45
- taskList,
46
- taskItem,
47
- decisionList,
48
- decisionItem,
49
- paragraph,
50
- bulletList,
51
- orderedList,
52
- listItem
53
- } = state.schema.nodes;
54
- const parentList = findParentNodeOfTypeClosestToPos($next, [taskList, taskItem, decisionList, decisionItem]);
55
- if (!parentList) {
56
- if ($next.parent.type === paragraph) {
57
- // try to join paragraph and taskList when backspacing
58
- return joinAtCut($next.doc.resolve($next.pos))(state, dispatch);
59
- }
60
- // If the item we are joining is a list
61
- if ($next.parent.type === bulletList || $next.parent.type === orderedList) {
62
- // If the list has an item
63
- if ($next.parent.firstChild && $next.parent.firstChild.type === listItem) {
64
- // Place the cursor at the first listItem
65
- const resolvedStartPos = state.doc.resolve($next.pos + 1);
66
- // Unindent the first listItem.
67
- // As if placing your cursor just after the first dot of the list (before the text)
68
- // and pressing Shift-Tab.
69
- const tr = liftBlock(state.tr, resolvedStartPos, resolvedStartPos);
70
-
71
- // If autoJoin not used, two ul/ol elements appear rather than one with multiple li elements
72
- return autoJoin((state, dispatch) => {
73
- if (tr) {
74
- if (dispatch) {
75
- dispatch(tr);
76
- }
77
- return true;
78
- }
79
- return false;
80
- }, ['bulletList', 'orderedList'])(state, dispatch);
81
- }
82
- }
83
- }
84
- return false;
85
- };
86
- export const getUnindentCommand = editorAnalyticsAPI => (inputMethod = INPUT_METHOD.KEYBOARD) => filter(isInsideTask, (state, dispatch) => {
87
- const normalizedSelection = normalizeTaskItemsSelection(state.selection);
88
- const curIndentLevel = getCurrentIndentLevel(normalizedSelection);
89
- if (!curIndentLevel || curIndentLevel === 1) {
90
- return false;
91
- }
92
- return withAnalytics(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, INDENT_DIRECTION.OUTDENT, inputMethod))(autoJoin(liftSelection, ['taskList']))(state, dispatch);
93
- });
94
-
95
- // if selection is decision item or first action item in table cell
96
- // then dont consume the Tab, as table-keymap should tab to the next cell
97
- const shouldLetTabThroughInTable = state => {
98
- const curIndentLevel = getCurrentIndentLevel(state.selection);
99
- const curIndex = getTaskItemIndex(state);
100
- const {
101
- tableCell,
102
- tableHeader
103
- } = state.schema.nodes;
104
- const cell = findParentNodeOfType([tableCell, tableHeader])(state.selection);
105
- if ((curIndentLevel === 1 && curIndex === 0 || isInsideDecision(state)) && cell) {
106
- return true;
107
- }
108
- return false;
109
- };
110
- export const getIndentCommand = editorAnalyticsAPI => (inputMethod = INPUT_METHOD.KEYBOARD) => filter(isInsideTask, (state, dispatch) => {
111
- const normalizedSelection = normalizeTaskItemsSelection(state.selection);
112
- const curIndentLevel = getCurrentIndentLevel(normalizedSelection);
113
- if (!curIndentLevel || curIndentLevel >= 6) {
114
- return true;
115
- }
116
- return withAnalytics(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, INDENT_DIRECTION.INDENT, inputMethod))(autoJoin(wrapSelectionInTaskList, ['taskList']))(state, dispatch);
117
- });
118
- const backspaceFrom = editorAnalyticsAPI => $from => (state, dispatch) => {
119
- // previous was empty, just delete backwards
120
- const taskBefore = $from.doc.resolve($from.before());
121
- if (taskBefore.nodeBefore && isActionOrDecisionItem(taskBefore.nodeBefore) && taskBefore.nodeBefore.nodeSize === 2) {
122
- return false;
123
- }
124
-
125
- // if nested, just unindent
126
- const {
127
- taskList,
128
- paragraph
129
- } = state.schema.nodes;
130
- if ($from.node($from.depth - 2).type === taskList) {
131
- return getUnindentCommand(editorAnalyticsAPI)()(state, dispatch);
132
- }
133
-
134
- // bottom level, should "unwrap" taskItem contents into paragraph
135
- // we achieve this by slicing the content out, and replacing
136
- if (actionDecisionFollowsOrNothing($from)) {
137
- if (dispatch) {
138
- const taskContent = state.doc.slice($from.start(), $from.end()).content;
139
-
140
- // might be end of document after
141
- const slice = taskContent.size ? paragraph.createChecked(undefined, taskContent) : paragraph.createChecked();
142
- dispatch(splitListItemWith(state.tr, slice, $from, true));
143
- }
144
- return true;
145
- }
146
- return false;
147
- };
148
- const backspace = editorAnalyticsAPI => filter(isEmptySelectionAtStart, autoJoin(chainCommands((state, dispatch) => joinAtCut(state.selection.$from)(state, dispatch), filter(isInsideTaskOrDecisionItem, (state, dispatch) => backspaceFrom(editorAnalyticsAPI)(state.selection.$from)(state, dispatch))), ['taskList', 'decisionList']));
149
- const unindentTaskOrUnwrapTaskDecisionFollowing = (state, dispatch) => {
150
- const {
151
- selection: {
152
- $from
153
- },
154
- schema: {
155
- nodes: {
156
- taskList,
157
- doc,
158
- paragraph
159
- }
160
- },
161
- tr
162
- } = state;
163
-
164
- // only run if cursor is at the end of the node
165
- if (!isEmptySelectionAtEnd(state) || !dispatch) {
166
- return false;
167
- }
168
-
169
- // look for the node after this current one
170
- const $next = walkOut($from);
171
-
172
- // this is a top-level node it wont have $next.before()
173
- if (!$next.parent || $next.parent.type === doc) {
174
- return false;
175
- }
176
-
177
- // if nested, just unindent
178
- if ($next.node($next.depth - 2).type === taskList ||
179
- // this is for the case when we are on a non-nested item and next one is nested
180
- $next.node($next.depth - 1).type === taskList && $next.parent.type === taskList) {
181
- liftBlock(tr, $next, $next);
182
- dispatch(tr);
183
- return true;
184
- }
185
-
186
- // if next node is of same type, remove the node wrapping and create paragraph
187
- if (!isTable($next.nodeAfter) && isActionOrDecisionItem($from.parent) && actionDecisionFollowsOrNothing($from) &&
188
- // only forward delete if the node is same type
189
- $next.node().type.name === $from.node().type.name) {
190
- const taskContent = state.doc.slice($next.start(), $next.end()).content;
191
-
192
- // might be end of document after
193
- const slice = taskContent.size ? paragraph.createChecked(undefined, taskContent) : [];
194
- dispatch(splitListItemWith(tr, slice, $next, false));
195
- return true;
196
- }
197
- return false;
198
- };
199
- const deleteForwards = autoJoin(chainCommands(deleteEmptyParagraphAndMoveBlockUp(isActionOrDecisionList), joinTaskDecisionFollowing, unindentTaskOrUnwrapTaskDecisionFollowing), ['taskList', 'decisionList']);
200
- const splitListItemWith = (tr, content, $from, setSelection) => {
201
- const origDoc = tr.doc;
202
-
203
- // split just before the current item
204
- // we can only split if there was a list item before us
205
- const container = $from.node($from.depth - 2);
206
- const posInList = $from.index($from.depth - 1);
207
- const shouldSplit = !(!isActionOrDecisionList(container) && posInList === 0);
208
- if (shouldSplit) {
209
- // this only splits a node to delete it, so we probably don't need a random uuid
210
- // but generate one anyway for correctness
211
- tr = tr.split($from.pos, 1, [{
212
- type: $from.parent.type,
213
- attrs: {
214
- localId: uuid.generate()
215
- }
216
- }]);
217
- }
218
- // and delete the action at the current pos
219
- // we can do this because we know either first new child will be taskItem or nothing at all
220
- const frag = Fragment.from(content);
221
- tr = tr.replace(tr.mapping.map($from.start() - 2), tr.mapping.map($from.end() + 2), frag.size ? new Slice(frag, 0, 0) : Slice.empty);
222
-
223
- // put cursor inside paragraph
224
- if (setSelection) {
225
- tr = tr.setSelection(new TextSelection(tr.doc.resolve($from.pos + 1 - (shouldSplit ? 0 : 2))));
226
- }
227
-
228
- // lift list up if the node after the initial one was a taskList
229
- // which means it would have empty placeholder content if we just immediately delete it
230
- //
231
- // if it's a taskItem then it can stand alone, so it's fine
232
- const $oldAfter = origDoc.resolve($from.after());
233
-
234
- // if different levels then we shouldn't lift
235
- if ($oldAfter.depth === $from.depth - 1) {
236
- if ($oldAfter.nodeAfter && isActionOrDecisionList($oldAfter.nodeAfter)) {
237
- // getBlockRange expects to be inside the taskItem
238
- const pos = tr.mapping.map($oldAfter.pos + 2);
239
- const $after = tr.doc.resolve(pos);
240
- const blockRange = getBlockRange($after, tr.doc.resolve($after.after($after.depth - 1) - 1));
241
- if (blockRange) {
242
- tr = tr.lift(blockRange, blockRange.depth - 1).scrollIntoView();
243
- }
244
-
245
- // we delete 1 past the range of the empty taskItem
246
- // otherwise we hit a bug in prosemirror-transform:
247
- // Cannot read property 'content' of undefined
248
- tr = tr.deleteRange(pos - 3, pos - 1);
249
- }
250
- }
251
- return tr;
252
- };
253
- const splitListItem = (state, dispatch) => {
254
- let {
255
- tr,
256
- selection: {
257
- $from
258
- }
259
- } = state;
260
- const {
261
- schema: {
262
- nodes: {
263
- paragraph
264
- }
265
- }
266
- } = state;
267
- if (actionDecisionFollowsOrNothing($from)) {
268
- if (dispatch) {
269
- dispatch(splitListItemWith(tr, paragraph.createChecked(), $from, true));
270
- }
271
- return true;
272
- }
273
- return false;
274
- };
275
- const enter = editorAnalyticsAPI => filter(isInsideTaskOrDecisionItem, chainCommands(filter(isEmptyTaskDecision, chainCommands(getUnindentCommand(editorAnalyticsAPI)(), splitListItem)), (state, dispatch) => {
276
- const {
277
- selection,
278
- schema
279
- } = state;
280
- const {
281
- taskItem
282
- } = schema.nodes;
283
- const {
284
- $from,
285
- $to
286
- } = selection;
287
- const node = $from.node($from.depth);
288
- const nodeType = node && node.type;
289
- const listType = nodeType === taskItem ? 'taskList' : 'decisionList';
290
- const addItem = ({
291
- tr,
292
- itemLocalId
293
- }) => {
294
- // ED-8932: When cursor is at the beginning of a task item, instead of split, we insert above.
295
- if ($from.pos === $to.pos && $from.parentOffset === 0) {
296
- const newTask = nodeType.createAndFill({
297
- localId: itemLocalId
298
- });
299
- if (newTask) {
300
- // Current position will point to text node, but we want to insert above the taskItem node
301
- return tr.insert($from.pos - 1, newTask);
302
- }
303
- }
304
- return tr.split($from.pos, 1, [{
305
- type: nodeType,
306
- attrs: {
307
- localId: itemLocalId
308
- }
309
- }]);
310
- };
311
- const insertTr = insertTaskDecisionWithAnalytics(editorAnalyticsAPI)(state, listType, INPUT_METHOD.KEYBOARD, addItem);
312
- if (insertTr && dispatch) {
313
- insertTr.scrollIntoView();
314
- dispatch(insertTr);
315
- }
316
- return true;
317
- }));
318
- const cmdOptEnter = filter(isInsideTaskOrDecisionItem, (state, dispatch) => {
319
- const {
320
- selection,
321
- schema
322
- } = state;
323
- const {
324
- taskItem
325
- } = schema.nodes;
326
- const {
327
- $from
328
- } = selection;
329
- const node = $from.node($from.depth);
330
- const nodeType = node && node.type;
331
- const nodePos = $from.before($from.depth);
332
- if (nodeType === taskItem) {
333
- const tr = state.tr;
334
- tr.step(new SetAttrsStep(nodePos, {
335
- state: node.attrs.state === 'TODO' ? 'DONE' : 'TODO',
336
- localId: node.attrs.localId
337
- }));
338
- if (tr && dispatch) {
339
- dispatch(tr);
340
- }
341
- }
342
- return true;
343
- });
344
- export function keymapPlugin(schema, api, allowNestedTasks, consumeTabs) {
345
- var _api$analytics3, _api$analytics4;
346
- const indentHandlers = {
347
- 'Shift-Tab': filter([isInsideTaskOrDecisionItem, state => !shouldLetTabThroughInTable(state)], (state, dispatch) => {
348
- var _api$analytics;
349
- return getUnindentCommand(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(INPUT_METHOD.KEYBOARD)(state, dispatch) || !!consumeTabs;
350
- }),
351
- Tab: filter([isInsideTaskOrDecisionItem, state => !shouldLetTabThroughInTable(state)], (state, dispatch) => {
352
- var _api$analytics2;
353
- return getIndentCommand(api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)(INPUT_METHOD.KEYBOARD)(state, dispatch) || !!consumeTabs;
354
- })
355
- };
356
- const defaultHandlers = consumeTabs ? {
357
- 'Shift-Tab': isInsideTaskOrDecisionItem,
358
- Tab: isInsideTaskOrDecisionItem
359
- } : {};
360
- const keymaps = {
361
- Backspace: backspace(api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions),
362
- Delete: deleteForwards,
363
- 'Ctrl-d': deleteForwards,
364
- Enter: enter(api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions),
365
- [toggleTaskItemCheckbox.common]: cmdOptEnter,
366
- ...(allowNestedTasks ? indentHandlers : defaultHandlers)
367
- };
368
- return keymap(keymaps);
369
- }
370
- export default keymapPlugin;
@@ -1,262 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
3
- import { uuid } from '@atlaskit/adf-schema';
4
- import { getStepRange } from '@atlaskit/editor-common/utils';
5
- import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
6
- import { createSelectionClickHandler, GapCursorSelection } from '@atlaskit/editor-common/selection';
7
- import { decisionItemNodeView } from '../nodeviews/decisionItem';
8
- import { taskItemNodeViewFactory } from '../nodeviews/taskItem';
9
- import { stateKey } from './plugin-key';
10
- import { getTaskItemDataToFocus, getTaskItemDataAtPos, focusCheckboxAndUpdateSelection, removeCheckboxFocus } from './helpers';
11
- import { ACTIONS } from './types';
12
- function nodesBetweenChanged(tr, f, startPos) {
13
- const stepRange = getStepRange(tr);
14
- if (!stepRange) {
15
- return;
16
- }
17
- tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
18
- }
19
- const setContextIdentifierProvider = provider => (state, dispatch) => {
20
- if (dispatch) {
21
- dispatch(state.tr.setMeta(stateKey, {
22
- action: ACTIONS.SET_CONTEXT_PROVIDER,
23
- data: provider
24
- }));
25
- }
26
- return true;
27
- };
28
- export function createPlugin(portalProviderAPI, eventDispatcher, providerFactory, dispatch, api, useLongPressSelection = false) {
29
- return new SafePlugin({
30
- props: {
31
- nodeViews: {
32
- taskItem: taskItemNodeViewFactory(portalProviderAPI, eventDispatcher, providerFactory, api),
33
- decisionItem: decisionItemNodeView(portalProviderAPI, eventDispatcher, api)
34
- },
35
- handleTextInput(view, from, to, text) {
36
- // When a decision item is selected and the user starts typing, the entire node
37
- // should be replaced with what was just typed. This custom text input handler
38
- // is needed to implement that behaviour.
39
-
40
- // TODO: ProseMirror should already do this by default
41
- // Tech debt to investigate why we need a custom handler here:
42
- // https://product-fabric.atlassian.net/browse/ED-9278
43
-
44
- const {
45
- state,
46
- dispatch
47
- } = view;
48
- const {
49
- tr
50
- } = state;
51
- if (state.selection instanceof NodeSelection && state.selection.node.type === view.state.schema.nodes.decisionItem) {
52
- state.selection.replace(tr);
53
- tr.insertText(text);
54
- if (dispatch) {
55
- dispatch(tr);
56
- }
57
- return true;
58
- }
59
- return false;
60
- },
61
- handleClickOn: createSelectionClickHandler(['decisionItem'], target => target.hasAttribute('data-decision-wrapper') || target.getAttribute('aria-label') === 'Decision', {
62
- useLongPressSelection
63
- }),
64
- handleKeyDown: (view, event) => {
65
- const {
66
- state,
67
- dispatch
68
- } = view;
69
- const {
70
- selection,
71
- schema
72
- } = state;
73
- const {
74
- $from,
75
- $to
76
- } = selection;
77
- const parentOffset = $from.parentOffset;
78
- const isInTaskItem = $from.node().type === schema.nodes.taskItem;
79
- const focusedTaskItemLocalId = stateKey.getState(state).focusedTaskItemLocalId;
80
- const currentTaskItemData = getTaskItemDataAtPos(view);
81
- const currentTaskItemFocused = focusedTaskItemLocalId === (currentTaskItemData === null || currentTaskItemData === void 0 ? void 0 : currentTaskItemData.localId);
82
-
83
- // if task item checkbox not focused and arrow key is not pressed
84
- // then we don't want to handle event.
85
- if (!['ArrowUp', 'ArrowDown', 'ArrowRight', 'ArrowLeft'].includes(event.key)) {
86
- return false;
87
- }
88
-
89
- // We want to handle arrow up, down and left key only
90
- // when selection is inside task item and no text is selected.
91
- if (['ArrowUp', 'ArrowDown', 'ArrowLeft'].includes(event.key) && (!isInTaskItem || $from.pos !== $to.pos)) {
92
- return false;
93
- }
94
-
95
- // Arrow keys are pressed and shift, ctrl or meta is pressed as well.
96
- // along with arrow keys and task item checkbox is focused
97
- // then first move focus to view and proceed with default event handling.
98
- if (event.shiftKey || event.ctrlKey || event.metaKey) {
99
- currentTaskItemFocused && removeCheckboxFocus(view);
100
- return false;
101
- }
102
-
103
- // task item checkbox is already focused
104
- if (focusedTaskItemLocalId) {
105
- if (event.key === 'ArrowLeft') {
106
- // Move focus to view and proceed with default keyboard handler.
107
- // Which will move cursor to previous position.
108
- removeCheckboxFocus(view);
109
- return false;
110
- }
111
- if (event.key === 'ArrowRight') {
112
- // Move focus to view and DON'T proceed with default handler.
113
- // We have assumed that selection is already before first character of task item.
114
- removeCheckboxFocus(view);
115
- return true;
116
- }
117
- if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
118
- const taskItemData = getTaskItemDataToFocus(view, event.key === 'ArrowUp' ? 'previous' : 'next');
119
- if (taskItemData) {
120
- focusCheckboxAndUpdateSelection(view, taskItemData);
121
- return true;
122
- } else {
123
- // If any how checkbox input not found, then move focus to view
124
- // and proceed with default keyboard handler.
125
- removeCheckboxFocus(view);
126
- return false;
127
- }
128
- }
129
- }
130
-
131
- // If left arrow key is pressed and cursor is at first position in task-item
132
- // then focus checkbox and DON'T proceed with default keyboard handler
133
- if (event.key === 'ArrowLeft' && parentOffset === 0) {
134
- // here we are not using focusCheckboxAndUpdateSelection() method
135
- // because it is working incorretly when we are placing is inside the nested items
136
- dispatch(state.tr.setMeta(stateKey, {
137
- action: ACTIONS.FOCUS_BY_LOCALID,
138
- data: currentTaskItemData === null || currentTaskItemData === void 0 ? void 0 : currentTaskItemData.localId
139
- }));
140
- return true;
141
- }
142
- if (event.key === 'ArrowRight') {
143
- var _$from$nodeAfter;
144
- // If gap cursor is just before task list then focus first task item in list.
145
- if (selection instanceof GapCursorSelection && selection.side === 'left' && ((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.type) === schema.nodes.taskList) {
146
- const taskList = $from.nodeAfter;
147
- const firstTaskItemNode = taskList.child(0);
148
- const taskItemPos = $from.pos + 1;
149
- focusCheckboxAndUpdateSelection(view, {
150
- pos: taskItemPos,
151
- localId: firstTaskItemNode.attrs.localId
152
- });
153
- return true;
154
- }
155
- // if cursor is at then end of task item text then focus next task item checkbox
156
- else if (isInTaskItem && $from.node().content.size === parentOffset) {
157
- const nextTaskItemData = getTaskItemDataToFocus(view, 'next');
158
- if (nextTaskItemData) {
159
- focusCheckboxAndUpdateSelection(view, nextTaskItemData);
160
- return true;
161
- }
162
- } else {
163
- return false;
164
- }
165
- }
166
- }
167
- },
168
- state: {
169
- init() {
170
- return {
171
- insideTaskDecisionItem: false
172
- };
173
- },
174
- apply(tr, pluginState) {
175
- const {
176
- action,
177
- data
178
- } = tr.getMeta(stateKey) || {
179
- action: null,
180
- data: null
181
- };
182
- let newPluginState = pluginState;
183
- switch (action) {
184
- case ACTIONS.SET_CONTEXT_PROVIDER:
185
- newPluginState = {
186
- ...pluginState,
187
- contextIdentifierProvider: data
188
- };
189
- break;
190
- case ACTIONS.FOCUS_BY_LOCALID:
191
- newPluginState = {
192
- ...pluginState,
193
- focusedTaskItemLocalId: data
194
- };
195
- break;
196
- }
197
- dispatch(stateKey, newPluginState);
198
- return newPluginState;
199
- }
200
- },
201
- view(editorView) {
202
- const providerHandler = (name, providerPromise) => {
203
- if (name === 'contextIdentifierProvider') {
204
- if (!providerPromise) {
205
- setContextIdentifierProvider(undefined)(editorView.state, editorView.dispatch);
206
- } else {
207
- providerPromise.then(provider => {
208
- setContextIdentifierProvider(provider)(editorView.state, editorView.dispatch);
209
- });
210
- }
211
- }
212
- };
213
- providerFactory.subscribe('contextIdentifierProvider', providerHandler);
214
- return {};
215
- },
216
- key: stateKey,
217
- /*
218
- * After each transaction, we search through the document for any decisionList/Item & taskList/Item nodes
219
- * that do not have the localId attribute set and generate a random UUID to use. This is to replace a previous
220
- * Prosemirror capabibility where node attributes could be generated dynamically.
221
- * See https://discuss.prosemirror.net/t/release-0-23-0-possibly-to-be-1-0-0/959/17 for a discussion of this approach.
222
- *
223
- * Note: we currently do not handle the edge case where two nodes may have the same localId
224
- */
225
- appendTransaction: (transactions, _oldState, newState) => {
226
- const tr = newState.tr;
227
- let modified = false;
228
- transactions.forEach(transaction => {
229
- if (!transaction.docChanged) {
230
- return;
231
- }
232
-
233
- // Adds a unique id to a node
234
- nodesBetweenChanged(transaction, (node, pos) => {
235
- const {
236
- decisionList,
237
- decisionItem,
238
- taskList,
239
- taskItem
240
- } = newState.schema.nodes;
241
- if (!!node.type && (node.type === decisionList || node.type === decisionItem || node.type === taskList || node.type === taskItem)) {
242
- const {
243
- localId,
244
- ...rest
245
- } = node.attrs;
246
- if (localId === undefined || localId === null || localId === '') {
247
- tr.step(new SetAttrsStep(pos, {
248
- localId: uuid.generate(),
249
- ...rest
250
- }));
251
- modified = true;
252
- }
253
- }
254
- });
255
- });
256
- if (modified) {
257
- return tr.setMeta('addToHistory', false);
258
- }
259
- return;
260
- }
261
- });
262
- }
@@ -1,2 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- export const stateKey = new PluginKey('tasksAndDecisionsPlugin');
@@ -1,5 +0,0 @@
1
- export let ACTIONS = /*#__PURE__*/function (ACTIONS) {
2
- ACTIONS[ACTIONS["SET_CONTEXT_PROVIDER"] = 0] = "SET_CONTEXT_PROVIDER";
3
- ACTIONS[ACTIONS["FOCUS_BY_LOCALID"] = 1] = "FOCUS_BY_LOCALID";
4
- return ACTIONS;
5
- }({});
@@ -1 +0,0 @@
1
- export {};
@@ -1,30 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import React from 'react';
3
- import { defineMessages, injectIntl } from 'react-intl-next';
4
- import { DecisionItem } from '@atlaskit/task-decision';
5
- const messages = defineMessages({
6
- placeholder: {
7
- id: 'fabric.editor.decisionPlaceholder',
8
- defaultMessage: 'Add a decision…',
9
- description: 'Placeholder description for an empty decision in the editor'
10
- }
11
- });
12
- export class Decision extends React.Component {
13
- render() {
14
- const {
15
- contentRef,
16
- showPlaceholder,
17
- intl: {
18
- formatMessage
19
- }
20
- } = this.props;
21
- const placeholder = formatMessage(messages.placeholder);
22
- return /*#__PURE__*/React.createElement(DecisionItem, {
23
- contentRef: contentRef,
24
- placeholder: placeholder,
25
- showPlaceholder: showPlaceholder
26
- });
27
- }
28
- }
29
- _defineProperty(Decision, "displayName", 'Decision');
30
- export default injectIntl(Decision);