@atlaskit/editor-core 184.0.0 → 185.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/.eslintrc.js +7 -3
  2. package/CHANGELOG.md +44 -0
  3. package/dist/cjs/create-editor/feature-flags-from-props.js +1 -2
  4. package/dist/cjs/editor-next/index.js +41 -34
  5. package/dist/cjs/editor.js +30 -269
  6. package/dist/cjs/i18n/en_ZZ.js +32 -6
  7. package/dist/cjs/index.js +0 -7
  8. package/dist/cjs/labs/next/presets/default.js +2 -1
  9. package/dist/cjs/plugins/base/index.js +0 -12
  10. package/dist/cjs/plugins/card/nodeviews/blockCard.js +7 -0
  11. package/dist/cjs/plugins/card/nodeviews/embedCard.js +7 -0
  12. package/dist/cjs/plugins/card/nodeviews/inlineCard.js +5 -1
  13. package/dist/cjs/plugins/card/pm-plugins/doc.js +1 -2
  14. package/dist/cjs/plugins/card/toolbar.js +11 -9
  15. package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +4 -4
  16. package/dist/cjs/plugins/code-block/index.js +7 -5
  17. package/dist/cjs/plugins/code-block/toolbar.js +5 -5
  18. package/dist/cjs/plugins/copy-button/commands.js +2 -3
  19. package/dist/cjs/plugins/copy-button/toolbar.js +7 -8
  20. package/dist/cjs/plugins/expand/index.js +1 -1
  21. package/dist/cjs/plugins/expand/toolbar.js +40 -39
  22. package/dist/cjs/plugins/extension/index.js +1 -1
  23. package/dist/cjs/plugins/extension/toolbar.js +5 -5
  24. package/dist/cjs/plugins/floating-toolbar/index.js +3 -2
  25. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +2 -4
  26. package/dist/cjs/plugins/layout/index.js +8 -4
  27. package/dist/cjs/plugins/layout/toolbar.js +5 -6
  28. package/dist/cjs/plugins/media/toolbar/index.js +31 -24
  29. package/dist/cjs/plugins/panel/index.js +2 -1
  30. package/dist/cjs/plugins/panel/toolbar.js +7 -7
  31. package/dist/cjs/plugins/placeholder-text/index.js +7 -5
  32. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +19 -0
  33. package/dist/cjs/ui/CollapsedEditor/index.js +1 -2
  34. package/dist/cjs/ui/ColorPickerButton/index.js +2 -2
  35. package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +6 -10
  36. package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +5 -3
  37. package/dist/cjs/ui/styles.js +6 -0
  38. package/dist/cjs/version-wrapper.js +1 -1
  39. package/dist/cjs/version.json +1 -1
  40. package/dist/es2019/create-editor/feature-flags-from-props.js +1 -2
  41. package/dist/es2019/editor-next/index.js +39 -30
  42. package/dist/es2019/editor.js +29 -232
  43. package/dist/es2019/i18n/en_ZZ.js +32 -6
  44. package/dist/es2019/index.js +1 -2
  45. package/dist/es2019/labs/next/presets/default.js +2 -1
  46. package/dist/es2019/plugins/base/index.js +0 -7
  47. package/dist/es2019/plugins/card/nodeviews/blockCard.js +8 -0
  48. package/dist/es2019/plugins/card/nodeviews/embedCard.js +8 -0
  49. package/dist/es2019/plugins/card/nodeviews/inlineCard.js +5 -1
  50. package/dist/es2019/plugins/card/pm-plugins/doc.js +1 -2
  51. package/dist/es2019/plugins/card/toolbar.js +8 -6
  52. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +2 -2
  53. package/dist/es2019/plugins/code-block/index.js +7 -5
  54. package/dist/es2019/plugins/code-block/toolbar.js +5 -6
  55. package/dist/es2019/plugins/copy-button/commands.js +2 -3
  56. package/dist/es2019/plugins/copy-button/toolbar.js +7 -8
  57. package/dist/es2019/plugins/expand/index.js +1 -1
  58. package/dist/es2019/plugins/expand/toolbar.js +5 -6
  59. package/dist/es2019/plugins/extension/index.js +1 -1
  60. package/dist/es2019/plugins/extension/toolbar.js +5 -6
  61. package/dist/es2019/plugins/floating-toolbar/index.js +3 -2
  62. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +2 -4
  63. package/dist/es2019/plugins/layout/index.js +8 -5
  64. package/dist/es2019/plugins/layout/toolbar.js +5 -6
  65. package/dist/es2019/plugins/media/toolbar/index.js +35 -24
  66. package/dist/es2019/plugins/panel/index.js +2 -2
  67. package/dist/es2019/plugins/panel/toolbar.js +7 -8
  68. package/dist/es2019/plugins/placeholder-text/index.js +7 -5
  69. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +21 -0
  70. package/dist/es2019/ui/CollapsedEditor/index.js +1 -2
  71. package/dist/es2019/ui/ColorPickerButton/index.js +2 -2
  72. package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +5 -10
  73. package/dist/es2019/ui/ElementBrowser/components/StatelessElementBrowser.js +5 -3
  74. package/dist/es2019/ui/styles.js +6 -0
  75. package/dist/es2019/version-wrapper.js +1 -1
  76. package/dist/es2019/version.json +1 -1
  77. package/dist/esm/create-editor/feature-flags-from-props.js +1 -2
  78. package/dist/esm/editor-next/index.js +42 -33
  79. package/dist/esm/editor.js +29 -270
  80. package/dist/esm/i18n/en_ZZ.js +32 -6
  81. package/dist/esm/index.js +1 -2
  82. package/dist/esm/labs/next/presets/default.js +2 -1
  83. package/dist/esm/plugins/base/index.js +0 -9
  84. package/dist/esm/plugins/card/nodeviews/blockCard.js +7 -0
  85. package/dist/esm/plugins/card/nodeviews/embedCard.js +7 -0
  86. package/dist/esm/plugins/card/nodeviews/inlineCard.js +5 -1
  87. package/dist/esm/plugins/card/pm-plugins/doc.js +1 -2
  88. package/dist/esm/plugins/card/toolbar.js +7 -6
  89. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +2 -2
  90. package/dist/esm/plugins/code-block/index.js +7 -5
  91. package/dist/esm/plugins/code-block/toolbar.js +5 -5
  92. package/dist/esm/plugins/copy-button/commands.js +2 -3
  93. package/dist/esm/plugins/copy-button/toolbar.js +7 -8
  94. package/dist/esm/plugins/expand/index.js +1 -1
  95. package/dist/esm/plugins/expand/toolbar.js +40 -39
  96. package/dist/esm/plugins/extension/index.js +1 -1
  97. package/dist/esm/plugins/extension/toolbar.js +5 -5
  98. package/dist/esm/plugins/floating-toolbar/index.js +3 -2
  99. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +2 -4
  100. package/dist/esm/plugins/layout/index.js +8 -4
  101. package/dist/esm/plugins/layout/toolbar.js +5 -6
  102. package/dist/esm/plugins/media/toolbar/index.js +31 -24
  103. package/dist/esm/plugins/panel/index.js +2 -1
  104. package/dist/esm/plugins/panel/toolbar.js +7 -7
  105. package/dist/esm/plugins/placeholder-text/index.js +7 -5
  106. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +19 -0
  107. package/dist/esm/ui/CollapsedEditor/index.js +1 -2
  108. package/dist/esm/ui/ColorPickerButton/index.js +2 -2
  109. package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +5 -10
  110. package/dist/esm/ui/ElementBrowser/components/StatelessElementBrowser.js +5 -3
  111. package/dist/esm/ui/styles.js +6 -0
  112. package/dist/esm/version-wrapper.js +1 -1
  113. package/dist/esm/version.json +1 -1
  114. package/dist/types/editor-next/index.d.ts +0 -6
  115. package/dist/types/editor.d.ts +1 -137
  116. package/dist/types/i18n/en_ZZ.d.ts +28 -2
  117. package/dist/types/index.d.ts +0 -1
  118. package/dist/types/labs/next/presets/cxhtml.d.ts +106 -0
  119. package/dist/types/labs/next/presets/default.d.ts +212 -0
  120. package/dist/types/labs/next/presets/mobile.d.ts +106 -0
  121. package/dist/types/plugins/base/index.d.ts +0 -4
  122. package/dist/types/plugins/card/index.d.ts +2 -2
  123. package/dist/types/plugins/card/nodeviews/blockCard.d.ts +3 -0
  124. package/dist/types/plugins/card/nodeviews/embedCard.d.ts +3 -0
  125. package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -0
  126. package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -1
  127. package/dist/types/plugins/card/pm-plugins/keymap.d.ts +1 -1
  128. package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -2
  129. package/dist/types/plugins/card/toolbar.d.ts +1 -2
  130. package/dist/types/plugins/card/types.d.ts +1 -1
  131. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -2
  132. package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +1 -1
  133. package/dist/types/plugins/card/ui/types.d.ts +1 -1
  134. package/dist/types/plugins/code-block/index.d.ts +7 -1
  135. package/dist/types/plugins/code-block/toolbar.d.ts +2 -1
  136. package/dist/types/plugins/copy-button/commands.d.ts +2 -1
  137. package/dist/types/plugins/copy-button/toolbar.d.ts +3 -2
  138. package/dist/types/plugins/expand/index.d.ts +2 -1
  139. package/dist/types/plugins/expand/toolbar.d.ts +2 -1
  140. package/dist/types/plugins/extension/index.d.ts +7 -2
  141. package/dist/types/plugins/extension/toolbar.d.ts +2 -1
  142. package/dist/types/plugins/floating-toolbar/index.d.ts +2 -1
  143. package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +3 -1
  144. package/dist/types/plugins/layout/index.d.ts +7 -1
  145. package/dist/types/plugins/layout/toolbar.d.ts +2 -1
  146. package/dist/types/plugins/media/index.d.ts +3 -1
  147. package/dist/types/plugins/panel/index.d.ts +2 -0
  148. package/dist/types/plugins/panel/toolbar.d.ts +3 -2
  149. package/dist/types/plugins/placeholder-text/index.d.ts +3 -1
  150. package/dist/types/ui/CollapsedEditor/index.d.ts +1 -2
  151. package/dist/types/ui/ColorPickerButton/index.d.ts +2 -2
  152. package/dist/types-ts4.5/editor-next/index.d.ts +0 -6
  153. package/dist/types-ts4.5/editor.d.ts +1 -137
  154. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +28 -2
  155. package/dist/types-ts4.5/index.d.ts +0 -1
  156. package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +122 -0
  157. package/dist/types-ts4.5/labs/next/presets/default.d.ts +244 -0
  158. package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +122 -0
  159. package/dist/types-ts4.5/plugins/base/index.d.ts +0 -4
  160. package/dist/types-ts4.5/plugins/card/index.d.ts +2 -2
  161. package/dist/types-ts4.5/plugins/card/nodeviews/blockCard.d.ts +3 -0
  162. package/dist/types-ts4.5/plugins/card/nodeviews/embedCard.d.ts +3 -0
  163. package/dist/types-ts4.5/plugins/card/nodeviews/inlineCard.d.ts +1 -0
  164. package/dist/types-ts4.5/plugins/card/pm-plugins/doc.d.ts +1 -1
  165. package/dist/types-ts4.5/plugins/card/pm-plugins/keymap.d.ts +1 -1
  166. package/dist/types-ts4.5/plugins/card/pm-plugins/main.d.ts +1 -2
  167. package/dist/types-ts4.5/plugins/card/toolbar.d.ts +1 -2
  168. package/dist/types-ts4.5/plugins/card/types.d.ts +1 -1
  169. package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +1 -2
  170. package/dist/types-ts4.5/plugins/card/ui/link-toolbar-button-group-options.d.ts +1 -1
  171. package/dist/types-ts4.5/plugins/card/ui/types.d.ts +1 -1
  172. package/dist/types-ts4.5/plugins/code-block/index.d.ts +7 -1
  173. package/dist/types-ts4.5/plugins/code-block/toolbar.d.ts +2 -1
  174. package/dist/types-ts4.5/plugins/copy-button/commands.d.ts +2 -1
  175. package/dist/types-ts4.5/plugins/copy-button/toolbar.d.ts +3 -2
  176. package/dist/types-ts4.5/plugins/expand/index.d.ts +3 -1
  177. package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +2 -1
  178. package/dist/types-ts4.5/plugins/extension/index.d.ts +4 -2
  179. package/dist/types-ts4.5/plugins/extension/toolbar.d.ts +2 -1
  180. package/dist/types-ts4.5/plugins/floating-toolbar/index.d.ts +3 -1
  181. package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +3 -1
  182. package/dist/types-ts4.5/plugins/layout/index.d.ts +7 -1
  183. package/dist/types-ts4.5/plugins/layout/toolbar.d.ts +2 -1
  184. package/dist/types-ts4.5/plugins/media/index.d.ts +3 -1
  185. package/dist/types-ts4.5/plugins/panel/index.d.ts +4 -0
  186. package/dist/types-ts4.5/plugins/panel/toolbar.d.ts +3 -2
  187. package/dist/types-ts4.5/plugins/placeholder-text/index.d.ts +5 -1
  188. package/dist/types-ts4.5/ui/CollapsedEditor/index.d.ts +1 -2
  189. package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +2 -2
  190. package/package.json +23 -18
  191. package/report.api.md +5 -93
  192. package/dist/cjs/editor-next/editor-migration-component.js +0 -54
  193. package/dist/cjs/plugins/base/pm-plugins/decoration.js +0 -122
  194. package/dist/es2019/editor-next/editor-migration-component.js +0 -30
  195. package/dist/es2019/plugins/base/pm-plugins/decoration.js +0 -111
  196. package/dist/esm/editor-next/editor-migration-component.js +0 -47
  197. package/dist/esm/plugins/base/pm-plugins/decoration.js +0 -113
  198. package/dist/types/editor-next/editor-migration-component.d.ts +0 -6
  199. package/dist/types/plugins/base/pm-plugins/decoration.d.ts +0 -24
  200. package/dist/types-ts4.5/editor-next/editor-migration-component.d.ts +0 -6
  201. package/dist/types-ts4.5/plugins/base/pm-plugins/decoration.d.ts +0 -24
@@ -4,11 +4,11 @@ import { default as createLayoutPlugin } from './pm-plugins/main';
4
4
  import { buildToolbar } from './toolbar';
5
5
  import { createDefaultLayoutSection } from './actions';
6
6
  import { IconLayout } from '../quick-insert/assets';
7
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../analytics';
7
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
8
8
  import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
9
9
  import { pluginKey } from './pm-plugins/plugin-key';
10
10
  export { pluginKey };
11
- const layoutPlugin = (options = {}) => ({
11
+ const layoutPlugin = (options = {}, api) => ({
12
12
  name: 'layout',
13
13
  nodes() {
14
14
  return [{
@@ -34,7 +34,8 @@ const layoutPlugin = (options = {}) => ({
34
34
  allowSingleColumnLayout
35
35
  } = pluginKey.getState(state);
36
36
  if (pos !== null) {
37
- return buildToolbar(state, intl, pos, allowBreakout, addSidebarLayouts, allowSingleColumnLayout);
37
+ var _api$dependencies$dec;
38
+ return buildToolbar(state, intl, pos, allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api === null || api === void 0 ? void 0 : (_api$dependencies$dec = api.dependencies.decorations.actions) === null || _api$dependencies$dec === void 0 ? void 0 : _api$dependencies$dec.hoverDecoration);
38
39
  }
39
40
  return undefined;
40
41
  },
@@ -48,8 +49,9 @@ const layoutPlugin = (options = {}) => ({
48
49
  priority: 1100,
49
50
  icon: () => /*#__PURE__*/React.createElement(IconLayout, null),
50
51
  action(insert, state) {
52
+ var _api$dependencies$ana, _api$dependencies$ana2;
51
53
  const tr = insert(createDefaultLayoutSection(state));
52
- return addAnalytics(state, tr, {
54
+ api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : (_api$dependencies$ana2 = _api$dependencies$ana.actions) === null || _api$dependencies$ana2 === void 0 ? void 0 : _api$dependencies$ana2.attachAnalyticsEvent({
53
55
  action: ACTION.INSERTED,
54
56
  actionSubject: ACTION_SUBJECT.DOCUMENT,
55
57
  actionSubjectId: ACTION_SUBJECT_ID.LAYOUT,
@@ -57,7 +59,8 @@ const layoutPlugin = (options = {}) => ({
57
59
  inputMethod: INPUT_METHOD.QUICK_INSERT
58
60
  },
59
61
  eventType: EVENT_TYPE.TRACK
60
- });
62
+ })(tr);
63
+ return tr;
61
64
  }
62
65
  }]
63
66
  }
@@ -9,7 +9,6 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
9
9
  import { toolbarMessages } from './toolbar-messages';
10
10
  import commonMessages from '../../messages';
11
11
  import { setPresetLayout, deleteActiveLayoutNode, getPresetLayout } from './actions';
12
- import { hoverDecoration } from '../base/pm-plugins/decoration';
13
12
  const LAYOUT_TYPES = [{
14
13
  id: 'editor.layout.twoEquals',
15
14
  type: 'two_equal',
@@ -54,7 +53,7 @@ const buildLayoutButton = (intl, item, currentLayout) => ({
54
53
  tabIndex: null
55
54
  });
56
55
  export const layoutToolbarTitle = 'Layout floating controls';
57
- export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout) => {
56
+ export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout, hoverDecoration) => {
58
57
  const node = state.doc.nodeAt(pos);
59
58
  if (node) {
60
59
  const currentLayout = getPresetLayout(node);
@@ -71,10 +70,10 @@ export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts
71
70
  testId: commonMessages.remove.id,
72
71
  title: intl.formatMessage(commonMessages.remove),
73
72
  onClick: deleteActiveLayoutNode,
74
- onMouseEnter: hoverDecoration(nodeType, true),
75
- onMouseLeave: hoverDecoration(nodeType, false),
76
- onFocus: hoverDecoration(nodeType, true),
77
- onBlur: hoverDecoration(nodeType, false),
73
+ onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
74
+ onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
75
+ onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
76
+ onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
78
77
  tabIndex: null
79
78
  };
80
79
  const layoutTypes = allowSingleColumnLayout ? LAYOUT_TYPES_WITH_SINGLE_COL : LAYOUT_TYPES;
@@ -6,7 +6,6 @@ import DownloadIcon from '@atlaskit/icon/glyph/download';
6
6
  import { mediaFilmstripItemDOMSelector } from '@atlaskit/media-filmstrip';
7
7
  import commonMessages from '../../../messages';
8
8
  import { stateKey } from '../pm-plugins/plugin-key';
9
- import { hoverDecoration } from '../../base/pm-plugins/decoration';
10
9
  import { getLinkingToolbar, shouldShowMediaLinkToolbar } from './linking';
11
10
  import buildLayoutButtons from '../../../ui/MediaAndEmbedsToolbar';
12
11
  import { getMediaLinkingState } from '../pm-plugins/linking';
@@ -14,7 +13,7 @@ import { getPluginState as getMediaAltTextPluginState } from '../pm-plugins/alt-
14
13
  import { altTextButton, getAltTextToolbar } from './alt-text';
15
14
  import { showLinkingToolbar } from '../commands/linking';
16
15
  import { LinkToolbarAppearance } from './linking-toolbar-appearance';
17
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE } from '../../analytics';
16
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
18
17
  import { messages } from '@atlaskit/media-ui';
19
18
  import { messages as cardMessages } from '../../card/messages';
20
19
  import { FilePreviewItem } from './filePreviewItem';
@@ -37,7 +36,7 @@ const handleRemoveMediaGroup = (state, dispatch) => {
37
36
  }
38
37
  return true;
39
38
  };
40
- const generateMediaCardFloatingToolbar = (state, intl, mediaPluginState) => {
39
+ const generateMediaCardFloatingToolbar = (state, intl, mediaPluginState, hoverDecoration) => {
41
40
  const {
42
41
  mediaGroup
43
42
  } = state.schema.nodes;
@@ -102,17 +101,17 @@ const generateMediaCardFloatingToolbar = (state, intl, mediaPluginState) => {
102
101
  appearance: 'danger',
103
102
  focusEditoronEnter: true,
104
103
  icon: RemoveIcon,
105
- onMouseEnter: hoverDecoration(mediaGroup, true),
106
- onMouseLeave: hoverDecoration(mediaGroup, false),
107
- onFocus: hoverDecoration(mediaGroup, true),
108
- onBlur: hoverDecoration(mediaGroup, false),
104
+ onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, true),
105
+ onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, false),
106
+ onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, true),
107
+ onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, false),
109
108
  title: intl.formatMessage(commonMessages.remove),
110
109
  onClick: handleRemoveMediaGroup,
111
110
  testId: 'media-toolbar-remove-button'
112
111
  }];
113
112
  return items;
114
113
  };
115
- const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState) => {
114
+ const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState, hoverDecoration) => {
116
115
  const {
117
116
  mediaInline
118
117
  } = state.schema.nodes;
@@ -177,17 +176,18 @@ const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState) => {
177
176
  appearance: 'danger',
178
177
  focusEditoronEnter: true,
179
178
  icon: RemoveIcon,
180
- onMouseEnter: hoverDecoration(mediaInline, true),
181
- onMouseLeave: hoverDecoration(mediaInline, false),
182
- onFocus: hoverDecoration(mediaInline, true),
183
- onBlur: hoverDecoration(mediaInline, false),
179
+ onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, true),
180
+ onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, false),
181
+ onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, true),
182
+ onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, false),
184
183
  title: intl.formatMessage(commonMessages.remove),
185
184
  onClick: removeInlineCard,
186
185
  testId: 'media-toolbar-remove-button'
187
186
  }];
188
187
  return items;
189
188
  };
190
- const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, mediaLinkingState, widthPluginDependencyApi, getEditorFeatureFlags) => {
189
+ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, mediaLinkingState, pluginInjectionApi, getEditorFeatureFlags) => {
190
+ var _pluginInjectionApi$d2;
191
191
  const {
192
192
  mediaSingle
193
193
  } = state.schema.nodes;
@@ -230,7 +230,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
230
230
  });
231
231
  }
232
232
  if (allowAdvancedToolBarOptions) {
233
- toolbarButtons = [...toolbarButtons, ...buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, widthPluginDependencyApi, allowResizing, allowResizingInTables)];
233
+ toolbarButtons = [...toolbarButtons, ...buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.width, allowResizing, allowResizingInTables)];
234
234
  if (toolbarButtons.length) {
235
235
  toolbarButtons.push({
236
236
  type: 'separator'
@@ -253,16 +253,20 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
253
253
  };
254
254
  const openLink = () => {
255
255
  if (editorView) {
256
+ var _pluginInjectionApi$d;
256
257
  const {
257
- state,
258
+ state: {
259
+ tr
260
+ },
258
261
  dispatch
259
262
  } = editorView;
260
- dispatch(addAnalytics(state, state.tr, {
263
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions.attachAnalyticsEvent({
261
264
  eventType: EVENT_TYPE.TRACK,
262
265
  action: ACTION.VISITED,
263
266
  actionSubject: ACTION_SUBJECT.MEDIA,
264
267
  actionSubjectId: ACTION_SUBJECT_ID.LINK
265
- }));
268
+ })(tr);
269
+ dispatch(tr);
266
270
  return true;
267
271
  }
268
272
  };
@@ -286,16 +290,19 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
286
290
  type: 'separator'
287
291
  });
288
292
  }
293
+ const {
294
+ hoverDecoration
295
+ } = (_pluginInjectionApi$d2 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.decorations.actions) !== null && _pluginInjectionApi$d2 !== void 0 ? _pluginInjectionApi$d2 : {};
289
296
  const removeButton = {
290
297
  id: 'editor.media.delete',
291
298
  type: 'button',
292
299
  appearance: 'danger',
293
300
  focusEditoronEnter: true,
294
301
  icon: RemoveIcon,
295
- onMouseEnter: hoverDecoration(mediaSingle, true),
296
- onMouseLeave: hoverDecoration(mediaSingle, false),
297
- onFocus: hoverDecoration(mediaSingle, true),
298
- onBlur: hoverDecoration(mediaSingle, false),
302
+ onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, true),
303
+ onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, false),
304
+ onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, true),
305
+ onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, false),
299
306
  title: intl.formatMessage(commonMessages.remove),
300
307
  onClick: remove,
301
308
  testId: 'media-toolbar-remove-button'
@@ -313,6 +320,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
313
320
  return items;
314
321
  };
315
322
  export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) => {
323
+ var _pluginInjectionApi$d3;
316
324
  const {
317
325
  media,
318
326
  mediaInline,
@@ -329,6 +337,9 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
329
337
  } = options;
330
338
  const mediaPluginState = stateKey.getState(state);
331
339
  const mediaLinkingState = getMediaLinkingState(state);
340
+ const {
341
+ hoverDecoration
342
+ } = (_pluginInjectionApi$d3 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.decorations.actions) !== null && _pluginInjectionApi$d3 !== void 0 ? _pluginInjectionApi$d3 : {};
332
343
  if (!mediaPluginState) {
333
344
  return;
334
345
  }
@@ -365,21 +376,21 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
365
376
  const selector = mediaFilmstripItemDOMSelector(mediaOffset);
366
377
  return (_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(selector);
367
378
  };
368
- items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState);
379
+ items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration);
369
380
  } else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
370
381
  baseToolbar.getDomRef = () => {
371
382
  var _mediaPluginState$ele2;
372
383
  const element = (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(`.${MediaInlineNodeSelector}`);
373
384
  return element || mediaPluginState.element;
374
385
  };
375
- items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState);
386
+ items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration);
376
387
  } else {
377
388
  baseToolbar.getDomRef = () => {
378
389
  var _mediaPluginState$ele3;
379
390
  const element = (_mediaPluginState$ele3 = mediaPluginState.element) === null || _mediaPluginState$ele3 === void 0 ? void 0 : _mediaPluginState$ele3.querySelector(`.${MediaSingleNodeSelector}`);
380
391
  return element || mediaPluginState.element;
381
392
  };
382
- items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.width, getEditorFeatureFlags);
393
+ items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi, getEditorFeatureFlags);
383
394
  }
384
395
  return {
385
396
  ...baseToolbar,
@@ -25,7 +25,7 @@ const insertPanelTypeWithAnalytics = (panelAttributes, state, insert) => {
25
25
  return tr;
26
26
  };
27
27
  const insertPanelType = (panelAttributes, state) => state.schema.nodes.panel.createChecked(panelAttributes, state.schema.nodes.paragraph.createChecked());
28
- const panelPlugin = (options = {}) => ({
28
+ const panelPlugin = (options = {}, api) => ({
29
29
  name: 'panel',
30
30
  nodes() {
31
31
  const panelNode = panel(!!options.allowCustomPanel);
@@ -130,7 +130,7 @@ const panelPlugin = (options = {}) => ({
130
130
  }
131
131
  return quickInsertOptions;
132
132
  },
133
- floatingToolbar: (state, intl, providerFactory) => getToolbarConfig(state, intl, options, providerFactory)
133
+ floatingToolbar: (state, intl, providerFactory) => getToolbarConfig(state, intl, options, providerFactory, api === null || api === void 0 ? void 0 : api.dependencies.decorations.actions.hoverDecoration)
134
134
  }
135
135
  });
136
136
  export default panelPlugin;
@@ -7,7 +7,6 @@ import ErrorIcon from '@atlaskit/icon/glyph/editor/error';
7
7
  import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
8
8
  import commonMessages from '../../messages';
9
9
  import { removePanel, changePanelType } from './actions';
10
- import { hoverDecoration } from '../base/pm-plugins/decoration';
11
10
  import { panelBackgroundPalette } from '../../ui/ColorPalette/Palettes/panelBackgroundPalette';
12
11
  import { getPanelTypeBackgroundNoTokens } from '@atlaskit/editor-common/panel';
13
12
  import { findPanel } from './utils';
@@ -42,7 +41,7 @@ export const panelIconMap = {
42
41
  id: 'atlassian-tip'
43
42
  }
44
43
  };
45
- export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, activePanelType, activePanelColor, activePanelIcon, state) => {
44
+ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, hoverDecoration, activePanelType, activePanelColor, activePanelIcon, state) => {
46
45
  // TODO: ED-14403 investigate why these titles are not getting translated for the tooltips
47
46
  const items = [{
48
47
  id: 'editor.panel.info',
@@ -235,16 +234,16 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
235
234
  focusEditoronEnter: true,
236
235
  icon: RemoveIcon,
237
236
  onClick: removePanel(),
238
- onMouseEnter: hoverDecoration(panelNodeType, true),
239
- onMouseLeave: hoverDecoration(panelNodeType, false),
240
- onFocus: hoverDecoration(panelNodeType, true),
241
- onBlur: hoverDecoration(panelNodeType, false),
237
+ onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
238
+ onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
239
+ onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
240
+ onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
242
241
  title: formatMessage(commonMessages.remove),
243
242
  tabIndex: null
244
243
  });
245
244
  return items;
246
245
  };
247
- export const getToolbarConfig = (state, intl, options = {}, providerFactory) => {
246
+ export const getToolbarConfig = (state, intl, options = {}, providerFactory, hoverDecoration) => {
248
247
  const {
249
248
  formatMessage
250
249
  } = intl;
@@ -261,7 +260,7 @@ export const getToolbarConfig = (state, intl, options = {}, providerFactory) =>
261
260
  };
262
261
 
263
262
  // force toolbar to be turned on
264
- const items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
263
+ const items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, hoverDecoration, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
265
264
  const getDomRef = editorView => {
266
265
  const domAtPos = editorView.domAtPos.bind(editorView);
267
266
  const element = findDomRefAtPos(panelObject.pos, domAtPos);
@@ -10,7 +10,7 @@ import PlaceholderFloatingToolbar from './ui/PlaceholderFloatingToolbar';
10
10
  import { hidePlaceholderFloatingToolbar, insertPlaceholderTextAtSelection } from './actions';
11
11
  import { PlaceholderTextNodeView } from './placeholder-text-nodeview';
12
12
  import { pluginKey } from './plugin-key';
13
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../analytics';
13
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
14
14
  import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
15
15
  import { isSelectionAtPlaceholder } from './selection-utils';
16
16
  import { createInternalTypeAheadTools } from '../type-ahead/api';
@@ -175,7 +175,7 @@ const basePlaceholderTextPlugin = options => ({
175
175
  });
176
176
  }
177
177
  });
178
- const decorateWithPluginOptions = (plugin, options) => {
178
+ const decorateWithPluginOptions = (plugin, options, api) => {
179
179
  if (!options.allowInserting) {
180
180
  return plugin;
181
181
  }
@@ -192,11 +192,12 @@ const decorateWithPluginOptions = (plugin, options) => {
192
192
  label: ""
193
193
  }),
194
194
  action(insert, state) {
195
+ var _api$dependencies$ana;
195
196
  const tr = state.tr;
196
197
  tr.setMeta(pluginKey, {
197
198
  showInsertPanelAt: tr.selection.anchor
198
199
  });
199
- return addAnalytics(state, tr, {
200
+ api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions.attachAnalyticsEvent({
200
201
  action: ACTION.INSERTED,
201
202
  actionSubject: ACTION_SUBJECT.DOCUMENT,
202
203
  actionSubjectId: ACTION_SUBJECT_ID.PLACEHOLDER_TEXT,
@@ -204,11 +205,12 @@ const decorateWithPluginOptions = (plugin, options) => {
204
205
  inputMethod: INPUT_METHOD.QUICK_INSERT
205
206
  },
206
207
  eventType: EVENT_TYPE.TRACK
207
- });
208
+ })(tr);
209
+ return tr;
208
210
  }
209
211
  }]
210
212
  };
211
213
  return plugin;
212
214
  };
213
- const placeholderTextPlugin = (options, api) => decorateWithPluginOptions(basePlaceholderTextPlugin(options, api), options);
215
+ const placeholderTextPlugin = (options, api) => decorateWithPluginOptions(basePlaceholderTextPlugin(options, api), options, api);
214
216
  export default placeholderTextPlugin;
@@ -182,6 +182,27 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
182
182
  element === null || element === void 0 ? void 0 : element.removeEventListener('focusout', focusOut);
183
183
  };
184
184
  }, [ref, cancel]);
185
+
186
+ // ED-17443 When you press escape on typeahead panel, it should remove focus and close the panel
187
+ // This is the expected keyboard behaviour advised by the Accessibility team
188
+ useLayoutEffect(() => {
189
+ const escape = event => {
190
+ if (event.key === 'Escape') {
191
+ cancel({
192
+ addPrefixTrigger: true,
193
+ setSelectionAt: CloseSelectionOptions.AFTER_TEXT_INSERTED,
194
+ forceFocusOnEditor: true
195
+ });
196
+ }
197
+ };
198
+ const {
199
+ current: element
200
+ } = ref;
201
+ element === null || element === void 0 ? void 0 : element.addEventListener('keydown', escape);
202
+ return () => {
203
+ element === null || element === void 0 ? void 0 : element.removeEventListener('keydown', escape);
204
+ };
205
+ }, [ref, cancel]);
185
206
  return jsx(Popup, {
186
207
  zIndex: akEditorFloatingDialogZIndex,
187
208
  target: anchorElement,
@@ -3,7 +3,6 @@ import { IntlProviderIfMissingWrapper } from '@atlaskit/editor-common/ui';
3
3
  import React from 'react';
4
4
  import Editor from '../../editor';
5
5
  import EditorNext from '../../editor-next';
6
- import EditorMigrationComponent from '../../editor-next/editor-migration-component';
7
6
  import EditorWithActions from '../../labs/EditorWithActions';
8
7
  import ChromeCollapsed from '../ChromeCollapsed';
9
8
  export default class CollapsedEditor extends React.Component {
@@ -25,7 +24,7 @@ export default class CollapsedEditor extends React.Component {
25
24
  }
26
25
  render() {
27
26
  const child = React.Children.only(this.props.children);
28
- if (child.type !== Editor && child.type !== EditorWithActions && child.type !== EditorNext && child.type !== EditorMigrationComponent) {
27
+ if (child.type !== Editor && child.type !== EditorWithActions && child.type !== EditorNext) {
29
28
  throw new Error('Expected child to be of type `Editor`');
30
29
  }
31
30
  if (!this.props.isExpanded) {
@@ -165,8 +165,8 @@ const ColorPickerButton = props => {
165
165
  border: 1px solid ${DEFAULT_BORDER_COLOR};
166
166
  border-radius: ${borderRadius()}px;
167
167
  background-color: ${currentColor || 'transparent'};
168
- width: ${((_props$size2 = props.size) === null || _props$size2 === void 0 ? void 0 : _props$size2.width) || 14}px;
169
- height: ${((_props$size3 = props.size) === null || _props$size3 === void 0 ? void 0 : _props$size3.height) || 14}px;
168
+ width: ${((_props$size2 = props.size) === null || _props$size2 === void 0 ? void 0 : _props$size2.width) || '14px'};
169
+ height: ${((_props$size3 = props.size) === null || _props$size3 === void 0 ? void 0 : _props$size3.height) || '14px'};
170
170
  padding: 0;
171
171
  }
172
172
  `;
@@ -5,8 +5,6 @@ import { Field } from '@atlaskit/form';
5
5
  import { hexToEditorTableChartsPaletteColor } from '@atlaskit/editor-palette';
6
6
  import { DEFAULT_BORDER_COLOR } from '../../../ui/ColorPalette/Palettes/common';
7
7
  import { validate } from '../utils';
8
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
9
- import { gridSize } from '@atlaskit/theme/constants';
10
8
  import { requiredIndicator } from './common/RequiredIndicator';
11
9
  import { headingSizes } from '@atlaskit/theme/typography';
12
10
  import FieldMessages from '../FieldMessages';
@@ -373,13 +371,10 @@ const ColorPicker = props => {
373
371
  showSomewhatSemanticTooltips: useSomewhatSemanticTextColorNames,
374
372
  cols: EXPANDED_COLOR_PICKER_COLUMNS,
375
373
  alignX: "right",
376
- placement: "ConfigPanel"
377
- // TODO: Migrate away from gridSize
378
- // Recommendation: Update types of size object to accept string width/height and then replace gridSize with tokens
379
- ,
374
+ placement: "ConfigPanel",
380
375
  size: {
381
- width: 3 * gridSize(),
382
- height: 3 * gridSize()
376
+ width: "var(--ds-space-300, 24px)",
377
+ height: "var(--ds-space-300, 24px)"
383
378
  }
384
379
  }) : jsx(ColorPickerButton, {
385
380
  title: title,
@@ -390,8 +385,8 @@ const ColorPicker = props => {
390
385
  alignX: "right",
391
386
  placement: "ConfigPanel",
392
387
  size: {
393
- width: 3 * gridSize(),
394
- height: 3 * gridSize()
388
+ width: "var(--ds-space-300, 24px)",
389
+ height: "var(--ds-space-300, 24px)"
395
390
  }
396
391
  });
397
392
  };
@@ -152,18 +152,20 @@ function StatelessElementBrowser(props) {
152
152
  /* Only for hitting enter to select item when focused on search bar,
153
153
  * The actual enter key press is handled on individual items level.
154
154
  */
155
+ const selectedItem = items[selectedItemIndex];
155
156
  const onItemsEnterKeyPress = useCallback(e => {
156
157
  if (e.key !== 'Enter') {
157
158
  return;
158
159
  }
159
- props.onInsertItem(items[selectedItemIndex]);
160
- }, [props, items, selectedItemIndex]);
160
+ if (onSelectItem && selectedItem != null) {
161
+ onSelectItem(selectedItem);
162
+ }
163
+ }, [onSelectItem, selectedItem]);
161
164
 
162
165
  /**
163
166
  * On arrow key selection and clicks the selectedItemIndex will change.
164
167
  * Making sure to update parent component.
165
168
  */
166
- const selectedItem = items[selectedItemIndex];
167
169
  useEffect(() => {
168
170
  if (onSelectItem && selectedItem != null) {
169
171
  onSelectItem(selectedItem);
@@ -10,6 +10,9 @@ export const buttonGroupStyle = css`
10
10
  display: flex;
11
11
  }
12
12
  `;
13
+
14
+ // This style is copied to packages/editor/editor-plugin-ai/src/ui/components/AtlassianIntelligenceToolbarButton/styles.tsx
15
+ // If you make change here, change in above file as well.
13
16
  export const separatorStyles = css`
14
17
  background: ${`var(--ds-border, ${N30})`};
15
18
  width: 1px;
@@ -18,6 +21,9 @@ export const separatorStyles = css`
18
21
  margin: 0 8px;
19
22
  user-select: none;
20
23
  `;
24
+
25
+ // This style is copied to packages/editor/editor-plugin-ai/src/ui/components/AtlassianIntelligenceToolbarButton/styles.tsx
26
+ // If you make change here, change in above file as well.
21
27
  export const wrapperStyle = css`
22
28
  display: flex;
23
29
  align-items: center;
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "184.0.0";
2
+ export const version = "185.0.0";
3
3
  export const 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": "184.0.0",
3
+ "version": "185.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -25,7 +25,7 @@ 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, _props$featureFlags45, _props$featureFlags46, _props$featureFlags47;
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, _props$featureFlags45, _props$featureFlags46;
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
31
 
@@ -72,7 +72,6 @@ export function createFeatureFlagsFromProps(props) {
72
72
  useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags43 = props.featureFlags) === null || _props$featureFlags43 === void 0 ? void 0 : _props$featureFlags43.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags44 = props.featureFlags) !== null && _props$featureFlags44 !== void 0 && _props$featureFlags44.useSomewhatSemanticTextColorNames) : false)),
73
73
  lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
74
74
  preventPopupOverflow: Boolean(typeof ((_props$featureFlags45 = props.featureFlags) === null || _props$featureFlags45 === void 0 ? void 0 : _props$featureFlags45['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags46 = props.featureFlags) !== null && _props$featureFlags46 !== void 0 && _props$featureFlags46['prevent-popup-overflow']) : false),
75
- useEditorNext: normalizedFeatureFlags.useEditorNext === true || ((_props$featureFlags47 = props.featureFlags) === null || _props$featureFlags47 === void 0 ? void 0 : _props$featureFlags47.useEditorNext) === true,
76
75
  // duplicated logic from `create-plugins-list.ts` due to presets not being finalised
77
76
  useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
78
77
  });