@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 187.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3df14c86161`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3df14c86161) - Cleaning up better typeahead feature flag.
8
+
9
+ ## 187.15.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`1a15910366d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1a15910366d) - [ux] New pixel entry component for image resizing floating bar
14
+
3
15
  ## 187.14.12
4
16
 
5
17
  ### Patch Changes
@@ -44,21 +44,16 @@ function getScrollGutterOptions(props) {
44
44
  return undefined;
45
45
  }
46
46
  function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
47
- var _props$performanceTra, _props$linking, _ref, _props$featureFlags$u, _props$featureFlags, _props$featureFlags2, _props$performanceTra2, _props$textFormatting, _props$linking2;
47
+ var _props$performanceTra, _props$linking, _props$performanceTra2, _props$textFormatting, _props$linking2;
48
48
  var appearance = props.appearance;
49
49
  var isMobile = appearance === 'mobile';
50
50
  var inputTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : _props$performanceTra.inputTracking;
51
51
  var cardOptions = ((_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks) || props.smartLinks || props.UNSAFE_cards;
52
-
53
- // duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
54
- var 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;
55
- var useBetterTypeaheadNavigation = Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true);
56
52
  return _objectSpread(_objectSpread({}, props), {}, {
57
53
  createAnalyticsEvent: createAnalyticsEvent,
58
54
  typeAhead: {
59
55
  createAnalyticsEvent: createAnalyticsEvent,
60
- isMobile: isMobile,
61
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
56
+ isMobile: isMobile
62
57
  },
63
58
  featureFlags: (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(props),
64
59
  paste: {
@@ -32,12 +32,9 @@ function getSpellCheck(featureFlags) {
32
32
  * which is used by both current and archv3 editors.
33
33
  */
34
34
  function createFeatureFlagsFromProps(props) {
35
- 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;
35
+ 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;
36
36
  var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
37
37
  var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
38
-
39
- // duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
40
- var pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
41
38
  return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
42
39
  newInsertionBehaviour: props.allowNewInsertionBehaviour,
43
40
  interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
@@ -48,36 +45,34 @@ function createFeatureFlagsFromProps(props) {
48
45
  singleLayout: (0, _typeof2.default)(props.allowLayouts) === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
49
46
  undoRedoButtons: props.allowUndoRedoButtons,
50
47
  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,
51
- 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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
52
- 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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
53
- 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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
54
- 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) : (0, _typeof2.default)(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,
55
- 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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
48
+ 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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
49
+ 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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
50
+ 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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
51
+ 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) : (0, _typeof2.default)(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,
52
+ 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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
56
53
  extendFloatingToolbar: Boolean((0, _typeof2.default)(props.allowExtension) === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
57
- 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),
58
- 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),
59
- 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),
60
- 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),
61
- 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),
62
- 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),
63
- 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),
64
- 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)),
65
- 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)),
54
+ 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),
55
+ 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),
56
+ 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),
57
+ 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),
58
+ 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),
59
+ 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),
60
+ 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),
61
+ 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)),
62
+ 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)),
66
63
  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),
67
- chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
64
+ chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
68
65
  tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
69
- 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),
70
- 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)),
71
- 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)),
72
- 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,
66
+ 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),
67
+ 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)),
68
+ 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)),
69
+ 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,
73
70
  disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
74
71
  // Including fallback to props.featureFlags so that mobile feature flags
75
72
  // are included (they are not kebab cased)
76
- restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.restartNumberedLists) === true,
77
- 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)),
73
+ restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedLists) === true,
74
+ 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)),
78
75
  lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
79
- 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),
80
- // duplicated logic from `create-plugins-list.ts` due to presets not being finalised
81
- useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
76
+ 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)
82
77
  });
83
78
  }
@@ -33,6 +33,9 @@ var _styles = require("../nodeviews/styles");
33
33
  var _ImageBorder = _interopRequireDefault(require("../ui/ImageBorder"));
34
34
  var _currentMediaNode = require("../utils/current-media-node");
35
35
  var _imageBorder = require("./imageBorder");
36
+ var _PixelEntry = require("../ui/PixelEntry");
37
+ var _mediaSingle = require("@atlaskit/editor-common/media-single");
38
+ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
36
39
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
37
40
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
38
41
  var remove = function remove(state, dispatch) {
@@ -255,6 +258,58 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
255
258
  type: 'separator'
256
259
  });
257
260
  }
261
+
262
+ // Pixel Entry Toolbar Support
263
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.extended-resize-experience') && allowResizing) {
264
+ toolbarButtons.push({
265
+ type: 'custom',
266
+ fallback: [],
267
+ render: function render(editorView) {
268
+ if (!editorView) {
269
+ return null;
270
+ }
271
+ var state = editorView.state,
272
+ dispatch = editorView.dispatch;
273
+ var selectedMediaSingleNode = (0, _utils2.getSelectedMediaSingle)(state);
274
+ if (!selectedMediaSingleNode) {
275
+ return null;
276
+ }
277
+ var selectedMediaNode = selectedMediaSingleNode.node.content.firstChild;
278
+ if (!selectedMediaNode) {
279
+ return null;
280
+ }
281
+ var singleMediaWidth = selectedMediaSingleNode.node.attrs.width;
282
+ var _selectedMediaNode$at = selectedMediaNode.attrs,
283
+ mediaWidth = _selectedMediaNode$at.width,
284
+ mediaHeight = _selectedMediaNode$at.height;
285
+ return /*#__PURE__*/_react.default.createElement(_PixelEntry.PixelEntry, {
286
+ intl: intl,
287
+ width: singleMediaWidth,
288
+ mediaWidth: mediaWidth || _mediaSingle.DEFAULT_IMAGE_WIDTH,
289
+ mediaHeight: mediaHeight || _mediaSingle.DEFAULT_IMAGE_HEIGHT,
290
+ validate: function validate(value) {
291
+ if (value !== '' && !isNaN(value) && value >= _mediaSingle.MEDIA_SINGLE_MIN_PIXEL_WIDTH && value <= _editorSharedStyles.akEditorFullWidthLayoutWidth) {
292
+ return true;
293
+ }
294
+ return false;
295
+ },
296
+ onSubmit: function onSubmit(_ref) {
297
+ var width = _ref.width;
298
+ var tr = state.tr.setNodeMarkup(selectedMediaSingleNode.pos, undefined, _objectSpread(_objectSpread({}, selectedMediaSingleNode.node.attrs), {}, {
299
+ width: width,
300
+ widthType: 'pixel'
301
+ }));
302
+ dispatch(tr);
303
+ }
304
+ });
305
+ }
306
+ });
307
+ if (!pluginState.isResizing) {
308
+ toolbarButtons.push({
309
+ type: 'separator'
310
+ });
311
+ }
312
+ }
258
313
  if (allowLinking && (0, _linking.shouldShowMediaLinkToolbar)(state)) {
259
314
  toolbarButtons.push({
260
315
  type: 'custom',
@@ -303,8 +358,8 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
303
358
  type: 'separator'
304
359
  });
305
360
  }
306
- var _ref = (_pluginInjectionApi$d7 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.decorations.actions) !== null && _pluginInjectionApi$d7 !== void 0 ? _pluginInjectionApi$d7 : {},
307
- hoverDecoration = _ref.hoverDecoration;
361
+ var _ref2 = (_pluginInjectionApi$d7 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.decorations.actions) !== null && _pluginInjectionApi$d7 !== void 0 ? _pluginInjectionApi$d7 : {},
362
+ hoverDecoration = _ref2.hoverDecoration;
308
363
  var removeButton = {
309
364
  id: 'editor.media.delete',
310
365
  type: 'button',
@@ -348,8 +403,8 @@ var floatingToolbar = function floatingToolbar(state, intl) {
348
403
  getEditorFeatureFlags = options.getEditorFeatureFlags;
349
404
  var mediaPluginState = _pluginKey.stateKey.getState(state);
350
405
  var mediaLinkingState = (0, _linking2.getMediaLinkingState)(state);
351
- var _ref2 = (_pluginInjectionApi$d8 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.decorations.actions) !== null && _pluginInjectionApi$d8 !== void 0 ? _pluginInjectionApi$d8 : {},
352
- hoverDecoration = _ref2.hoverDecoration;
406
+ var _ref3 = (_pluginInjectionApi$d8 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.decorations.actions) !== null && _pluginInjectionApi$d8 !== void 0 ? _pluginInjectionApi$d8 : {},
407
+ hoverDecoration = _ref3.hoverDecoration;
353
408
  if (!mediaPluginState || mediaPluginState.isResizing) {
354
409
  return;
355
410
  }
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.PixelEntry = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _react = require("@emotion/react");
12
+ var _react2 = require("react");
13
+ var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
14
+ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
15
+ var _button = _interopRequireDefault(require("@atlaskit/button"));
16
+ var _form = _interopRequireWildcard(require("@atlaskit/form"));
17
+ var _styles = require("./styles");
18
+ var _messages = require("./messages");
19
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+ /** @jsx jsx */
22
+
23
+ var PixelEntry = function PixelEntry(_ref) {
24
+ var width = _ref.width,
25
+ mediaWidth = _ref.mediaWidth,
26
+ mediaHeight = _ref.mediaHeight,
27
+ onSubmit = _ref.onSubmit,
28
+ validate = _ref.validate,
29
+ formatMessage = _ref.intl.formatMessage;
30
+ var ratioWidth = (0, _react2.useMemo)(function () {
31
+ return mediaHeight / mediaWidth;
32
+ }, [mediaHeight, mediaWidth]);
33
+ var ratioHeight = (0, _react2.useMemo)(function () {
34
+ return mediaWidth / mediaHeight;
35
+ }, [mediaHeight, mediaWidth]);
36
+ var _useState = (0, _react2.useState)(width),
37
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
38
+ computedWidth = _useState2[0],
39
+ setComputedWidth = _useState2[1];
40
+ var _useState3 = (0, _react2.useState)(Math.round(ratioWidth * width)),
41
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
42
+ computedHeight = _useState4[0],
43
+ setComputedHeight = _useState4[1];
44
+
45
+ // Handle update to width from outside component
46
+ (0, _react2.useEffect)(function () {
47
+ setComputedWidth(width);
48
+ setComputedHeight(Math.round(ratioWidth * width));
49
+ }, [width, ratioWidth]);
50
+
51
+ // Handle submit when user presses enter in form
52
+ var handleOnSubmit = function handleOnSubmit(data) {
53
+ if (onSubmit) {
54
+ if (data.inputWidth === '') {
55
+ return;
56
+ }
57
+ onSubmit({
58
+ width: data.inputWidth
59
+ });
60
+ }
61
+ };
62
+
63
+ // Syncronous validation returning undefined for valid and string for invalid
64
+ var handleValidateWidth = (0, _react2.useCallback)(function (value) {
65
+ if (!value || !validate) {
66
+ return;
67
+ }
68
+ if (validate) {
69
+ return validate(value) === true ? undefined : formatMessage(_messages.messages.validationFailedMessage);
70
+ }
71
+ return;
72
+ }, [validate, formatMessage]);
73
+
74
+ // Handle updating computed fields based on
75
+ var handleOnChange = (0, _react2.useCallback)(function (type) {
76
+ return function (event) {
77
+ var value = parseInt(event.currentTarget.value);
78
+ var newInputValue = isNaN(value) ? '' : parseInt(event.currentTarget.value);
79
+ switch (type) {
80
+ case 'inputWidth':
81
+ {
82
+ setComputedWidth(newInputValue);
83
+ if (!isNaN(value)) {
84
+ setComputedHeight(Math.round(ratioWidth * value));
85
+ }
86
+ break;
87
+ }
88
+ case 'inputHeight':
89
+ {
90
+ setComputedHeight(newInputValue);
91
+ if (!isNaN(value)) {
92
+ setComputedWidth(Math.round(ratioHeight * value));
93
+ }
94
+ break;
95
+ }
96
+ }
97
+ };
98
+ }, [ratioHeight, ratioWidth]);
99
+ return (0, _react.jsx)("div", {
100
+ css: _styles.pixelEntryForm
101
+ }, (0, _react.jsx)(_form.default, {
102
+ onSubmit: handleOnSubmit
103
+ }, function (_ref2) {
104
+ var formProps = _ref2.formProps;
105
+ return (0, _react.jsx)("form", formProps, (0, _react.jsx)("div", {
106
+ css: _styles.pixelSizingWrapper
107
+ }, (0, _react.jsx)(_form.Field, {
108
+ key: "inputWidth",
109
+ name: "inputWidth",
110
+ validate: handleValidateWidth,
111
+ defaultValue: computedWidth
112
+ }, function (_ref3) {
113
+ var fieldProps = _ref3.fieldProps;
114
+ return (0, _react.jsx)(_tooltip.default, {
115
+ hideTooltipOnMouseDown: true,
116
+ content: formatMessage(_messages.messages.inputWidthTooltip),
117
+ position: "top"
118
+ }, (0, _react.jsx)(_textfield.default, (0, _extends2.default)({}, fieldProps, {
119
+ css: [_styles.pixelSizingWidthInput, _styles.pixelSizingInput],
120
+ appearance: "none",
121
+ isCompact: true,
122
+ onChange: handleOnChange('inputWidth'),
123
+ pattern: "\\d*",
124
+ "aria-label": formatMessage(_messages.messages.inputWidthAriaLabel)
125
+ })));
126
+ }), (0, _react.jsx)("span", {
127
+ css: _styles.pixelSizingLabel
128
+ }, "x"), (0, _react.jsx)(_form.Field, {
129
+ key: "inputHeight",
130
+ name: "inputHeight",
131
+ defaultValue: computedHeight
132
+ }, function (_ref4) {
133
+ var fieldProps = _ref4.fieldProps;
134
+ return (0, _react.jsx)(_tooltip.default, {
135
+ hideTooltipOnMouseDown: true,
136
+ content: formatMessage(_messages.messages.inputHeightTooltip),
137
+ position: "top"
138
+ }, (0, _react.jsx)(_textfield.default, (0, _extends2.default)({}, fieldProps, {
139
+ css: [_styles.pixelSizingHeightInput, _styles.pixelSizingInput],
140
+ appearance: "none",
141
+ isCompact: true,
142
+ onChange: handleOnChange('inputHeight'),
143
+ pattern: "\\d*",
144
+ "aria-label": formatMessage(_messages.messages.inputHeightAriaLabel)
145
+ })));
146
+ }), (0, _react.jsx)(_button.default, {
147
+ css: _styles.pixelEntryHiddenSubmit,
148
+ type: "submit"
149
+ }, formatMessage(_messages.messages.submitButtonText))));
150
+ }));
151
+ };
152
+ exports.PixelEntry = PixelEntry;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.messages = void 0;
7
+ var _reactIntlNext = require("react-intl-next");
8
+ var messages = (0, _reactIntlNext.defineMessages)({
9
+ validationFailedMessage: {
10
+ id: 'fabric.editor.media.pixelEntry.validationFailedMessage',
11
+ defaultMessage: 'Validation for width failed',
12
+ description: 'The passed in validator function returned false'
13
+ },
14
+ inputWidthTooltip: {
15
+ id: 'fabric.editor.media.pixelEntry.inputWidthTooltip',
16
+ defaultMessage: 'Width',
17
+ description: 'The tooltip displayed ontop of the width input'
18
+ },
19
+ inputWidthAriaLabel: {
20
+ id: 'fabric.editor.media.pixelEntry.inputWidthAriaLabel',
21
+ defaultMessage: 'width input',
22
+ description: 'The width input aria label'
23
+ },
24
+ inputHeightTooltip: {
25
+ id: 'fabric.editor.media.pixelEntry.inputHeightTooltip',
26
+ defaultMessage: 'Height',
27
+ description: 'The tooltip displayed ontop of the height input'
28
+ },
29
+ inputHeightAriaLabel: {
30
+ id: 'fabric.editor.media.pixelEntry.inputHeightAriaLabel',
31
+ defaultMessage: 'height input',
32
+ description: 'The width input aria label'
33
+ },
34
+ submitButtonText: {
35
+ id: 'fabric.editor.media.pixelEntry.submitButtonText',
36
+ defaultMessage: 'Submit',
37
+ description: 'The text give to the hidden submit button'
38
+ }
39
+ });
40
+ exports.messages = messages;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.pixelSizingWrapper = exports.pixelSizingWidthInput = exports.pixelSizingLabel = exports.pixelSizingInput = exports.pixelSizingHeightInput = exports.pixelEntryHiddenSubmit = exports.pixelEntryForm = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
+ var _react = require("@emotion/react");
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
11
+ var PIXEL_SIZING_WRAPPER_MINIMUM_WIDTH = 120;
12
+ var pixelSizingWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: grid;\n grid-template-columns: 1fr 1em 1fr 0;\n grid-template-rows: auto;\n grid-template-areas: 'widthinput label heightinput submit';\n width: ", "px;\n text-align: center;\n height: ", ";\n\n // Atlaskit fieldset does not allow style override\n & > * {\n margin-top: 0 !important;\n }\n"])), PIXEL_SIZING_WRAPPER_MINIMUM_WIDTH, "var(--ds-space-300, 24px)");
13
+ exports.pixelSizingWrapper = pixelSizingWrapper;
14
+ var pixelEntryForm = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n form {\n width: 100%;\n }\n"])));
15
+ exports.pixelEntryForm = pixelEntryForm;
16
+ var pixelSizingInput = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: ", ";\n & input {\n text-align: center;\n }\n"])), "var(--ds-space-300, 24px)");
17
+ exports.pixelSizingInput = pixelSizingInput;
18
+ var pixelSizingLabel = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n grid-area: label;\n line-height: ", ";\n"])), "var(--ds-space-300, 24px)");
19
+ exports.pixelSizingLabel = pixelSizingLabel;
20
+ var pixelSizingWidthInput = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n grid-area: widthinput;\n"])));
21
+ exports.pixelSizingWidthInput = pixelSizingWidthInput;
22
+ var pixelSizingHeightInput = (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n grid-area: heightinput;\n"])));
23
+ exports.pixelSizingHeightInput = pixelSizingHeightInput;
24
+ var pixelEntryHiddenSubmit = (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n grid-area: submit;\n visibility: hidden;\n width: 0;\n height: 0;\n"])));
25
+ exports.pixelEntryHiddenSubmit = pixelEntryHiddenSubmit;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -127,8 +127,6 @@ var TypeAheadMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
127
127
  *
128
128
  */
129
129
  var typeAheadPlugin = function typeAheadPlugin(options) {
130
- var _options$useBetterTyp;
131
- var useBetterTypeaheadNavigation = (_options$useBetterTyp = options === null || options === void 0 ? void 0 : options.useBetterTypeaheadNavigation) !== null && _options$useBetterTyp !== void 0 ? _options$useBetterTyp : true;
132
130
  var fireAnalyticsCallback = (0, _analytics.fireAnalyticsEvent)(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
133
131
  var popupMountRef = {
134
132
  current: null
@@ -155,8 +153,7 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
155
153
  popupMountRef: popupMountRef,
156
154
  reactDispatch: dispatch,
157
155
  typeAheadHandlers: typeAhead,
158
- createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent,
159
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
156
+ createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent
160
157
  });
161
158
  }
162
159
  }, {
@@ -22,8 +22,7 @@ var _closeTypeAhead = require("../transforms/close-type-ahead");
22
22
  var factoryDecorations = function factoryDecorations(_ref) {
23
23
  var intl = _ref.intl,
24
24
  popupMountRef = _ref.popupMountRef,
25
- createAnalyticsEvent = _ref.createAnalyticsEvent,
26
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
25
+ createAnalyticsEvent = _ref.createAnalyticsEvent;
27
26
  var createDecorations = function createDecorations(tr, _ref2) {
28
27
  var triggerHandler = _ref2.triggerHandler,
29
28
  inputMethod = _ref2.inputMethod,
@@ -95,8 +94,7 @@ var factoryDecorations = function factoryDecorations(_ref) {
95
94
  popupsBoundariesElement: (_popupMountRef$curren2 = popupMountRef.current) === null || _popupMountRef$curren2 === void 0 ? void 0 : _popupMountRef$curren2.popupsBoundariesElement,
96
95
  popupsScrollableElement: (_popupMountRef$curren3 = popupMountRef.current) === null || _popupMountRef$curren3 === void 0 ? void 0 : _popupMountRef$curren3.popupsScrollableElement,
97
96
  onUndoRedo: onUndoRedo,
98
- reopenQuery: reopenQuery,
99
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
97
+ reopenQuery: reopenQuery
100
98
  })), typeaheadComponent);
101
99
  shouldFocusCursorInsideQuery = false;
102
100
  return typeaheadComponent;
@@ -31,14 +31,12 @@ function createPlugin(_ref) {
31
31
  popupMountRef = _ref.popupMountRef,
32
32
  createAnalyticsEvent = _ref.createAnalyticsEvent,
33
33
  typeAheadHandlers = _ref.typeAheadHandlers,
34
- getIntl = _ref.getIntl,
35
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
34
+ getIntl = _ref.getIntl;
36
35
  var intl = getIntl();
37
36
  var _factoryDecorations = (0, _decorations.factoryDecorations)({
38
37
  intl: intl,
39
38
  popupMountRef: popupMountRef,
40
- createAnalyticsEvent: createAnalyticsEvent,
41
- useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
39
+ createAnalyticsEvent: createAnalyticsEvent
42
40
  }),
43
41
  createDecorations = _factoryDecorations.createDecorations,
44
42
  removeDecorations = _factoryDecorations.removeDecorations;
@@ -76,8 +76,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
76
76
  onQueryFocus = _ref.onQueryFocus,
77
77
  onUndoRedo = _ref.onUndoRedo,
78
78
  editorView = _ref.editorView,
79
- items = _ref.items,
80
- useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
79
+ items = _ref.items;
81
80
  var ref = (0, _react.useRef)(document.createElement('span'));
82
81
  var inputRef = (0, _react.useRef)(null);
83
82
  var _useState = (0, _react.useState)(null),
@@ -150,27 +149,6 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
150
149
  // Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
151
150
  if (!event.isComposing && event.which !== 229 && event.keyCode !== 229) {
152
151
  if (selectedIndex === -1) {
153
- if (useBetterTypeaheadNavigation) {
154
- /**
155
- * TODO DTR-1401: (also see ED-17200) There are two options
156
- * here, either
157
- * - set the index directly to 1 in WrapperTypeAhead.tsx's
158
- * `insertSelectedItem` at the cost of breaking some of the a11y
159
- * focus changes,
160
- * - or do this jank at the cost of some small analytics noise.
161
- *
162
- * The focus behaviour still needs cleanup
163
- */
164
- selectPreviousItem();
165
- }
166
- selectNextItem();
167
- }
168
- onItemSelect(event.shiftKey ? _typeAhead.SelectItemMode.SHIFT_ENTER : _typeAhead.SelectItemMode.ENTER);
169
- }
170
- break;
171
- case 'Tab':
172
- if (selectedIndex === -1) {
173
- if (useBetterTypeaheadNavigation) {
174
152
  /**
175
153
  * TODO DTR-1401: (also see ED-17200) There are two options
176
154
  * here, either
@@ -179,33 +157,36 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
179
157
  * focus changes,
180
158
  * - or do this jank at the cost of some small analytics noise.
181
159
  *
160
+ * The focus behaviour still needs cleanup
182
161
  */
183
162
  selectPreviousItem();
163
+ selectNextItem();
184
164
  }
165
+ onItemSelect(event.shiftKey ? _typeAhead.SelectItemMode.SHIFT_ENTER : _typeAhead.SelectItemMode.ENTER);
166
+ }
167
+ break;
168
+ case 'Tab':
169
+ if (selectedIndex === -1) {
170
+ /**
171
+ * TODO DTR-1401: (also see ED-17200) There are two options
172
+ * here, either
173
+ * - set the index directly to 1 in WrapperTypeAhead.tsx's
174
+ * `insertSelectedItem` at the cost of breaking some of the a11y
175
+ * focus changes,
176
+ * - or do this jank at the cost of some small analytics noise.
177
+ *
178
+ */
179
+ selectPreviousItem();
185
180
  selectNextItem();
186
181
  }
187
182
  // TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
188
183
  onItemSelect(_typeAhead.SelectItemMode.TAB);
189
184
  break;
190
185
  case 'ArrowDown':
191
- if (useBetterTypeaheadNavigation) {
192
- selectNextItem();
193
- } else {
194
- // TODO DTR-1401: why were we preventing selection?
195
- if (selectedIndex === -1) {
196
- selectNextItem();
197
- }
198
- }
186
+ selectNextItem();
199
187
  break;
200
188
  case 'ArrowUp':
201
- if (useBetterTypeaheadNavigation) {
202
- selectPreviousItem();
203
- } else {
204
- // TODO DTR-1401: why were we preventing selection?
205
- if (selectedIndex === -1) {
206
- selectPreviousItem();
207
- }
208
- }
189
+ selectPreviousItem();
209
190
  break;
210
191
  }
211
192
  var undoRedoType = isUndoRedoShortcut(event);
@@ -217,7 +198,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
217
198
  event.preventDefault();
218
199
  return false;
219
200
  }
220
- }, [useBetterTypeaheadNavigation, onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
201
+ }, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
221
202
  var onClick = (0, _react.useCallback)(function (event) {
222
203
  var _inputRef$current;
223
204
  event.stopPropagation();