@atlaskit/editor-common 72.5.1 → 72.6.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 (89) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/cjs/node-width/index.js +18 -4
  3. package/dist/cjs/preset/builder.js +180 -0
  4. package/dist/cjs/preset/index.js +19 -0
  5. package/dist/cjs/preset/plugin-injection-api.js +223 -0
  6. package/dist/cjs/styles/shared/media-single.js +1 -1
  7. package/dist/cjs/styles/shared/panel.js +2 -2
  8. package/dist/cjs/styles/shared/table.js +2 -1
  9. package/dist/cjs/styles/shared/tableCell.js +31 -0
  10. package/dist/cjs/ui/DropList/index.js +6 -3
  11. package/dist/cjs/ui-color/ColorPalette/Color/styles.js +1 -1
  12. package/dist/cjs/ui-color/ColorPalette/Palettes/index.js +14 -1
  13. package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +139 -8
  14. package/dist/cjs/ui-color/ColorPalette/index.js +10 -11
  15. package/dist/cjs/ui-color/index.js +13 -0
  16. package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -2
  17. package/dist/cjs/ui-menu/Dropdown/index.js +18 -8
  18. package/dist/cjs/ui-menu/DropdownMenu/index.js +1 -1
  19. package/dist/cjs/utils/breakout.js +12 -4
  20. package/dist/cjs/utils/index.js +12 -7
  21. package/dist/cjs/utils/nodes.js +38 -2
  22. package/dist/cjs/version.json +1 -1
  23. package/dist/es2019/node-width/index.js +18 -4
  24. package/dist/es2019/preset/builder.js +138 -0
  25. package/dist/es2019/preset/index.js +2 -0
  26. package/dist/es2019/preset/plugin-injection-api.js +176 -0
  27. package/dist/es2019/styles/shared/media-single.js +9 -0
  28. package/dist/es2019/styles/shared/panel.js +2 -2
  29. package/dist/es2019/styles/shared/table.js +2 -0
  30. package/dist/es2019/styles/shared/tableCell.js +27 -0
  31. package/dist/es2019/ui/DropList/index.js +6 -3
  32. package/dist/es2019/ui-color/ColorPalette/Color/styles.js +3 -1
  33. package/dist/es2019/ui-color/ColorPalette/Palettes/index.js +2 -1
  34. package/dist/es2019/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +137 -7
  35. package/dist/es2019/ui-color/ColorPalette/index.js +10 -8
  36. package/dist/es2019/ui-color/index.js +1 -0
  37. package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -2
  38. package/dist/es2019/ui-menu/Dropdown/index.js +18 -6
  39. package/dist/es2019/ui-menu/DropdownMenu/index.js +1 -1
  40. package/dist/es2019/utils/breakout.js +13 -5
  41. package/dist/es2019/utils/index.js +1 -2
  42. package/dist/es2019/utils/nodes.js +34 -0
  43. package/dist/es2019/version.json +1 -1
  44. package/dist/esm/node-width/index.js +18 -4
  45. package/dist/esm/preset/builder.js +172 -0
  46. package/dist/esm/preset/index.js +2 -0
  47. package/dist/esm/preset/plugin-injection-api.js +213 -0
  48. package/dist/esm/styles/shared/media-single.js +1 -1
  49. package/dist/esm/styles/shared/panel.js +2 -2
  50. package/dist/esm/styles/shared/table.js +2 -1
  51. package/dist/esm/styles/shared/tableCell.js +24 -0
  52. package/dist/esm/ui/DropList/index.js +6 -3
  53. package/dist/esm/ui-color/ColorPalette/Color/styles.js +1 -1
  54. package/dist/esm/ui-color/ColorPalette/Palettes/index.js +2 -1
  55. package/dist/esm/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +132 -5
  56. package/dist/esm/ui-color/ColorPalette/index.js +10 -11
  57. package/dist/esm/ui-color/index.js +1 -0
  58. package/dist/esm/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -2
  59. package/dist/esm/ui-menu/Dropdown/index.js +18 -8
  60. package/dist/esm/ui-menu/DropdownMenu/index.js +1 -1
  61. package/dist/esm/utils/breakout.js +13 -5
  62. package/dist/esm/utils/index.js +1 -2
  63. package/dist/esm/utils/nodes.js +34 -0
  64. package/dist/esm/version.json +1 -1
  65. package/dist/types/card/cardOptions.d.ts +1 -0
  66. package/dist/types/preset/builder.d.ts +30 -0
  67. package/dist/types/preset/index.d.ts +2 -0
  68. package/dist/types/preset/plugin-injection-api.d.ts +43 -0
  69. package/dist/types/provider-factory/provider-factory.d.ts +1 -1
  70. package/dist/types/styles/shared/tableCell.d.ts +1 -0
  71. package/dist/types/types/feature-flags.d.ts +28 -3
  72. package/dist/types/types/index.d.ts +1 -1
  73. package/dist/types/types/next-editor-plugin.d.ts +56 -28
  74. package/dist/types/ui/DropList/index.d.ts +2 -1
  75. package/dist/types/ui-color/ColorPalette/Palettes/index.d.ts +1 -0
  76. package/dist/types/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.d.ts +648 -2
  77. package/dist/types/ui-color/ColorPalette/Palettes/type.d.ts +4 -0
  78. package/dist/types/ui-color/ColorPalette/index.d.ts +36 -17
  79. package/dist/types/ui-color/index.d.ts +2 -1
  80. package/dist/types/ui-menu/Dropdown/index.d.ts +3 -0
  81. package/dist/types/utils/breakout.d.ts +10 -2
  82. package/dist/types/utils/index.d.ts +1 -2
  83. package/dist/types/utils/nodes.d.ts +15 -1
  84. package/package.json +13 -12
  85. package/preset/package.json +15 -0
  86. package/dist/cjs/utils/builder.js +0 -34
  87. package/dist/es2019/utils/builder.js +0 -14
  88. package/dist/esm/utils/builder.js +0 -26
  89. package/dist/types/utils/builder.d.ts +0 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 72.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b737494c727`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b737494c727) - Update optional feature flag type
8
+
9
+ ## 72.6.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`a697f9eb7ca`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a697f9eb7ca) - [ED-16746] Introduce the shareable actions concept into the NextEditorPlugin
14
+ - [`a7e36157e01`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a7e36157e01) - [ED-15941] Refactor Preset into EditorPresetBuilder
15
+ - [`66bbcd766fe`](https://bitbucket.org/atlassian/atlassian-frontend/commits/66bbcd766fe) - [ED-16735] Inject its own api on NextEditorPlugin
16
+ - [`0078ddc7e2e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0078ddc7e2e) - New smartLinks prop to allow renderer and editor to determine whether smart link should show actions that can change the link resource.
17
+ - [`568b7d96689`](https://bitbucket.org/atlassian/atlassian-frontend/commits/568b7d96689) - [ED-16819] Introduce 'isMediaNode' and 'isNodeBeforeMediaNode' utils that check if the node passed in (for isMediaNode) or the node before selection passed in (for isNodeBeforeMediaNode) has the type of media, mediaInline, mediaGroup or mediaSingle
18
+ - [`592e3761622`](https://bitbucket.org/atlassian/atlassian-frontend/commits/592e3761622) - [ED-15941] NextEditorPlugins will receive an api with the plugins dependencies on runtime
19
+
20
+ ### Patch Changes
21
+
22
+ - [`f81e7ba7c07`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f81e7ba7c07) - [ux] ED-16556 Fixed - Table floating toolbar "Table Options" and "Cell Options" are not accessible
23
+ - [`2367ba14aa0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2367ba14aa0) - [ux] ED-16758 Added support for theme tokens in table cell background color.
24
+ - [`49d121d9640`](https://bitbucket.org/atlassian/atlassian-frontend/commits/49d121d9640) - [ED-16310] Creates an optional dependency type `OptionalPlugin` to indicate `NextEditorPlugin` dependencies are optional.
25
+
26
+ You can use in the dependency array of a `NextEditorPlugin` like so:
27
+
28
+ ```ts
29
+ const examplePlugin = NextEditorPlugin<
30
+ 'example',
31
+ { dependencies: [typeof plugin1, OptionalPlugin<typeof plugin2>] }
32
+ >;
33
+ ```
34
+
35
+ - [`f7fc96b3738`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f7fc96b3738) - ED-17086 - Added feature flag for expandedChartColors
36
+ - [`0379951cd05`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0379951cd05) - [ED-17210] Improve equality check for SharedStateAPI onChange behaviour
37
+ - [`eb7ef06e38c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eb7ef06e38c) - Contextual toolbar focus will now be regained when exiting via ArrowLeft / ArrowRight keys, and will progress to the next toolbar item. onBlur will now also be called correctly when dropdown menu items lose focus.
38
+ - [`2661a586431`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2661a586431) - ED-15843 Applied fix for bodiedExtensions animation as per DTR-807
39
+ - [`747f7e45c27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/747f7e45c27) - [ux] ED-16816 Safari fix: add focus outline when focus is on color palatte options
40
+ - [`db34131a1e4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/db34131a1e4) - [ED-16579] Add methods to Preset object including `setProvider`, `getProvider` and `getAllProviders`.
41
+
42
+ These are used internally to set providers (objects which can return functionality such as `emojiProvider`).
43
+
44
+ - [`68f4ce6955d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/68f4ce6955d) - Fix logic to reconfigure state in ReactEditorView to fix a breakage on NCS pages.
45
+ - [`deef98920f4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/deef98920f4) - [ux] ED-16718 Table scroll troll - refactor nested expand logic back into editor-common
46
+ - [`1720ddc8076`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1720ddc8076) - [ux] ED-16725 Added support for semantic tooltip names for background color palette.
47
+ - [`3eea6eec479`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3eea6eec479) - [ux] ED-16930 Horizontally rendering multiple wrapped-left media items inside a table
48
+ - Updated dependencies
49
+
3
50
  ## 72.5.1
4
51
 
5
52
  ### Patch Changes
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getParentNodeWidth = void 0;
7
7
  var _prosemirrorUtils = require("prosemirror-utils");
8
8
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
9
+ var _constants = require("@atlaskit/theme/constants");
9
10
  var _extension = require("../styles/shared/extension");
10
11
  var _layout = require("../styles/shared/layout");
11
12
  var _breakout = require("../utils/breakout");
@@ -44,10 +45,23 @@ var getParentNodeWidth = function getParentNodeWidth(pos, state, containerWidth,
44
45
  }
45
46
 
46
47
  // account for the padding of the parent node
47
- if (node.type === schema.nodes.layoutSection) {
48
- parentWidth -= _layout.LAYOUT_COLUMN_PADDING * 2;
49
- } else if (node.type === schema.nodes.bodiedExtension) {
50
- parentWidth -= _extension.BODIED_EXT_PADDING * 2;
48
+ switch (node.type) {
49
+ case schema.nodes.layoutSection:
50
+ parentWidth -= _layout.LAYOUT_COLUMN_PADDING * 2;
51
+ break;
52
+ case schema.nodes.bodiedExtension:
53
+ parentWidth -= _extension.BODIED_EXT_PADDING * 2;
54
+ break;
55
+ case schema.nodes.expand:
56
+ // padding
57
+ parentWidth -= (0, _constants.gridSize)() * 2;
58
+ // gutter offset
59
+ parentWidth += (0, _constants.gridSize)() * 1.5 * 2;
60
+ // padding right
61
+ parentWidth -= (0, _constants.gridSize)();
62
+ // padding left
63
+ parentWidth -= (0, _constants.gridSize)() * 4 - (0, _constants.gridSize)() / 2;
64
+ break;
51
65
  }
52
66
  parentWidth -= 2; // border
53
67
 
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.EditorPresetBuilder = void 0;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ var _construct2 = _interopRequireDefault(require("@babel/runtime/helpers/construct"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
+ var EditorPresetBuilder = /*#__PURE__*/function () {
15
+ function EditorPresetBuilder() {
16
+ (0, _classCallCheck2.default)(this, EditorPresetBuilder);
17
+ (0, _defineProperty2.default)(this, "safeEntry", function (plugin) {
18
+ return Array.isArray(plugin) ? plugin : [plugin, undefined];
19
+ });
20
+ for (var _len = arguments.length, more = new Array(_len), _key = 0; _key < _len; _key++) {
21
+ more[_key] = arguments[_key];
22
+ }
23
+ this.data = [].concat(more) || [];
24
+ }
25
+ (0, _createClass2.default)(EditorPresetBuilder, [{
26
+ key: "add",
27
+ value: function add(nextOrTuple) {
28
+ return (0, _construct2.default)(EditorPresetBuilder, [
29
+ /**
30
+ * re-cast this to NewPlugin as we've done all the type
31
+ * safety, dependency checking, narrowing, during
32
+ * `SafePresetCheck & VerifyPluginDependencies`
33
+ */
34
+ nextOrTuple].concat((0, _toConsumableArray2.default)(this.data)));
35
+ }
36
+
37
+ //hasPlugin<Plugin extends NextEditorPlugin<any, any>>(
38
+ // pluginToAdd: Plugin,
39
+ //): this is TryCastEditorPresetBuilderByCheckingPlugins<this, Plugin> {
40
+ // const hasPluginQueryExists = this.data.find((pluginEntry) => {
41
+ // const pluginFunction: NextEditorPlugin<any, any> = !Array.isArray(
42
+ // pluginEntry,
43
+ // )
44
+ // ? pluginEntry
45
+ // : pluginEntry[0];
46
+
47
+ // return pluginFunction === pluginToAdd;
48
+ // });
49
+
50
+ // return Boolean(hasPluginQueryExists);
51
+ //}
52
+ }, {
53
+ key: "maybeAdd",
54
+ value: function maybeAdd(pluginToAdd, add) {
55
+ return add(pluginToAdd,
56
+ // @ts-ignore
57
+ this);
58
+ }
59
+ }, {
60
+ key: "has",
61
+ value: function has(plugin) {
62
+ return this.data.some(function (pluginPreset) {
63
+ if (Array.isArray(pluginPreset)) {
64
+ return pluginPreset[0] === plugin;
65
+ }
66
+ return pluginPreset === plugin;
67
+ });
68
+ }
69
+ }, {
70
+ key: "build",
71
+ value: function build() {
72
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
73
+ pluginInjectionAPI = _ref.pluginInjectionAPI,
74
+ maybeExcludePlugins = _ref.excludePlugins;
75
+ var excludePlugins = new Set(maybeExcludePlugins ? maybeExcludePlugins : []);
76
+ var editorPlugins = this.processEditorPlugins({
77
+ pluginInjectionAPI: pluginInjectionAPI,
78
+ excludePlugins: excludePlugins
79
+ });
80
+ return this.removeExcludedPlugins(editorPlugins, excludePlugins);
81
+ }
82
+ }, {
83
+ key: "verifyDuplicatedPlugins",
84
+ value: function verifyDuplicatedPlugins() {
85
+ var cache = new Set();
86
+ this.data.forEach(function (pluginEntry) {
87
+ var _ref2 = Array.isArray(pluginEntry) ? pluginEntry : [pluginEntry, undefined],
88
+ _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
89
+ pluginFn = _ref3[0],
90
+ _ = _ref3[1];
91
+ if (cache.has(pluginFn)) {
92
+ throw new Error("".concat(pluginFn, " is already included!"));
93
+ }
94
+ cache.add(pluginFn);
95
+ });
96
+ return true;
97
+ }
98
+ }, {
99
+ key: "processEditorPlugins",
100
+ value: function processEditorPlugins(_ref4) {
101
+ var _this = this;
102
+ var pluginInjectionAPI = _ref4.pluginInjectionAPI,
103
+ excludePlugins = _ref4.excludePlugins;
104
+ this.verifyDuplicatedPlugins();
105
+ var seen = new Set();
106
+ var plugins = this.data.reverse().map(function (entry) {
107
+ var _this$safeEntry = _this.safeEntry(entry),
108
+ _this$safeEntry2 = (0, _slicedToArray2.default)(_this$safeEntry, 2),
109
+ fn = _this$safeEntry2[0],
110
+ config = _this$safeEntry2[1];
111
+ if (seen.has(fn)) {
112
+ return null;
113
+ }
114
+ seen.add(fn);
115
+ if (typeof fn !== 'function') {
116
+ return null;
117
+ }
118
+ var plugin = pluginInjectionAPI ? fn(config, pluginInjectionAPI.api()) : fn(config);
119
+ if (plugin && excludePlugins !== null && excludePlugins !== void 0 && excludePlugins.has(plugin.name)) {
120
+ return null;
121
+ }
122
+ if (!pluginInjectionAPI) {
123
+ return plugin;
124
+ }
125
+ pluginInjectionAPI.onEditorPluginInitialized(plugin);
126
+ return plugin;
127
+ }).filter(Boolean);
128
+ return plugins;
129
+ }
130
+ }, {
131
+ key: "removeExcludedPlugins",
132
+ value: function removeExcludedPlugins(plugins, excludes) {
133
+ if (excludes) {
134
+ return plugins.filter(function (plugin) {
135
+ return !plugin || !excludes.has(plugin.name);
136
+ });
137
+ }
138
+ return plugins;
139
+ }
140
+
141
+ // TODO: ED-17023 - Bring back type safety to the EditorPresetBuilder.add preset
142
+ //import type {
143
+ // ExtractPluginDependencies,
144
+ //} from '../types/next-editor-plugin';
145
+ //type TryCastEditorPresetBuilderByCheckingDependencies<MaybeEditorPresetBuilder, Plugin> =
146
+ // MaybeEditorPresetBuilder extends EditorPresetBuilder<any, infer StackPlugins>
147
+ // ? Plugin extends NextEditorPlugin<any, any>
148
+ // ? ExtractPluginDependencies<Plugin>[number] extends StackPlugins[number]
149
+ // ? MaybeEditorPresetBuilder
150
+ // : never
151
+ // : never
152
+ // : never;
153
+ // Because how our plugins are added in the preset, we can't use the type safe system
154
+ // in the EditorPresetBuilder.
155
+ // TODO: ED-17023 - Bring back type safety to the EditorPresetBuilder.add preset
156
+ //maybeAdd<
157
+ // MaybePlugin extends NextEditorPlugin<any, any>,
158
+ // MaybePluginNames extends string[],
159
+ // MaybeStackPlugins extends AllEditorPresetPluginTypes[],
160
+ // MaybeEditorPresetBuilder extends EditorPresetBuilder<
161
+ // MaybePluginNames,
162
+ // MaybeStackPlugins
163
+ // >,
164
+ //>(
165
+ // pluginToAdd: MaybePlugin,
166
+ // add: (
167
+ // pluginToAdd: MaybePlugin,
168
+ // maybeEditorPresetBuilder: TryCastEditorPresetBuilderByCheckingDependencies<this, MaybePlugin>,
169
+ // ) => MaybeEditorPresetBuilder,
170
+ //): MaybeEditorPresetBuilder | this {
171
+ // return add(
172
+ // pluginToAdd,
173
+ // // @ts-ignore
174
+ // this as any,
175
+ // );
176
+ //}
177
+ }]);
178
+ return EditorPresetBuilder;
179
+ }();
180
+ exports.EditorPresetBuilder = EditorPresetBuilder;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "EditorPluginInjectionAPI", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _pluginInjectionApi.EditorPluginInjectionAPI;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "EditorPresetBuilder", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _builder.EditorPresetBuilder;
16
+ }
17
+ });
18
+ var _builder = require("./builder");
19
+ var _pluginInjectionApi = require("./plugin-injection-api");
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.SharedStateAPI = exports.PluginsData = exports.EditorPluginInjectionAPI = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
12
+ var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
13
+ var _throttle = _interopRequireDefault(require("lodash/throttle"));
14
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
15
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
16
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
+ function hasGetSharedState(plugin) {
18
+ return typeof plugin.getSharedState === 'function';
19
+ }
20
+ function hasActions(plugin) {
21
+ return (0, _typeof2.default)(plugin.actions) === 'object';
22
+ }
23
+ var DREAM_TARGET_60_FPS = 16;
24
+ /*
25
+ *
26
+ * After some investigations, we discovered this is the best ratio for our current Editor: 80ms. That means is five times bigger than the 60fps dream target.
27
+ *
28
+ * In the future, once we remove the entire WithPluginState, We may decide to reduce this value.
29
+ *
30
+ */
31
+ var THROTTLE_CALLS_FOR_MILLISECONDS = DREAM_TARGET_60_FPS * 5;
32
+ var notifyListenersThrottled = (0, _throttle.default)(function (_ref) {
33
+ var newEditorState = _ref.newEditorState,
34
+ oldEditorState = _ref.oldEditorState,
35
+ listeners = _ref.listeners,
36
+ plugins = _ref.plugins;
37
+ var isInitialization = !oldEditorState && newEditorState;
38
+ var callbacks = [];
39
+ var _iterator = _createForOfIteratorHelper(listeners.keys()),
40
+ _step;
41
+ try {
42
+ var _loop = function _loop() {
43
+ var pluginName = _step.value;
44
+ var plugin = plugins.get(pluginName);
45
+ if (!plugin || !hasGetSharedState(plugin)) {
46
+ return "continue";
47
+ }
48
+ var nextSharedState = plugin.getSharedState(newEditorState);
49
+ var prevSharedState = !isInitialization && oldEditorState ? plugin.getSharedState(oldEditorState) : undefined;
50
+ var isSamePluginState = (0, _isEqual.default)(prevSharedState, nextSharedState);
51
+ if (isInitialization || !isSamePluginState) {
52
+ (listeners.get(pluginName) || new Set()).forEach(function (callback) {
53
+ callbacks.push(callback.bind(callback, {
54
+ nextSharedState: nextSharedState,
55
+ prevSharedState: prevSharedState
56
+ }));
57
+ });
58
+ }
59
+ };
60
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
61
+ var _ret = _loop();
62
+ if (_ret === "continue") continue;
63
+ }
64
+ } catch (err) {
65
+ _iterator.e(err);
66
+ } finally {
67
+ _iterator.f();
68
+ }
69
+ if (callbacks.length === 0) {
70
+ return;
71
+ }
72
+ callbacks.forEach(function (cb) {
73
+ cb();
74
+ });
75
+ }, THROTTLE_CALLS_FOR_MILLISECONDS);
76
+ var PluginsData = /*#__PURE__*/(0, _createClass2.default)(function PluginsData() {
77
+ (0, _classCallCheck2.default)(this, PluginsData);
78
+ });
79
+ exports.PluginsData = PluginsData;
80
+ var ActionsAPI = /*#__PURE__*/function () {
81
+ function ActionsAPI() {
82
+ (0, _classCallCheck2.default)(this, ActionsAPI);
83
+ }
84
+ (0, _createClass2.default)(ActionsAPI, [{
85
+ key: "createAPI",
86
+ value: function createAPI(plugin) {
87
+ if (!plugin || !hasActions(plugin)) {
88
+ return {};
89
+ }
90
+ return new Proxy(plugin.actions || {}, {
91
+ get: function get(target, prop, receiver) {
92
+ // We will be able to track perfomance here
93
+ return Reflect.get(target, prop);
94
+ }
95
+ });
96
+ }
97
+ }]);
98
+ return ActionsAPI;
99
+ }();
100
+ var SharedStateAPI = /*#__PURE__*/function () {
101
+ function SharedStateAPI(_ref2) {
102
+ var getEditorState = _ref2.getEditorState;
103
+ (0, _classCallCheck2.default)(this, SharedStateAPI);
104
+ this.getEditorState = getEditorState;
105
+ this.listeners = new Map();
106
+ }
107
+ (0, _createClass2.default)(SharedStateAPI, [{
108
+ key: "createAPI",
109
+ value: function createAPI(plugin) {
110
+ var _this = this;
111
+ if (!plugin) {
112
+ return {
113
+ currentState: function currentState() {
114
+ return undefined;
115
+ },
116
+ onChange: function onChange(sub) {
117
+ return function () {};
118
+ }
119
+ };
120
+ }
121
+ var pluginName = plugin.name;
122
+ return {
123
+ currentState: function currentState() {
124
+ var state = _this.getEditorState();
125
+ if (!state || !hasGetSharedState(plugin)) {
126
+ return undefined;
127
+ }
128
+ return plugin.getSharedState(state);
129
+ },
130
+ onChange: function onChange(sub) {
131
+ var pluginListeners = _this.listeners.get(pluginName) || new Set();
132
+ pluginListeners.add(sub);
133
+ _this.listeners.set(pluginName, pluginListeners);
134
+ return function () {
135
+ (_this.listeners.get(pluginName) || new Set()).delete(sub);
136
+ };
137
+ }
138
+ };
139
+ }
140
+ }, {
141
+ key: "notifyListeners",
142
+ value: function notifyListeners(_ref3) {
143
+ var newEditorState = _ref3.newEditorState,
144
+ oldEditorState = _ref3.oldEditorState,
145
+ plugins = _ref3.plugins;
146
+ var listeners = this.listeners;
147
+ notifyListenersThrottled({
148
+ newEditorState: newEditorState,
149
+ oldEditorState: oldEditorState,
150
+ listeners: listeners,
151
+ plugins: plugins
152
+ });
153
+ }
154
+ }, {
155
+ key: "destroy",
156
+ value: function destroy() {
157
+ this.listeners.clear();
158
+ }
159
+ }]);
160
+ return SharedStateAPI;
161
+ }();
162
+ exports.SharedStateAPI = SharedStateAPI;
163
+ var EditorPluginInjectionAPI = /*#__PURE__*/function () {
164
+ function EditorPluginInjectionAPI(_ref4) {
165
+ var _this2 = this;
166
+ var getEditorState = _ref4.getEditorState;
167
+ (0, _classCallCheck2.default)(this, EditorPluginInjectionAPI);
168
+ (0, _defineProperty2.default)(this, "onEditorViewUpdated", function (_ref5) {
169
+ var newEditorState = _ref5.newEditorState,
170
+ oldEditorState = _ref5.oldEditorState;
171
+ _this2.sharedStateAPI.notifyListeners({
172
+ newEditorState: newEditorState,
173
+ oldEditorState: oldEditorState,
174
+ plugins: _this2.plugins
175
+ });
176
+ });
177
+ (0, _defineProperty2.default)(this, "onEditorPluginInitialized", function (plugin) {
178
+ _this2.addPlugin(plugin);
179
+ });
180
+ (0, _defineProperty2.default)(this, "addPlugin", function (plugin) {
181
+ _this2.plugins.set(plugin.name, plugin);
182
+ });
183
+ (0, _defineProperty2.default)(this, "getPluginByName", function (pluginName) {
184
+ var plugin = _this2.plugins.get(pluginName);
185
+ return plugin;
186
+ });
187
+ this.sharedStateAPI = new SharedStateAPI({
188
+ getEditorState: getEditorState
189
+ });
190
+ this.plugins = new Map();
191
+ this.actionsAPI = new ActionsAPI();
192
+ }
193
+ (0, _createClass2.default)(EditorPluginInjectionAPI, [{
194
+ key: "api",
195
+ value: function api() {
196
+ var sharedStateAPI = this.sharedStateAPI,
197
+ actionsAPI = this.actionsAPI,
198
+ getPluginByName = this.getPluginByName;
199
+ var externalPlugins = new Proxy({}, {
200
+ get: function get(target, prop, receiver) {
201
+ var plugin = getPluginByName(prop);
202
+ if (!plugin) {
203
+ // eslint-disable-next-line
204
+ console.error("Plugin: ".concat(prop, " does not exist"));
205
+ return undefined;
206
+ }
207
+ var sharedState = sharedStateAPI.createAPI(plugin);
208
+ var actions = actionsAPI.createAPI(plugin);
209
+ var proxyCoreAPI = {
210
+ sharedState: sharedState,
211
+ actions: actions
212
+ };
213
+ return proxyCoreAPI;
214
+ }
215
+ });
216
+ return {
217
+ externalPlugins: externalPlugins
218
+ };
219
+ }
220
+ }]);
221
+ return EditorPluginInjectionAPI;
222
+ }();
223
+ exports.EditorPluginInjectionAPI = EditorPluginInjectionAPI;
@@ -11,5 +11,5 @@ var _templateObject;
11
11
  var richMediaClassName = 'rich-media-item';
12
12
  exports.richMediaClassName = richMediaClassName;
13
13
  var wrappedMediaBreakoutPoint = 410;
14
- var mediaSingleSharedStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n li .", " {\n margin: 0;\n }\n\n /* Hack for chrome to fix media single position\n inside a list when media is the first child */\n &.ua-chrome li > .mediaSingleView-content-wrap::before {\n content: '';\n display: block;\n height: 0;\n }\n\n &.ua-firefox {\n .mediaSingleView-content-wrap {\n user-select: none;\n }\n\n .captionView-content-wrap {\n user-select: text;\n }\n }\n\n .mediaSingleView-content-wrap[layout='center'] {\n clear: both;\n }\n\n table .", " {\n margin-top: 12px;\n margin-bottom: 12px;\n clear: both;\n }\n\n .", ".image-wrap-right\n + .", ".image-wrap-left {\n clear: both;\n }\n\n .", ".image-wrap-left\n + .", ".image-wrap-right,\n .", ".image-wrap-right\n + .", ".image-wrap-left,\n .", ".image-wrap-left\n + .", ".image-wrap-left,\n .", ".image-wrap-right\n + .", ".image-wrap-right {\n margin-right: 0;\n margin-left: 0;\n }\n\n @media all and (max-width: ", "px) {\n div.mediaSingleView-content-wrap[layout='wrap-left'],\n div.mediaSingleView-content-wrap[data-layout='wrap-left'],\n div.mediaSingleView-content-wrap[layout='wrap-right'],\n div.mediaSingleView-content-wrap[data-layout='wrap-right'] {\n float: none;\n overflow: auto;\n margin: 12px 0;\n }\n }\n"])), richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, wrappedMediaBreakoutPoint);
14
+ var mediaSingleSharedStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n li .", " {\n margin: 0;\n }\n\n /* Hack for chrome to fix media single position\n inside a list when media is the first child */\n &.ua-chrome li > .mediaSingleView-content-wrap::before {\n content: '';\n display: block;\n height: 0;\n }\n\n &.ua-firefox {\n .mediaSingleView-content-wrap {\n user-select: none;\n }\n\n .captionView-content-wrap {\n user-select: text;\n }\n }\n\n .mediaSingleView-content-wrap[layout='center'] {\n clear: both;\n }\n\n table .", " {\n margin-top: 12px;\n margin-bottom: 12px;\n clear: both;\n\n &.image-wrap-left,\n &.image-wrap-right {\n clear: none;\n\n &:first-child {\n margin-top: 12px;\n }\n }\n }\n\n .", ".image-wrap-right\n + .", ".image-wrap-left {\n clear: both;\n }\n\n .", ".image-wrap-left\n + .", ".image-wrap-right,\n .", ".image-wrap-right\n + .", ".image-wrap-left,\n .", ".image-wrap-left\n + .", ".image-wrap-left,\n .", ".image-wrap-right\n + .", ".image-wrap-right {\n margin-right: 0;\n margin-left: 0;\n }\n\n @media all and (max-width: ", "px) {\n div.mediaSingleView-content-wrap[layout='wrap-left'],\n div.mediaSingleView-content-wrap[data-layout='wrap-left'],\n div.mediaSingleView-content-wrap[layout='wrap-right'],\n div.mediaSingleView-content-wrap[data-layout='wrap-right'] {\n float: none;\n overflow: auto;\n margin: 12px 0;\n }\n }\n"])), richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, wrappedMediaBreakoutPoint);
15
15
  exports.mediaSingleSharedStyle = mediaSingleSharedStyle;
@@ -167,11 +167,11 @@ var PanelSharedSelectors = {
167
167
  removeEmojiIcon: "[aria-label=\"Remove emoji\"]",
168
168
  emojiIcon: "[aria-label=\"editor-add-emoji\"]",
169
169
  selectedEmoji: "[aria-label=\":grinning:\"]",
170
- addYourOwnEmoji: "[aria-label=\"Add your own emoji\"]",
170
+ addYourOwnEmoji: "#add-custom-emoji",
171
171
  emojiNameInCustomEmoji: "[aria-label=\"Enter a name for the new emoji\"]",
172
172
  title: "#editor-title",
173
173
  emojiPopup: "[aria-label=\"Popup\"]",
174
- searchEmoji: "[aria-label=\"Search emoji\"]",
174
+ searchEmoji: "[aria-label=\"Emoji name\"]",
175
175
  orangeWarningIcon: "[aria-label=\":warning:\"]",
176
176
  yellowWarningIcon: "[aria-label=\":warning:\"] span:nth-child(1)",
177
177
  copyButton: "button[aria-label=\"Copy\"]"
@@ -14,6 +14,7 @@ var _components = require("@atlaskit/theme/components");
14
14
  var _constants = require("@atlaskit/theme/constants");
15
15
  var _browser = _interopRequireDefault(require("../../utils/browser"));
16
16
  var _codeBlock = require("./code-block");
17
+ var _tableCell = require("./tableCell");
17
18
  var _templateObject;
18
19
  var tableMarginTop = 24;
19
20
  exports.tableMarginTop = tableMarginTop;
@@ -50,7 +51,7 @@ var TableSharedCssClassName = {
50
51
  };
51
52
  exports.TableSharedCssClassName = TableSharedCssClassName;
52
53
  var tableSharedStyle = function tableSharedStyle(props) {
53
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-of-type > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n .", " > table {\n margin: ", "px 0 0 0;\n }\n\n .", " > table,\n .", " > table {\n margin: ", "px ", "px 0 0;\n }\n\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: ", ";\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > :first-child:not(style),\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]):not(.danger) {\n .", ":not(.danger) {\n background-color: ", ";\n\n :not(.", ") {\n box-shadow: 0px 0px 0px 1px\n ", ";\n }\n\n .", " {\n background-image: ", ";\n\n background-color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableMarginTop, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, (0, _components.themed)({
54
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-of-type > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n .", " > table {\n margin: ", "px 0 0 0;\n }\n\n .", " > table,\n .", " > table {\n margin: ", "px ", "px 0 0;\n }\n\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: ", ";\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > :first-child:not(style),\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]):not(.danger) {\n .", ":not(.danger) {\n background-color: ", ";\n\n :not(.", ") {\n box-shadow: 0px 0px 0px 1px\n ", ";\n }\n\n .", " {\n background-image: ", ";\n\n background-color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), (0, _tableCell.tableCellBackgroundStyleOverride)(), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableMarginTop, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, (0, _components.themed)({
54
55
  light: "var(--ds-border, ".concat(_editorSharedStyles.akEditorTableBorder, ")"),
55
56
  dark: "var(--ds-border, ".concat(_editorSharedStyles.akEditorTableBorderDark, ")")
56
57
  })(props), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, (0, _components.themed)({
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.tableCellBackgroundStyleOverride = void 0;
8
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
+ var _react = require("@emotion/react");
10
+ var _adfSchema = require("@atlaskit/adf-schema");
11
+ var _editorPalette = require("@atlaskit/editor-palette");
12
+ var _templateObject;
13
+ // This is used in order to support usage of DS tokens. Table cell background-color
14
+ // is set inline in '@atlaskit/adf-schema' and the color value is stored in ADF so
15
+ // it is not possible to use tokens there without polluting ADF.
16
+ // As table cell backgrounds are set inline, this should not break mobile as
17
+ // hexToEditorBackgroundPaletteColor() outputs a css variable with fallback hex.
18
+ var mapBackgroundColors = function mapBackgroundColors() {
19
+ var cssString = '';
20
+ _adfSchema.tableBackgroundColorNames.forEach(function (value, key) {
21
+ var paletteColorValue = (0, _editorPalette.hexToEditorBackgroundPaletteColor)(value);
22
+ if (paletteColorValue) {
23
+ cssString += "\n td[colorname='".concat(key, "' i],\n th[colorname='").concat(key, "' i] {\n background-color: ").concat(paletteColorValue, " !important;\n }\n ");
24
+ }
25
+ });
26
+ return cssString;
27
+ };
28
+ var tableCellBackgroundStyleOverride = function tableCellBackgroundStyleOverride() {
29
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), mapBackgroundColors());
30
+ };
31
+ exports.tableCellBackgroundStyleOverride = tableCellBackgroundStyleOverride;
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
24
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
25
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "72.5.1";
27
+ var packageVersion = "72.6.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = "0, ".concat((0, _constants.gridSize)(), "px");
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -137,7 +137,8 @@ var DropList = /*#__PURE__*/function (_Component) {
137
137
  position = _this$props.position,
138
138
  trigger = _this$props.trigger,
139
139
  onPositioned = _this$props.onPositioned,
140
- testId = _this$props.testId;
140
+ testId = _this$props.testId,
141
+ id = _this$props.id;
141
142
  var layerContent = isOpen ? (0, _react2.jsx)("div", {
142
143
  css: function css(theme) {
143
144
  return _this2.menuWrapper({
@@ -146,7 +147,9 @@ var DropList = /*#__PURE__*/function (_Component) {
146
147
  },
147
148
  "data-role": "droplistContent",
148
149
  "data-testid": testId && "".concat(testId, "--content"),
149
- ref: this.handleContentRef
150
+ ref: this.handleContentRef,
151
+ id: id,
152
+ role: "menu"
150
153
  }, children) : null;
151
154
  return (0, _react2.jsx)("div", {
152
155
  css: this.wrapperStyles
@@ -17,6 +17,6 @@ var buttonStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _tag
17
17
  /** this is not new usage - old code extracted from editor-core */
18
18
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
19
19
  exports.buttonStyle = buttonStyle;
20
- var buttonWrapperStyle = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid transparent;\n margin: 1px;\n font-size: 0;\n display: flex;\n align-items: center;\n padding: 1px;\n border-radius: 6px;\n &:hover {\n border-color: ", ";\n }\n"])), _colors.N50);
20
+ var buttonWrapperStyle = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid transparent;\n margin: 1px;\n font-size: 0;\n display: flex;\n align-items: center;\n padding: 1px;\n border-radius: 6px;\n &:focus-within,\n &:focus,\n &:hover {\n border-color: ", " !important;\n }\n"])), _colors.N50);
21
21
  /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
22
22
  exports.buttonWrapperStyle = buttonWrapperStyle;