@atlaskit/editor-common 82.0.1 → 82.1.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 (48) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/cjs/element-browser/components/ElementList/ElementList.js +123 -27
  3. package/dist/cjs/element-browser/components/StatelessElementBrowser.js +7 -1
  4. package/dist/cjs/element-browser/constants.js +3 -2
  5. package/dist/cjs/mark/commands.js +8 -1
  6. package/dist/cjs/messages/card.js +5 -0
  7. package/dist/cjs/monitoring/environment.js +22 -0
  8. package/dist/cjs/monitoring/error.js +3 -2
  9. package/dist/cjs/styles/shared/annotation.js +67 -42
  10. package/dist/cjs/styles/shared/background-color.js +11 -13
  11. package/dist/cjs/ui/DropList/index.js +1 -1
  12. package/dist/cjs/utils/annotation/index.js +11 -3
  13. package/dist/cjs/utils/validator.js +24 -27
  14. package/dist/es2019/element-browser/components/ElementList/ElementList.js +100 -6
  15. package/dist/es2019/element-browser/components/StatelessElementBrowser.js +7 -1
  16. package/dist/es2019/element-browser/constants.js +2 -1
  17. package/dist/es2019/mark/commands.js +8 -1
  18. package/dist/es2019/messages/card.js +5 -0
  19. package/dist/es2019/monitoring/environment.js +16 -0
  20. package/dist/es2019/monitoring/error.js +3 -2
  21. package/dist/es2019/styles/shared/annotation.js +70 -43
  22. package/dist/es2019/styles/shared/background-color.js +3 -3
  23. package/dist/es2019/ui/DropList/index.js +1 -1
  24. package/dist/es2019/utils/annotation/index.js +11 -3
  25. package/dist/es2019/utils/validator.js +24 -24
  26. package/dist/esm/element-browser/components/ElementList/ElementList.js +124 -28
  27. package/dist/esm/element-browser/components/StatelessElementBrowser.js +7 -1
  28. package/dist/esm/element-browser/constants.js +2 -1
  29. package/dist/esm/mark/commands.js +8 -1
  30. package/dist/esm/messages/card.js +5 -0
  31. package/dist/esm/monitoring/environment.js +16 -0
  32. package/dist/esm/monitoring/error.js +3 -2
  33. package/dist/esm/styles/shared/annotation.js +67 -42
  34. package/dist/esm/styles/shared/background-color.js +11 -13
  35. package/dist/esm/ui/DropList/index.js +1 -1
  36. package/dist/esm/utils/annotation/index.js +11 -3
  37. package/dist/esm/utils/validator.js +24 -27
  38. package/dist/types/element-browser/components/ElementList/ElementList.d.ts +1 -0
  39. package/dist/types/element-browser/constants.d.ts +1 -0
  40. package/dist/types/messages/card.d.ts +5 -0
  41. package/dist/types/monitoring/environment.d.ts +1 -0
  42. package/dist/types/styles/shared/background-color.d.ts +1 -1
  43. package/dist/types-ts4.5/element-browser/components/ElementList/ElementList.d.ts +1 -0
  44. package/dist/types-ts4.5/element-browser/constants.d.ts +1 -0
  45. package/dist/types-ts4.5/messages/card.d.ts +5 -0
  46. package/dist/types-ts4.5/monitoring/environment.d.ts +1 -0
  47. package/dist/types-ts4.5/styles/shared/background-color.d.ts +1 -1
  48. package/package.json +12 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 82.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#108480](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108480)
8
+ [`8552b1dc7f80d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8552b1dc7f80d) -
9
+ Creating new dropdown component for configuring links
10
+
11
+ ## 82.1.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#102065](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102065)
16
+ [`3550442d1b3d2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3550442d1b3d2) -
17
+ [ux] [ECA11Y-185] Element Browser Modal: Replaced Collection component with Grid in order to
18
+ layout remains readable when WCAG values are applied
19
+ - [#108459](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108459)
20
+ [`dff16b735e876`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dff16b735e876) -
21
+ [ED-23613] Avoid blending background color when inline comments overlap with highlights
22
+ - [#108623](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108623)
23
+ [`c01339668ebde`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c01339668ebde) -
24
+ [ux] ED-23617 Add support in editor for comments on status, emoji, date and mention nodes
25
+ - [#108623](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108623)
26
+ [`5af1dca5d4168`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5af1dca5d4168) -
27
+ [ux] ED-23616 Introduces support in renderer for commenting on status, emoji, date and mention
28
+ nodes.
29
+
30
+ ### Patch Changes
31
+
32
+ - [#108217](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108217)
33
+ [`97daaf15d02fb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/97daaf15d02fb) -
34
+ [ED-23052] disable Sentry logging in FedRamp instances
35
+ - Updated dependencies
36
+
3
37
  ## 82.0.1
4
38
 
5
39
  ### Patch Changes
@@ -12,7 +12,9 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
12
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _react2 = require("@emotion/react");
15
+ var _reactVirtualized = require("react-virtualized");
15
16
  var _AutoSizer = require("react-virtualized/dist/commonjs/AutoSizer");
17
+ var _CellMeasurer = require("react-virtualized/dist/commonjs/CellMeasurer");
16
18
  var _Collection = require("react-virtualized/dist/commonjs/Collection");
17
19
  var _analyticsNext = require("@atlaskit/analytics-next");
18
20
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
@@ -31,7 +33,7 @@ var _types = require("../../types");
31
33
  var _cellSizeAndPositionGetter = _interopRequireDefault(require("./cellSizeAndPositionGetter"));
32
34
  var _EmptyState = _interopRequireDefault(require("./EmptyState"));
33
35
  var _utils = require("./utils");
34
- var _excluded = ["items", "mode", "selectedItemIndex", "focusedItemIndex", "setColumnCount", "createAnalyticsEvent", "emptyStateHandler", "selectedCategory", "selectedCategoryIndex", "searchTerm", "setFocusedCategoryIndex", "setFocusedItemIndex"];
36
+ var _excluded = ["items", "mode", "selectedItemIndex", "focusedItemIndex", "columnCount", "setColumnCount", "createAnalyticsEvent", "emptyStateHandler", "selectedCategory", "selectedCategoryIndex", "searchTerm", "setFocusedCategoryIndex", "setFocusedItemIndex"];
35
37
  /** @jsx jsx */
36
38
  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); }
37
39
  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; }
@@ -57,6 +59,7 @@ function ElementList(_ref) {
57
59
  mode = _ref.mode,
58
60
  selectedItemIndex = _ref.selectedItemIndex,
59
61
  focusedItemIndex = _ref.focusedItemIndex,
62
+ columnCount = _ref.columnCount,
60
63
  setColumnCount = _ref.setColumnCount,
61
64
  createAnalyticsEvent = _ref.createAnalyticsEvent,
62
65
  emptyStateHandler = _ref.emptyStateHandler,
@@ -96,11 +99,28 @@ function ElementList(_ref) {
96
99
  }
97
100
  });
98
101
  }, [createAnalyticsEvent]);
102
+
103
+ // eslint-disable-next-line react-hooks/exhaustive-deps
104
+ var cache = new _CellMeasurer.CellMeasurerCache({
105
+ fixedWidth: true,
106
+ defaultHeight: _constants2.ELEMENT_ITEM_HEIGHT,
107
+ minHeight: _constants2.ELEMENT_ITEM_HEIGHT
108
+ });
109
+ var columnWidth = (containerWidth - _constants2.ELEMENT_ITEM_PADDING * 2) / columnCount;
110
+ var rowCount = Math.ceil(items.length / columnCount);
111
+ var rowHeight = function rowHeight(_ref2) {
112
+ var index = _ref2.index;
113
+ return cache.rowHeight({
114
+ index: index
115
+ }) <= _constants2.ELEMENT_ITEM_HEIGHT ? _constants2.ELEMENT_ITEM_HEIGHT : cache.rowHeight({
116
+ index: index
117
+ }) + _constants2.ELEMENT_ITEM_PADDING * 2;
118
+ };
99
119
  var cellRenderer = (0, _react.useMemo)(function () {
100
- return function (_ref2) {
101
- var index = _ref2.index,
102
- key = _ref2.key,
103
- style = _ref2.style;
120
+ return function (_ref3) {
121
+ var index = _ref3.index,
122
+ key = _ref3.key,
123
+ style = _ref3.style;
104
124
  if (items[index] == null) {
105
125
  return;
106
126
  }
@@ -143,6 +163,61 @@ function ElementList(_ref) {
143
163
  }, props)));
144
164
  };
145
165
  }, [items, fullMode, selectedItemIndex, focusedItemIndex, selectedCategoryIndex, setFocusedCategoryIndex, setFocusedItemIndex, props]);
166
+ var gridCellRenderer = (0, _react.useMemo)(function () {
167
+ return function (_ref4) {
168
+ var columnIndex = _ref4.columnIndex,
169
+ key = _ref4.key,
170
+ parent = _ref4.parent,
171
+ rowIndex = _ref4.rowIndex,
172
+ style = _ref4.style;
173
+ var index = rowIndex * columnCount + columnIndex;
174
+ if (items[index] == null) {
175
+ return;
176
+ }
177
+ return index > items.length - 1 ? null : (0, _react2.jsx)(_CellMeasurer.CellMeasurer, {
178
+ cache: cache,
179
+ key: key,
180
+ rowIndex: rowIndex,
181
+ columnIndex: columnIndex,
182
+ parent: parent
183
+ }, (0, _react2.jsx)("div", {
184
+ style: style,
185
+ key: key,
186
+ className: "element-item-wrapper",
187
+ css: elementItemWrapper,
188
+ onKeyDown: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-focus-order-for-element-browser-categories_ztiw1') ? function (e) {
189
+ if (e.key === 'Tab') {
190
+ if (e.shiftKey && index === 0) {
191
+ if (setFocusedCategoryIndex) {
192
+ if (!!selectedCategoryIndex) {
193
+ setFocusedCategoryIndex(selectedCategoryIndex);
194
+ } else {
195
+ setFocusedCategoryIndex(0);
196
+ }
197
+ e.preventDefault();
198
+ }
199
+ }
200
+ // before focus jumps from elements list we need to rerender react-virtualized collection.
201
+ // Otherwise on the next render 'scrollToCell' will have same cached value
202
+ // and collection will not be scrolled to top.
203
+ // So Tab press on category will not work anymore due to invisible 1-t element.
204
+ else if (index === items.length - 2) {
205
+ setFocusedItemIndex(items.length - 1);
206
+ }
207
+ }
208
+ } : undefined
209
+ }, (0, _react2.jsx)(MemoizedElementItem, (0, _extends2.default)({
210
+ inlineMode: !fullMode,
211
+ index: index,
212
+ item: items[index],
213
+ selected: selectedItemIndex === index,
214
+ focus: focusedItemIndex === index,
215
+ setFocusedItemIndex: setFocusedItemIndex
216
+ }, props))));
217
+ };
218
+ },
219
+ // eslint-disable-next-line react-hooks/exhaustive-deps
220
+ [cache, items, fullMode, selectedItemIndex, columnCount, focusedItemIndex, selectedCategoryIndex, setFocusedCategoryIndex, setFocusedItemIndex, props]);
146
221
  return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(ContainerWidthMonitor, null), (0, _react2.jsx)("div", {
147
222
  css: elementItemsWrapper,
148
223
  "data-testid": "element-items",
@@ -158,9 +233,30 @@ function ElementList(_ref) {
158
233
  onExternalLinkClick: onExternalLinkClick
159
234
  }) : (0, _react2.jsx)(_react.Fragment, null, containerWidth > 0 && (0, _react2.jsx)(_AutoSizer.AutoSizer, {
160
235
  disableWidth: true
161
- }, function (_ref3) {
162
- var height = _ref3.height;
163
- return (0, _react2.jsx)(_Collection.Collection, {
236
+ }, function (_ref5) {
237
+ var height = _ref5.height;
238
+ return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-element-browser') ? (0, _react2.jsx)(_reactVirtualized.Grid, (0, _extends2.default)({
239
+ cellRenderer: gridCellRenderer,
240
+ height: height,
241
+ width: containerWidth - _constants2.ELEMENT_LIST_PADDING * 2 // containerWidth - padding on Left/Right (for focus outline)
242
+ /**
243
+ * Refresh Grid on WidthObserver value change.
244
+ * Length of the items used to force re-render to solve Firefox bug with react-virtualized retaining
245
+ * scroll position after updating the data. If new data has different number of cells, a re-render
246
+ * is forced to prevent the scroll position render bug.
247
+ */,
248
+ key: containerWidth + items.length,
249
+ rowHeight: rowHeight,
250
+ rowCount: rowCount,
251
+ columnCount: columnCount,
252
+ columnWidth: columnWidth,
253
+ deferredMeasurementCache: cache
254
+ }, selectedItemIndex && {
255
+ scrollToCell: {
256
+ rowIndex: selectedItemIndex / columnCount,
257
+ columnIndex: selectedItemIndex % columnCount
258
+ }
259
+ })) : (0, _react2.jsx)(_Collection.Collection, {
164
260
  cellCount: items.length,
165
261
  cellRenderer: cellRenderer,
166
262
  cellSizeAndPositionGetter: (0, _cellSizeAndPositionGetter.default)(containerWidth - _constants2.ELEMENT_LIST_PADDING * 2, scrollbarWidth),
@@ -179,14 +275,14 @@ function ElementList(_ref) {
179
275
  }
180
276
  var MemoizedElementItem = /*#__PURE__*/(0, _react.memo)(ElementItem);
181
277
  MemoizedElementItem.displayName = 'MemoizedElementItem';
182
- function ElementItem(_ref4) {
183
- var inlineMode = _ref4.inlineMode,
184
- selected = _ref4.selected,
185
- item = _ref4.item,
186
- index = _ref4.index,
187
- onInsertItem = _ref4.onInsertItem,
188
- focus = _ref4.focus,
189
- setFocusedItemIndex = _ref4.setFocusedItemIndex;
278
+ function ElementItem(_ref6) {
279
+ var inlineMode = _ref6.inlineMode,
280
+ selected = _ref6.selected,
281
+ item = _ref6.item,
282
+ index = _ref6.index,
283
+ onInsertItem = _ref6.onInsertItem,
284
+ focus = _ref6.focus,
285
+ setFocusedItemIndex = _ref6.setFocusedItemIndex;
190
286
  var ref = (0, _useFocus.default)(focus);
191
287
 
192
288
  /**
@@ -251,17 +347,17 @@ function ElementItem(_ref4) {
251
347
  var itemStyleOverrides = {
252
348
  alignItems: 'flex-start'
253
349
  };
254
- var ElementBefore = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
255
- var icon = _ref5.icon,
256
- title = _ref5.title;
350
+ var ElementBefore = /*#__PURE__*/(0, _react.memo)(function (_ref7) {
351
+ var icon = _ref7.icon,
352
+ title = _ref7.title;
257
353
  return (0, _react2.jsx)("div", {
258
354
  css: [itemIcon, itemIconStyle]
259
355
  }, icon ? icon() : (0, _react2.jsx)(_quickInsert.IconFallback, null));
260
356
  });
261
- var ItemContent = /*#__PURE__*/(0, _react.memo)(function (_ref6) {
262
- var title = _ref6.title,
263
- description = _ref6.description,
264
- keyshortcut = _ref6.keyshortcut;
357
+ var ItemContent = /*#__PURE__*/(0, _react.memo)(function (_ref8) {
358
+ var title = _ref8.title,
359
+ description = _ref8.description,
360
+ keyshortcut = _ref8.keyshortcut;
265
361
  return (
266
362
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
267
363
  (0, _react2.jsx)("div", {
@@ -289,14 +385,14 @@ var elementItemsWrapper = (0, _react2.css)({
289
385
  justifyContent: 'flex-start',
290
386
  overflow: 'hidden',
291
387
  padding: "var(--ds-space-025, 2px)",
292
- '.ReactVirtualized__Collection': {
388
+ '.ReactVirtualized__Collection, .ReactVirtualized__Grid': {
293
389
  borderRadius: '3px',
294
390
  outline: 'none',
295
- ':focus': {
391
+ '&:focus': {
296
392
  boxShadow: "0 0 0 ".concat(_constants2.ELEMENT_LIST_PADDING, "px ", "var(--ds-border-focused, ".concat(_colors.B100, ")"))
297
393
  }
298
394
  },
299
- '.ReactVirtualized__Collection__innerScrollContainer': {
395
+ '.ReactVirtualized__Collection__innerScrollContainer, .ReactVirtualized__Grid__innerScrollContainer': {
300
396
  "div[class='element-item-wrapper']:last-child": {
301
397
  paddingBottom: "var(--ds-space-050, 4px)"
302
398
  }
@@ -305,7 +401,7 @@ var elementItemsWrapper = (0, _react2.css)({
305
401
  var elementItemWrapper = (0, _react2.css)({
306
402
  div: {
307
403
  button: {
308
- height: '75px',
404
+ minHeight: '75px',
309
405
  alignItems: 'flex-start',
310
406
  padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-150, 12px)", " 11px")
311
407
  }
@@ -87,7 +87,7 @@ var mobileCategoryListWrapper = (0, _react2.css)({
87
87
  padding: "var(--ds-space-200, 8px)".concat(" 0 ", "var(--ds-space-200, 16px)", " 0"),
88
88
  minHeight: "".concat(_constants.GRID_SIZE * 4, "px"),
89
89
  overflow: '-moz-scrollbars-none',
90
- '::-webkit-scrollbar': {
90
+ '&::-webkit-scrollbar': {
91
91
  display: 'none'
92
92
  },
93
93
  scrollbarWidth: 'none',
@@ -219,6 +219,7 @@ function StatelessElementBrowser(props) {
219
219
  focusedCategoryIndex: focusedCategoryIndex,
220
220
  setFocusedCategoryIndex: setFocusedCategoryIndex,
221
221
  focusOnSearch: focusOnSearch,
222
+ columnCount: columnCount,
222
223
  setColumnCount: setColumnCount,
223
224
  setFocusOnSearch: setFocusOnSearch,
224
225
  onKeyPress: onItemsEnterTabKeyPress,
@@ -231,6 +232,7 @@ function StatelessElementBrowser(props) {
231
232
  setFocusedItemIndex: setFocusedItemIndex,
232
233
  focusOnSearch: focusOnSearch,
233
234
  setColumnCount: setColumnCount,
235
+ columnCount: columnCount,
234
236
  setFocusOnSearch: setFocusOnSearch,
235
237
  onKeyPress: onItemsEnterTabKeyPress,
236
238
  onKeyDown: onKeyDown,
@@ -257,6 +259,7 @@ function MobileBrowser(_ref) {
257
259
  setFocusedCategoryIndex = _ref.setFocusedCategoryIndex,
258
260
  focusOnSearch = _ref.focusOnSearch,
259
261
  focusOnViewMore = _ref.focusOnViewMore,
262
+ columnCount = _ref.columnCount,
260
263
  setColumnCount = _ref.setColumnCount,
261
264
  setFocusOnSearch = _ref.setFocusOnSearch,
262
265
  onKeyPress = _ref.onKeyPress,
@@ -300,6 +303,7 @@ function MobileBrowser(_ref) {
300
303
  selectedItemIndex: selectedItemIndex,
301
304
  focusedItemIndex: focusedItemIndex,
302
305
  setFocusedItemIndex: setFocusedItemIndex,
306
+ columnCount: columnCount,
303
307
  setColumnCount: setColumnCount,
304
308
  createAnalyticsEvent: createAnalyticsEvent,
305
309
  emptyStateHandler: emptyStateHandler,
@@ -327,6 +331,7 @@ function DesktopBrowser(_ref2) {
327
331
  setFocusedCategoryIndex = _ref2.setFocusedCategoryIndex,
328
332
  selectedCategoryIndex = _ref2.selectedCategoryIndex,
329
333
  focusOnSearch = _ref2.focusOnSearch,
334
+ columnCount = _ref2.columnCount,
330
335
  setColumnCount = _ref2.setColumnCount,
331
336
  setFocusOnSearch = _ref2.setFocusOnSearch,
332
337
  onKeyPress = _ref2.onKeyPress,
@@ -384,6 +389,7 @@ function DesktopBrowser(_ref2) {
384
389
  selectedItemIndex: selectedItemIndex,
385
390
  focusedItemIndex: focusedItemIndex,
386
391
  setFocusedItemIndex: setFocusedItemIndex,
392
+ columnCount: columnCount,
387
393
  setColumnCount: setColumnCount,
388
394
  createAnalyticsEvent: createAnalyticsEvent,
389
395
  emptyStateHandler: emptyStateHandler,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SIDEBAR_WIDTH = exports.SIDEBAR_HEADING_WRAPPER_HEIGHT = exports.SIDEBAR_HEADING_PADDING_LEFT = exports.SEARCH_ITEM_HEIGHT_WIDTH = exports.SCROLLBAR_WIDTH = exports.INLINE_SIDEBAR_HEIGHT = exports.GRID_SIZE = exports.FLEX_ITEMS_CONTAINER_BREAKPOINT_NUMBERS = exports.ELEMENT_LIST_PADDING = exports.ELEMENT_ITEM_HEIGHT = exports.DEVICE_BREAKPOINT_NUMBERS = void 0;
6
+ exports.SIDEBAR_WIDTH = exports.SIDEBAR_HEADING_WRAPPER_HEIGHT = exports.SIDEBAR_HEADING_PADDING_LEFT = exports.SEARCH_ITEM_HEIGHT_WIDTH = exports.SCROLLBAR_WIDTH = exports.INLINE_SIDEBAR_HEIGHT = exports.GRID_SIZE = exports.FLEX_ITEMS_CONTAINER_BREAKPOINT_NUMBERS = exports.ELEMENT_LIST_PADDING = exports.ELEMENT_ITEM_PADDING = exports.ELEMENT_ITEM_HEIGHT = exports.DEVICE_BREAKPOINT_NUMBERS = void 0;
7
7
  var _constants = require("@atlaskit/theme/constants");
8
8
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
9
9
 
@@ -27,4 +27,5 @@ var INLINE_SIDEBAR_HEIGHT = exports.INLINE_SIDEBAR_HEIGHT = '54px';
27
27
  var SEARCH_ITEM_HEIGHT_WIDTH = exports.SEARCH_ITEM_HEIGHT_WIDTH = '20px';
28
28
  var SCROLLBAR_WIDTH = exports.SCROLLBAR_WIDTH = 15;
29
29
  var ELEMENT_LIST_PADDING = exports.ELEMENT_LIST_PADDING = 2;
30
- var ELEMENT_ITEM_HEIGHT = exports.ELEMENT_ITEM_HEIGHT = 75;
30
+ var ELEMENT_ITEM_HEIGHT = exports.ELEMENT_ITEM_HEIGHT = 75;
31
+ var ELEMENT_ITEM_PADDING = exports.ELEMENT_ITEM_PADDING = 10;
@@ -145,7 +145,14 @@ var applyMarkOnRange = exports.applyMarkOnRange = function applyMarkOnRange(from
145
145
  (0, _platformFeatureFlags.getBooleanFF)('platform.editor.simplify-inline-cards-in-code-blocks_jw6t1') ? transformNonTextNodesToText(from, to, tr) : transformSmartCharsMentionsAndEmojis(from, to, tr);
146
146
  }
147
147
  tr.doc.nodesBetween(tr.mapping.map(from), tr.mapping.map(to), function (node, pos) {
148
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes')) {
148
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
149
+ if (!node.isText) {
150
+ var isAllowedInlineNode = ['emoji', 'status', 'date', 'mention', 'inlineCard'].includes(node.type.name);
151
+ if (!isAllowedInlineNode) {
152
+ return true;
153
+ }
154
+ }
155
+ } else if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes')) {
149
156
  if (!node.isText && node.type !== inlineCard) {
150
157
  return true;
151
158
  }
@@ -151,6 +151,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
151
151
  defaultMessage: 'Configure link',
152
152
  description: 'An icon shown when hovering over inline smart link to inform user they can click the icon to configure the links appearance.'
153
153
  },
154
+ inlineGoToLink: {
155
+ id: 'fabric.editor.inlineGoToLink',
156
+ defaultMessage: 'Go to link',
157
+ description: 'An option in the configure link dropdown that informs the user they can click the option to open the link'
158
+ },
154
159
  datasourceConfluenceSearch: {
155
160
  id: 'fabric.editor.datasource.confluenceSearch',
156
161
  defaultMessage: 'Insert Confluence list',
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isFedRamp = isFedRamp;
7
+ var FEDRAMP_MODERATE = 'fedramp-moderate';
8
+
9
+ // To determine whether an instance is a FedRAMP instance
10
+ // Copied from platform/packages/uip/atl-context/src/services/is-fedramp/index.tsx
11
+ // We cannot import the same-named function from @atlassian/atl-context due to editor-common being a public package (and atl-context being private)
12
+ // TODO: Seek alternatives
13
+ function isFedRamp() {
14
+ var _globalThis$location;
15
+ // MICROS_PERIMETER is already used by few products, so we need to keep it for backward compatibility
16
+ var env = globalThis.MICROS_PERIMETER || globalThis.UNSAFE_ATL_CONTEXT_BOUNDARY;
17
+ if (env) {
18
+ return env === FEDRAMP_MODERATE;
19
+ }
20
+ var matches = (_globalThis$location = globalThis.location) === null || _globalThis$location === void 0 || (_globalThis$location = _globalThis$location.hostname) === null || _globalThis$location === void 0 ? void 0 : _globalThis$location.match(/atlassian-us-gov-mod\.(com|net)|atlassian-us-gov\.(com|net)|atlassian-fex\.(com|net)|atlassian-stg-fedm\.(com|net)/);
21
+ return matches ? matches.length > 0 : false;
22
+ }
@@ -10,13 +10,14 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
+ var _environment = require("./environment");
13
14
  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
15
  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
  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); }
16
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; }
17
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "82.0.1";
20
+ var packageVersion = "82.1.1";
20
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
22
  // Remove URL as it has UGC
22
23
  // TODO: Sanitise the URL instead of just removing it
@@ -55,7 +56,7 @@ var logException = exports.logException = /*#__PURE__*/function () {
55
56
  _yield$import2 = _context.sent;
56
57
  ExtraErrorData = _yield$import2.ExtraErrorData;
57
58
  sentryOptions = {
58
- dsn: SENTRY_DSN,
59
+ dsn: (0, _environment.isFedRamp)() ? undefined : SENTRY_DSN,
59
60
  release: "".concat(packageName, "@").concat(packageVersion),
60
61
  environment: (_process$env$CLOUD_EN = process.env.CLOUD_ENV) !== null && _process$env$CLOUD_EN !== void 0 ? _process$env$CLOUD_EN : 'unknown',
61
62
  ignoreErrors: [
@@ -22,53 +22,78 @@ var BlockAnnotationSharedClassNames = exports.BlockAnnotationSharedClassNames =
22
22
  blur: "".concat(blockAnnotationPrefix, "-blur"),
23
23
  draft: "".concat(blockAnnotationPrefix, "-draft")
24
24
  };
25
- var Y75a = 'rgba(255, 240, 179, 0.5)';
25
+ var Yellow100 = 'rgb(255, 247, 214)';
26
26
  var Y200a = 'rgba(255, 196, 0, 0.82)';
27
27
  var AnnotationSharedCSSByState = exports.AnnotationSharedCSSByState = function AnnotationSharedCSSByState() {
28
- return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes') ? {
29
- focus: (0, _react.css)({
30
- background: "var(--ds-background-accent-yellow-subtler, ".concat(_colors.Y75, ")"),
31
- borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(_colors.Y300, ")")),
32
- boxShadow: "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(_colors.N60A, ", -1px 2px 3px ").concat(_colors.N60A), ")"),
33
- cursor: 'pointer',
34
- '&:has(.card)': {
35
- fontSize: '1.5rem',
36
- lineHeight: '1.2rem',
37
- '& > *': {
38
- fontSize: '16px'
28
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
29
+ return {
30
+ focus: (0, _react.css)({
31
+ background: "var(--ds-background-accent-yellow-subtler, ".concat(_colors.Y75, ")"),
32
+ borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(_colors.Y300, ")")),
33
+ boxShadow: "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(_colors.N60A, ", -1px 2px 3px ").concat(_colors.N60A), ")"),
34
+ cursor: 'pointer',
35
+ padding: '1.5px 0',
36
+ '&:has(.card)': {
37
+ padding: '4.5px 0 3px 0'
39
38
  }
40
- }
41
- }),
42
- blur: (0, _react.css)({
43
- background: "var(--ds-background-accent-yellow-subtlest, ".concat(Y75a, ")"),
44
- borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(Y200a, ")")),
45
- cursor: 'pointer',
46
- '&:has(.card)': {
47
- fontSize: '1.5rem',
48
- lineHeight: '1.2rem',
49
- '& > *': {
50
- fontSize: '16px'
39
+ }),
40
+ blur: (0, _react.css)({
41
+ background: "var(--ds-background-accent-yellow-subtlest, ".concat(Yellow100, ")"),
42
+ borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(Y200a, ")")),
43
+ cursor: 'pointer',
44
+ padding: '1.5px 0',
45
+ '&:has(.card)': {
46
+ padding: '4.5px 0 3px 0'
51
47
  }
52
- }
53
- })
54
- } : {
55
- focus: (0, _react.css)({
56
- // Background is not coming through in confluence, suspecting to be caused by some specific combination of
57
- // emotion and token look up
58
- background: "var(--ds-background-accent-yellow-subtler, ".concat(_colors.Y75, ")"),
59
- borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(_colors.Y300, ")")),
60
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4147
61
- boxShadow: "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(_colors.N60A, ", -1px 2px 3px ").concat(_colors.N60A), ")"),
62
- cursor: 'pointer'
63
- }),
64
- blur: (0, _react.css)({
65
- background: "var(--ds-background-accent-yellow-subtlest, ".concat(Y75a, ")"),
66
- borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(Y200a, ")")),
67
- cursor: 'pointer'
68
- })
69
- };
48
+ })
49
+ };
50
+ } else if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes')) {
51
+ return {
52
+ focus: (0, _react.css)({
53
+ background: "var(--ds-background-accent-yellow-subtler, ".concat(_colors.Y75, ")"),
54
+ borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(_colors.Y300, ")")),
55
+ boxShadow: "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(_colors.N60A, ", -1px 2px 3px ").concat(_colors.N60A), ")"),
56
+ cursor: 'pointer',
57
+ '&:has(.card)': {
58
+ fontSize: '1.5rem',
59
+ lineHeight: '1.2rem',
60
+ '& > *': {
61
+ fontSize: '16px'
62
+ }
63
+ }
64
+ }),
65
+ blur: (0, _react.css)({
66
+ background: "var(--ds-background-accent-yellow-subtlest, ".concat(Yellow100, ")"),
67
+ borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(Y200a, ")")),
68
+ cursor: 'pointer',
69
+ '&:has(.card)': {
70
+ fontSize: '1.5rem',
71
+ lineHeight: '1.2rem',
72
+ '& > *': {
73
+ fontSize: '16px'
74
+ }
75
+ }
76
+ })
77
+ };
78
+ } else {
79
+ return {
80
+ focus: (0, _react.css)({
81
+ // Background is not coming through in confluence, suspecting to be caused by some specific combination of
82
+ // emotion and token look up
83
+ background: "var(--ds-background-accent-yellow-subtler, ".concat(_colors.Y75, ")"),
84
+ borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(_colors.Y300, ")")),
85
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-4147
86
+ boxShadow: "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(_colors.N60A, ", -1px 2px 3px ").concat(_colors.N60A), ")"),
87
+ cursor: 'pointer'
88
+ }),
89
+ blur: (0, _react.css)({
90
+ background: "var(--ds-background-accent-yellow-subtlest, ".concat(Yellow100, ")"),
91
+ borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(Y200a, ")")),
92
+ cursor: 'pointer'
93
+ })
94
+ };
95
+ }
70
96
  };
71
-
72
97
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState()` is not safe in object syntax
73
98
  var annotationSharedStyles = exports.annotationSharedStyles = function annotationSharedStyles() {
74
99
  return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t.", " {\n\t\t\t", ";\n\t\t}\n\n\t\t.", " {\n\t\t\t", ";\n\t\t\tcursor: initial;\n\t\t}\n\n\t\t.", " {\n\t\t\t", ";\n\t\t}\n\t}\n"])), AnnotationSharedClassNames.focus, AnnotationSharedCSSByState().focus, AnnotationSharedClassNames.draft, AnnotationSharedCSSByState().focus, AnnotationSharedClassNames.blur, AnnotationSharedCSSByState().blur);
@@ -5,16 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.backgroundColorStyles = void 0;
7
7
  var _react = require("@emotion/react");
8
- var backgroundColorStyles = exports.backgroundColorStyles = function backgroundColorStyles(colorMode) {
9
- return (0, _react.css)({
10
- '.fabric-background-color-mark': {
11
- backgroundColor: 'var(--custom-palette-color, inherit)'
12
- },
13
- 'a .fabric-background-color-mark': {
14
- backgroundColor: 'unset'
15
- },
16
- '.fabric-background-color-mark .ak-editor-annotation, .fabric-background-color-mark [data-mark-type="annotation"]': {
17
- mixBlendMode: colorMode === 'dark' ? 'color-dodge' : 'multiply'
18
- }
19
- });
20
- };
8
+ var backgroundColorStyles = exports.backgroundColorStyles = (0, _react.css)({
9
+ '.fabric-background-color-mark': {
10
+ backgroundColor: 'var(--custom-palette-color, inherit)'
11
+ },
12
+ 'a .fabric-background-color-mark': {
13
+ backgroundColor: 'unset'
14
+ },
15
+ '.fabric-background-color-mark .ak-editor-annotation': {
16
+ backgroundColor: 'unset'
17
+ }
18
+ });
@@ -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 */
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "82.0.1";
23
+ var packageVersion = "82.1.1";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -26,9 +26,17 @@ var canApplyAnnotationOnRange = exports.canApplyAnnotationOnRange = function can
26
26
  // or if we're leaf and not text
27
27
 
28
28
  if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes')) {
29
- if (node.isInline && !node.isText && node.type !== inlineCard || node.isLeaf && !node.isText && node.type !== inlineCard || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
30
- foundInvalid = true;
31
- return false;
29
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
30
+ var isAllowedInlineNode = ['emoji', 'status', 'date', 'mention', 'inlineCard'].includes(node.type.name);
31
+ if (node.isInline && !node.isText && !isAllowedInlineNode || node.isLeaf && !node.isText && !isAllowedInlineNode || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
32
+ foundInvalid = true;
33
+ return false;
34
+ }
35
+ } else {
36
+ if (node.isInline && !node.isText && node.type !== inlineCard || node.isLeaf && !node.isText && node.type !== inlineCard || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
37
+ foundInvalid = true;
38
+ return false;
39
+ }
32
40
  }
33
41
  } else {
34
42
  if (node.isInline && !node.isText || node.isLeaf && !node.isText || node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {