@atlaskit/editor-common 109.15.0 → 109.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/copy-button/index.js +4 -2
  3. package/dist/cjs/keymaps/index.js +11 -6
  4. package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +3 -1
  5. package/dist/cjs/monitoring/error.js +1 -1
  6. package/dist/cjs/resizer/BreakoutResizer.js +6 -4
  7. package/dist/cjs/styles/shared/table.js +3 -3
  8. package/dist/cjs/ui/DropList/index.js +1 -1
  9. package/dist/cjs/ui/PanelTextInput/index.js +7 -4
  10. package/dist/cjs/utils/browser.js +43 -9
  11. package/dist/es2019/copy-button/index.js +3 -1
  12. package/dist/es2019/keymaps/index.js +6 -1
  13. package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +3 -1
  14. package/dist/es2019/monitoring/error.js +1 -1
  15. package/dist/es2019/resizer/BreakoutResizer.js +5 -3
  16. package/dist/es2019/styles/shared/table.js +107 -105
  17. package/dist/es2019/ui/DropList/index.js +1 -1
  18. package/dist/es2019/ui/PanelTextInput/index.js +4 -1
  19. package/dist/es2019/utils/browser.js +43 -9
  20. package/dist/esm/copy-button/index.js +3 -1
  21. package/dist/esm/keymaps/index.js +6 -1
  22. package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +3 -1
  23. package/dist/esm/monitoring/error.js +1 -1
  24. package/dist/esm/resizer/BreakoutResizer.js +5 -3
  25. package/dist/esm/styles/shared/table.js +4 -4
  26. package/dist/esm/ui/DropList/index.js +1 -1
  27. package/dist/esm/ui/PanelTextInput/index.js +4 -1
  28. package/dist/esm/utils/browser.js +43 -9
  29. package/dist/types/analytics/types/ai-streaming.d.ts +3 -0
  30. package/dist/types-ts4.5/analytics/types/ai-streaming.d.ts +3 -0
  31. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 109.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b1acfd162fa8a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b1acfd162fa8a) -
8
+ use latest browser util for editor-common
9
+ - [`096440b378eeb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/096440b378eeb) -
10
+ [ux] EDITOR-1786 - fix update stream errors
11
+ - Updated dependencies
12
+
3
13
  ## 109.15.0
4
14
 
5
15
  ### Minor Changes
@@ -9,8 +9,9 @@ exports.toDOM = void 0;
9
9
  var _model = require("@atlaskit/editor-prosemirror/model");
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
11
  var _utils = require("@atlaskit/editor-prosemirror/utils");
12
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
13
  var _clipboard = require("../clipboard");
13
- var _utils2 = require("../utils");
14
+ var _browser = require("../utils/browser");
14
15
  function getSelectedNodeOrNodeParentByNodeType(_ref) {
15
16
  var nodeType = _ref.nodeType,
16
17
  selection = _ref.selection;
@@ -28,6 +29,7 @@ var copyDomNode = exports.copyDomNode = function copyDomNode(domNode, nodeType,
28
29
  var div = document.createElement('div');
29
30
  div.appendChild(domNode);
30
31
  var schema = selection.$from.doc.type.schema;
32
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
31
33
 
32
34
  // if copying inline content
33
35
  if (nodeType.inlineContent) {
@@ -47,7 +49,7 @@ var copyDomNode = exports.copyDomNode = function copyDomNode(domNode, nodeType,
47
49
  }
48
50
  // ED-17083 safari seems have bugs for extension copy because exntension do not have a child text(innerText) and it will not recognized as html in clipboard, this could be merge into one if this extension fixed children issue or safari fix the copy bug
49
51
  // MEX-2528 safari has a bug related to the mediaSingle node with border or link. The image tag within the clipboard is not recognized as HTML when using the ClipboardItem API. To address this, we have to switch to ClipboardPolyfill
50
- if (_utils2.browser.safari && selection instanceof _state.NodeSelection && (selection.node.type === schema.nodes.extension || selection.node.type === schema.nodes.mediaSingle)) {
52
+ if (browser.safari && selection instanceof _state.NodeSelection && (selection.node.type === schema.nodes.extension || selection.node.type === schema.nodes.mediaSingle)) {
51
53
  (0, _clipboard.copyHTMLToClipboardPolyfill)(div);
52
54
  } else {
53
55
  (0, _clipboard.copyHTMLToClipboard)(div);
@@ -110,8 +110,9 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
110
110
  var _react = _interopRequireWildcard(require("react"));
111
111
  var _react2 = require("@emotion/react");
112
112
  var _w3cKeyname = require("w3c-keyname");
113
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
113
114
  var _editorCommands = require("../preset/editor-commands");
114
- var _utils = require("../utils");
115
+ var _browser = require("../utils/browser");
115
116
  var _consts = require("./consts");
116
117
  var _keymap = require("./keymap");
117
118
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
@@ -236,7 +237,8 @@ var tooltipShortcutStyle = (0, _react2.css)({
236
237
  });
237
238
  function formatShortcut(keymap) {
238
239
  var shortcut;
239
- if (_utils.browser.mac) {
240
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
241
+ if (browser.mac) {
240
242
  // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
241
243
  shortcut = keymap.mac
242
244
  // Ignored via go/ees005
@@ -269,7 +271,7 @@ function formatShortcut(keymap) {
269
271
  lastKey = lastKey.toUpperCase();
270
272
  }
271
273
  keys[keys.length - 1] = arrowKeysMap[lastKey.toUpperCase()] || lastKey;
272
- return keys.join(_utils.browser.mac ? '' : '+');
274
+ return keys.join(browser.mac ? '' : '+');
273
275
  }
274
276
  function tooltip(keymap, description) {
275
277
  if (keymap) {
@@ -317,17 +319,19 @@ function findShortcutByDescription(description) {
317
319
  return;
318
320
  }
319
321
  function findShortcutByKeymap(keymap) {
320
- if (_utils.browser.mac) {
322
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
323
+ if (browser.mac) {
321
324
  return keymap.mac;
322
325
  }
323
326
  return keymap.windows;
324
327
  }
325
328
  function getAriaKeyshortcuts(keymap) {
326
329
  var keyShortcuts;
330
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
327
331
  if (typeof keymap === 'string') {
328
332
  keyShortcuts = keymap;
329
333
  } else if ((0, _typeof2.default)(keymap) === 'object') {
330
- keyShortcuts = keymap[_utils.browser.mac ? 'mac' : 'windows'];
334
+ keyShortcuts = keymap[browser.mac ? 'mac' : 'windows'];
331
335
  }
332
336
  if (keyShortcuts) {
333
337
  return keyShortcuts.toLowerCase().split('-').map(function (modifier) {
@@ -414,7 +418,8 @@ function bindKeymapWithEditorCommand(shortcut, cmd, keymap) {
414
418
  }
415
419
  function findKeyMapForBrowser(keyMap) {
416
420
  if (keyMap) {
417
- if (_utils.browser.mac) {
421
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
422
+ if (browser.mac) {
418
423
  return keyMap.mac;
419
424
  }
420
425
  return keyMap.windows;
@@ -32,6 +32,7 @@ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
32
32
  var _analytics = require("../../../analytics");
33
33
  var _ui = require("../../../ui");
34
34
  var _utils = require("../../../utils");
35
+ var _browser = require("../../../utils/browser");
35
36
  var _LinkSearchList = _interopRequireWildcard(require("../../LinkSearch/LinkSearchList"));
36
37
  var _ToolbarComponents = require("../../LinkSearch/ToolbarComponents");
37
38
  var _transformTimeStamp = require("../../LinkSearch/transformTimeStamp");
@@ -877,10 +878,11 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
877
878
  var ariaActiveDescendant = selectedIndex > -1 ? "link-search-list-item-".concat(selectedIndex) : '';
878
879
  var linkSearchInputId = 'search-recent-links-field-id';
879
880
  var displayTextInputId = 'display-text-filed-id';
881
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
880
882
  // Added workaround with a screen reader Announcer specifically for VoiceOver + Safari
881
883
  // as the Aria design pattern for combobox does not work in this case
882
884
  // for details: https://a11y-internal.atlassian.net/browse/AK-740
883
- var screenReaderText = _utils.browser.safari && this.getScreenReaderText();
885
+ var screenReaderText = browser.safari && this.getScreenReaderText();
884
886
  return (0, _react2.jsx)("div", {
885
887
  "aria-label": "Hyperlink Edit"
886
888
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "109.14.1";
19
+ var packageVersion = "109.15.0";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -11,6 +11,7 @@ var _react = _interopRequireWildcard(require("react"));
11
11
  var _bindEventListener = require("bind-event-listener");
12
12
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
13
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
15
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
15
16
  var _analytics = require("../analytics");
16
17
  var _styles = require("../styles");
@@ -140,6 +141,7 @@ var BreakoutResizer = exports.BreakoutResizer = function BreakoutResizer(_ref) {
140
141
  currentLayout = _useBreakoutGuideline.currentLayout,
141
142
  guidelines = _useBreakoutGuideline.guidelines,
142
143
  setCurrentWidth = _useBreakoutGuideline.setCurrentWidth;
144
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
143
145
  (0, _react.useEffect)(function () {
144
146
  if (displayGuidelines) {
145
147
  displayGuidelines(guidelines || []);
@@ -263,7 +265,7 @@ var BreakoutResizer = exports.BreakoutResizer = function BreakoutResizer(_ref) {
263
265
  }, [handleResizeStop, maxWidth, minWidth, parentRef]);
264
266
  var resizeHandleKeyDownHandler = (0, _react.useCallback)(function (event) {
265
267
  var isBracketKey = event.code === 'BracketRight' || event.code === 'BracketLeft';
266
- var metaKey = _browser.browser.mac ? event.metaKey : event.ctrlKey;
268
+ var metaKey = browser.mac ? event.metaKey : event.ctrlKey;
267
269
  if (event.altKey || metaKey || event.shiftKey) {
268
270
  areResizeMetaKeysPressed.current = true;
269
271
  }
@@ -275,7 +277,7 @@ var BreakoutResizer = exports.BreakoutResizer = function BreakoutResizer(_ref) {
275
277
  } else if (!areResizeMetaKeysPressed.current) {
276
278
  handleEscape();
277
279
  }
278
- }, [handleEscape, handleLayoutSizeChangeOnKeypress]);
280
+ }, [handleEscape, handleLayoutSizeChangeOnKeypress, browser]);
279
281
  var resizeHandleKeyUpHandler = (0, _react.useCallback)(function (event) {
280
282
  if (event.altKey || event.metaKey) {
281
283
  areResizeMetaKeysPressed.current = false;
@@ -287,7 +289,7 @@ var BreakoutResizer = exports.BreakoutResizer = function BreakoutResizer(_ref) {
287
289
  return;
288
290
  }
289
291
  var resizeHandleThumbEl = resizerRef.current.getResizerThumbEl();
290
- var metaKey = _browser.browser.mac ? event.metaKey : event.ctrlKey;
292
+ var metaKey = browser.mac ? event.metaKey : event.ctrlKey;
291
293
  var isTargetResizeHandle = event.target instanceof HTMLElement && event.target.classList.contains('resizer-handle-thumb');
292
294
  if (event.altKey && event.shiftKey && metaKey && event.code === 'KeyR' || isTargetResizeHandle && (event.altKey || metaKey || event.shiftKey)) {
293
295
  event.preventDefault();
@@ -301,7 +303,7 @@ var BreakoutResizer = exports.BreakoutResizer = function BreakoutResizer(_ref) {
301
303
  inline: 'nearest'
302
304
  });
303
305
  }
304
- }, [resizerRef]);
306
+ }, [resizerRef, browser]);
305
307
  (0, _react.useLayoutEffect)(function () {
306
308
  if (!resizerRef.current || !editorView) {
307
309
  return;
@@ -57,10 +57,10 @@ var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
57
57
  (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t> :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)) {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t"]))) : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
58
58
  (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t> :first-child:not(style),\n\t\t\t\t> style:first-child + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + span + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t"])));
59
59
  };
60
-
61
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Appears safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing
62
60
  var tableSharedStyle = exports.tableSharedStyle = function tableSharedStyle() {
63
- return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t", "\n\t.", " {\n\t\tposition: relative;\n\t\tmargin: 0 auto ", ";\n\t\tbox-sizing: border-box;\n\n\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.", "[data-number-column='true'] {\n\t\tpadding-left: ", "px;\n\t\tclear: both;\n\t}\n\n\t.", " {\n\t\twill-change: width, margin-left;\n\t}\n\n\t.", " table {\n\t\twill-change: width;\n\t}\n\n\t.", " > table {\n\t\tmargin: ", " 0 0 0;\n\t}\n\n\t.", " > table,\n\t.", " > table {\n\t\tmargin: ", " ", " 0 0;\n\t}\n\n\t/* support panel nested in table */\n\t", "\n\n\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\tborder-collapse: collapse;\n\t\tborder: ", "px solid\n\t\t\t", ";\n\t\ttable-layout: fixed;\n\t\tfont-size: 1em;\n\t\twidth: 100%;\n\n\t\t&[data-autosize='true'] {\n\t\t\ttable-layout: auto;\n\t\t}\n\n\t\t& {\n\t\t\t* {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\thr {\n\t\t\t\tbox-sizing: content-box;\n\t\t\t}\n\n\t\t\ttbody {\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t\tth td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\n\t\t\t> tbody > tr > th,\n\t\t\t> tbody > tr > td {\n\t\t\t\tmin-width: ", "px;\n\t\t\t\tfont-weight: ", ";\n\t\t\t\tvertical-align: top;\n\t\t\t\tborder: 1px solid ", ";\n\t\t\t\tborder-right-width: 0;\n\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\tpadding: ", ";\n\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t", "\n\n\t\t\t\t", "\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Ensures nested tables are compatible with parent table background color - uses specificity to ensure tables nested by extensions are not affected */\n\t\t\t> tbody > tr > td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\n\t\t\tth {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\ttext-align: left;\n\n\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t", " {\n\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t/* selector lives inside @atlaskit/code */\n\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"])), (0, _tableCell.tableCellBackgroundStyleOverride)(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", (0, _platformFeatureFlags.fg)('platform_editor_bordered_panel_nested_in_table') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " .ak-editor-panel {\n\t\t\tborder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #d9dbea)", ";\n\t\t}") : '', TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, "var(--ds-font-weight-regular, 400)", "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-space-100, 8px)", _browser.browser.gecko || _browser.browser.ie || _browser.browser.mac && _browser.browser.chrome ? 'background-clip: padding-box;' : '', firstNodeWithNotMarginTop(), "var(--ds-space-150, 12px)", "var(--ds-surface, #FFFFFF)", "var(--ds-background-accent-gray-subtlest, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"), (0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true) ? '&:not(.danger)' : '&:not([style]):not(.danger)', _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", _editorSharedStyles.akEditorSelectedNodeClassName, "var(--ds-border, transparent)", _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, (0, _editorSharedStyles.overflowShadow)({
61
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
62
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Appears safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing
63
+ return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\t", "\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tmargin: 0 auto ", ";\n\t\t\tbox-sizing: border-box;\n\n\t\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\t\t.", "[data-number-column='true'] {\n\t\t\tpadding-left: ", "px;\n\t\t\tclear: both;\n\t\t}\n\n\t\t.", " {\n\t\t\twill-change: width, margin-left;\n\t\t}\n\n\t\t.", " table {\n\t\t\twill-change: width;\n\t\t}\n\n\t\t.", " > table {\n\t\t\tmargin: ", " 0 0 0;\n\t\t}\n\n\t\t.", " > table,\n\t\t.", " > table {\n\t\t\tmargin: ", " ", " 0 0;\n\t\t}\n\n\t\t/* support panel nested in table */\n\t\t", "\n\n\t\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\t\tborder-collapse: collapse;\n\t\t\tborder: ", "px solid\n\t\t\t\t", ";\n\t\t\ttable-layout: fixed;\n\t\t\tfont-size: 1em;\n\t\t\twidth: 100%;\n\n\t\t\t&[data-autosize='true'] {\n\t\t\t\ttable-layout: auto;\n\t\t\t}\n\n\t\t\t& {\n\t\t\t\t* {\n\t\t\t\t\tbox-sizing: border-box;\n\t\t\t\t}\n\t\t\t\thr {\n\t\t\t\t\tbox-sizing: content-box;\n\t\t\t\t}\n\n\t\t\t\ttbody {\n\t\t\t\t\tborder-bottom: none;\n\t\t\t\t}\n\t\t\t\tth td {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t}\n\n\t\t\t\t> tbody > tr > th,\n\t\t\t\t> tbody > tr > td {\n\t\t\t\t\tmin-width: ", "px;\n\t\t\t\t\tfont-weight: ", ";\n\t\t\t\t\tvertical-align: top;\n\t\t\t\t\tborder: 1px solid ", ";\n\t\t\t\t\tborder-right-width: 0;\n\t\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\t\tpadding: ", ";\n\t\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t\t", "\n\n\t\t\t\t\t", "\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Ensures nested tables are compatible with parent table background color - uses specificity to ensure tables nested by extensions are not affected */\n\t\t\t\t> tbody > tr > td {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t}\n\n\t\t\t\tth {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\ttext-align: left;\n\n\t\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t\t", " {\n\t\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t\t/* selector lives inside @atlaskit/code */\n\t\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"])), (0, _tableCell.tableCellBackgroundStyleOverride)(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", (0, _platformFeatureFlags.fg)('platform_editor_bordered_panel_nested_in_table') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " .ak-editor-panel {\n\t\t\tborder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #d9dbea)", ";\n\t\t}") : '', TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, "var(--ds-font-weight-regular, 400)", "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")"), "var(--ds-space-100, 8px)", browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', firstNodeWithNotMarginTop(), "var(--ds-space-150, 12px)", "var(--ds-surface, #FFFFFF)", "var(--ds-background-accent-gray-subtlest, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"), (0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true) ? '&:not(.danger)' : '&:not([style]):not(.danger)', _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", _editorSharedStyles.akEditorSelectedNodeClassName, "var(--ds-border, transparent)", _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, (0, _editorSharedStyles.overflowShadow)({
64
64
  leftCoverWidth: "var(--ds-space-300, 24px)"
65
65
  }), "var(--ds-background-neutral, rgb(235, 237, 240))", _codeBlock.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, rgb(226, 229, 233))", (0, _editorSharedStyles.overflowShadow)({
66
66
  leftCoverWidth: "var(--ds-space-300, 24px)"
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "109.14.1";
27
+ var packageVersion = "109.15.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -14,7 +14,8 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _react = require("react");
16
16
  var _react2 = require("@emotion/react");
17
- var _utils = require("../../utils");
17
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
+ var _browser = require("../../utils/browser");
18
19
  var _styles = require("./styles");
19
20
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
20
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
@@ -173,11 +174,12 @@ var PanelTextInput = exports.default = /*#__PURE__*/function (_PureComponent) {
173
174
  // Ignored via go/ees005
174
175
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
175
176
  function isUndoEvent(event) {
177
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
176
178
  return event.keyCode === KeyZCode && (
177
179
  // cmd + z for mac
178
- _utils.browser.mac && event.metaKey && !event.shiftKey ||
180
+ browser.mac && event.metaKey && !event.shiftKey ||
179
181
  // ctrl + z for non-mac
180
- !_utils.browser.mac && event.ctrlKey);
182
+ !browser.mac && event.ctrlKey);
181
183
  }
182
184
 
183
185
  // Ignored via go/ees005
@@ -185,9 +187,10 @@ var PanelTextInput = exports.default = /*#__PURE__*/function (_PureComponent) {
185
187
  }, {
186
188
  key: "isRedoEvent",
187
189
  value: function isRedoEvent(event) {
190
+ var browser = (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) ? (0, _browser.getBrowserInfo)() : _browser.browser;
188
191
  return (
189
192
  // ctrl + y for non-mac
190
- !_utils.browser.mac && event.ctrlKey && event.keyCode === KeyYCode || _utils.browser.mac && event.metaKey && event.shiftKey && event.keyCode === KeyZCode || event.ctrlKey && event.shiftKey && event.keyCode === KeyZCode
193
+ !browser.mac && event.ctrlKey && event.keyCode === KeyYCode || browser.mac && event.metaKey && event.shiftKey && event.keyCode === KeyZCode || event.ctrlKey && event.shiftKey && event.keyCode === KeyZCode
191
194
  );
192
195
  }
193
196
  }]);
@@ -104,6 +104,42 @@ var getSecondMatch = function getSecondMatch(regexp, ua) {
104
104
  return match && match.length > 0 && match[2] || '';
105
105
  };
106
106
 
107
+ // Helper functions to safely access browser properties
108
+ var getSafeUserAgent = function getSafeUserAgent() {
109
+ var _window$navigator;
110
+ if (typeof window === 'undefined') {
111
+ return undefined;
112
+ }
113
+
114
+ // Check for SSR user agent first
115
+ if (process.env.REACT_SSR) {
116
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
117
+ var ssrUserAgent = window.__SSR_USER_AGENT__;
118
+ if (ssrUserAgent) {
119
+ return ssrUserAgent;
120
+ }
121
+ }
122
+
123
+ // Fallback to navigator.userAgent with proper null checking
124
+ return (_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : _window$navigator.userAgent;
125
+ };
126
+ var getSafePlatform = function getSafePlatform() {
127
+ var _window$navigator2;
128
+ if (typeof window === 'undefined') {
129
+ return undefined;
130
+ }
131
+ return (_window$navigator2 = window.navigator) === null || _window$navigator2 === void 0 ? void 0 : _window$navigator2.platform;
132
+ };
133
+ var hasIntersectionObserver = function hasIntersectionObserver() {
134
+ return typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window &&
135
+ // Ignored via go/ees005
136
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
137
+ 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
138
+ };
139
+ var hasResizeObserver = function hasResizeObserver() {
140
+ return typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
141
+ };
142
+
107
143
  // New API to get the browser info on demand
108
144
  var getBrowserInfo = exports.getBrowserInfo = (0, _memoizeOne.default)(function () {
109
145
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -124,9 +160,8 @@ var getBrowserInfo = exports.getBrowserInfo = (0, _memoizeOne.default)(function
124
160
  supportsIntersectionObserver: false,
125
161
  supportsResizeObserver: false
126
162
  };
127
- var userAgent = process.env.REACT_SSR ?
128
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
129
- window.__SSR_USER_AGENT__ : navigator.userAgent;
163
+ var userAgent = getSafeUserAgent();
164
+ var platform = getSafePlatform();
130
165
  if (userAgent) {
131
166
  // inspired from https://github.com/bowser-js/bowser/blob/master/src/parser-browsers.js
132
167
  // Ignored via go/ees005
@@ -137,9 +172,11 @@ var getBrowserInfo = exports.getBrowserInfo = (0, _memoizeOne.default)(function
137
172
  // eslint-disable-next-line require-unicode-regexp
138
173
  var internetExplorer = /msie|trident/i.test(userAgent);
139
174
 
175
+ // Ideally we should use userAgent instead of platform, but we have lots of keymap tests failure when we change it
176
+ // So leave it as is for now.
140
177
  // Ignored via go/ees005
141
178
  // eslint-disable-next-line require-unicode-regexp
142
- result.mac = /macintosh/i.test(userAgent);
179
+ result.mac = platform && /Mac/.test(platform);
143
180
 
144
181
  // Previously relied on navigator.userAgentData?.platform and userAgent, now used only userAgent
145
182
  result.windows =
@@ -194,11 +231,8 @@ var getBrowserInfo = exports.getBrowserInfo = (0, _memoizeOne.default)(function
194
231
  // Previously we relied on documentElement.style.WebkitAppearance, now changed to userAgent
195
232
  // eslint-disable-next-line require-unicode-regexp
196
233
  result.webkit = /(apple)?webkit/i.test(userAgent);
197
- result.supportsIntersectionObserver = typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window &&
198
- // Ignored via go/ees005
199
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
200
- 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
201
- result.supportsResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
234
+ result.supportsIntersectionObserver = hasIntersectionObserver();
235
+ result.supportsResizeObserver = hasResizeObserver();
202
236
  }
203
237
  return result;
204
238
  });
@@ -1,8 +1,9 @@
1
1
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
2
2
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill } from '../clipboard';
5
- import { browser } from '../utils';
6
+ import { browser as browserLegacy, getBrowserInfo } from '../utils/browser';
6
7
  export function getSelectedNodeOrNodeParentByNodeType({
7
8
  nodeType,
8
9
  selection
@@ -21,6 +22,7 @@ export const copyDomNode = (domNode, nodeType, selection) => {
21
22
  const div = document.createElement('div');
22
23
  div.appendChild(domNode);
23
24
  const schema = selection.$from.doc.type.schema;
25
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
24
26
 
25
27
  // if copying inline content
26
28
  if (nodeType.inlineContent) {
@@ -7,8 +7,9 @@ import React, { Fragment } from 'react';
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import { base, keyName } from 'w3c-keyname';
10
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
11
  import { editorCommandToPMCommand } from '../preset/editor-commands';
11
- import { browser } from '../utils';
12
+ import { browser as browserLegacy, getBrowserInfo } from '../utils/browser';
12
13
  export const addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
13
14
  export const navToEditorToolbar = makeKeyMapWithCommon('Navigate to editor toolbar', 'Alt-F9');
14
15
  export const navToFloatingToolbar = makeKeyMapWithCommon('Navigate to floating toolbar', 'Alt-F10');
@@ -123,6 +124,7 @@ const tooltipShortcutStyle = css({
123
124
  });
124
125
  export function formatShortcut(keymap) {
125
126
  let shortcut;
127
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
126
128
  if (browser.mac) {
127
129
  // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
128
130
  shortcut = keymap.mac
@@ -201,6 +203,7 @@ export function findShortcutByDescription(description) {
201
203
  return;
202
204
  }
203
205
  export function findShortcutByKeymap(keymap) {
206
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
204
207
  if (browser.mac) {
205
208
  return keymap.mac;
206
209
  }
@@ -208,6 +211,7 @@ export function findShortcutByKeymap(keymap) {
208
211
  }
209
212
  export function getAriaKeyshortcuts(keymap) {
210
213
  let keyShortcuts;
214
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
211
215
  if (typeof keymap === 'string') {
212
216
  keyShortcuts = keymap;
213
217
  } else if (typeof keymap === 'object') {
@@ -298,6 +302,7 @@ export function bindKeymapWithEditorCommand(shortcut, cmd, keymap) {
298
302
  }
299
303
  export function findKeyMapForBrowser(keyMap) {
300
304
  if (keyMap) {
305
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
301
306
  if (browser.mac) {
302
307
  return keyMap.mac;
303
308
  }
@@ -22,7 +22,8 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
22
22
  import Tooltip from '@atlaskit/tooltip';
23
23
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, INPUT_METHOD } from '../../../analytics';
24
24
  import { Announcer, PanelTextInput } from '../../../ui';
25
- import { browser, normalizeUrl } from '../../../utils';
25
+ import { normalizeUrl } from '../../../utils';
26
+ import { browser as browserLegacy, getBrowserInfo } from '../../../utils/browser';
26
27
  import LinkSearchList, { LinkSearchListNext } from '../../LinkSearch/LinkSearchList';
27
28
  import { container, containerWithProvider, inputWrapper } from '../../LinkSearch/ToolbarComponents';
28
29
  import { transformTimeStamp } from '../../LinkSearch/transformTimeStamp';
@@ -729,6 +730,7 @@ export class HyperlinkLinkAddToolbar extends PureComponent {
729
730
  const ariaActiveDescendant = selectedIndex > -1 ? `link-search-list-item-${selectedIndex}` : '';
730
731
  const linkSearchInputId = 'search-recent-links-field-id';
731
732
  const displayTextInputId = 'display-text-filed-id';
733
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
732
734
  // Added workaround with a screen reader Announcer specifically for VoiceOver + Safari
733
735
  // as the Aria design pattern for combobox does not work in this case
734
736
  // for details: https://a11y-internal.atlassian.net/browse/AK-740
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "109.14.1";
4
+ const packageVersion = "109.15.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -2,10 +2,11 @@ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSta
2
2
  import { bind, bindAll } from 'bind-event-listener';
3
3
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
4
4
  import { fg } from '@atlaskit/platform-feature-flags';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
7
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
7
8
  import { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN } from '../styles';
8
- import { browser } from '../utils/browser';
9
+ import { browser as browserLegacy, getBrowserInfo } from '../utils/browser';
9
10
  import Resizer from './Resizer';
10
11
  import { ResizerBreakoutModeLabel } from './ResizerBreakoutModeLabel';
11
12
  import { SNAP_GAP, useBreakoutGuidelines } from './useBreakoutGuidelines';
@@ -129,6 +130,7 @@ const BreakoutResizer = ({
129
130
  guidelines,
130
131
  setCurrentWidth
131
132
  } = useBreakoutGuidelines(getEditorWidth, isResizing && editorExperiment('single_column_layouts', true), dynamicFullWidthGuidelineOffset);
133
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
132
134
  useEffect(() => {
133
135
  if (displayGuidelines) {
134
136
  displayGuidelines(guidelines || []);
@@ -271,7 +273,7 @@ const BreakoutResizer = ({
271
273
  } else if (!areResizeMetaKeysPressed.current) {
272
274
  handleEscape();
273
275
  }
274
- }, [handleEscape, handleLayoutSizeChangeOnKeypress]);
276
+ }, [handleEscape, handleLayoutSizeChangeOnKeypress, browser]);
275
277
  const resizeHandleKeyUpHandler = useCallback(event => {
276
278
  if (event.altKey || event.metaKey) {
277
279
  areResizeMetaKeysPressed.current = false;
@@ -297,7 +299,7 @@ const BreakoutResizer = ({
297
299
  inline: 'nearest'
298
300
  });
299
301
  }
300
- }, [resizerRef]);
302
+ }, [resizerRef, browser]);
301
303
  useLayoutEffect(() => {
302
304
  if (!resizerRef.current || !editorView) {
303
305
  return;
@@ -4,7 +4,7 @@ import { tableCellContentDomSelector, tableCellSelector, tableHeaderSelector, ta
4
4
  import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorSelectedNodeClassName, akEditorTableBorder, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorWideLayoutWidth, overflowShadow } from '@atlaskit/editor-shared-styles';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
- import { browser } from '../../utils/browser';
7
+ import { browser as browserLegacy, getBrowserInfo } from '../../utils/browser';
8
8
  import { CodeBlockSharedCssClassName } from './code-block';
9
9
  import { tableCellBackgroundStyleOverride } from './tableCell';
10
10
  export const tableMarginTop = 24;
@@ -68,148 +68,150 @@ css`
68
68
  margin-top: 0;
69
69
  }
70
70
  `;
71
-
72
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Appears safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing
73
- const tableSharedStyle = () => css`
74
- ${tableCellBackgroundStyleOverride()}
75
- .${TableSharedCssClassName.TABLE_CONTAINER} {
76
- position: relative;
77
- margin: 0 auto ${"var(--ds-space-200, 16px)"};
78
- box-sizing: border-box;
79
-
80
- /**
71
+ const tableSharedStyle = () => {
72
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
73
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Appears safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing
74
+ return css`
75
+ ${tableCellBackgroundStyleOverride()}
76
+ .${TableSharedCssClassName.TABLE_CONTAINER} {
77
+ position: relative;
78
+ margin: 0 auto ${"var(--ds-space-200, 16px)"};
79
+ box-sizing: border-box;
80
+
81
+ /**
81
82
  * Fix block top alignment inside table cells.
82
83
  */
83
- .decisionItemView-content-wrap:first-of-type > div {
84
- margin-top: 0;
84
+ .decisionItemView-content-wrap:first-of-type > div {
85
+ margin-top: 0;
86
+ }
87
+ }
88
+ .${TableSharedCssClassName.TABLE_CONTAINER}[data-number-column='true'] {
89
+ padding-left: ${akEditorTableNumberColumnWidth - 1}px;
90
+ clear: both;
85
91
  }
86
- }
87
- .${TableSharedCssClassName.TABLE_CONTAINER}[data-number-column='true'] {
88
- padding-left: ${akEditorTableNumberColumnWidth - 1}px;
89
- clear: both;
90
- }
91
92
 
92
- .${TableSharedCssClassName.TABLE_RESIZER_CONTAINER} {
93
- will-change: width, margin-left;
94
- }
93
+ .${TableSharedCssClassName.TABLE_RESIZER_CONTAINER} {
94
+ will-change: width, margin-left;
95
+ }
95
96
 
96
- .${TableSharedCssClassName.TABLE_RESIZER_CONTAINER} table {
97
- will-change: width;
98
- }
97
+ .${TableSharedCssClassName.TABLE_RESIZER_CONTAINER} table {
98
+ will-change: width;
99
+ }
99
100
 
100
- .${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table {
101
- margin: ${"var(--ds-space-300, 24px)"} 0 0 0;
102
- }
101
+ .${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table {
102
+ margin: ${"var(--ds-space-300, 24px)"} 0 0 0;
103
+ }
103
104
 
104
- .${TableSharedCssClassName.TABLE_CONTAINER} > table,
105
- .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table {
106
- margin: ${"var(--ds-space-300, 24px)"} ${"var(--ds-space-100, 8px)"} 0 0;
107
- }
105
+ .${TableSharedCssClassName.TABLE_CONTAINER} > table,
106
+ .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table {
107
+ margin: ${"var(--ds-space-300, 24px)"} ${"var(--ds-space-100, 8px)"} 0 0;
108
+ }
108
109
 
109
- /* support panel nested in table */
110
- ${fg('platform_editor_bordered_panel_nested_in_table') ? `.${TableSharedCssClassName.TABLE_NODE_WRAPPER} .ak-editor-panel {
110
+ /* support panel nested in table */
111
+ ${fg('platform_editor_bordered_panel_nested_in_table') ? `.${TableSharedCssClassName.TABLE_NODE_WRAPPER} .ak-editor-panel {
111
112
  border: ${"var(--ds-border-width, 1px)"} solid ${"var(--ds-border, #d9dbea)"};
112
113
  }` : ''}
113
114
 
114
- /* avoid applying styles to nested tables (possible via extensions) */
115
+ /* avoid applying styles to nested tables (possible via extensions) */
115
116
  .${TableSharedCssClassName.TABLE_CONTAINER} > table,
116
117
  .${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table,
117
118
  .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table {
118
- border-collapse: collapse;
119
- border: ${tableCellBorderWidth}px solid
120
- ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`};
121
- table-layout: fixed;
122
- font-size: 1em;
123
- width: 100%;
124
-
125
- &[data-autosize='true'] {
126
- table-layout: auto;
127
- }
128
-
129
- & {
130
- * {
131
- box-sizing: border-box;
132
- }
133
- hr {
134
- box-sizing: content-box;
119
+ border-collapse: collapse;
120
+ border: ${tableCellBorderWidth}px solid
121
+ ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`};
122
+ table-layout: fixed;
123
+ font-size: 1em;
124
+ width: 100%;
125
+
126
+ &[data-autosize='true'] {
127
+ table-layout: auto;
135
128
  }
136
129
 
137
- tbody {
138
- border-bottom: none;
139
- }
140
- th td {
141
- background-color: ${"var(--ds-background-neutral-subtle, white)"};
142
- }
130
+ & {
131
+ * {
132
+ box-sizing: border-box;
133
+ }
134
+ hr {
135
+ box-sizing: content-box;
136
+ }
143
137
 
144
- > tbody > tr > th,
145
- > tbody > tr > td {
146
- min-width: ${tableCellMinWidth}px;
147
- font-weight: ${"var(--ds-font-weight-regular, 400)"};
148
- vertical-align: top;
149
- border: 1px solid ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`};
150
- border-right-width: 0;
151
- border-bottom-width: 0;
138
+ tbody {
139
+ border-bottom: none;
140
+ }
141
+ th td {
142
+ background-color: ${"var(--ds-background-neutral-subtle, white)"};
143
+ }
144
+
145
+ > tbody > tr > th,
146
+ > tbody > tr > td {
147
+ min-width: ${tableCellMinWidth}px;
148
+ font-weight: ${"var(--ds-font-weight-regular, 400)"};
149
+ vertical-align: top;
150
+ border: 1px solid ${`var(--ds-background-accent-gray-subtler, ${akEditorTableBorder})`};
151
+ border-right-width: 0;
152
+ border-bottom-width: 0;
152
153
 
153
- padding: ${"var(--ds-space-100, 8px)"};
154
- /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */
155
- ${browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : ''}
154
+ padding: ${"var(--ds-space-100, 8px)"};
155
+ /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */
156
+ ${browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : ''}
156
157
 
157
- ${firstNodeWithNotMarginTop()}
158
+ ${firstNodeWithNotMarginTop()}
158
159
 
159
160
  th p:not(:first-of-type),
160
161
  td p:not(:first-of-type) {
161
- margin-top: ${"var(--ds-space-150, 12px)"};
162
+ margin-top: ${"var(--ds-space-150, 12px)"};
163
+ }
162
164
  }
163
- }
164
165
 
165
- /* Ensures nested tables are compatible with parent table background color - uses specificity to ensure tables nested by extensions are not affected */
166
- > tbody > tr > td {
167
- background-color: ${"var(--ds-surface, #FFFFFF)"};
168
- }
166
+ /* Ensures nested tables are compatible with parent table background color - uses specificity to ensure tables nested by extensions are not affected */
167
+ > tbody > tr > td {
168
+ background-color: ${"var(--ds-surface, #FFFFFF)"};
169
+ }
169
170
 
170
- th {
171
- background-color: ${`var(--ds-background-accent-gray-subtlest, ${akEditorTableToolbar})`};
172
- text-align: left;
171
+ th {
172
+ background-color: ${`var(--ds-background-accent-gray-subtlest, ${akEditorTableToolbar})`};
173
+ text-align: left;
173
174
 
174
- /* only apply this styling to codeblocks in default background headercells */
175
- /* TODO this needs to be overhauled as it relies on unsafe selectors */
176
- ${expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? '&:not(.danger)' : '&:not([style]):not(.danger)'} {
177
- .${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER}:not(.danger) {
178
- background-color: ${"var(--ds-surface-raised, rgb(235, 237, 240))"};
175
+ /* only apply this styling to codeblocks in default background headercells */
176
+ /* TODO this needs to be overhauled as it relies on unsafe selectors */
177
+ ${expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? '&:not(.danger)' : '&:not([style]):not(.danger)'} {
178
+ .${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER}:not(.danger) {
179
+ background-color: ${"var(--ds-surface-raised, rgb(235, 237, 240))"};
179
180
 
180
- :not(.${akEditorSelectedNodeClassName}) {
181
- box-shadow: 0px 0px 0px 1px ${"var(--ds-border, transparent)"};
182
- }
181
+ :not(.${akEditorSelectedNodeClassName}) {
182
+ box-shadow: 0px 0px 0px 1px ${"var(--ds-border, transparent)"};
183
+ }
183
184
 
184
- .${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER} {
185
- background-image: ${overflowShadow({
186
- leftCoverWidth: "var(--ds-space-300, 24px)"
187
- })};
185
+ .${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER} {
186
+ background-image: ${overflowShadow({
187
+ leftCoverWidth: "var(--ds-space-300, 24px)"
188
+ })};
188
189
 
189
- background-color: ${"var(--ds-background-neutral, rgb(235, 237, 240))"};
190
- }
190
+ background-color: ${"var(--ds-background-neutral, rgb(235, 237, 240))"};
191
+ }
191
192
 
192
- .${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER} {
193
- background-color: ${"var(--ds-background-neutral, rgb(226, 229, 233))"};
194
- }
193
+ .${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER} {
194
+ background-color: ${"var(--ds-background-neutral, rgb(226, 229, 233))"};
195
+ }
195
196
 
196
- /* this is only relevant to the element taken care of by renderer */
197
- > [data-ds--code--code-block] {
198
- background-image: ${overflowShadow({
199
- leftCoverWidth: "var(--ds-space-300, 24px)"
200
- })}!important;
197
+ /* this is only relevant to the element taken care of by renderer */
198
+ > [data-ds--code--code-block] {
199
+ background-image: ${overflowShadow({
200
+ leftCoverWidth: "var(--ds-space-300, 24px)"
201
+ })}!important;
201
202
 
202
- background-color: ${"var(--ds-background-neutral, rgb(235, 237, 240))"}!important;
203
+ background-color: ${"var(--ds-background-neutral, rgb(235, 237, 240))"}!important;
203
204
 
204
- /* selector lives inside @atlaskit/code */
205
- --ds--code--line-number-bg-color: ${"var(--ds-background-neutral, rgb(226, 229, 233))"};
205
+ /* selector lives inside @atlaskit/code */
206
+ --ds--code--line-number-bg-color: ${"var(--ds-background-neutral, rgb(226, 229, 233))"};
207
+ }
206
208
  }
207
209
  }
208
210
  }
209
211
  }
210
212
  }
211
- }
212
- `;
213
+ `;
214
+ };
213
215
  export const calcTableWidth = (layout, containerWidth, addControllerPadding = true) => {
214
216
  switch (layout) {
215
217
  case 'full-width':
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "109.14.1";
17
+ const packageVersion = "109.15.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -8,7 +8,8 @@ import { PureComponent } from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { jsx } from '@emotion/react';
11
- import { browser } from '../../utils';
11
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
+ import { browser as browserLegacy, getBrowserInfo } from '../../utils/browser';
12
13
  import { panelTextInput, panelTextInputWithCustomWidth } from './styles';
13
14
  const KeyZCode = 90;
14
15
  const KeyYCode = 89;
@@ -157,6 +158,7 @@ export default class PanelTextInput extends PureComponent {
157
158
  // Ignored via go/ees005
158
159
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
159
160
  isUndoEvent(event) {
161
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
160
162
  return event.keyCode === KeyZCode && (
161
163
  // cmd + z for mac
162
164
  browser.mac && event.metaKey && !event.shiftKey ||
@@ -167,6 +169,7 @@ export default class PanelTextInput extends PureComponent {
167
169
  // Ignored via go/ees005
168
170
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
169
171
  isRedoEvent(event) {
172
+ const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
170
173
  return (
171
174
  // ctrl + y for non-mac
172
175
  !browser.mac && event.ctrlKey && event.keyCode === KeyYCode || browser.mac && event.metaKey && event.shiftKey && event.keyCode === KeyZCode || event.ctrlKey && event.shiftKey && event.keyCode === KeyZCode
@@ -98,6 +98,42 @@ const getSecondMatch = (regexp, ua) => {
98
98
  return match && match.length > 0 && match[2] || '';
99
99
  };
100
100
 
101
+ // Helper functions to safely access browser properties
102
+ const getSafeUserAgent = () => {
103
+ var _window$navigator;
104
+ if (typeof window === 'undefined') {
105
+ return undefined;
106
+ }
107
+
108
+ // Check for SSR user agent first
109
+ if (process.env.REACT_SSR) {
110
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
111
+ const ssrUserAgent = window.__SSR_USER_AGENT__;
112
+ if (ssrUserAgent) {
113
+ return ssrUserAgent;
114
+ }
115
+ }
116
+
117
+ // Fallback to navigator.userAgent with proper null checking
118
+ return (_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : _window$navigator.userAgent;
119
+ };
120
+ const getSafePlatform = () => {
121
+ var _window$navigator2;
122
+ if (typeof window === 'undefined') {
123
+ return undefined;
124
+ }
125
+ return (_window$navigator2 = window.navigator) === null || _window$navigator2 === void 0 ? void 0 : _window$navigator2.platform;
126
+ };
127
+ const hasIntersectionObserver = () => {
128
+ return typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window &&
129
+ // Ignored via go/ees005
130
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
131
+ 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
132
+ };
133
+ const hasResizeObserver = () => {
134
+ return typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
135
+ };
136
+
101
137
  // New API to get the browser info on demand
102
138
  export const getBrowserInfo = memorizeOne(() => {
103
139
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -118,9 +154,8 @@ export const getBrowserInfo = memorizeOne(() => {
118
154
  supportsIntersectionObserver: false,
119
155
  supportsResizeObserver: false
120
156
  };
121
- const userAgent = process.env.REACT_SSR ?
122
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
123
- window.__SSR_USER_AGENT__ : navigator.userAgent;
157
+ const userAgent = getSafeUserAgent();
158
+ const platform = getSafePlatform();
124
159
  if (userAgent) {
125
160
  // inspired from https://github.com/bowser-js/bowser/blob/master/src/parser-browsers.js
126
161
  // Ignored via go/ees005
@@ -131,9 +166,11 @@ export const getBrowserInfo = memorizeOne(() => {
131
166
  // eslint-disable-next-line require-unicode-regexp
132
167
  const internetExplorer = /msie|trident/i.test(userAgent);
133
168
 
169
+ // Ideally we should use userAgent instead of platform, but we have lots of keymap tests failure when we change it
170
+ // So leave it as is for now.
134
171
  // Ignored via go/ees005
135
172
  // eslint-disable-next-line require-unicode-regexp
136
- result.mac = /macintosh/i.test(userAgent);
173
+ result.mac = platform && /Mac/.test(platform);
137
174
 
138
175
  // Previously relied on navigator.userAgentData?.platform and userAgent, now used only userAgent
139
176
  result.windows =
@@ -188,11 +225,8 @@ export const getBrowserInfo = memorizeOne(() => {
188
225
  // Previously we relied on documentElement.style.WebkitAppearance, now changed to userAgent
189
226
  // eslint-disable-next-line require-unicode-regexp
190
227
  result.webkit = /(apple)?webkit/i.test(userAgent);
191
- result.supportsIntersectionObserver = typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window &&
192
- // Ignored via go/ees005
193
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
194
- 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
195
- result.supportsResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
228
+ result.supportsIntersectionObserver = hasIntersectionObserver();
229
+ result.supportsResizeObserver = hasResizeObserver();
196
230
  }
197
231
  return result;
198
232
  });
@@ -1,8 +1,9 @@
1
1
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
2
2
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill } from '../clipboard';
5
- import { browser } from '../utils';
6
+ import { browser as browserLegacy, getBrowserInfo } from '../utils/browser';
6
7
  export function getSelectedNodeOrNodeParentByNodeType(_ref) {
7
8
  var nodeType = _ref.nodeType,
8
9
  selection = _ref.selection;
@@ -20,6 +21,7 @@ export var copyDomNode = function copyDomNode(domNode, nodeType, selection) {
20
21
  var div = document.createElement('div');
21
22
  div.appendChild(domNode);
22
23
  var schema = selection.$from.doc.type.schema;
24
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
23
25
 
24
26
  // if copying inline content
25
27
  if (nodeType.inlineContent) {
@@ -8,8 +8,9 @@ import React, { Fragment } from 'react';
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { base, keyName } from 'w3c-keyname';
11
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
12
  import { editorCommandToPMCommand } from '../preset/editor-commands';
12
- import { browser } from '../utils';
13
+ import { browser as browserLegacy, getBrowserInfo } from '../utils/browser';
13
14
  export var addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
14
15
  export var navToEditorToolbar = makeKeyMapWithCommon('Navigate to editor toolbar', 'Alt-F9');
15
16
  export var navToFloatingToolbar = makeKeyMapWithCommon('Navigate to floating toolbar', 'Alt-F10');
@@ -124,6 +125,7 @@ var tooltipShortcutStyle = css({
124
125
  });
125
126
  export function formatShortcut(keymap) {
126
127
  var shortcut;
128
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
127
129
  if (browser.mac) {
128
130
  // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
129
131
  shortcut = keymap.mac
@@ -205,6 +207,7 @@ export function findShortcutByDescription(description) {
205
207
  return;
206
208
  }
207
209
  export function findShortcutByKeymap(keymap) {
210
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
208
211
  if (browser.mac) {
209
212
  return keymap.mac;
210
213
  }
@@ -212,6 +215,7 @@ export function findShortcutByKeymap(keymap) {
212
215
  }
213
216
  export function getAriaKeyshortcuts(keymap) {
214
217
  var keyShortcuts;
218
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
215
219
  if (typeof keymap === 'string') {
216
220
  keyShortcuts = keymap;
217
221
  } else if (_typeof(keymap) === 'object') {
@@ -302,6 +306,7 @@ export function bindKeymapWithEditorCommand(shortcut, cmd, keymap) {
302
306
  }
303
307
  export function findKeyMapForBrowser(keyMap) {
304
308
  if (keyMap) {
309
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
305
310
  if (browser.mac) {
306
311
  return keyMap.mac;
307
312
  }
@@ -33,7 +33,8 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
33
33
  import Tooltip from '@atlaskit/tooltip';
34
34
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, INPUT_METHOD } from '../../../analytics';
35
35
  import { Announcer, PanelTextInput } from '../../../ui';
36
- import { browser, normalizeUrl } from '../../../utils';
36
+ import { normalizeUrl } from '../../../utils';
37
+ import { browser as browserLegacy, getBrowserInfo } from '../../../utils/browser';
37
38
  import LinkSearchList, { LinkSearchListNext } from '../../LinkSearch/LinkSearchList';
38
39
  import { container, containerWithProvider, inputWrapper } from '../../LinkSearch/ToolbarComponents';
39
40
  import { transformTimeStamp } from '../../LinkSearch/transformTimeStamp';
@@ -873,6 +874,7 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
873
874
  var ariaActiveDescendant = selectedIndex > -1 ? "link-search-list-item-".concat(selectedIndex) : '';
874
875
  var linkSearchInputId = 'search-recent-links-field-id';
875
876
  var displayTextInputId = 'display-text-filed-id';
877
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
876
878
  // Added workaround with a screen reader Announcer specifically for VoiceOver + Safari
877
879
  // as the Aria design pattern for combobox does not work in this case
878
880
  // for details: https://a11y-internal.atlassian.net/browse/AK-740
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "109.14.1";
10
+ var packageVersion = "109.15.0";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -3,10 +3,11 @@ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSta
3
3
  import { bind, bindAll } from 'bind-event-listener';
4
4
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
8
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
8
9
  import { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN } from '../styles';
9
- import { browser } from '../utils/browser';
10
+ import { browser as browserLegacy, getBrowserInfo } from '../utils/browser';
10
11
  import Resizer from './Resizer';
11
12
  import { ResizerBreakoutModeLabel } from './ResizerBreakoutModeLabel';
12
13
  import { SNAP_GAP, useBreakoutGuidelines } from './useBreakoutGuidelines';
@@ -131,6 +132,7 @@ var BreakoutResizer = function BreakoutResizer(_ref) {
131
132
  currentLayout = _useBreakoutGuideline.currentLayout,
132
133
  guidelines = _useBreakoutGuideline.guidelines,
133
134
  setCurrentWidth = _useBreakoutGuideline.setCurrentWidth;
135
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
134
136
  useEffect(function () {
135
137
  if (displayGuidelines) {
136
138
  displayGuidelines(guidelines || []);
@@ -266,7 +268,7 @@ var BreakoutResizer = function BreakoutResizer(_ref) {
266
268
  } else if (!areResizeMetaKeysPressed.current) {
267
269
  handleEscape();
268
270
  }
269
- }, [handleEscape, handleLayoutSizeChangeOnKeypress]);
271
+ }, [handleEscape, handleLayoutSizeChangeOnKeypress, browser]);
270
272
  var resizeHandleKeyUpHandler = useCallback(function (event) {
271
273
  if (event.altKey || event.metaKey) {
272
274
  areResizeMetaKeysPressed.current = false;
@@ -292,7 +294,7 @@ var BreakoutResizer = function BreakoutResizer(_ref) {
292
294
  inline: 'nearest'
293
295
  });
294
296
  }
295
- }, [resizerRef]);
297
+ }, [resizerRef, browser]);
296
298
  useLayoutEffect(function () {
297
299
  if (!resizerRef.current || !editorView) {
298
300
  return;
@@ -6,7 +6,7 @@ import { tableCellContentDomSelector, tableCellSelector, tableHeaderSelector, ta
6
6
  import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorSelectedNodeClassName, akEditorTableBorder, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorWideLayoutWidth, overflowShadow } from '@atlaskit/editor-shared-styles';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
- import { browser } from '../../utils/browser';
9
+ import { browser as browserLegacy, getBrowserInfo } from '../../utils/browser';
10
10
  import { CodeBlockSharedCssClassName } from './code-block';
11
11
  import { tableCellBackgroundStyleOverride } from './tableCell';
12
12
  export var tableMarginTop = 24;
@@ -51,10 +51,10 @@ var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
51
51
  css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t\t\t> :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)) {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t"]))) : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
52
52
  css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\t\t\t> :first-child:not(style),\n\t\t\t\t> style:first-child + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + span + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\t\t\t"])));
53
53
  };
54
-
55
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Appears safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing
56
54
  var tableSharedStyle = function tableSharedStyle() {
57
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t", "\n\t.", " {\n\t\tposition: relative;\n\t\tmargin: 0 auto ", ";\n\t\tbox-sizing: border-box;\n\n\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.", "[data-number-column='true'] {\n\t\tpadding-left: ", "px;\n\t\tclear: both;\n\t}\n\n\t.", " {\n\t\twill-change: width, margin-left;\n\t}\n\n\t.", " table {\n\t\twill-change: width;\n\t}\n\n\t.", " > table {\n\t\tmargin: ", " 0 0 0;\n\t}\n\n\t.", " > table,\n\t.", " > table {\n\t\tmargin: ", " ", " 0 0;\n\t}\n\n\t/* support panel nested in table */\n\t", "\n\n\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\tborder-collapse: collapse;\n\t\tborder: ", "px solid\n\t\t\t", ";\n\t\ttable-layout: fixed;\n\t\tfont-size: 1em;\n\t\twidth: 100%;\n\n\t\t&[data-autosize='true'] {\n\t\t\ttable-layout: auto;\n\t\t}\n\n\t\t& {\n\t\t\t* {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}\n\t\t\thr {\n\t\t\t\tbox-sizing: content-box;\n\t\t\t}\n\n\t\t\ttbody {\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t\tth td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\n\t\t\t> tbody > tr > th,\n\t\t\t> tbody > tr > td {\n\t\t\t\tmin-width: ", "px;\n\t\t\t\tfont-weight: ", ";\n\t\t\t\tvertical-align: top;\n\t\t\t\tborder: 1px solid ", ";\n\t\t\t\tborder-right-width: 0;\n\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\tpadding: ", ";\n\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t", "\n\n\t\t\t\t", "\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Ensures nested tables are compatible with parent table background color - uses specificity to ensure tables nested by extensions are not affected */\n\t\t\t> tbody > tr > td {\n\t\t\t\tbackground-color: ", ";\n\t\t\t}\n\n\t\t\tth {\n\t\t\t\tbackground-color: ", ";\n\t\t\t\ttext-align: left;\n\n\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t", " {\n\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t/* selector lives inside @atlaskit/code */\n\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"])), tableCellBackgroundStyleOverride(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", fg('platform_editor_bordered_panel_nested_in_table') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " .ak-editor-panel {\n\t\t\tborder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #d9dbea)", ";\n\t\t}") : '', TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, "var(--ds-font-weight-regular, 400)", "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-space-100, 8px)", browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', firstNodeWithNotMarginTop(), "var(--ds-space-150, 12px)", "var(--ds-surface, #FFFFFF)", "var(--ds-background-accent-gray-subtlest, ".concat(akEditorTableToolbar, ")"), expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? '&:not(.danger)' : '&:not([style]):not(.danger)', CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", akEditorSelectedNodeClassName, "var(--ds-border, transparent)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, overflowShadow({
55
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
56
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Appears safe to auto-fix, but leaving it up to the team to remediate as the readability only gets worse with autofixing
57
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t", "\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tmargin: 0 auto ", ";\n\t\t\tbox-sizing: border-box;\n\n\t\t\t/**\n * Fix block top alignment inside table cells.\n */\n\t\t\t.decisionItemView-content-wrap:first-of-type > div {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\t\t.", "[data-number-column='true'] {\n\t\t\tpadding-left: ", "px;\n\t\t\tclear: both;\n\t\t}\n\n\t\t.", " {\n\t\t\twill-change: width, margin-left;\n\t\t}\n\n\t\t.", " table {\n\t\t\twill-change: width;\n\t\t}\n\n\t\t.", " > table {\n\t\t\tmargin: ", " 0 0 0;\n\t\t}\n\n\t\t.", " > table,\n\t\t.", " > table {\n\t\t\tmargin: ", " ", " 0 0;\n\t\t}\n\n\t\t/* support panel nested in table */\n\t\t", "\n\n\t\t/* avoid applying styles to nested tables (possible via extensions) */\n\t.", " > table,\n\t.", " > table,\n\t.", " > table {\n\t\t\tborder-collapse: collapse;\n\t\t\tborder: ", "px solid\n\t\t\t\t", ";\n\t\t\ttable-layout: fixed;\n\t\t\tfont-size: 1em;\n\t\t\twidth: 100%;\n\n\t\t\t&[data-autosize='true'] {\n\t\t\t\ttable-layout: auto;\n\t\t\t}\n\n\t\t\t& {\n\t\t\t\t* {\n\t\t\t\t\tbox-sizing: border-box;\n\t\t\t\t}\n\t\t\t\thr {\n\t\t\t\t\tbox-sizing: content-box;\n\t\t\t\t}\n\n\t\t\t\ttbody {\n\t\t\t\t\tborder-bottom: none;\n\t\t\t\t}\n\t\t\t\tth td {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t}\n\n\t\t\t\t> tbody > tr > th,\n\t\t\t\t> tbody > tr > td {\n\t\t\t\t\tmin-width: ", "px;\n\t\t\t\t\tfont-weight: ", ";\n\t\t\t\t\tvertical-align: top;\n\t\t\t\t\tborder: 1px solid ", ";\n\t\t\t\t\tborder-right-width: 0;\n\t\t\t\t\tborder-bottom-width: 0;\n\n\t\t\t\t\tpadding: ", ";\n\t\t\t\t\t/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n\t\t\t\t\t", "\n\n\t\t\t\t\t", "\n\n\t\t\t\tth p:not(:first-of-type),\n\t\t\t\ttd p:not(:first-of-type) {\n\t\t\t\t\t\tmargin-top: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Ensures nested tables are compatible with parent table background color - uses specificity to ensure tables nested by extensions are not affected */\n\t\t\t\t> tbody > tr > td {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t}\n\n\t\t\t\tth {\n\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\ttext-align: left;\n\n\t\t\t\t\t/* only apply this styling to codeblocks in default background headercells */\n\t\t\t\t\t/* TODO this needs to be overhauled as it relies on unsafe selectors */\n\t\t\t\t\t", " {\n\t\t\t\t\t\t.", ":not(.danger) {\n\t\t\t\t\t\t\tbackground-color: ", ";\n\n\t\t\t\t\t\t\t:not(.", ") {\n\t\t\t\t\t\t\t\tbox-shadow: 0px 0px 0px 1px ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\tbackground-image: ", ";\n\n\t\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\tbackground-color: ", ";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/* this is only relevant to the element taken care of by renderer */\n\t\t\t\t\t\t\t> [data-ds--code--code-block] {\n\t\t\t\t\t\t\t\tbackground-image: ", "!important;\n\n\t\t\t\t\t\t\t\tbackground-color: ", "!important;\n\n\t\t\t\t\t\t\t\t/* selector lives inside @atlaskit/code */\n\t\t\t\t\t\t\t\t--ds--code--line-number-bg-color: ", ";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"])), tableCellBackgroundStyleOverride(), TableSharedCssClassName.TABLE_CONTAINER, "var(--ds-space-200, 16px)", TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_RESIZER_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, "var(--ds-space-300, 24px)", TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", fg('platform_editor_bordered_panel_nested_in_table') ? ".".concat(TableSharedCssClassName.TABLE_NODE_WRAPPER, " .ak-editor-panel {\n\t\t\tborder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #d9dbea)", ";\n\t\t}") : '', TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, "var(--ds-font-weight-regular, 400)", "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableBorder, ")"), "var(--ds-space-100, 8px)", browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', firstNodeWithNotMarginTop(), "var(--ds-space-150, 12px)", "var(--ds-surface, #FFFFFF)", "var(--ds-background-accent-gray-subtlest, ".concat(akEditorTableToolbar, ")"), expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? '&:not(.danger)' : '&:not([style]):not(.danger)', CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, rgb(235, 237, 240))", akEditorSelectedNodeClassName, "var(--ds-border, transparent)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, overflowShadow({
58
58
  leftCoverWidth: "var(--ds-space-300, 24px)"
59
59
  }), "var(--ds-background-neutral, rgb(235, 237, 240))", CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, rgb(226, 229, 233))", overflowShadow({
60
60
  leftCoverWidth: "var(--ds-space-300, 24px)"
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "109.14.1";
24
+ var packageVersion = "109.15.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -16,7 +16,8 @@ import { PureComponent } from 'react';
16
16
 
17
17
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
18
  import { jsx } from '@emotion/react';
19
- import { browser } from '../../utils';
19
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
20
+ import { browser as browserLegacy, getBrowserInfo } from '../../utils/browser';
20
21
  import { panelTextInput, panelTextInputWithCustomWidth } from './styles';
21
22
  var KeyZCode = 90;
22
23
  var KeyYCode = 89;
@@ -170,6 +171,7 @@ var PanelTextInput = /*#__PURE__*/function (_PureComponent) {
170
171
  // Ignored via go/ees005
171
172
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
172
173
  function isUndoEvent(event) {
174
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
173
175
  return event.keyCode === KeyZCode && (
174
176
  // cmd + z for mac
175
177
  browser.mac && event.metaKey && !event.shiftKey ||
@@ -182,6 +184,7 @@ var PanelTextInput = /*#__PURE__*/function (_PureComponent) {
182
184
  }, {
183
185
  key: "isRedoEvent",
184
186
  value: function isRedoEvent(event) {
187
+ var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
185
188
  return (
186
189
  // ctrl + y for non-mac
187
190
  !browser.mac && event.ctrlKey && event.keyCode === KeyYCode || browser.mac && event.metaKey && event.shiftKey && event.keyCode === KeyZCode || event.ctrlKey && event.shiftKey && event.keyCode === KeyZCode
@@ -98,6 +98,42 @@ var getSecondMatch = function getSecondMatch(regexp, ua) {
98
98
  return match && match.length > 0 && match[2] || '';
99
99
  };
100
100
 
101
+ // Helper functions to safely access browser properties
102
+ var getSafeUserAgent = function getSafeUserAgent() {
103
+ var _window$navigator;
104
+ if (typeof window === 'undefined') {
105
+ return undefined;
106
+ }
107
+
108
+ // Check for SSR user agent first
109
+ if (process.env.REACT_SSR) {
110
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
111
+ var ssrUserAgent = window.__SSR_USER_AGENT__;
112
+ if (ssrUserAgent) {
113
+ return ssrUserAgent;
114
+ }
115
+ }
116
+
117
+ // Fallback to navigator.userAgent with proper null checking
118
+ return (_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : _window$navigator.userAgent;
119
+ };
120
+ var getSafePlatform = function getSafePlatform() {
121
+ var _window$navigator2;
122
+ if (typeof window === 'undefined') {
123
+ return undefined;
124
+ }
125
+ return (_window$navigator2 = window.navigator) === null || _window$navigator2 === void 0 ? void 0 : _window$navigator2.platform;
126
+ };
127
+ var hasIntersectionObserver = function hasIntersectionObserver() {
128
+ return typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window &&
129
+ // Ignored via go/ees005
130
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
131
+ 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
132
+ };
133
+ var hasResizeObserver = function hasResizeObserver() {
134
+ return typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
135
+ };
136
+
101
137
  // New API to get the browser info on demand
102
138
  export var getBrowserInfo = memorizeOne(function () {
103
139
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -118,9 +154,8 @@ export var getBrowserInfo = memorizeOne(function () {
118
154
  supportsIntersectionObserver: false,
119
155
  supportsResizeObserver: false
120
156
  };
121
- var userAgent = process.env.REACT_SSR ?
122
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
123
- window.__SSR_USER_AGENT__ : navigator.userAgent;
157
+ var userAgent = getSafeUserAgent();
158
+ var platform = getSafePlatform();
124
159
  if (userAgent) {
125
160
  // inspired from https://github.com/bowser-js/bowser/blob/master/src/parser-browsers.js
126
161
  // Ignored via go/ees005
@@ -131,9 +166,11 @@ export var getBrowserInfo = memorizeOne(function () {
131
166
  // eslint-disable-next-line require-unicode-regexp
132
167
  var internetExplorer = /msie|trident/i.test(userAgent);
133
168
 
169
+ // Ideally we should use userAgent instead of platform, but we have lots of keymap tests failure when we change it
170
+ // So leave it as is for now.
134
171
  // Ignored via go/ees005
135
172
  // eslint-disable-next-line require-unicode-regexp
136
- result.mac = /macintosh/i.test(userAgent);
173
+ result.mac = platform && /Mac/.test(platform);
137
174
 
138
175
  // Previously relied on navigator.userAgentData?.platform and userAgent, now used only userAgent
139
176
  result.windows =
@@ -188,11 +225,8 @@ export var getBrowserInfo = memorizeOne(function () {
188
225
  // Previously we relied on documentElement.style.WebkitAppearance, now changed to userAgent
189
226
  // eslint-disable-next-line require-unicode-regexp
190
227
  result.webkit = /(apple)?webkit/i.test(userAgent);
191
- result.supportsIntersectionObserver = typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window &&
192
- // Ignored via go/ees005
193
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
194
- 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
195
- result.supportsResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
228
+ result.supportsIntersectionObserver = hasIntersectionObserver();
229
+ result.supportsResizeObserver = hasResizeObserver();
196
230
  }
197
231
  return result;
198
232
  });
@@ -5,8 +5,11 @@ type AILocalIdNotFoundErrorAEP = OperationalAEP<ACTION.LOCAL_ID_NOT_FOUND, ACTIO
5
5
  localId: string;
6
6
  }>;
7
7
  type AIStreamingUpdateStreamError = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.UPDATE_STREAM, {
8
+ docSize: number;
8
9
  errorMessage?: string;
9
10
  errorStack: string;
11
+ fragmentSize: number;
12
+ isFinalStream: boolean;
10
13
  }>;
11
14
  type AIStreamingDiscardStreamError = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.DISCARD_STREAM, {
12
15
  errorMessage?: string;
@@ -5,8 +5,11 @@ type AILocalIdNotFoundErrorAEP = OperationalAEP<ACTION.LOCAL_ID_NOT_FOUND, ACTIO
5
5
  localId: string;
6
6
  }>;
7
7
  type AIStreamingUpdateStreamError = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.UPDATE_STREAM, {
8
+ docSize: number;
8
9
  errorMessage?: string;
9
10
  errorStack: string;
11
+ fragmentSize: number;
12
+ isFinalStream: boolean;
10
13
  }>;
11
14
  type AIStreamingDiscardStreamError = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.AI_STREAMING, ACTION_SUBJECT_ID.DISCARD_STREAM, {
12
15
  errorMessage?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "109.15.0",
3
+ "version": "109.15.1",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -71,7 +71,7 @@
71
71
  "@atlaskit/platform-feature-flags-react": "^0.3.0",
72
72
  "@atlaskit/popper": "^7.1.0",
73
73
  "@atlaskit/primitives": "^14.15.0",
74
- "@atlaskit/profilecard": "^24.13.0",
74
+ "@atlaskit/profilecard": "^24.14.0",
75
75
  "@atlaskit/react-ufo": "^4.10.0",
76
76
  "@atlaskit/section-message": "^8.7.0",
77
77
  "@atlaskit/smart-card": "^42.2.0",