@atlaskit/editor-core 187.15.0 → 187.16.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 (114) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/create-editor/create-plugins-list.js +2 -7
  3. package/dist/cjs/create-editor/feature-flags-from-props.js +23 -28
  4. package/dist/cjs/index.js +0 -7
  5. package/dist/cjs/plugins/media/toolbar/alt-text.js +5 -2
  6. package/dist/cjs/plugins/media/toolbar/index.js +7 -5
  7. package/dist/cjs/plugins/media/toolbar/linking-toolbar-appearance.js +3 -4
  8. package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +1 -2
  9. package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +13 -4
  10. package/dist/cjs/plugins/type-ahead/index.js +1 -4
  11. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +2 -4
  12. package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +2 -4
  13. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +21 -40
  14. package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
  15. package/dist/cjs/plugins/type-ahead/utils.js +15 -19
  16. package/dist/cjs/version-wrapper.js +1 -1
  17. package/dist/cjs/version.json +1 -1
  18. package/dist/es2019/create-editor/create-plugins-list.js +2 -7
  19. package/dist/es2019/create-editor/feature-flags-from-props.js +23 -28
  20. package/dist/es2019/index.js +0 -1
  21. package/dist/es2019/plugins/media/toolbar/alt-text.js +6 -4
  22. package/dist/es2019/plugins/media/toolbar/index.js +7 -5
  23. package/dist/es2019/plugins/media/toolbar/linking-toolbar-appearance.js +1 -1
  24. package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +1 -2
  25. package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +13 -4
  26. package/dist/es2019/plugins/type-ahead/index.js +1 -4
  27. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -4
  28. package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +2 -4
  29. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +21 -40
  30. package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
  31. package/dist/es2019/plugins/type-ahead/utils.js +15 -19
  32. package/dist/es2019/version-wrapper.js +1 -1
  33. package/dist/es2019/version.json +1 -1
  34. package/dist/esm/create-editor/create-plugins-list.js +2 -7
  35. package/dist/esm/create-editor/feature-flags-from-props.js +23 -28
  36. package/dist/esm/index.js +0 -1
  37. package/dist/esm/plugins/media/toolbar/alt-text.js +6 -4
  38. package/dist/esm/plugins/media/toolbar/index.js +7 -5
  39. package/dist/esm/plugins/media/toolbar/linking-toolbar-appearance.js +1 -1
  40. package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +1 -2
  41. package/dist/esm/plugins/panel/pm-plugins/keymaps.js +13 -4
  42. package/dist/esm/plugins/type-ahead/index.js +1 -4
  43. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -4
  44. package/dist/esm/plugins/type-ahead/pm-plugins/main.js +2 -4
  45. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +21 -40
  46. package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
  47. package/dist/esm/plugins/type-ahead/utils.js +15 -19
  48. package/dist/esm/version-wrapper.js +1 -1
  49. package/dist/esm/version.json +1 -1
  50. package/dist/types/create-editor/create-plugins-list.d.ts +6 -6
  51. package/dist/types/index.d.ts +0 -5
  52. package/dist/types/plugins/annotation/toolbar.d.ts +1 -1
  53. package/dist/types/plugins/code-block/toolbar.d.ts +1 -2
  54. package/dist/types/plugins/copy-button/toolbar.d.ts +1 -1
  55. package/dist/types/plugins/expand/toolbar.d.ts +1 -1
  56. package/dist/types/plugins/extension/toolbar.d.ts +1 -1
  57. package/dist/types/plugins/floating-toolbar/index.d.ts +3 -6
  58. package/dist/types/plugins/floating-toolbar/ui/CheckboxModal.d.ts +2 -2
  59. package/dist/types/plugins/floating-toolbar/ui/ConfirmationModal.d.ts +2 -2
  60. package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -1
  61. package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +1 -1
  62. package/dist/types/plugins/floating-toolbar/ui/SimpleModal.d.ts +2 -2
  63. package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
  64. package/dist/types/plugins/layout/index.d.ts +1 -1
  65. package/dist/types/plugins/layout/toolbar.d.ts +1 -1
  66. package/dist/types/plugins/media/toolbar/alt-text.d.ts +3 -1
  67. package/dist/types/plugins/media/toolbar/index.d.ts +1 -1
  68. package/dist/types/plugins/media/toolbar/linking.d.ts +1 -1
  69. package/dist/types/plugins/panel/toolbar.d.ts +1 -1
  70. package/dist/types/plugins/type-ahead/index.d.ts +0 -1
  71. package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +1 -2
  72. package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +1 -2
  73. package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +0 -1
  74. package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -1
  75. package/dist/types/plugins/type-ahead/utils.d.ts +1 -2
  76. package/dist/types-ts4.5/create-editor/create-plugins-list.d.ts +6 -6
  77. package/dist/types-ts4.5/index.d.ts +0 -5
  78. package/dist/types-ts4.5/plugins/annotation/toolbar.d.ts +1 -1
  79. package/dist/types-ts4.5/plugins/code-block/toolbar.d.ts +1 -2
  80. package/dist/types-ts4.5/plugins/copy-button/toolbar.d.ts +1 -1
  81. package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +1 -1
  82. package/dist/types-ts4.5/plugins/extension/toolbar.d.ts +1 -1
  83. package/dist/types-ts4.5/plugins/floating-toolbar/index.d.ts +3 -6
  84. package/dist/types-ts4.5/plugins/floating-toolbar/ui/CheckboxModal.d.ts +2 -2
  85. package/dist/types-ts4.5/plugins/floating-toolbar/ui/ConfirmationModal.d.ts +2 -2
  86. package/dist/types-ts4.5/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -1
  87. package/dist/types-ts4.5/plugins/floating-toolbar/ui/DropdownMenu.d.ts +1 -1
  88. package/dist/types-ts4.5/plugins/floating-toolbar/ui/SimpleModal.d.ts +2 -2
  89. package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
  90. package/dist/types-ts4.5/plugins/layout/index.d.ts +1 -1
  91. package/dist/types-ts4.5/plugins/layout/toolbar.d.ts +1 -1
  92. package/dist/types-ts4.5/plugins/media/toolbar/alt-text.d.ts +3 -1
  93. package/dist/types-ts4.5/plugins/media/toolbar/index.d.ts +1 -1
  94. package/dist/types-ts4.5/plugins/media/toolbar/linking.d.ts +1 -1
  95. package/dist/types-ts4.5/plugins/panel/toolbar.d.ts +1 -1
  96. package/dist/types-ts4.5/plugins/type-ahead/index.d.ts +0 -1
  97. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/decorations.d.ts +1 -2
  98. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/main.d.ts +1 -2
  99. package/dist/types-ts4.5/plugins/type-ahead/ui/InputQuery.d.ts +0 -1
  100. package/dist/types-ts4.5/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -1
  101. package/dist/types-ts4.5/plugins/type-ahead/utils.d.ts +1 -2
  102. package/package.json +2 -2
  103. package/report.api.md +1 -48
  104. package/tmp/api-report-tmp.d.ts +1 -46
  105. package/dist/cjs/plugins/floating-toolbar/types.js +0 -5
  106. package/dist/cjs/plugins/floating-toolbar/ui/types.js +0 -5
  107. package/dist/es2019/plugins/floating-toolbar/types.js +0 -1
  108. package/dist/es2019/plugins/floating-toolbar/ui/types.js +0 -1
  109. package/dist/esm/plugins/floating-toolbar/types.js +0 -1
  110. package/dist/esm/plugins/floating-toolbar/ui/types.js +0 -1
  111. package/dist/types/plugins/floating-toolbar/types.d.ts +0 -1
  112. package/dist/types/plugins/floating-toolbar/ui/types.d.ts +0 -1
  113. package/dist/types-ts4.5/plugins/floating-toolbar/types.d.ts +0 -1
  114. package/dist/types-ts4.5/plugins/floating-toolbar/ui/types.d.ts +0 -1
@@ -25,12 +25,9 @@ function getSpellCheck(featureFlags) {
25
25
  * which is used by both current and archv3 editors.
26
26
  */
27
27
  export function createFeatureFlagsFromProps(props) {
28
- var _props$featureFlags, _ref, _props$featureFlags$u, _props$featureFlags2, _props$featureFlags3, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags4, _props$featureFlags5, _props$allowTables, _props$featureFlags6, _props$featureFlags7, _props$allowTables2, _props$featureFlags8, _props$featureFlags9, _props$allowTables3, _props$featureFlags10, _props$featureFlags11, _props$allowTables4, _props$allowTables5, _props$featureFlags12, _props$featureFlags13, _props$allowTables6, _props$allowExtension, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$collabEdit, _props$collabEdit2, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42, _props$featureFlags43, _props$featureFlags44;
28
+ var _props$featureFlags, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$collabEdit, _props$collabEdit2, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42;
29
29
  var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
30
30
  var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
31
-
32
- // duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
33
- var pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
34
31
  return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
35
32
  newInsertionBehaviour: props.allowNewInsertionBehaviour,
36
33
  interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
@@ -41,36 +38,34 @@ export function createFeatureFlagsFromProps(props) {
41
38
  singleLayout: _typeof(props.allowLayouts) === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
42
39
  undoRedoButtons: props.allowUndoRedoButtons,
43
40
  catchAllTracking: (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.catchAllTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.enabled,
44
- stickyHeadersOptimization: typeof ((_props$featureFlags4 = props.featureFlags) === null || _props$featureFlags4 === void 0 ? void 0 : _props$featureFlags4.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.stickyHeadersOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
45
- initialRenderOptimization: typeof ((_props$featureFlags6 = props.featureFlags) === null || _props$featureFlags6 === void 0 ? void 0 : _props$featureFlags6.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.initialRenderOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
46
- mouseMoveOptimization: typeof ((_props$featureFlags8 = props.featureFlags) === null || _props$featureFlags8 === void 0 ? void 0 : _props$featureFlags8.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.mouseMoveOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
47
- tableRenderOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableRenderOptimization) : _typeof(props.allowTables) === 'object' && typeof ((_props$allowTables4 = props.allowTables) === null || _props$allowTables4 === void 0 ? void 0 : _props$allowTables4.tableRenderOptimization) === 'boolean' ? (_props$allowTables5 = props.allowTables) === null || _props$allowTables5 === void 0 ? void 0 : _props$allowTables5.tableRenderOptimization : true,
48
- tableOverflowShadowsOptimization: typeof ((_props$featureFlags12 = props.featureFlags) === null || _props$featureFlags12 === void 0 ? void 0 : _props$featureFlags12.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags13 = props.featureFlags) !== null && _props$featureFlags13 !== void 0 && _props$featureFlags13.tableOverflowShadowsOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
41
+ stickyHeadersOptimization: typeof ((_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.stickyHeadersOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
42
+ initialRenderOptimization: typeof ((_props$featureFlags4 = props.featureFlags) === null || _props$featureFlags4 === void 0 ? void 0 : _props$featureFlags4.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.initialRenderOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
43
+ mouseMoveOptimization: typeof ((_props$featureFlags6 = props.featureFlags) === null || _props$featureFlags6 === void 0 ? void 0 : _props$featureFlags6.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.mouseMoveOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
44
+ tableRenderOptimization: typeof ((_props$featureFlags8 = props.featureFlags) === null || _props$featureFlags8 === void 0 ? void 0 : _props$featureFlags8.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.tableRenderOptimization) : _typeof(props.allowTables) === 'object' && typeof ((_props$allowTables4 = props.allowTables) === null || _props$allowTables4 === void 0 ? void 0 : _props$allowTables4.tableRenderOptimization) === 'boolean' ? (_props$allowTables5 = props.allowTables) === null || _props$allowTables5 === void 0 ? void 0 : _props$allowTables5.tableRenderOptimization : true,
45
+ tableOverflowShadowsOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableOverflowShadowsOptimization) : _typeof(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
49
46
  extendFloatingToolbar: Boolean(_typeof(props.allowExtension) === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
50
- showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.showAvatarGroupAsPlugin) : false),
51
- errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.useErrorBoundaryDocStructure) : false),
52
- synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.synchronyErrorDocStructure) : false),
53
- enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.enableViewUpdateSubscription) : false),
54
- collabAvatarScroll: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.collabAvatarScroll) : false),
55
- ufo: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.ufo) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.ufo) : false),
56
- twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.twoLineEditorToolbar) : false),
57
- saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactions) : false)),
58
- saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.saferDispatchedTransactionsAnalyticsOnly) : false)),
47
+ showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags12 = props.featureFlags) === null || _props$featureFlags12 === void 0 ? void 0 : _props$featureFlags12.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags13 = props.featureFlags) !== null && _props$featureFlags13 !== void 0 && _props$featureFlags13.showAvatarGroupAsPlugin) : false),
48
+ errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.useErrorBoundaryDocStructure) : false),
49
+ synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.synchronyErrorDocStructure) : false),
50
+ enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.enableViewUpdateSubscription) : false),
51
+ collabAvatarScroll: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.collabAvatarScroll) : false),
52
+ ufo: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.ufo) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.ufo) : false),
53
+ twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.twoLineEditorToolbar) : false),
54
+ saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.saferDispatchedTransactions) : false)),
55
+ saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactionsAnalyticsOnly) : false)),
59
56
  useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
60
- chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
57
+ chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
61
58
  tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
62
- showHoverPreview: Boolean(typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.showHoverPreview) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.showHoverPreview) : false),
63
- indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.indentationButtonsInTheToolbar) : false)),
64
- floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags38 = props.featureFlags) !== null && _props$featureFlags38 !== void 0 && _props$featureFlags38.floatingToolbarCopyButton) : false)),
65
- floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
59
+ showHoverPreview: Boolean(typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.showHoverPreview) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.showHoverPreview) : false),
60
+ indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.indentationButtonsInTheToolbar) : false)),
61
+ floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.floatingToolbarCopyButton) : false)),
62
+ floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
66
63
  disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
67
64
  // Including fallback to props.featureFlags so that mobile feature flags
68
65
  // are included (they are not kebab cased)
69
- restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.restartNumberedLists) === true,
70
- useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags42 = props.featureFlags) !== null && _props$featureFlags42 !== void 0 && _props$featureFlags42.useSomewhatSemanticTextColorNames) : false)),
66
+ restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedLists) === true,
67
+ useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags40 = props.featureFlags) !== null && _props$featureFlags40 !== void 0 && _props$featureFlags40.useSomewhatSemanticTextColorNames) : false)),
71
68
  lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
72
- preventPopupOverflow: Boolean(typeof ((_props$featureFlags43 = props.featureFlags) === null || _props$featureFlags43 === void 0 ? void 0 : _props$featureFlags43['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags44 = props.featureFlags) !== null && _props$featureFlags44 !== void 0 && _props$featureFlags44['prevent-popup-overflow']) : false),
73
- // duplicated logic from `create-plugins-list.ts` due to presets not being finalised
74
- useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
69
+ preventPopupOverflow: Boolean(typeof ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags42 = props.featureFlags) !== null && _props$featureFlags42 !== void 0 && _props$featureFlags42['prevent-popup-overflow']) : false)
75
70
  });
76
71
  }
package/dist/esm/index.js CHANGED
@@ -52,7 +52,6 @@ export { GapCursorSelection, Side as GapCursorSide } from './plugins/selection/g
52
52
  export { selectionPluginKey } from './plugins/mobile-selection';
53
53
  export { insertExpand } from './plugins/expand/commands';
54
54
  export { default as WithPluginState } from './ui/WithPluginState';
55
- export { pluginKey as floatingToolbarPluginKey } from './plugins/floating-toolbar';
56
55
  export { lightModeStatusColorPalette, darkModeStatusColorPalette } from './ui/ColorPalette/Palettes/statusColorPalette';
57
56
  export { DEFAULT_BORDER_COLOR } from './ui/ColorPalette/Palettes/common';
58
57
  export { default as messages, statusMessages, dateMessages } from './messages';
@@ -5,11 +5,9 @@ import React from 'react';
5
5
  import { openMediaAltTextMenu } from '../pm-plugins/alt-text/commands';
6
6
  import { ToolTipContent, addAltText } from '../../../keymaps';
7
7
  import { messages } from '../pm-plugins/alt-text/messages';
8
- import AltTextEdit from '../pm-plugins/alt-text/ui/AltTextEdit';
9
- import { CONTAINER_WIDTH_IN_PX } from '../pm-plugins/alt-text/ui/AltTextEdit';
8
+ import AltTextEdit, { CONTAINER_WIDTH_IN_PX } from '../pm-plugins/alt-text/ui/AltTextEdit';
10
9
  import { getMediaNodeFromSelection } from '../utils/media-common';
11
10
  import { ClassNames } from '../pm-plugins/alt-text/style';
12
- import { forceFocusSelector } from '../../floating-toolbar/pm-plugins/force-focus';
13
11
  var testId = 'alt-text-edit-button';
14
12
  export var altTextButton = function altTextButton(intl, state) {
15
13
  var mediaNode = getMediaNodeFromSelection(state);
@@ -45,9 +43,13 @@ export var altTextEditComponent = function altTextEditComponent(options) {
45
43
  * and not close the floating toolbar.
46
44
  */
47
45
  var handleEsc = function handleEsc() {
46
+ var _options$forceFocusSe;
48
47
  var tr = view.state.tr,
49
48
  dispatch = view.dispatch;
50
- dispatch(forceFocusSelector("[data-testid=\"".concat(testId, "\"]"))(tr));
49
+ var newTr = options === null || options === void 0 ? void 0 : (_options$forceFocusSe = options.forceFocusSelector) === null || _options$forceFocusSe === void 0 ? void 0 : _options$forceFocusSe.call(options, "[data-testid=\"".concat(testId, "\"]"))(tr);
50
+ if (newTr) {
51
+ dispatch(newTr);
52
+ }
51
53
  };
52
54
  return /*#__PURE__*/React.createElement(AltTextEdit, {
53
55
  view: view,
@@ -418,8 +418,10 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
418
418
  if (allowAltTextOnImages) {
419
419
  var mediaAltTextPluginState = getMediaAltTextPluginState(state);
420
420
  if (mediaAltTextPluginState.isAltTextEditorOpen) {
421
+ var _pluginInjectionApi$d9;
421
422
  return getAltTextToolbar(baseToolbar, {
422
- altTextValidator: altTextValidator
423
+ altTextValidator: altTextValidator,
424
+ forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d9 = pluginInjectionApi.dependencies.floatingToolbar.actions) === null || _pluginInjectionApi$d9 === void 0 ? void 0 : _pluginInjectionApi$d9.forceFocusSelector
423
425
  });
424
426
  }
425
427
  }
@@ -430,22 +432,22 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
430
432
  selectedNodeType = state.selection.node.type;
431
433
  }
432
434
  if (allowMediaInline && (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup) {
433
- var _pluginInjectionApi$d9, _pluginInjectionApi$d10;
435
+ var _pluginInjectionApi$d10, _pluginInjectionApi$d11;
434
436
  var mediaOffset = state.selection.$from.parentOffset + 1;
435
437
  baseToolbar.getDomRef = function () {
436
438
  var _mediaPluginState$ele;
437
439
  var selector = mediaFilmstripItemDOMSelector(mediaOffset);
438
440
  return (_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(selector);
439
441
  };
440
- items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d9 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d9 === void 0 ? void 0 : (_pluginInjectionApi$d10 = _pluginInjectionApi$d9.analytics) === null || _pluginInjectionApi$d10 === void 0 ? void 0 : _pluginInjectionApi$d10.actions);
442
+ items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d10 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d10 === void 0 ? void 0 : (_pluginInjectionApi$d11 = _pluginInjectionApi$d10.analytics) === null || _pluginInjectionApi$d11 === void 0 ? void 0 : _pluginInjectionApi$d11.actions);
441
443
  } else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
442
- var _pluginInjectionApi$d11, _pluginInjectionApi$d12;
444
+ var _pluginInjectionApi$d12, _pluginInjectionApi$d13;
443
445
  baseToolbar.getDomRef = function () {
444
446
  var _mediaPluginState$ele2;
445
447
  var element = (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(".".concat(MediaInlineNodeSelector));
446
448
  return element || mediaPluginState.element;
447
449
  };
448
- items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d11 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d11 === void 0 ? void 0 : (_pluginInjectionApi$d12 = _pluginInjectionApi$d11.analytics) === null || _pluginInjectionApi$d12 === void 0 ? void 0 : _pluginInjectionApi$d12.actions);
450
+ items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d12 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d12 === void 0 ? void 0 : (_pluginInjectionApi$d13 = _pluginInjectionApi$d12.analytics) === null || _pluginInjectionApi$d13 === void 0 ? void 0 : _pluginInjectionApi$d13.actions);
449
451
  } else {
450
452
  baseToolbar.getDomRef = function () {
451
453
  var _mediaPluginState$ele3;
@@ -10,7 +10,7 @@ import OpenIcon from '@atlaskit/icon/glyph/shortcut';
10
10
  import { isSafeUrl } from '@atlaskit/adf-schema';
11
11
  import { checkMediaType } from '../utils/check-media-type';
12
12
  import { FloatingToolbarButton as ToolbarButton } from '@atlaskit/editor-common/ui';
13
- import Separator from '../../floating-toolbar/ui/Separator';
13
+ import { FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
14
14
  import { linkMessages } from '../../../messages';
15
15
  import { linkToolbarMessages } from '@atlaskit/editor-common/messages';
16
16
  import { ToolTipContent, addLink } from '../../../keymaps';
@@ -18,8 +18,7 @@ import EditorUnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
18
18
  // Common Translations will live here
19
19
 
20
20
  import { PanelTextInput } from '@atlaskit/editor-common/ui';
21
- import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
22
- import Separator from '../../floating-toolbar/ui/Separator';
21
+ import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
23
22
  import { container, containerWithProvider, inputWrapper, RecentSearch } from '@atlaskit/editor-common/link';
24
23
  import { linkToolbarMessages } from '@atlaskit/editor-common/messages';
25
24
  import { normalizeUrl } from '@atlaskit/editor-common/utils';
@@ -20,6 +20,7 @@ export function keymapPlugin() {
20
20
  };
21
21
  var keymaps = {
22
22
  Backspace: function Backspace(state, dispatch) {
23
+ var _nodeBeforePanel$type, _nodeBeforePanel$type2;
23
24
  var selection = state.selection,
24
25
  nodes = state.schema.nodes,
25
26
  tr = state.tr;
@@ -36,17 +37,25 @@ export function keymapPlugin() {
36
37
  if ($from.parentOffset !== 0) {
37
38
  return false;
38
39
  }
39
- var previousPos = tr.doc.resolve(Math.max(0, $from.before($from.depth) - 1));
40
- var previousNodeType = previousPos.pos > 0 && previousPos.parent && previousPos.parent.type;
40
+ var $previousPos = tr.doc.resolve(Math.max(0, $from.before($from.depth) - 1));
41
+ var previousNodeType = $previousPos.pos > 0 && $previousPos.parent && $previousPos.parent.type;
41
42
  var parentNodeType = $from.parent.type;
42
43
  var isPreviousNodeAPanel = previousNodeType === panel;
43
44
  var isParentNodeAPanel = parentNodeType === panel;
45
+ var nodeBeforePanel = $previousPos === null || $previousPos === void 0 ? void 0 : $previousPos.nodeBefore;
44
46
 
45
47
  // Stops merging panels when deleting empty paragraph in between
46
48
  // Stops merging blockquotes with panels when deleting from start of blockquote
47
- if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || hasParentNodeOfType(blockquote)(selection)) {
49
+
50
+ if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || hasParentNodeOfType(blockquote)(selection) ||
51
+ // Lift line of panel content up and out of the panel, when backspacing
52
+ // at the start of a panel, if the node before the panel is an 'isolating' node
53
+ // (for e.g. a table, or an expand), otherwise the default prosemirror backspace
54
+ // behaviour will fallback to 'select node backward' logic because the node
55
+ // before is an isolating node.
56
+ nodeBeforePanel !== null && nodeBeforePanel !== void 0 && (_nodeBeforePanel$type = nodeBeforePanel.type) !== null && _nodeBeforePanel$type !== void 0 && (_nodeBeforePanel$type2 = _nodeBeforePanel$type.spec) !== null && _nodeBeforePanel$type2 !== void 0 && _nodeBeforePanel$type2.isolating && hasParentNodeOfType(panel)(selection)) {
48
57
  var content = $from.node($from.depth).content;
49
- var insertPos = previousPos.pos;
58
+ var insertPos = $previousPos.pos;
50
59
  deleteCurrentItem($from, tr).insert(insertPos, content);
51
60
  if (dispatch) {
52
61
  dispatch(setTextSelection(insertPos)(tr).scrollIntoView());
@@ -113,8 +113,6 @@ var TypeAheadMenu = /*#__PURE__*/React.memo(function (_ref) {
113
113
  *
114
114
  */
115
115
  var typeAheadPlugin = function typeAheadPlugin(options) {
116
- var _options$useBetterTyp;
117
- var useBetterTypeaheadNavigation = (_options$useBetterTyp = options === null || options === void 0 ? void 0 : options.useBetterTypeaheadNavigation) !== null && _options$useBetterTyp !== void 0 ? _options$useBetterTyp : true;
118
116
  var fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
119
117
  var popupMountRef = {
120
118
  current: null
@@ -141,8 +139,7 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
141
139
  popupMountRef: popupMountRef,
142
140
  reactDispatch: dispatch,
143
141
  typeAheadHandlers: typeAhead,
144
- createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent,
145
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
142
+ createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent
146
143
  });
147
144
  }
148
145
  }, {
@@ -15,8 +15,7 @@ import { closeTypeAhead } from '../transforms/close-type-ahead';
15
15
  export var factoryDecorations = function factoryDecorations(_ref) {
16
16
  var intl = _ref.intl,
17
17
  popupMountRef = _ref.popupMountRef,
18
- createAnalyticsEvent = _ref.createAnalyticsEvent,
19
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
18
+ createAnalyticsEvent = _ref.createAnalyticsEvent;
20
19
  var createDecorations = function createDecorations(tr, _ref2) {
21
20
  var triggerHandler = _ref2.triggerHandler,
22
21
  inputMethod = _ref2.inputMethod,
@@ -88,8 +87,7 @@ export var factoryDecorations = function factoryDecorations(_ref) {
88
87
  popupsBoundariesElement: (_popupMountRef$curren2 = popupMountRef.current) === null || _popupMountRef$curren2 === void 0 ? void 0 : _popupMountRef$curren2.popupsBoundariesElement,
89
88
  popupsScrollableElement: (_popupMountRef$curren3 = popupMountRef.current) === null || _popupMountRef$curren3 === void 0 ? void 0 : _popupMountRef$curren3.popupsScrollableElement,
90
89
  onUndoRedo: onUndoRedo,
91
- reopenQuery: reopenQuery,
92
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
90
+ reopenQuery: reopenQuery
93
91
  })), typeaheadComponent);
94
92
  shouldFocusCursorInsideQuery = false;
95
93
  return typeaheadComponent;
@@ -25,14 +25,12 @@ export function createPlugin(_ref) {
25
25
  popupMountRef = _ref.popupMountRef,
26
26
  createAnalyticsEvent = _ref.createAnalyticsEvent,
27
27
  typeAheadHandlers = _ref.typeAheadHandlers,
28
- getIntl = _ref.getIntl,
29
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
28
+ getIntl = _ref.getIntl;
30
29
  var intl = getIntl();
31
30
  var _factoryDecorations = factoryDecorations({
32
31
  intl: intl,
33
32
  popupMountRef: popupMountRef,
34
- createAnalyticsEvent: createAnalyticsEvent,
35
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
33
+ createAnalyticsEvent: createAnalyticsEvent
36
34
  }),
37
35
  createDecorations = _factoryDecorations.createDecorations,
38
36
  removeDecorations = _factoryDecorations.removeDecorations;
@@ -66,8 +66,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
66
66
  onQueryFocus = _ref.onQueryFocus,
67
67
  onUndoRedo = _ref.onUndoRedo,
68
68
  editorView = _ref.editorView,
69
- items = _ref.items,
70
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
69
+ items = _ref.items;
71
70
  var ref = useRef(document.createElement('span'));
72
71
  var inputRef = useRef(null);
73
72
  var _useState = useState(null),
@@ -140,27 +139,6 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
140
139
  // Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
141
140
  if (!event.isComposing && event.which !== 229 && event.keyCode !== 229) {
142
141
  if (selectedIndex === -1) {
143
- if (useBetterTypeaheadNavigation) {
144
- /**
145
- * TODO DTR-1401: (also see ED-17200) There are two options
146
- * here, either
147
- * - set the index directly to 1 in WrapperTypeAhead.tsx's
148
- * `insertSelectedItem` at the cost of breaking some of the a11y
149
- * focus changes,
150
- * - or do this jank at the cost of some small analytics noise.
151
- *
152
- * The focus behaviour still needs cleanup
153
- */
154
- selectPreviousItem();
155
- }
156
- selectNextItem();
157
- }
158
- onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
159
- }
160
- break;
161
- case 'Tab':
162
- if (selectedIndex === -1) {
163
- if (useBetterTypeaheadNavigation) {
164
142
  /**
165
143
  * TODO DTR-1401: (also see ED-17200) There are two options
166
144
  * here, either
@@ -169,33 +147,36 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
169
147
  * focus changes,
170
148
  * - or do this jank at the cost of some small analytics noise.
171
149
  *
150
+ * The focus behaviour still needs cleanup
172
151
  */
173
152
  selectPreviousItem();
153
+ selectNextItem();
174
154
  }
155
+ onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
156
+ }
157
+ break;
158
+ case 'Tab':
159
+ if (selectedIndex === -1) {
160
+ /**
161
+ * TODO DTR-1401: (also see ED-17200) There are two options
162
+ * here, either
163
+ * - set the index directly to 1 in WrapperTypeAhead.tsx's
164
+ * `insertSelectedItem` at the cost of breaking some of the a11y
165
+ * focus changes,
166
+ * - or do this jank at the cost of some small analytics noise.
167
+ *
168
+ */
169
+ selectPreviousItem();
175
170
  selectNextItem();
176
171
  }
177
172
  // TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
178
173
  onItemSelect(SelectItemMode.TAB);
179
174
  break;
180
175
  case 'ArrowDown':
181
- if (useBetterTypeaheadNavigation) {
182
- selectNextItem();
183
- } else {
184
- // TODO DTR-1401: why were we preventing selection?
185
- if (selectedIndex === -1) {
186
- selectNextItem();
187
- }
188
- }
176
+ selectNextItem();
189
177
  break;
190
178
  case 'ArrowUp':
191
- if (useBetterTypeaheadNavigation) {
192
- selectPreviousItem();
193
- } else {
194
- // TODO DTR-1401: why were we preventing selection?
195
- if (selectedIndex === -1) {
196
- selectPreviousItem();
197
- }
198
- }
179
+ selectPreviousItem();
199
180
  break;
200
181
  }
201
182
  var undoRedoType = isUndoRedoShortcut(event);
@@ -207,7 +188,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
207
188
  event.preventDefault();
208
189
  return false;
209
190
  }
210
- }, [useBetterTypeaheadNavigation, onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
191
+ }, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
211
192
  var onClick = useCallback(function (event) {
212
193
  var _inputRef$current;
213
194
  event.stopPropagation();
@@ -19,8 +19,7 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
19
19
  inputMethod = _ref.inputMethod,
20
20
  getDecorationPosition = _ref.getDecorationPosition,
21
21
  reopenQuery = _ref.reopenQuery,
22
- onUndoRedo = _ref.onUndoRedo,
23
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
22
+ onUndoRedo = _ref.onUndoRedo;
24
23
  var _useState = useState(false),
25
24
  _useState2 = _slicedToArray(_useState, 2),
26
25
  closed = _useState2[0],
@@ -42,17 +41,15 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
42
41
  var selectNextItem = useMemo(function () {
43
42
  return moveSelectedIndex({
44
43
  editorView: editorView,
45
- direction: 'next',
46
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
44
+ direction: 'next'
47
45
  });
48
- }, [editorView, useBetterTypeaheadNavigation]);
46
+ }, [editorView]);
49
47
  var selectPreviousItem = useMemo(function () {
50
48
  return moveSelectedIndex({
51
49
  editorView: editorView,
52
- direction: 'previous',
53
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
50
+ direction: 'previous'
54
51
  });
55
- }, [editorView, useBetterTypeaheadNavigation]);
52
+ }, [editorView]);
56
53
  var cancel = useCallback(function (_ref2) {
57
54
  var setSelectionAt = _ref2.setSelectionAt,
58
55
  addPrefixTrigger = _ref2.addPrefixTrigger,
@@ -103,7 +100,6 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
103
100
  return null;
104
101
  }
105
102
  return /*#__PURE__*/React.createElement(InputQuery, {
106
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation,
107
103
  triggerQueryPrefix: triggerHandler.trigger,
108
104
  onQueryChange: setQuery,
109
105
  onItemSelect: insertSelectedItem,
@@ -53,8 +53,7 @@ export var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
53
53
  };
54
54
  export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
55
55
  var editorView = _ref2.editorView,
56
- direction = _ref2.direction,
57
- useBetterTypeaheadNavigation = _ref2.useBetterTypeaheadNavigation;
56
+ direction = _ref2.direction;
58
57
  return function () {
59
58
  var typeAheadState = getPluginState(editorView.state);
60
59
  if (!typeAheadState) {
@@ -66,23 +65,20 @@ export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
66
65
  var nextIndex;
67
66
  if (direction === 'next') {
68
67
  stats.increaseArrowDown();
69
- if (useBetterTypeaheadNavigation) {
70
- /**
71
- * See: https://product-fabric.atlassian.net/browse/ED-17200
72
- * `selectedIndex` is forced to -1 now to not immediately focus the typeahead
73
- * and only do so when there is explicit logic to focus into the typeahead
74
- * options.
75
- *
76
- * This check for "set index to 1 when -1"
77
- * - is a temporary workaround to get back the previous behaviour without
78
- * entirely reverting the a11y improvements
79
- *
80
- */
81
- if (selectedIndex === -1 && items.length > 1) {
82
- nextIndex = 1;
83
- } else {
84
- nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
85
- }
68
+
69
+ /**
70
+ * See: https://product-fabric.atlassian.net/browse/ED-17200
71
+ * `selectedIndex` is forced to -1 now to not immediately focus the typeahead
72
+ * and only do so when there is explicit logic to focus into the typeahead
73
+ * options.
74
+ *
75
+ * This check for "set index to 1 when -1"
76
+ * - is a temporary workaround to get back the previous behaviour without
77
+ * entirely reverting the a11y improvements
78
+ *
79
+ */
80
+ if (selectedIndex === -1 && items.length > 1) {
81
+ nextIndex = 1;
86
82
  } else {
87
83
  nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
88
84
  }
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.15.0";
2
+ export var version = "187.16.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": "187.15.0",
3
+ "version": "187.16.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,9 +1,9 @@
1
- import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { EditorPlugin, EditorProps } from '../types';
3
- import { EditorPluginFeatureProps } from '../types/editor-props';
4
- import { ScrollGutterPluginOptions } from '../plugins/base/pm-plugins/scroll-gutter';
5
- import { DefaultPresetPluginOptions } from '../labs/next/presets/default';
6
- import { EditorPresetProps } from '../labs/next/presets/types';
1
+ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
+ import type { EditorPlugin, EditorProps } from '../types';
3
+ import type { EditorPluginFeatureProps } from '../types/editor-props';
4
+ import type { ScrollGutterPluginOptions } from '../plugins/base/pm-plugins/scroll-gutter';
5
+ import type { DefaultPresetPluginOptions } from '../labs/next/presets/default';
6
+ import type { EditorPresetProps } from '../labs/next/presets/types';
7
7
  import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
8
8
  export declare function getScrollGutterOptions(props: EditorProps): ScrollGutterPluginOptions | undefined;
9
9
  export declare function getDefaultPresetOptionsFromEditorProps(props: EditorProps, createAnalyticsEvent?: CreateUIAnalyticsEvent): EditorPresetProps & DefaultPresetPluginOptions & EditorPluginFeatureProps;
@@ -71,11 +71,6 @@ export { selectionPluginKey } from './plugins/mobile-selection';
71
71
  export type { SelectionData, SelectionDataState, } from './plugins/mobile-selection';
72
72
  export { insertExpand } from './plugins/expand/commands';
73
73
  export { default as WithPluginState } from './ui/WithPluginState';
74
- export { pluginKey as floatingToolbarPluginKey } from './plugins/floating-toolbar';
75
- export type { FloatingToolbarPluginState } from './plugins/floating-toolbar';
76
- export type { FloatingToolbarConfig, FloatingToolbarItem, FloatingToolbarButton, FloatingToolbarDropdown, FloatingToolbarListPicker, FloatingToolbarSelect, FloatingToolbarColorPicker, FloatingToolbarDatePicker, FloatingToolbarInput, FloatingToolbarEmojiPicker, } from './plugins/floating-toolbar/types';
77
- export type { DropdownOptionT } from './plugins/floating-toolbar/ui/types';
78
- export type { SelectOption } from './plugins/floating-toolbar/ui/Select';
79
74
  export { lightModeStatusColorPalette, darkModeStatusColorPalette, } from './ui/ColorPalette/Palettes/statusColorPalette';
80
75
  export type { PaletteColor } from './ui/ColorPalette/Palettes/type';
81
76
  export { DEFAULT_BORDER_COLOR } from './ui/ColorPalette/Palettes/common';
@@ -1,6 +1,6 @@
1
1
  import type { IntlShape } from 'react-intl-next';
2
2
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- import type { FloatingToolbarConfig } from '../../plugins/floating-toolbar/types';
3
+ import type { FloatingToolbarConfig } from '@atlaskit/editor-common/types';
4
4
  export declare const annotationMessages: {
5
5
  createComment: {
6
6
  id: string;
@@ -1,6 +1,5 @@
1
- import type { FloatingToolbarHandler } from '../floating-toolbar/types';
1
+ import type { FloatingToolbarHandler, SelectOption } from '@atlaskit/editor-common/types';
2
2
  import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
3
- import type { SelectOption } from '../floating-toolbar/ui/Select';
4
3
  export declare const messages: {
5
4
  selectLanguage: {
6
5
  id: string;
@@ -2,7 +2,7 @@
2
2
  /// <reference path="../../../../../../../typings/prosemirror-state.d.ts" />
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { Command } from '../../../src/types';
5
- import type { FloatingToolbarButton, FloatingToolbarItem, MarkOptions, NodeOptions } from '../floating-toolbar/types';
5
+ import type { FloatingToolbarButton, FloatingToolbarItem, MarkOptions, NodeOptions } from '@atlaskit/editor-common/types';
6
6
  import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
7
7
  export declare function getCopyButtonConfig(options: MarkOptions | NodeOptions, hoverDecoration: HoverDecorationHandler | undefined): FloatingToolbarButton<Command>;
8
8
  export declare const showCopyButton: (state?: EditorState) => import("prosemirror-state").Plugin<any> | undefined;
@@ -1,3 +1,3 @@
1
- import { FloatingToolbarHandler } from '../floating-toolbar/types';
1
+ import type { FloatingToolbarHandler } from '@atlaskit/editor-common/types';
2
2
  import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
3
3
  export declare const getToolbarConfig: (hoverDecoration: HoverDecorationHandler | undefined) => FloatingToolbarHandler;
@@ -1,4 +1,4 @@
1
- import type { FloatingToolbarHandler } from '../floating-toolbar/types';
1
+ import type { FloatingToolbarHandler } from '@atlaskit/editor-common/types';
2
2
  import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
3
3
  import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
4
4
  export declare const messages: {
@@ -1,10 +1,7 @@
1
- import type { Selection, EditorState } from '@atlaskit/editor-prosemirror/state';
1
+ import type { Selection } from '@atlaskit/editor-prosemirror/state';
2
2
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import type { FloatingToolbarConfig } from './types';
4
- import type { FloatingToolbarPlugin, ConfigWithNodeInfo } from '@atlaskit/editor-plugin-floating-toolbar';
5
- export type FloatingToolbarPluginState = {
6
- getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
7
- };
3
+ import type { FloatingToolbarConfig } from '@atlaskit/editor-common/types';
4
+ import type { FloatingToolbarPlugin, ConfigWithNodeInfo, FloatingToolbarPluginState } from '@atlaskit/editor-plugin-floating-toolbar';
8
5
  export declare const getRelevantConfig: (selection: Selection, configs: Array<FloatingToolbarConfig>) => ConfigWithNodeInfo | undefined;
9
6
  declare const floatingToolbarPlugin: FloatingToolbarPlugin;
10
7
  export default floatingToolbarPlugin;