@atlaskit/editor-common 85.2.0 → 86.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/cjs/lazy-node-view/index.js +217 -0
  3. package/dist/cjs/link/ConfigureLinkOverlay/Dropdown.js +19 -4
  4. package/dist/cjs/link/ConfigureLinkOverlay/index.js +2 -1
  5. package/dist/cjs/link/constants.js +2 -4
  6. package/dist/cjs/link/index.js +0 -13
  7. package/dist/cjs/link/utils.js +1 -12
  8. package/dist/cjs/messages/help-dialog.js +5 -0
  9. package/dist/cjs/monitoring/error.js +1 -1
  10. package/dist/cjs/ui/DropList/index.js +1 -1
  11. package/dist/cjs/ui-menu/DropdownMenu/index.js +4 -4
  12. package/dist/cjs/ui-menu/ToolbarButton/index.js +7 -1
  13. package/dist/es2019/lazy-node-view/index.js +212 -0
  14. package/dist/es2019/link/ConfigureLinkOverlay/Dropdown.js +17 -4
  15. package/dist/es2019/link/ConfigureLinkOverlay/index.js +2 -1
  16. package/dist/es2019/link/constants.js +1 -3
  17. package/dist/es2019/link/index.js +0 -1
  18. package/dist/es2019/link/utils.js +2 -13
  19. package/dist/es2019/messages/help-dialog.js +5 -0
  20. package/dist/es2019/monitoring/error.js +1 -1
  21. package/dist/es2019/ui/DropList/index.js +1 -1
  22. package/dist/es2019/ui-menu/DropdownMenu/index.js +4 -4
  23. package/dist/es2019/ui-menu/ToolbarButton/index.js +7 -1
  24. package/dist/esm/lazy-node-view/index.js +211 -0
  25. package/dist/esm/link/ConfigureLinkOverlay/Dropdown.js +19 -4
  26. package/dist/esm/link/ConfigureLinkOverlay/index.js +2 -1
  27. package/dist/esm/link/constants.js +1 -3
  28. package/dist/esm/link/index.js +0 -1
  29. package/dist/esm/link/utils.js +2 -13
  30. package/dist/esm/messages/help-dialog.js +5 -0
  31. package/dist/esm/monitoring/error.js +1 -1
  32. package/dist/esm/ui/DropList/index.js +1 -1
  33. package/dist/esm/ui-menu/DropdownMenu/index.js +4 -4
  34. package/dist/esm/ui-menu/ToolbarButton/index.js +7 -1
  35. package/dist/types/lazy-node-view/index.d.ts +109 -0
  36. package/dist/types/link/ConfigureLinkOverlay/Dropdown.d.ts +2 -0
  37. package/dist/types/link/constants.d.ts +0 -2
  38. package/dist/types/link/index.d.ts +0 -1
  39. package/dist/types/messages/help-dialog.d.ts +5 -0
  40. package/dist/types/ui-menu/ToolbarButton/index.d.ts +3 -0
  41. package/dist/types-ts4.5/lazy-node-view/index.d.ts +109 -0
  42. package/dist/types-ts4.5/link/ConfigureLinkOverlay/Dropdown.d.ts +2 -0
  43. package/dist/types-ts4.5/link/constants.d.ts +0 -2
  44. package/dist/types-ts4.5/link/index.d.ts +0 -1
  45. package/dist/types-ts4.5/messages/help-dialog.d.ts +5 -0
  46. package/dist/types-ts4.5/ui-menu/ToolbarButton/index.d.ts +3 -0
  47. package/lazy-node-view/package.json +15 -0
  48. package/package.json +5 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 86.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#120893](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120893)
8
+ [`67a22e5eb05a2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/67a22e5eb05a2) -
9
+ [ux] [ECA11Y-113] This change adds the keyboard shortcut (Shift+F10) to the Cell Options Tooltip
10
+ and to the Editor Help dialog. This change is behind the `platform_editor_a11y_table_context_menu`
11
+ feature flag.
12
+ - [#120665](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120665)
13
+ [`a4ee6908e0e2c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a4ee6908e0e2c) -
14
+ [ED-23943] Milestone: Initial LazyNodeViewLoading implementation for Table
15
+
16
+ ### Patch Changes
17
+
18
+ - [#120665](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120665)
19
+ [`3f142b915c0a2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3f142b915c0a2) -
20
+ Return focus to editor after clicking link overlay dropdown options
21
+
22
+ ## 86.0.0
23
+
24
+ ### Major Changes
25
+
26
+ - [#120553](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120553)
27
+ [`259bed51cbd99`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/259bed51cbd99) -
28
+ Updates getLinkPreferencesURLFromENV to leverage @atlaskit/atlassian-context rather than env
29
+ variables (ff cleanup). Removes link preferences constants exports.
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies
34
+
3
35
  ## 85.2.0
4
36
 
5
37
  ### Minor Changes
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.withLazyLoading = exports.debouncedReplaceNodeviews = 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 _debounce = _interopRequireDefault(require("lodash/debounce"));
12
+ var _model = require("@atlaskit/editor-prosemirror/model");
13
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
+ /**
16
+ * 📢 Public Type
17
+ *
18
+ * @see {withLazyLoading}
19
+ */
20
+
21
+ /**
22
+ * 📢 Public Type
23
+ *
24
+ * @see {withLazyLoading}
25
+ */
26
+
27
+ /**
28
+ * 🧱 Internal: Editor FE Platform
29
+ */
30
+
31
+ /**
32
+ * 🧱 Internal: Editor FE Platform
33
+ */
34
+
35
+ /**
36
+ * 🧱 Internal: Editor FE Platform
37
+ */
38
+
39
+ /**
40
+ * 🧱 Internal: Editor FE Platform
41
+ *
42
+ * A cache to store loaded React NodeViews for each EditorView.
43
+ *
44
+ * This cache will help us to avoid any race condition
45
+ * when multiple Editors exist in the same page.
46
+ *
47
+ * @type {CacheType}
48
+ */
49
+ var cachePerEditorView = new WeakMap();
50
+
51
+ /**
52
+ * 🧱 Internal: Editor FE Platform
53
+ */
54
+ var isFirefox = /gecko\/\d/i.test(navigator.userAgent);
55
+
56
+ /**
57
+ * 🧱 Internal: Editor FE Platform
58
+ *
59
+ * A NodeView that serves as a placeholder until the actual NodeView is loaded.
60
+ */
61
+ var LazyNodeView = /*#__PURE__*/(0, _createClass2.default)(function LazyNodeView(node, view, getPos) {
62
+ var _node$type;
63
+ (0, _classCallCheck2.default)(this, LazyNodeView);
64
+ if (typeof ((_node$type = node.type) === null || _node$type === void 0 || (_node$type = _node$type.spec) === null || _node$type === void 0 ? void 0 : _node$type.toDOM) !== 'function') {
65
+ this.dom = document.createElement('div');
66
+ return;
67
+ }
68
+ var fallback = _model.DOMSerializer.renderSpec(document, node.type.spec.toDOM(node));
69
+ this.dom = fallback.dom;
70
+ this.contentDOM = fallback.contentDOM;
71
+ if (this.dom instanceof HTMLElement) {
72
+ // This attribute is mostly used for debugging purposed
73
+ // It will help us to found out when the node was replaced
74
+ this.dom.setAttribute('data-lazy-node-view', node.type.name);
75
+ // This is used on Libra tests
76
+ // We are using this to make sure all lazy noded were replaced
77
+ // before the test started
78
+ this.dom.setAttribute('data-lazy-node-view-fallback', 'true');
79
+ }
80
+ });
81
+ /**
82
+ * 🧱 Internal: Editor FE Platform
83
+ *
84
+ * Debounces and replaces the node views in a ProseMirror editor with lazy-loaded node views.
85
+ *
86
+ * This function is used to update the `nodeViews` property of the `EditorView` after lazy-loaded
87
+ * node views have been loaded. It uses a debounced approach to ensure that the replacement does
88
+ * not happen too frequently, which can be performance-intensive.
89
+ *
90
+ * The function checks if there are any loaded node views in the cache associated with the given
91
+ * `EditorView`. If there are, it replaces the current `nodeViews` in the `EditorView` with the
92
+ * loaded node views. The replacement is scheduled using `requestIdleCallback` or
93
+ * `requestAnimationFrame` to avoid blocking the main thread, especially in Firefox where
94
+ * `requestIdleCallback` may not be supported.
95
+ *
96
+ * @param {WeakMap<EditorView, Record<string, NodeViewConstructor>>} cache - A WeakMap that stores
97
+ * the loaded node views for each `EditorView`. The key is the `EditorView`, and the value
98
+ * is a record of node type names to their corresponding `NodeViewConstructor`.
99
+ * @param {EditorView} view - The ProseMirror `EditorView` instance whose `nodeViews` property
100
+ * needs to be updated.
101
+ *
102
+ * @example
103
+ * const cache = new WeakMap();
104
+ * const view = new EditorView(...);
105
+ *
106
+ * // Assume some node views have been loaded and stored in the cache
107
+ * cache.set(view, {
108
+ * 'table': TableViewConstructor,
109
+ * 'tableCell': TableCellViewConstructor,
110
+ * });
111
+ *
112
+ * debouncedReplaceNodeviews(cache, view);
113
+ */
114
+ var debouncedReplaceNodeviews = exports.debouncedReplaceNodeviews = (0, _debounce.default)(function (cache, view) {
115
+ var loadedNodeviews = cache.get(view);
116
+ if (!loadedNodeviews) {
117
+ return;
118
+ }
119
+ cache.delete(view);
120
+
121
+ // eslint-disable-next-line compat/compat
122
+ var idle = window.requestIdleCallback;
123
+
124
+ /*
125
+ * For reasons that goes beyond my knowledge
126
+ * some Firefox versions aren't calling the requestIdleCallback.
127
+ *
128
+ * So, we need this check to make sure we use the requestAnimationFrame instead
129
+ */
130
+ var later = isFirefox || typeof idle !== 'function' ? window.requestAnimationFrame : idle;
131
+ later(function () {
132
+ var currentNodeViews = view.props.nodeViews;
133
+ var nextNodeViews = _objectSpread(_objectSpread({}, currentNodeViews), loadedNodeviews);
134
+ view.setProps({
135
+ nodeViews: nextNodeViews
136
+ });
137
+ });
138
+ });
139
+
140
+ /**
141
+ * 📢 Public: Any EditorPlugin can use this function
142
+ *
143
+ * Wraps a NodeView constructor with laziness, allowing the NodeView to be loaded only when required.
144
+ *
145
+ * This higher-order function is designed to optimize the loading and rendering performance
146
+ * of ProseMirror editor nodes by deferring the loading of their associated NodeViews until they are actually needed.
147
+ * This is particularly useful for complex or heavy NodeViews, such as tables, table cells, rows, and headers within
148
+ * the ProseMirror editor. By using dynamic imports (with promises), the initial load time of the editor can be significantly
149
+ * reduced, leading to a smoother and faster user experience.
150
+ *
151
+ * The function accepts configuration parameters including the node name, a loader function that dynamically imports
152
+ * the NodeView, and a function to retrieve NodeView options. It returns a NodeViewConstructor that ProseMirror
153
+ * can use when rendering nodes of the specified type.
154
+ *
155
+ * @template NodeViewOptions - The type parameter that describes the shape of the options object for the NodeView.
156
+ * @param {LazyLoadingProps<NodeViewOptions>} params - Configuration parameters for lazy loading.
157
+ * @param {string} params.nodeName - The name of the node (e.g., 'table', 'tableCell', 'tableHeader', 'tableRow') for which the lazy-loaded NodeView is intended.
158
+ * @param {() => Promise<CreateReactNodeViewProps<NodeViewOptions>>} params.loader - A function that, when called, returns a promise that resolves to the actual NodeView constructor. This function typically uses dynamic `import()` to load the NodeView code.
159
+ * @param {() => NodeViewOptions} params.getNodeViewOptions - A function that returns the options to be passed to the NodeView constructor. These options can include dependencies like `portalProviderAPI`, `eventDispatcher`, and others, which are necessary for the NodeView's operation.
160
+ * @param {DispatchAnalyticsEvent} [params.dispatchAnalyticsEvent] - An optional function for dispatching analytics events, which can be used to monitor the performance and usage of the lazy-loaded NodeViews.
161
+ * @returns {NodeViewConstructor} A constructor function for creating a NodeView that ProseMirror can instantiate when it encounters a node of the specified type. This constructor is a lightweight placeholder until the actual NodeView is loaded.
162
+ *
163
+ * @example
164
+ * // Lazy load a table NodeView with specific options
165
+ * const lazyTableView = withLazyLoading({
166
+ * nodeName: 'table',
167
+ * loader: () => import('./table').then(module => module.createTableView),
168
+ * getNodeViewOptions: () => ({
169
+ * portalProviderAPI,
170
+ * eventDispatcher,
171
+ * getEditorContainerWidth,
172
+ * getEditorFeatureFlags,
173
+ * dispatchAnalyticsEvent,
174
+ * pluginInjectionApi,
175
+ * }),
176
+ * });
177
+ *
178
+ * // Then, use `lazyTableView` in ProseMirror editor setup to enhance 'table' nodes with lazy loading
179
+ */
180
+ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
181
+ var nodeName = _ref.nodeName,
182
+ loader = _ref.loader,
183
+ getNodeViewOptions = _ref.getNodeViewOptions,
184
+ dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
185
+ var createLazyNodeView = function createLazyNodeView(node, view, getPos, decorations) {
186
+ var _node$type2;
187
+ var cachedMap = cachePerEditorView.get(view);
188
+ if (!cachedMap) {
189
+ cachedMap = {};
190
+ cachePerEditorView.set(view, cachedMap);
191
+ }
192
+ var wasAlreadyRequested = cachedMap.hasOwnProperty(nodeName);
193
+ if (wasAlreadyRequested) {
194
+ return new LazyNodeView(node, view, getPos);
195
+ }
196
+ loader().then(function (nodeViewFuncModule) {
197
+ cachedMap[nodeName] = function (node, view, getPos, decorations) {
198
+ return nodeViewFuncModule(node, view, getPos, decorations, getNodeViewOptions);
199
+ };
200
+ debouncedReplaceNodeviews(cachePerEditorView, view);
201
+ });
202
+ if (typeof ((_node$type2 = node.type) === null || _node$type2 === void 0 || (_node$type2 = _node$type2.spec) === null || _node$type2 === void 0 ? void 0 : _node$type2.toDOM) !== 'function') {
203
+ // TODO: Analytics ED-23982
204
+ // dispatchAnalyticsEvent({
205
+ // action: ACTION.LAZY_NODE_VIEW_ERROR,
206
+ // actionSubject: ACTION_SUBJECT.LAZY_NODE_VIEW,
207
+ // eventType: EVENT_TYPE.OPERATIONAL,
208
+ // attributes: {
209
+ // nodeName,
210
+ // error: 'No spec found',
211
+ // },
212
+ // });
213
+ }
214
+ return new LazyNodeView(node, view, getPos);
215
+ };
216
+ return createLazyNodeView;
217
+ };
@@ -28,6 +28,7 @@ var SMALL_LINK_TOOLBAR_ANALYTICS_SOURCE = 'smallLinkToolbar';
28
28
  var Dropdown = function Dropdown(_ref) {
29
29
  var onConfigureClickCallback = _ref.onConfigureClick,
30
30
  onDropdownChange = _ref.onDropdownChange,
31
+ editorView = _ref.editorView,
31
32
  testId = _ref.testId;
32
33
  var _useIntl = (0, _reactIntlNext.useIntl)(),
33
34
  formatMessage = _useIntl.formatMessage;
@@ -37,20 +38,34 @@ var Dropdown = function Dropdown(_ref) {
37
38
  fireActionClickEvent = _useLinkOverlayAnalyt.fireActionClickEvent,
38
39
  fireLinkClickEvent = _useLinkOverlayAnalyt.fireLinkClickEvent,
39
40
  fireToolbarViewEvent = _useLinkOverlayAnalyt.fireToolbarViewEvent;
41
+ var focusEditor = (0, _react.useCallback)(function () {
42
+ // Fix dropdown giving focus back to the trigger async which is then unmounted and losing focus
43
+ // this is happening deep within atlaskit dropdown as a result of this code: https://github.com/focus-trap/focus-trap/blob/master/index.js#L987
44
+ // use setTimeout to run this async after that call
45
+ setTimeout(function () {
46
+ return editorView.focus();
47
+ }, 0);
48
+ }, [editorView]);
40
49
  var onOpenChange = (0, _react.useCallback)(function (_ref2) {
41
- var isOpen = _ref2.isOpen;
50
+ var isOpen = _ref2.isOpen,
51
+ event = _ref2.event;
42
52
  onDropdownChange === null || onDropdownChange === void 0 || onDropdownChange(isOpen);
43
53
  if (isOpen) {
44
54
  fireToolbarViewEvent();
45
55
  }
46
- }, [fireToolbarViewEvent, onDropdownChange]);
56
+ if (!isOpen && event instanceof KeyboardEvent) {
57
+ focusEditor();
58
+ }
59
+ }, [fireToolbarViewEvent, focusEditor, onDropdownChange]);
47
60
  var onGoToLinkClick = (0, _react.useCallback)(function () {
48
61
  fireActionClickEvent('goToLink');
49
- }, [fireActionClickEvent]);
62
+ focusEditor();
63
+ }, [fireActionClickEvent, focusEditor]);
50
64
  var onConfigureClick = (0, _react.useCallback)(function () {
51
65
  fireActionClickEvent('configureLink');
52
66
  onConfigureClickCallback === null || onConfigureClickCallback === void 0 || onConfigureClickCallback();
53
- }, [fireActionClickEvent, onConfigureClickCallback]);
67
+ focusEditor();
68
+ }, [fireActionClickEvent, focusEditor, onConfigureClickCallback]);
54
69
  return (0, _react2.jsx)(_dropdownMenu.default, {
55
70
  trigger: function trigger(_ref3) {
56
71
  var _onClick = _ref3.onClick,
@@ -95,7 +95,8 @@ var OverlayButton = exports.OverlayButton = (0, _analyticsNext.withAnalyticsCont
95
95
  }, showDropdown ? (0, _react2.jsx)(_Dropdown.default, {
96
96
  testId: testId,
97
97
  onConfigureClick: handleConfigureClick,
98
- onDropdownChange: onDropdownChange
98
+ onDropdownChange: onDropdownChange,
99
+ editorView: editorView
99
100
  }) : (0, _react2.jsx)(_tooltip.default, {
100
101
  content: configureLinkLabel,
101
102
  hideTooltipOnClick: true,
@@ -3,7 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.stagingLinkPreferencesUrl = exports.productionLinkPreferencesUrl = exports.linkPreferencesPath = void 0;
7
- var linkPreferencesPath = exports.linkPreferencesPath = '/manage-profile/link-preferences';
8
- var stagingLinkPreferencesUrl = exports.stagingLinkPreferencesUrl = 'https://id.stg.internal.atlassian.com/manage-profile/link-preferences';
9
- var productionLinkPreferencesUrl = exports.productionLinkPreferencesUrl = 'https://id.atlassian.com/manage-profile/link-preferences';
6
+ exports.linkPreferencesPath = void 0;
7
+ var linkPreferencesPath = exports.linkPreferencesPath = '/manage-profile/link-preferences';
@@ -107,24 +107,12 @@ Object.defineProperty(exports, "isTextAtPos", {
107
107
  return _utils2.isTextAtPos;
108
108
  }
109
109
  });
110
- Object.defineProperty(exports, "productionLinkPreferencesUrl", {
111
- enumerable: true,
112
- get: function get() {
113
- return _constants.productionLinkPreferencesUrl;
114
- }
115
- });
116
110
  Object.defineProperty(exports, "sha1", {
117
111
  enumerable: true,
118
112
  get: function get() {
119
113
  return _utils.sha1;
120
114
  }
121
115
  });
122
- Object.defineProperty(exports, "stagingLinkPreferencesUrl", {
123
- enumerable: true,
124
- get: function get() {
125
- return _constants.stagingLinkPreferencesUrl;
126
- }
127
- });
128
116
  Object.defineProperty(exports, "transformTimeStamp", {
129
117
  enumerable: true,
130
118
  get: function get() {
@@ -142,7 +130,6 @@ var _HyperlinkAddToolbar = require("./LinkPicker/HyperlinkAddToolbar");
142
130
  var _HyperlinkAddToolbar2 = _interopRequireWildcard(require("./LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar"));
143
131
  var _utils = require("./LinkPicker/HyperlinkAddToolbar/utils");
144
132
  var _utils2 = require("./utils");
145
- var _constants = require("./constants");
146
133
  var _ConfigureLinkOverlay = require("./ConfigureLinkOverlay");
147
134
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
148
135
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -7,7 +7,6 @@ exports.getLinkPreferencesURLFromENV = void 0;
7
7
  exports.isLinkAtPos = isLinkAtPos;
8
8
  exports.isTextAtPos = isTextAtPos;
9
9
  var _atlassianContext = require("@atlaskit/atlassian-context");
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
10
  var _constants = require("./constants");
12
11
  function isTextAtPos(pos) {
13
12
  return function (state) {
@@ -22,15 +21,5 @@ function isLinkAtPos(pos) {
22
21
  };
23
22
  }
24
23
  var getLinkPreferencesURLFromENV = exports.getLinkPreferencesURLFromENV = function getLinkPreferencesURLFromENV() {
25
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.linking-preferences-url-atlassian-context')) {
26
- return (0, _atlassianContext.getATLContextUrl)('id') + _constants.linkPreferencesPath;
27
- }
28
- if (process.env.NODE_ENV === 'production' && process.env.CLOUD_ENV === 'staging') {
29
- // only a production CLOUD_ENV staging environment has a different link preferences URL
30
- return _constants.stagingLinkPreferencesUrl;
31
- } else if (process.env.NODE_ENV === 'production') {
32
- return _constants.productionLinkPreferencesUrl;
33
- } else {
34
- return _constants.stagingLinkPreferencesUrl;
35
- }
24
+ return (0, _atlassianContext.getATLContextUrl)('id') + _constants.linkPreferencesPath;
36
25
  };
@@ -76,6 +76,11 @@ var helpDialogMessages = exports.helpDialogMessages = (0, _reactIntlNext.defineM
76
76
  defaultMessage: 'Decrease table or media size',
77
77
  description: 'The text is shown as an shortcut description in help dialog modal, when the user uses the described shortcut, he is able to decrease the width of the selected element. Optimal characters less than 21.'
78
78
  },
79
+ openCellOptions: {
80
+ id: 'fabric.editor.openCellOptions',
81
+ defaultMessage: 'Open cell options',
82
+ description: 'Keyboard shortcut to open cell options.'
83
+ },
79
84
  focusTableResizeHandle: {
80
85
  id: 'fabric.editor.focusTableResizeHandle',
81
86
  defaultMessage: 'Focus table resize handle',
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "85.2.0";
20
+ var packageVersion = "86.1.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
20
20
  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); }; }
21
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "85.2.0";
23
+ var packageVersion = "86.1.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -105,7 +105,7 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
105
105
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleCloseAndFocus", function (event) {
106
106
  var _this$state$target;
107
107
  (_this$state$target = _this.state.target) === null || _this$state$target === void 0 || (_this$state$target = _this$state$target.querySelector('button')) === null || _this$state$target === void 0 || _this$state$target.focus();
108
- if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c')) {
108
+ if ((0, _platformFeatureFlags.fg)('platform_editor_a11y_table_context_menu')) {
109
109
  _this.handleClose(event);
110
110
  } else {
111
111
  _this.handleClose();
@@ -114,7 +114,7 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
114
114
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClose", function (event) {
115
115
  var onOpenChange = _this.props.onOpenChange;
116
116
  if (onOpenChange) {
117
- if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c')) {
117
+ if ((0, _platformFeatureFlags.fg)('platform_editor_a11y_table_context_menu')) {
118
118
  onOpenChange({
119
119
  isOpen: false,
120
120
  event: event
@@ -193,7 +193,7 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
193
193
  handleClickOutside: this.handleClose,
194
194
  handleEscapeKeydown: (0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown') ? handleEscapeKeydown || this.handleCloseAndFocus : this.handleCloseAndFocus,
195
195
  handleEnterKeydown: function handleEnterKeydown(e) {
196
- if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c') || (0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown')) {
196
+ if ((0, _platformFeatureFlags.fg)('platform_editor_a11y_table_context_menu') || (0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown')) {
197
197
  if (!allowEnterDefaultBehavior) {
198
198
  e.preventDefault();
199
199
  }
@@ -365,7 +365,7 @@ function DropdownMenuItem(_ref) {
365
365
  item: item
366
366
  });
367
367
  },
368
- "aria-expanded": (0, _platformFeatureFlags.fg)('platform.editor.a11y-table-context-menu_y4c9c') ? item['aria-expanded'] : undefined
368
+ "aria-expanded": (0, _platformFeatureFlags.fg)('platform_editor_a11y_table_context_menu') ? item['aria-expanded'] : undefined
369
369
  }, item.content));
370
370
  if (item.tooltipDescription) {
371
371
  var _item$key3;
@@ -10,8 +10,10 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var _react2 = require("@emotion/react");
12
12
  var _analyticsListeners = require("@atlaskit/analytics-listeners");
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
14
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
14
15
  var _analytics = require("../../analytics");
16
+ var _keymaps = require("../../keymaps");
15
17
  var _styles = _interopRequireDefault(require("./styles"));
16
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
19
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -39,6 +41,7 @@ var ToolbarButton = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
39
41
  children = props.children,
40
42
  hideTooltip = props.hideTooltip,
41
43
  title = props.title,
44
+ keymap = props.keymap,
42
45
  _props$titlePosition = props.titlePosition,
43
46
  titlePosition = _props$titlePosition === void 0 ? 'top' : _props$titlePosition,
44
47
  item = props.item,
@@ -99,7 +102,10 @@ var ToolbarButton = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
99
102
  if (!title) {
100
103
  return button;
101
104
  }
102
- var tooltipContent = !hideTooltip ? title : null;
105
+ var tooltipContent = hideTooltip ? null : (0, _platformFeatureFlags.fg)('platform_editor_a11y_table_context_menu') ? (0, _react2.jsx)(_keymaps.ToolTipContent, {
106
+ description: title,
107
+ keymap: keymap
108
+ }) : title;
103
109
  return (0, _react2.jsx)(_tooltip.default, {
104
110
  content: tooltipContent,
105
111
  hideTooltipOnClick: true,