@atlaskit/editor-core 187.14.12 → 187.15.1

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 (71) hide show
  1. package/CHANGELOG.md +12 -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/plugins/media/toolbar/index.js +59 -4
  5. package/dist/cjs/plugins/media/ui/PixelEntry/index.js +152 -0
  6. package/dist/cjs/plugins/media/ui/PixelEntry/messages.js +40 -0
  7. package/dist/cjs/plugins/media/ui/PixelEntry/styles.js +25 -0
  8. package/dist/cjs/plugins/media/ui/PixelEntry/types.js +5 -0
  9. package/dist/cjs/plugins/type-ahead/index.js +1 -4
  10. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +2 -4
  11. package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +2 -4
  12. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +21 -40
  13. package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
  14. package/dist/cjs/plugins/type-ahead/utils.js +15 -19
  15. package/dist/cjs/version-wrapper.js +1 -1
  16. package/dist/cjs/version.json +1 -1
  17. package/dist/es2019/create-editor/create-plugins-list.js +2 -7
  18. package/dist/es2019/create-editor/feature-flags-from-props.js +23 -28
  19. package/dist/es2019/plugins/media/toolbar/index.js +62 -0
  20. package/dist/es2019/plugins/media/ui/PixelEntry/index.js +133 -0
  21. package/dist/es2019/plugins/media/ui/PixelEntry/messages.js +33 -0
  22. package/dist/es2019/plugins/media/ui/PixelEntry/styles.js +44 -0
  23. package/dist/es2019/plugins/media/ui/PixelEntry/types.js +1 -0
  24. package/dist/es2019/plugins/type-ahead/index.js +1 -4
  25. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -4
  26. package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +2 -4
  27. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +21 -40
  28. package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
  29. package/dist/es2019/plugins/type-ahead/utils.js +15 -19
  30. package/dist/es2019/version-wrapper.js +1 -1
  31. package/dist/es2019/version.json +1 -1
  32. package/dist/esm/create-editor/create-plugins-list.js +2 -7
  33. package/dist/esm/create-editor/feature-flags-from-props.js +23 -28
  34. package/dist/esm/plugins/media/toolbar/index.js +59 -4
  35. package/dist/esm/plugins/media/ui/PixelEntry/index.js +140 -0
  36. package/dist/esm/plugins/media/ui/PixelEntry/messages.js +33 -0
  37. package/dist/esm/plugins/media/ui/PixelEntry/styles.js +11 -0
  38. package/dist/esm/plugins/media/ui/PixelEntry/types.js +1 -0
  39. package/dist/esm/plugins/type-ahead/index.js +1 -4
  40. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -4
  41. package/dist/esm/plugins/type-ahead/pm-plugins/main.js +2 -4
  42. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +21 -40
  43. package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
  44. package/dist/esm/plugins/type-ahead/utils.js +15 -19
  45. package/dist/esm/version-wrapper.js +1 -1
  46. package/dist/esm/version.json +1 -1
  47. package/dist/types/create-editor/create-plugins-list.d.ts +6 -6
  48. package/dist/types/plugins/media/ui/PixelEntry/index.d.ts +4 -0
  49. package/dist/types/plugins/media/ui/PixelEntry/messages.d.ts +32 -0
  50. package/dist/types/plugins/media/ui/PixelEntry/styles.d.ts +7 -0
  51. package/dist/types/plugins/media/ui/PixelEntry/types.d.ts +35 -0
  52. package/dist/types/plugins/type-ahead/index.d.ts +0 -1
  53. package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +1 -2
  54. package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +1 -2
  55. package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +0 -1
  56. package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -1
  57. package/dist/types/plugins/type-ahead/utils.d.ts +1 -2
  58. package/dist/types-ts4.5/create-editor/create-plugins-list.d.ts +6 -6
  59. package/dist/types-ts4.5/plugins/media/ui/PixelEntry/index.d.ts +4 -0
  60. package/dist/types-ts4.5/plugins/media/ui/PixelEntry/messages.d.ts +32 -0
  61. package/dist/types-ts4.5/plugins/media/ui/PixelEntry/styles.d.ts +7 -0
  62. package/dist/types-ts4.5/plugins/media/ui/PixelEntry/types.d.ts +35 -0
  63. package/dist/types-ts4.5/plugins/type-ahead/index.d.ts +0 -1
  64. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/decorations.d.ts +1 -2
  65. package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/main.d.ts +1 -2
  66. package/dist/types-ts4.5/plugins/type-ahead/ui/InputQuery.d.ts +0 -1
  67. package/dist/types-ts4.5/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -1
  68. package/dist/types-ts4.5/plugins/type-ahead/utils.d.ts +1 -2
  69. package/package.json +1 -1
  70. package/report.api.md +1 -2
  71. package/tmp/api-report-tmp.d.ts +1 -2
@@ -29,8 +29,7 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
29
29
  inputMethod = _ref.inputMethod,
30
30
  getDecorationPosition = _ref.getDecorationPosition,
31
31
  reopenQuery = _ref.reopenQuery,
32
- onUndoRedo = _ref.onUndoRedo,
33
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
32
+ onUndoRedo = _ref.onUndoRedo;
34
33
  var _useState = (0, _react.useState)(false),
35
34
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
36
35
  closed = _useState2[0],
@@ -52,17 +51,15 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
52
51
  var selectNextItem = (0, _react.useMemo)(function () {
53
52
  return (0, _utils.moveSelectedIndex)({
54
53
  editorView: editorView,
55
- direction: 'next',
56
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
54
+ direction: 'next'
57
55
  });
58
- }, [editorView, useBetterTypeaheadNavigation]);
56
+ }, [editorView]);
59
57
  var selectPreviousItem = (0, _react.useMemo)(function () {
60
58
  return (0, _utils.moveSelectedIndex)({
61
59
  editorView: editorView,
62
- direction: 'previous',
63
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
60
+ direction: 'previous'
64
61
  });
65
- }, [editorView, useBetterTypeaheadNavigation]);
62
+ }, [editorView]);
66
63
  var cancel = (0, _react.useCallback)(function (_ref2) {
67
64
  var setSelectionAt = _ref2.setSelectionAt,
68
65
  addPrefixTrigger = _ref2.addPrefixTrigger,
@@ -113,7 +110,6 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
113
110
  return null;
114
111
  }
115
112
  return /*#__PURE__*/_react.default.createElement(_InputQuery.InputQuery, {
116
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation,
117
113
  triggerQueryPrefix: triggerHandler.trigger,
118
114
  onQueryChange: setQuery,
119
115
  onItemSelect: insertSelectedItem,
@@ -67,8 +67,7 @@ var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
67
67
  exports.findHandlerByTrigger = findHandlerByTrigger;
68
68
  var moveSelectedIndex = function moveSelectedIndex(_ref2) {
69
69
  var editorView = _ref2.editorView,
70
- direction = _ref2.direction,
71
- useBetterTypeaheadNavigation = _ref2.useBetterTypeaheadNavigation;
70
+ direction = _ref2.direction;
72
71
  return function () {
73
72
  var typeAheadState = getPluginState(editorView.state);
74
73
  if (!typeAheadState) {
@@ -80,23 +79,20 @@ var moveSelectedIndex = function moveSelectedIndex(_ref2) {
80
79
  var nextIndex;
81
80
  if (direction === 'next') {
82
81
  stats.increaseArrowDown();
83
- if (useBetterTypeaheadNavigation) {
84
- /**
85
- * See: https://product-fabric.atlassian.net/browse/ED-17200
86
- * `selectedIndex` is forced to -1 now to not immediately focus the typeahead
87
- * and only do so when there is explicit logic to focus into the typeahead
88
- * options.
89
- *
90
- * This check for "set index to 1 when -1"
91
- * - is a temporary workaround to get back the previous behaviour without
92
- * entirely reverting the a11y improvements
93
- *
94
- */
95
- if (selectedIndex === -1 && items.length > 1) {
96
- nextIndex = 1;
97
- } else {
98
- nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
99
- }
82
+
83
+ /**
84
+ * See: https://product-fabric.atlassian.net/browse/ED-17200
85
+ * `selectedIndex` is forced to -1 now to not immediately focus the typeahead
86
+ * and only do so when there is explicit logic to focus into the typeahead
87
+ * options.
88
+ *
89
+ * This check for "set index to 1 when -1"
90
+ * - is a temporary workaround to get back the previous behaviour without
91
+ * entirely reverting the a11y improvements
92
+ *
93
+ */
94
+ if (selectedIndex === -1 && items.length > 1) {
95
+ nextIndex = 1;
100
96
  } else {
101
97
  nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
102
98
  }
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "187.14.12";
9
+ var version = "187.15.1";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.14.12",
3
+ "version": "187.15.1",
4
4
  "sideEffects": false
5
5
  }
@@ -29,22 +29,17 @@ export function getScrollGutterOptions(props) {
29
29
  return undefined;
30
30
  }
31
31
  export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
32
- var _props$performanceTra, _props$linking, _ref, _props$featureFlags$u, _props$featureFlags, _props$featureFlags2, _props$performanceTra2, _props$textFormatting, _props$linking2;
32
+ var _props$performanceTra, _props$linking, _props$performanceTra2, _props$textFormatting, _props$linking2;
33
33
  const appearance = props.appearance;
34
34
  const isMobile = appearance === 'mobile';
35
35
  const inputTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : _props$performanceTra.inputTracking;
36
36
  const cardOptions = ((_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks) || props.smartLinks || props.UNSAFE_cards;
37
-
38
- // duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
39
- const pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
40
- const useBetterTypeaheadNavigation = Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true);
41
37
  return {
42
38
  ...props,
43
39
  createAnalyticsEvent,
44
40
  typeAhead: {
45
41
  createAnalyticsEvent,
46
- isMobile,
47
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
42
+ isMobile
48
43
  },
49
44
  featureFlags: createFeatureFlagsFromProps(props),
50
45
  paste: {
@@ -21,12 +21,9 @@ function getSpellCheck(featureFlags) {
21
21
  * which is used by both current and archv3 editors.
22
22
  */
23
23
  export function createFeatureFlagsFromProps(props) {
24
- 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;
24
+ 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;
25
25
  const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
26
26
  const tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
27
-
28
- // duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
29
- const 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;
30
27
  return {
31
28
  ...normalizedFeatureFlags,
32
29
  newInsertionBehaviour: props.allowNewInsertionBehaviour,
@@ -38,36 +35,34 @@ export function createFeatureFlagsFromProps(props) {
38
35
  singleLayout: typeof props.allowLayouts === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
39
36
  undoRedoButtons: props.allowUndoRedoButtons,
40
37
  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,
41
- 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),
42
- 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),
43
- 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),
44
- 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,
45
- 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),
38
+ 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),
39
+ 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),
40
+ 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),
41
+ 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,
42
+ 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),
46
43
  extendFloatingToolbar: Boolean(typeof props.allowExtension === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
47
- 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),
48
- 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),
49
- 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),
50
- 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),
51
- 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),
52
- 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),
53
- 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),
54
- 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)),
55
- 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)),
44
+ 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),
45
+ 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),
46
+ 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),
47
+ 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),
48
+ 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),
49
+ 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),
50
+ 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),
51
+ 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)),
52
+ 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)),
56
53
  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),
57
- chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
54
+ chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
58
55
  tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
59
- 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),
60
- 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)),
61
- 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)),
62
- 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,
56
+ 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),
57
+ 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)),
58
+ 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)),
59
+ 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,
63
60
  disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
64
61
  // Including fallback to props.featureFlags so that mobile feature flags
65
62
  // are included (they are not kebab cased)
66
- restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.restartNumberedLists) === true,
67
- 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)),
63
+ restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedLists) === true,
64
+ 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)),
68
65
  lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
69
- 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),
70
- // duplicated logic from `create-plugins-list.ts` due to presets not being finalised
71
- useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
66
+ 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)
72
67
  };
73
68
  }
@@ -24,6 +24,9 @@ import { MediaInlineNodeSelector, MediaSingleNodeSelector } from '../nodeviews/s
24
24
  import ImageBorderItem from '../ui/ImageBorder';
25
25
  import { currentMediaNodeBorderMark } from '../utils/current-media-node';
26
26
  import { shouldShowImageBorder } from './imageBorder';
27
+ import { PixelEntry } from '../ui/PixelEntry';
28
+ import { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, MEDIA_SINGLE_MIN_PIXEL_WIDTH } from '@atlaskit/editor-common/media-single';
29
+ import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
27
30
  const remove = (state, dispatch) => {
28
31
  if (dispatch) {
29
32
  dispatch(removeSelectedNode(state.tr));
@@ -256,6 +259,65 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
256
259
  type: 'separator'
257
260
  });
258
261
  }
262
+
263
+ // Pixel Entry Toolbar Support
264
+ if (getBooleanFF('platform.editor.media.extended-resize-experience') && allowResizing) {
265
+ toolbarButtons.push({
266
+ type: 'custom',
267
+ fallback: [],
268
+ render: editorView => {
269
+ if (!editorView) {
270
+ return null;
271
+ }
272
+ const {
273
+ state,
274
+ dispatch
275
+ } = editorView;
276
+ const selectedMediaSingleNode = getSelectedMediaSingle(state);
277
+ if (!selectedMediaSingleNode) {
278
+ return null;
279
+ }
280
+ const selectedMediaNode = selectedMediaSingleNode.node.content.firstChild;
281
+ if (!selectedMediaNode) {
282
+ return null;
283
+ }
284
+ const {
285
+ width: singleMediaWidth
286
+ } = selectedMediaSingleNode.node.attrs;
287
+ const {
288
+ width: mediaWidth,
289
+ height: mediaHeight
290
+ } = selectedMediaNode.attrs;
291
+ return /*#__PURE__*/React.createElement(PixelEntry, {
292
+ intl: intl,
293
+ width: singleMediaWidth,
294
+ mediaWidth: mediaWidth || DEFAULT_IMAGE_WIDTH,
295
+ mediaHeight: mediaHeight || DEFAULT_IMAGE_HEIGHT,
296
+ validate: value => {
297
+ if (value !== '' && !isNaN(value) && value >= MEDIA_SINGLE_MIN_PIXEL_WIDTH && value <= akEditorFullWidthLayoutWidth) {
298
+ return true;
299
+ }
300
+ return false;
301
+ },
302
+ onSubmit: ({
303
+ width
304
+ }) => {
305
+ const tr = state.tr.setNodeMarkup(selectedMediaSingleNode.pos, undefined, {
306
+ ...selectedMediaSingleNode.node.attrs,
307
+ width,
308
+ widthType: 'pixel'
309
+ });
310
+ dispatch(tr);
311
+ }
312
+ });
313
+ }
314
+ });
315
+ if (!pluginState.isResizing) {
316
+ toolbarButtons.push({
317
+ type: 'separator'
318
+ });
319
+ }
320
+ }
259
321
  if (allowLinking && shouldShowMediaLinkToolbar(state)) {
260
322
  toolbarButtons.push({
261
323
  type: 'custom',
@@ -0,0 +1,133 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /** @jsx jsx */
3
+ import { jsx } from '@emotion/react';
4
+ import { useCallback, useEffect, useMemo, useState } from 'react';
5
+ import Textfield from '@atlaskit/textfield';
6
+ import Tooltip from '@atlaskit/tooltip';
7
+ import Button from '@atlaskit/button';
8
+ import Form, { Field } from '@atlaskit/form';
9
+ import { pixelSizingInput, pixelSizingLabel, pixelSizingWidthInput, pixelSizingHeightInput, pixelSizingWrapper, pixelEntryForm, pixelEntryHiddenSubmit } from './styles';
10
+ import { messages } from './messages';
11
+ export const PixelEntry = ({
12
+ width,
13
+ mediaWidth,
14
+ mediaHeight,
15
+ onSubmit,
16
+ validate,
17
+ intl: {
18
+ formatMessage
19
+ }
20
+ }) => {
21
+ const ratioWidth = useMemo(() => {
22
+ return mediaHeight / mediaWidth;
23
+ }, [mediaHeight, mediaWidth]);
24
+ const ratioHeight = useMemo(() => {
25
+ return mediaWidth / mediaHeight;
26
+ }, [mediaHeight, mediaWidth]);
27
+ const [computedWidth, setComputedWidth] = useState(width);
28
+ const [computedHeight, setComputedHeight] = useState(Math.round(ratioWidth * width));
29
+
30
+ // Handle update to width from outside component
31
+ useEffect(() => {
32
+ setComputedWidth(width);
33
+ setComputedHeight(Math.round(ratioWidth * width));
34
+ }, [width, ratioWidth]);
35
+
36
+ // Handle submit when user presses enter in form
37
+ const handleOnSubmit = data => {
38
+ if (onSubmit) {
39
+ if (data.inputWidth === '') {
40
+ return;
41
+ }
42
+ onSubmit({
43
+ width: data.inputWidth
44
+ });
45
+ }
46
+ };
47
+
48
+ // Syncronous validation returning undefined for valid and string for invalid
49
+ const handleValidateWidth = useCallback(value => {
50
+ if (!value || !validate) {
51
+ return;
52
+ }
53
+ if (validate) {
54
+ return validate(value) === true ? undefined : formatMessage(messages.validationFailedMessage);
55
+ }
56
+ return;
57
+ }, [validate, formatMessage]);
58
+
59
+ // Handle updating computed fields based on
60
+ const handleOnChange = useCallback(type => event => {
61
+ const value = parseInt(event.currentTarget.value);
62
+ const newInputValue = isNaN(value) ? '' : parseInt(event.currentTarget.value);
63
+ switch (type) {
64
+ case 'inputWidth':
65
+ {
66
+ setComputedWidth(newInputValue);
67
+ if (!isNaN(value)) {
68
+ setComputedHeight(Math.round(ratioWidth * value));
69
+ }
70
+ break;
71
+ }
72
+ case 'inputHeight':
73
+ {
74
+ setComputedHeight(newInputValue);
75
+ if (!isNaN(value)) {
76
+ setComputedWidth(Math.round(ratioHeight * value));
77
+ }
78
+ break;
79
+ }
80
+ }
81
+ }, [ratioHeight, ratioWidth]);
82
+ return jsx("div", {
83
+ css: pixelEntryForm
84
+ }, jsx(Form, {
85
+ onSubmit: handleOnSubmit
86
+ }, ({
87
+ formProps
88
+ }) => {
89
+ return jsx("form", formProps, jsx("div", {
90
+ css: pixelSizingWrapper
91
+ }, jsx(Field, {
92
+ key: "inputWidth",
93
+ name: "inputWidth",
94
+ validate: handleValidateWidth,
95
+ defaultValue: computedWidth
96
+ }, ({
97
+ fieldProps
98
+ }) => jsx(Tooltip, {
99
+ hideTooltipOnMouseDown: true,
100
+ content: formatMessage(messages.inputWidthTooltip),
101
+ position: "top"
102
+ }, jsx(Textfield, _extends({}, fieldProps, {
103
+ css: [pixelSizingWidthInput, pixelSizingInput],
104
+ appearance: "none",
105
+ isCompact: true,
106
+ onChange: handleOnChange('inputWidth'),
107
+ pattern: "\\d*",
108
+ "aria-label": formatMessage(messages.inputWidthAriaLabel)
109
+ })))), jsx("span", {
110
+ css: pixelSizingLabel
111
+ }, "x"), jsx(Field, {
112
+ key: "inputHeight",
113
+ name: "inputHeight",
114
+ defaultValue: computedHeight
115
+ }, ({
116
+ fieldProps
117
+ }) => jsx(Tooltip, {
118
+ hideTooltipOnMouseDown: true,
119
+ content: formatMessage(messages.inputHeightTooltip),
120
+ position: "top"
121
+ }, jsx(Textfield, _extends({}, fieldProps, {
122
+ css: [pixelSizingHeightInput, pixelSizingInput],
123
+ appearance: "none",
124
+ isCompact: true,
125
+ onChange: handleOnChange('inputHeight'),
126
+ pattern: "\\d*",
127
+ "aria-label": formatMessage(messages.inputHeightAriaLabel)
128
+ })))), jsx(Button, {
129
+ css: pixelEntryHiddenSubmit,
130
+ type: "submit"
131
+ }, formatMessage(messages.submitButtonText))));
132
+ }));
133
+ };
@@ -0,0 +1,33 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export const messages = defineMessages({
3
+ validationFailedMessage: {
4
+ id: 'fabric.editor.media.pixelEntry.validationFailedMessage',
5
+ defaultMessage: 'Validation for width failed',
6
+ description: 'The passed in validator function returned false'
7
+ },
8
+ inputWidthTooltip: {
9
+ id: 'fabric.editor.media.pixelEntry.inputWidthTooltip',
10
+ defaultMessage: 'Width',
11
+ description: 'The tooltip displayed ontop of the width input'
12
+ },
13
+ inputWidthAriaLabel: {
14
+ id: 'fabric.editor.media.pixelEntry.inputWidthAriaLabel',
15
+ defaultMessage: 'width input',
16
+ description: 'The width input aria label'
17
+ },
18
+ inputHeightTooltip: {
19
+ id: 'fabric.editor.media.pixelEntry.inputHeightTooltip',
20
+ defaultMessage: 'Height',
21
+ description: 'The tooltip displayed ontop of the height input'
22
+ },
23
+ inputHeightAriaLabel: {
24
+ id: 'fabric.editor.media.pixelEntry.inputHeightAriaLabel',
25
+ defaultMessage: 'height input',
26
+ description: 'The width input aria label'
27
+ },
28
+ submitButtonText: {
29
+ id: 'fabric.editor.media.pixelEntry.submitButtonText',
30
+ defaultMessage: 'Submit',
31
+ description: 'The text give to the hidden submit button'
32
+ }
33
+ });
@@ -0,0 +1,44 @@
1
+ import { css } from '@emotion/react';
2
+ const PIXEL_SIZING_WRAPPER_MINIMUM_WIDTH = 120;
3
+ export const pixelSizingWrapper = css`
4
+ display: grid;
5
+ grid-template-columns: 1fr 1em 1fr 0;
6
+ grid-template-rows: auto;
7
+ grid-template-areas: 'widthinput label heightinput submit';
8
+ width: ${PIXEL_SIZING_WRAPPER_MINIMUM_WIDTH}px;
9
+ text-align: center;
10
+ height: ${"var(--ds-space-300, 24px)"};
11
+
12
+ // Atlaskit fieldset does not allow style override
13
+ & > * {
14
+ margin-top: 0 !important;
15
+ }
16
+ `;
17
+ export const pixelEntryForm = css`
18
+ form {
19
+ width: 100%;
20
+ }
21
+ `;
22
+ export const pixelSizingInput = css`
23
+ width: 100%;
24
+ height: ${"var(--ds-space-300, 24px)"};
25
+ & input {
26
+ text-align: center;
27
+ }
28
+ `;
29
+ export const pixelSizingLabel = css`
30
+ grid-area: label;
31
+ line-height: ${"var(--ds-space-300, 24px)"};
32
+ `;
33
+ export const pixelSizingWidthInput = css`
34
+ grid-area: widthinput;
35
+ `;
36
+ export const pixelSizingHeightInput = css`
37
+ grid-area: heightinput;
38
+ `;
39
+ export const pixelEntryHiddenSubmit = css`
40
+ grid-area: submit;
41
+ visibility: hidden;
42
+ width: 0;
43
+ height: 0;
44
+ `;
@@ -0,0 +1 @@
1
+ export {};
@@ -111,8 +111,6 @@ const TypeAheadMenu = /*#__PURE__*/React.memo(({
111
111
  *
112
112
  */
113
113
  const typeAheadPlugin = options => {
114
- var _options$useBetterTyp;
115
- const useBetterTypeaheadNavigation = (_options$useBetterTyp = options === null || options === void 0 ? void 0 : options.useBetterTypeaheadNavigation) !== null && _options$useBetterTyp !== void 0 ? _options$useBetterTyp : true;
116
114
  const fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
117
115
  const popupMountRef = {
118
116
  current: null
@@ -138,8 +136,7 @@ const typeAheadPlugin = options => {
138
136
  popupMountRef,
139
137
  reactDispatch: dispatch,
140
138
  typeAheadHandlers: typeAhead,
141
- createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent,
142
- useBetterTypeaheadNavigation
139
+ createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent
143
140
  })
144
141
  }, {
145
142
  name: 'typeAheadInsertItem',
@@ -15,8 +15,7 @@ import { closeTypeAhead } from '../transforms/close-type-ahead';
15
15
  export const factoryDecorations = ({
16
16
  intl,
17
17
  popupMountRef,
18
- createAnalyticsEvent,
19
- useBetterTypeaheadNavigation
18
+ createAnalyticsEvent
20
19
  }) => {
21
20
  const createDecorations = (tr, {
22
21
  triggerHandler,
@@ -94,8 +93,7 @@ export const factoryDecorations = ({
94
93
  popupsBoundariesElement: (_popupMountRef$curren2 = popupMountRef.current) === null || _popupMountRef$curren2 === void 0 ? void 0 : _popupMountRef$curren2.popupsBoundariesElement,
95
94
  popupsScrollableElement: (_popupMountRef$curren3 = popupMountRef.current) === null || _popupMountRef$curren3 === void 0 ? void 0 : _popupMountRef$curren3.popupsScrollableElement,
96
95
  onUndoRedo: onUndoRedo,
97
- reopenQuery: reopenQuery,
98
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
96
+ reopenQuery: reopenQuery
99
97
  })), typeaheadComponent);
100
98
  shouldFocusCursorInsideQuery = false;
101
99
  return typeaheadComponent;
@@ -23,8 +23,7 @@ export function createPlugin({
23
23
  popupMountRef,
24
24
  createAnalyticsEvent,
25
25
  typeAheadHandlers,
26
- getIntl,
27
- useBetterTypeaheadNavigation
26
+ getIntl
28
27
  }) {
29
28
  const intl = getIntl();
30
29
  const {
@@ -33,8 +32,7 @@ export function createPlugin({
33
32
  } = factoryDecorations({
34
33
  intl,
35
34
  popupMountRef,
36
- createAnalyticsEvent: createAnalyticsEvent,
37
- useBetterTypeaheadNavigation
35
+ createAnalyticsEvent: createAnalyticsEvent
38
36
  });
39
37
  const reducer = createReducer({
40
38
  createDecorations,