@atlaskit/editor-common 105.8.4 → 105.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/element-browser/components/ElementSearch.js +4 -1
  3. package/dist/cjs/element-browser/components/StatelessElementBrowser.js +2 -1
  4. package/dist/cjs/extensions/combine-extension-providers.js +19 -4
  5. package/dist/cjs/extensions/default-extension-provider.js +1 -1
  6. package/dist/cjs/monitoring/error.js +1 -1
  7. package/dist/cjs/styles/shared/resizer.js +1 -1
  8. package/dist/cjs/ui/DropList/index.js +1 -1
  9. package/dist/cjs/utils/validate-using-spec.js +23 -4
  10. package/dist/es2019/element-browser/components/ElementSearch.js +4 -1
  11. package/dist/es2019/element-browser/components/StatelessElementBrowser.js +2 -1
  12. package/dist/es2019/extensions/combine-extension-providers.js +19 -4
  13. package/dist/es2019/extensions/default-extension-provider.js +1 -1
  14. package/dist/es2019/monitoring/error.js +1 -1
  15. package/dist/es2019/styles/shared/resizer.js +1 -0
  16. package/dist/es2019/ui/DropList/index.js +1 -1
  17. package/dist/es2019/utils/validate-using-spec.js +20 -4
  18. package/dist/esm/element-browser/components/ElementSearch.js +4 -1
  19. package/dist/esm/element-browser/components/StatelessElementBrowser.js +2 -1
  20. package/dist/esm/extensions/combine-extension-providers.js +19 -4
  21. package/dist/esm/extensions/default-extension-provider.js +1 -1
  22. package/dist/esm/monitoring/error.js +1 -1
  23. package/dist/esm/styles/shared/resizer.js +1 -1
  24. package/dist/esm/ui/DropList/index.js +1 -1
  25. package/dist/esm/utils/validate-using-spec.js +22 -4
  26. package/dist/types/element-browser/components/ElementSearch.d.ts +1 -0
  27. package/dist/types/utils/validate-using-spec.d.ts +3 -1
  28. package/dist/types-ts4.5/element-browser/components/ElementSearch.d.ts +1 -0
  29. package/dist/types-ts4.5/utils/validate-using-spec.d.ts +3 -1
  30. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 105.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#160422](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160422)
8
+ [`83606959c73cd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/83606959c73cd) -
9
+ EDITOR-719 Overrides adf validation of nested tables for nested renderers inside bodied extensions
10
+ and reverts a previous change to transformNestedTablesIncomingDocument which prevented nested
11
+ tables inside bodied extensions from being transformed by their parent renderer. This was due to a
12
+ bug with comment positions of nested tables inside bodied extensions which meant their positions
13
+ were not being calculated correctly due to not being transformed in the parent renderer.
14
+
15
+ ### Patch Changes
16
+
17
+ - [#159390](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159390)
18
+ [`cc1d530fb6ed2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cc1d530fb6ed2) -
19
+ [ux] [ED-28074] Fix media selection state and remove css-based targeting
20
+ - Updated dependencies
21
+
22
+ ## 105.8.5
23
+
24
+ ### Patch Changes
25
+
26
+ - [#160276](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160276)
27
+ [`52a350ed32172`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/52a350ed32172) -
28
+ Fallback to async loading in manifest provider when not preloaded in production
29
+
3
30
  ## 105.8.4
4
31
 
5
32
  ### Patch Changes
@@ -37,7 +37,8 @@ function ElementSearch(_ref) {
37
37
  onKeyDown = _ref.onKeyDown,
38
38
  searchTerm = _ref.searchTerm,
39
39
  items = _ref.items,
40
- selectedItemIndex = _ref.selectedItemIndex;
40
+ selectedItemIndex = _ref.selectedItemIndex,
41
+ ariaControlsId = _ref.ariaControlsId;
41
42
  var ref = (0, _useFocus.default)(focus);
42
43
  var assistiveTextRef = (0, _react.useRef)(null);
43
44
  var _useState = (0, _react.useState)(false),
@@ -120,6 +121,8 @@ function ElementSearch(_ref) {
120
121
  ,
121
122
  className: "js-search-input",
122
123
  role: "combobox",
124
+ "aria-expanded": "true",
125
+ "aria-controls": ariaControlsId,
123
126
  "aria-activedescendant": ariaActiveDescendant,
124
127
  value: searchTerm
125
128
  }), (0, _react2.jsx)("span", {
@@ -424,7 +424,8 @@ function DesktopBrowser(_ref2) {
424
424
  onClick: setFocusOnSearch,
425
425
  searchTerm: searchTerm,
426
426
  items: items,
427
- selectedItemIndex: selectedItemIndex
427
+ selectedItemIndex: selectedItemIndex,
428
+ ariaControlsId: selectedCategory ? "browse-category-".concat(selectedCategory, "-tab") : 'browse-category-tab'
428
429
  })), (0, _react2.jsx)(_ElementList.default, {
429
430
  items: items,
430
431
  mode: mode,
@@ -57,22 +57,37 @@ var _default = exports.default = function _default(extensionProviders) {
57
57
  // preload() has not been called yet
58
58
  return;
59
59
  }
60
+ var error;
60
61
  var _iterator = _createForOfIteratorHelper(providersCache),
61
62
  _step;
62
63
  try {
63
64
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
64
- var _provider$getPreloade;
65
65
  var provider = _step.value;
66
- var result = provider === null || provider === void 0 || (_provider$getPreloade = provider.getPreloadedExtension) === null || _provider$getPreloade === void 0 ? void 0 : _provider$getPreloade.call(provider, type, key);
67
- if (result) {
68
- return result;
66
+ // Similar to invokeSingle. We are returning the first result that not throwing an error.
67
+ // It's OK to get exception here because we have a lot of providers.
68
+ // The current provider may not have the extension type we are looking for.
69
+ try {
70
+ var _provider$getPreloade;
71
+ var result = provider === null || provider === void 0 || (_provider$getPreloade = provider.getPreloadedExtension) === null || _provider$getPreloade === void 0 ? void 0 : _provider$getPreloade.call(provider, type, key);
72
+ if (result) {
73
+ return result;
74
+ }
75
+ } catch (e) {
76
+ error = e instanceof Error ? e : new Error(String(e));
69
77
  }
70
78
  }
79
+
80
+ // If we exhausted all providers and none of them returned a result, we throw the last error.
81
+ // However as a extra precaution, we only throw in the dev environment.
82
+ // In production we will return undefined and getExtensionModuleNodeMaybePreloaded will fallback to regular getExtension call.
71
83
  } catch (err) {
72
84
  _iterator.e(err);
73
85
  } finally {
74
86
  _iterator.f();
75
87
  }
88
+ if (error && process.env.NODE_ENV !== 'production') {
89
+ throw error;
90
+ }
76
91
  },
77
92
  getExtension: function getExtension(type, key) {
78
93
  return invokeSingle('getExtension', [type, key]);
@@ -42,7 +42,7 @@ var DefaultExtensionProvider = exports.default = /*#__PURE__*/function () {
42
42
  while (1) switch (_context.prev = _context.next) {
43
43
  case 0:
44
44
  _context.next = 2;
45
- return this.manifestsPromise;
45
+ return this.getExtensions();
46
46
  case 2:
47
47
  this.manifestsCache = _context.sent;
48
48
  preloadCalls = [];
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "105.8.4";
20
+ var packageVersion = "105.9.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // Ignored via go/ees007
@@ -28,7 +28,7 @@ var handleWrapperClass = exports.handleWrapperClass = 'resizer-handle-wrapper';
28
28
  var resizerHandleZIndex = exports.resizerHandleZIndex = 1;
29
29
 
30
30
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766, Seems perfectly safe to autofix, but comments would be lost…
31
- var resizerStyles = exports.resizerStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\twill-change: width;\n\n\t\t&:hover,\n\t\t&.display-handle {\n\t\t\t& > .", " > .", " {\n\t\t\t\tvisibility: visible;\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\n\t\t&.is-resizing {\n\t\t\t& .", " {\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&.", " {\n\t\t\t& .", " {\n\t\t\t\ttransition: none;\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\t\tvisibility: hidden;\n\t\topacity: 0;\n\t\tflex-direction: column;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: 7px;\n\t\ttransition:\n\t\t\tvisibility 0.2s,\n\t\t\topacity 0.2s;\n\n\t\t/*\n NOTE: The below style is targeted at the div element added by the tooltip. We don't have any means of injecting styles\n into the tooltip\n */\n\t\t& div[role='presentation'] {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\t\t\tmargin-top: ", ";\n\t\t\twhite-space: normal;\n\t\t}\n\n\t\t/*\n Handle Positions\n */\n\t\t&.left {\n\t\t\talign-items: flex-start;\n\t\t}\n\t\t&.right {\n\t\t\talign-items: flex-end;\n\t\t}\n\n\t\t/*\n Handle Sizing\n */\n\t\t&.small {\n\t\t\t& .", " {\n\t\t\t\theight: 43px;\n\t\t\t}\n\t\t}\n\t\t&.medium {\n\t\t\t& .", " {\n\t\t\t\theight: 64px;\n\t\t\t}\n\t\t}\n\t\t&.large {\n\t\t\t& .", " {\n\t\t\t\theight: 96px;\n\t\t\t}\n\t\t}\n\t\t&.clamped {\n\t\t\t& .", " {\n\t\t\t\theight: clamp(43px, calc(100% - 32px), 96px);\n\t\t\t}\n\t\t}\n\n\t\t/*\n Handle Alignment\n */\n\t\t&.sticky {\n\t\t\t& .", " {\n\t\t\t\tposition: sticky;\n\t\t\t\ttop: ", ";\n\t\t\t\tbottom: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&:hover {\n\t\t\t& .", " {\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\n\t\t\t& .", " {\n\t\t\t\tvisibility: visible;\n\t\t\t\topacity: 0.5;\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tcontent: ' ';\n\t\tdisplay: flex;\n\t\twidth: 3px;\n\t\tmargin: 0 ", ";\n\t\theight: 64px;\n\t\ttransition: background-color 0.2s;\n\t\tborder-radius: 6px;\n\t\tborder: 0;\n\t\tpadding: 0;\n\t\tz-index: 2;\n\t\toutline: none;\n\t\tmin-height: 24px;\n\t\tbackground: ", ";\n\n\t\t&:hover {\n\t\t\tcursor: col-resize;\n\t\t}\n\n\t\t&:focus {\n\t\t\tbackground: ", ";\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: ", ";\n\t\t\t\tright: ", ";\n\t\t\t\tbottom: ", ";\n\t\t\t\tleft: ", ";\n\t\t\t\tborder: 2px solid ", ";\n\t\t\t\tborder-radius: inherit;\n\t\t\t\tz-index: -1;\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tvisibility: hidden;\n\t\tposition: absolute;\n\t\twidth: 7px;\n\t\theight: calc(100% - 40px);\n\t\tborder-radius: 4px;\n\t\topacity: 0;\n\t\ttransition:\n\t\t\tbackground-color 0.2s,\n\t\t\tvisibility 0.2s,\n\t\t\topacity 0.2s;\n\n\t\t&.none {\n\t\t\tbackground: none;\n\t\t}\n\n\t\t&.shadow {\n\t\t\tbackground: ", ";\n\t\t}\n\n\t\t&.full-height {\n\t\t\tbackground: ", ";\n\t\t\theight: 100%;\n\t\t\tmin-height: 36px;\n\t\t}\n\t}\n\n\t.", " {\n\t\t& .", " {\n\t\t\tbackground: ", ";\n\t\t}\n\t}\n\n\t.ak-editor-no-interaction\n\t\t.", "\n\t\t.", ":not(:hover)\n\t\t.", " {\n\t\tbackground: ", ";\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t\twidth: 100%;\n\n\t\t&.", " {\n\t\t\tpadding: 0 ", ";\n\t\t\tleft: ", ";\n\t\t}\n\t}\n\n\t/* This below style is here to make sure the image width is correct when nested in a table */\n\ttable .", ", table .", ".", " {\n\t\tpadding: unset;\n\t\tleft: unset;\n\t}\n"])), resizerItemClassName, handleWrapperClass, resizerHandleClassName, resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", resizerDangerClassName, resizerHandleThumbClassName, "var(--ds-icon-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), resizerHandleClassName, "var(--ds-space-negative-200, -16px)", resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", resizerHandleTrackClassName, resizerHandleThumbClassName, "var(--ds-space-025, 2px)", "var(--ds-border, #091E4224)", "var(--ds-border-selected, #0C66E4)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-border-focused, #388BFF)", resizerHandleTrackClassName, "var(--ds-background-selected, #E9F2FF)", "var(--ds-background-selected, #E9F2FF)", akEditorSelectedNodeClassName, resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", akEditorSelectedNodeClassName, resizerHandleClassName, resizerHandleThumbClassName, "var(--ds-border, #091E4224)", resizerHoverZoneClassName, resizerExtendedZone, "var(--ds-space-150, 12px)", "var(--ds-space-negative-150, -12px)", resizerHoverZoneClassName, resizerHoverZoneClassName, resizerExtendedZone);
31
+ var resizerStyles = exports.resizerStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\twill-change: width;\n\n\t\t&:hover,\n\t\t&.display-handle {\n\t\t\t& > .", " > .", " {\n\t\t\t\tvisibility: visible;\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\n\t\t&.is-resizing {\n\t\t\t& .", " {\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&.", " {\n\t\t\t& .", " {\n\t\t\t\ttransition: none;\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\t\tvisibility: hidden;\n\t\topacity: 0;\n\t\tflex-direction: column;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: 7px;\n\t\ttransition:\n\t\t\tvisibility 0.2s,\n\t\t\topacity 0.2s;\n\n\t\t/*\n NOTE: The below style is targeted at the div element added by the tooltip. We don't have any means of injecting styles\n into the tooltip\n */\n\t\t& div[role='presentation'] {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\t\t\tmargin-top: ", ";\n\t\t\twhite-space: normal;\n\t\t}\n\n\t\t/*\n Handle Positions\n */\n\t\t&.left {\n\t\t\talign-items: flex-start;\n\t\t}\n\t\t&.right {\n\t\t\talign-items: flex-end;\n\t\t}\n\n\t\t/*\n Handle Sizing\n */\n\t\t&.small {\n\t\t\t& .", " {\n\t\t\t\theight: 43px;\n\t\t\t}\n\t\t}\n\t\t&.medium {\n\t\t\t& .", " {\n\t\t\t\theight: 64px;\n\t\t\t}\n\t\t}\n\t\t&.large {\n\t\t\t& .", " {\n\t\t\t\theight: 96px;\n\t\t\t}\n\t\t}\n\t\t&.clamped {\n\t\t\t& .", " {\n\t\t\t\theight: clamp(43px, calc(100% - 32px), 96px);\n\t\t\t}\n\t\t}\n\n\t\t/*\n Handle Alignment\n */\n\t\t&.sticky {\n\t\t\t& .", " {\n\t\t\t\tposition: sticky;\n\t\t\t\ttop: ", ";\n\t\t\t\tbottom: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&:hover {\n\t\t\t& .", " {\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\n\t\t\t& .", " {\n\t\t\t\tvisibility: visible;\n\t\t\t\topacity: 0.5;\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tcontent: ' ';\n\t\tdisplay: flex;\n\t\twidth: 3px;\n\t\tmargin: 0 ", ";\n\t\theight: 64px;\n\t\ttransition: background-color 0.2s;\n\t\tborder-radius: 6px;\n\t\tborder: 0;\n\t\tpadding: 0;\n\t\tz-index: 2;\n\t\toutline: none;\n\t\tmin-height: 24px;\n\t\tbackground: ", ";\n\n\t\t&:hover {\n\t\t\tcursor: col-resize;\n\t\t}\n\n\t\t&:focus {\n\t\t\tbackground: ", ";\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: ", ";\n\t\t\t\tright: ", ";\n\t\t\t\tbottom: ", ";\n\t\t\t\tleft: ", ";\n\t\t\t\tborder: 2px solid ", ";\n\t\t\t\tborder-radius: inherit;\n\t\t\t\tz-index: -1;\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tvisibility: hidden;\n\t\tposition: absolute;\n\t\twidth: 7px;\n\t\theight: calc(100% - 40px);\n\t\tborder-radius: 4px;\n\t\topacity: 0;\n\t\ttransition:\n\t\t\tbackground-color 0.2s,\n\t\t\tvisibility 0.2s,\n\t\t\topacity 0.2s;\n\n\t\t&.none {\n\t\t\tbackground: none;\n\t\t}\n\n\t\t&.shadow {\n\t\t\tbackground: ", ";\n\t\t}\n\n\t\t&.full-height {\n\t\t\tbackground: ", ";\n\t\t\theight: 100%;\n\t\t\tmin-height: 36px;\n\t\t}\n\t}\n\n\t.", " {\n\t\t& .", " {\n\t\t\tbackground: ", ";\n\t\t}\n\t}\n\n\t// Remove when cleaning up platform_editor_interaction_api_refactor\n\t.ak-editor-no-interaction\n\t\t.", "\n\t\t.", ":not(:hover)\n\t\t.", " {\n\t\tbackground: ", ";\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t\twidth: 100%;\n\n\t\t&.", " {\n\t\t\tpadding: 0 ", ";\n\t\t\tleft: ", ";\n\t\t}\n\t}\n\n\t/* This below style is here to make sure the image width is correct when nested in a table */\n\ttable .", ", table .", ".", " {\n\t\tpadding: unset;\n\t\tleft: unset;\n\t}\n"])), resizerItemClassName, handleWrapperClass, resizerHandleClassName, resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", resizerDangerClassName, resizerHandleThumbClassName, "var(--ds-icon-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), resizerHandleClassName, "var(--ds-space-negative-200, -16px)", resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", resizerHandleTrackClassName, resizerHandleThumbClassName, "var(--ds-space-025, 2px)", "var(--ds-border, #091E4224)", "var(--ds-border-selected, #0C66E4)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-border-focused, #388BFF)", resizerHandleTrackClassName, "var(--ds-background-selected, #E9F2FF)", "var(--ds-background-selected, #E9F2FF)", akEditorSelectedNodeClassName, resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", akEditorSelectedNodeClassName, resizerHandleClassName, resizerHandleThumbClassName, "var(--ds-border, #091E4224)", resizerHoverZoneClassName, resizerExtendedZone, "var(--ds-space-150, 12px)", "var(--ds-space-negative-150, -12px)", resizerHoverZoneClassName, resizerHoverZoneClassName, resizerExtendedZone);
32
32
 
33
33
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
34
34
  var pragmaticResizerStyles = exports.pragmaticResizerStyles = function pragmaticResizerStyles() {
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "105.8.4";
26
+ var packageVersion = "105.9.0";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -1,17 +1,23 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.validationErrorHandler = exports.validateADFEntity = exports.UNSUPPORTED_NODE_ATTRIBUTE = void 0;
7
8
  exports.wrapWithUnsupported = wrapWithUnsupported;
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
10
  var _validator = require("@atlaskit/adf-utils/validator");
9
11
  var _analytics = require("../analytics");
10
12
  var _trackUnsupportedContent = require("./track-unsupported-content");
13
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
15
  var UNSUPPORTED_NODE_ATTRIBUTE = exports.UNSUPPORTED_NODE_ATTRIBUTE = 'unsupportedNodeAttribute';
12
- var errorCallbackFor = function errorCallbackFor(marks, validate, dispatchAnalyticsEvent) {
16
+ var errorCallbackFor = function errorCallbackFor(marks, validate, dispatchAnalyticsEvent, validationOverrides) {
13
17
  return function (entity, error, options) {
14
- return validationErrorHandler(entity, error, options, marks, validate, dispatchAnalyticsEvent);
18
+ return validationErrorHandler(entity, error, _objectSpread(_objectSpread({}, options), {}, {
19
+ allowNestedTables: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowNestedTables
20
+ }), marks, validate, dispatchAnalyticsEvent);
15
21
  };
16
22
  };
17
23
  var validationErrorHandler = exports.validationErrorHandler = function validationErrorHandler(entity, error, options, marks, validate, dispatchAnalyticsEvent) {
@@ -62,6 +68,19 @@ var validationErrorHandler = exports.validationErrorHandler = function validatio
62
68
  }
63
69
  }
64
70
  }
71
+
72
+ // Nested tables don't actually exist in ADF. In ADF they are stored as an `extension` node with the nested table content serialized in a property of that extension.
73
+ // Usually when we validate ADF we are validating this `extension` and then later transforming it into nested tables for usage by ProseMirror.
74
+ // Under certain circumstances however, ADF validation is performed on this already transformed extension and since nested tables aren't allowed by ADF this
75
+ // produces an error. For example, nested renderers in Confluence `bodiedExtension`'s. The nested renderer receives the already transformed nested tables that originated from the
76
+ // `extension` node and validates it. This is invalid ADF so an error is thrown.
77
+ // This override allows an exception to be made for nested tables in the validator in this circumstance.
78
+ if (options.allowNestedTables) {
79
+ var meta = error.meta;
80
+ if (options.allowNestedTables && meta !== null && meta !== void 0 && meta.parentType && ['tableCell', 'tableHeader'].includes(meta === null || meta === void 0 ? void 0 : meta.parentType) && error.code === 'INVALID_CONTENT' && entity.type === 'table') {
81
+ return entity;
82
+ }
83
+ }
65
84
  if (options.allowUnsupportedBlock) {
66
85
  return wrapWithUnsupported(entity);
67
86
  }
@@ -112,7 +131,7 @@ function trackValidationError(dispatchAnalyticsEvent, error, entity) {
112
131
  attrs: entity.attrs || {}
113
132
  }, error.code);
114
133
  }
115
- var validateADFEntity = exports.validateADFEntity = function validateADFEntity(schema, node, dispatchAnalyticsEvent) {
134
+ var validateADFEntity = exports.validateADFEntity = function validateADFEntity(schema, node, dispatchAnalyticsEvent, validationOverrides) {
116
135
  var nodes = Object.keys(schema.nodes);
117
136
  var marks = Object.keys(schema.marks);
118
137
  var validate = (0, _validator.validator)(nodes, marks, {
@@ -122,7 +141,7 @@ var validateADFEntity = exports.validateADFEntity = function validateADFEntity(s
122
141
  type: 'doc',
123
142
  content: []
124
143
  };
125
- var _validate = validate(node, errorCallbackFor(marks, validate, dispatchAnalyticsEvent)),
144
+ var _validate = validate(node, errorCallbackFor(marks, validate, dispatchAnalyticsEvent, validationOverrides)),
126
145
  _validate$entity = _validate.entity,
127
146
  entity = _validate$entity === void 0 ? emptyDoc : _validate$entity;
128
147
  return entity;
@@ -27,7 +27,8 @@ function ElementSearch({
27
27
  onKeyDown,
28
28
  searchTerm,
29
29
  items,
30
- selectedItemIndex
30
+ selectedItemIndex,
31
+ ariaControlsId
31
32
  }) {
32
33
  const ref = useFocus(focus);
33
34
  const assistiveTextRef = useRef(null);
@@ -111,6 +112,8 @@ function ElementSearch({
111
112
  ,
112
113
  className: "js-search-input",
113
114
  role: "combobox",
115
+ "aria-expanded": "true",
116
+ "aria-controls": ariaControlsId,
114
117
  "aria-activedescendant": ariaActiveDescendant,
115
118
  value: searchTerm
116
119
  }), jsx("span", {
@@ -415,7 +415,8 @@ function DesktopBrowser({
415
415
  onClick: setFocusOnSearch,
416
416
  searchTerm: searchTerm,
417
417
  items: items,
418
- selectedItemIndex: selectedItemIndex
418
+ selectedItemIndex: selectedItemIndex,
419
+ ariaControlsId: selectedCategory ? `browse-category-${selectedCategory}-tab` : 'browse-category-tab'
419
420
  })), jsx(ElementList, {
420
421
  items: items,
421
422
  mode: mode,
@@ -27,13 +27,28 @@ export default (extensionProviders => {
27
27
  // preload() has not been called yet
28
28
  return;
29
29
  }
30
+ let error;
30
31
  for (const provider of providersCache) {
31
- var _provider$getPreloade;
32
- const result = provider === null || provider === void 0 ? void 0 : (_provider$getPreloade = provider.getPreloadedExtension) === null || _provider$getPreloade === void 0 ? void 0 : _provider$getPreloade.call(provider, type, key);
33
- if (result) {
34
- return result;
32
+ // Similar to invokeSingle. We are returning the first result that not throwing an error.
33
+ // It's OK to get exception here because we have a lot of providers.
34
+ // The current provider may not have the extension type we are looking for.
35
+ try {
36
+ var _provider$getPreloade;
37
+ const result = provider === null || provider === void 0 ? void 0 : (_provider$getPreloade = provider.getPreloadedExtension) === null || _provider$getPreloade === void 0 ? void 0 : _provider$getPreloade.call(provider, type, key);
38
+ if (result) {
39
+ return result;
40
+ }
41
+ } catch (e) {
42
+ error = e instanceof Error ? e : new Error(String(e));
35
43
  }
36
44
  }
45
+
46
+ // If we exhausted all providers and none of them returned a result, we throw the last error.
47
+ // However as a extra precaution, we only throw in the dev environment.
48
+ // In production we will return undefined and getExtensionModuleNodeMaybePreloaded will fallback to regular getExtension call.
49
+ if (error && process.env.NODE_ENV !== 'production') {
50
+ throw error;
51
+ }
37
52
  },
38
53
  getExtension(type, key) {
39
54
  return invokeSingle('getExtension', [type, key]);
@@ -17,7 +17,7 @@ export default class DefaultExtensionProvider {
17
17
  return this.manifestsPromise;
18
18
  }
19
19
  async preload() {
20
- this.manifestsCache = await this.manifestsPromise;
20
+ this.manifestsCache = await this.getExtensions();
21
21
  const preloadCalls = [];
22
22
  for (const manifest of this.manifestsCache) {
23
23
  var _manifest$modules;
@@ -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 = "105.8.4";
4
+ const packageVersion = "105.9.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -199,6 +199,7 @@ export const resizerStyles = css`
199
199
  }
200
200
  }
201
201
 
202
+ // Remove when cleaning up platform_editor_interaction_api_refactor
202
203
  .ak-editor-no-interaction
203
204
  .${akEditorSelectedNodeClassName}
204
205
  .${resizerHandleClassName}:not(:hover)
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "105.8.4";
16
+ const packageVersion = "105.9.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -2,9 +2,12 @@ import { validator } from '@atlaskit/adf-utils/validator';
2
2
  import { ACTION_SUBJECT_ID } from '../analytics';
3
3
  export const UNSUPPORTED_NODE_ATTRIBUTE = 'unsupportedNodeAttribute';
4
4
  import { fireUnsupportedEvent } from './track-unsupported-content';
5
- const errorCallbackFor = (marks, validate, dispatchAnalyticsEvent) => {
5
+ const errorCallbackFor = (marks, validate, dispatchAnalyticsEvent, validationOverrides) => {
6
6
  return (entity, error, options) => {
7
- return validationErrorHandler(entity, error, options, marks, validate, dispatchAnalyticsEvent);
7
+ return validationErrorHandler(entity, error, {
8
+ ...options,
9
+ allowNestedTables: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowNestedTables
10
+ }, marks, validate, dispatchAnalyticsEvent);
8
11
  };
9
12
  };
10
13
  export const validationErrorHandler = (entity, error, options, marks, validate, dispatchAnalyticsEvent) => {
@@ -55,6 +58,19 @@ export const validationErrorHandler = (entity, error, options, marks, validate,
55
58
  }
56
59
  }
57
60
  }
61
+
62
+ // Nested tables don't actually exist in ADF. In ADF they are stored as an `extension` node with the nested table content serialized in a property of that extension.
63
+ // Usually when we validate ADF we are validating this `extension` and then later transforming it into nested tables for usage by ProseMirror.
64
+ // Under certain circumstances however, ADF validation is performed on this already transformed extension and since nested tables aren't allowed by ADF this
65
+ // produces an error. For example, nested renderers in Confluence `bodiedExtension`'s. The nested renderer receives the already transformed nested tables that originated from the
66
+ // `extension` node and validates it. This is invalid ADF so an error is thrown.
67
+ // This override allows an exception to be made for nested tables in the validator in this circumstance.
68
+ if (options.allowNestedTables) {
69
+ const meta = error.meta;
70
+ if (options.allowNestedTables && meta !== null && meta !== void 0 && meta.parentType && ['tableCell', 'tableHeader'].includes(meta === null || meta === void 0 ? void 0 : meta.parentType) && error.code === 'INVALID_CONTENT' && entity.type === 'table') {
71
+ return entity;
72
+ }
73
+ }
58
74
  if (options.allowUnsupportedBlock) {
59
75
  return wrapWithUnsupported(entity);
60
76
  }
@@ -101,7 +117,7 @@ function trackValidationError(dispatchAnalyticsEvent, error, entity) {
101
117
  attrs: entity.attrs || {}
102
118
  }, error.code);
103
119
  }
104
- export const validateADFEntity = (schema, node, dispatchAnalyticsEvent) => {
120
+ export const validateADFEntity = (schema, node, dispatchAnalyticsEvent, validationOverrides) => {
105
121
  const nodes = Object.keys(schema.nodes);
106
122
  const marks = Object.keys(schema.marks);
107
123
  const validate = validator(nodes, marks, {
@@ -113,7 +129,7 @@ export const validateADFEntity = (schema, node, dispatchAnalyticsEvent) => {
113
129
  };
114
130
  const {
115
131
  entity = emptyDoc
116
- } = validate(node, errorCallbackFor(marks, validate, dispatchAnalyticsEvent));
132
+ } = validate(node, errorCallbackFor(marks, validate, dispatchAnalyticsEvent, validationOverrides));
117
133
  return entity;
118
134
  };
119
135
  export function wrapWithUnsupported(originalValue, type = 'block') {
@@ -26,7 +26,8 @@ function ElementSearch(_ref) {
26
26
  onKeyDown = _ref.onKeyDown,
27
27
  searchTerm = _ref.searchTerm,
28
28
  items = _ref.items,
29
- selectedItemIndex = _ref.selectedItemIndex;
29
+ selectedItemIndex = _ref.selectedItemIndex,
30
+ ariaControlsId = _ref.ariaControlsId;
30
31
  var ref = useFocus(focus);
31
32
  var assistiveTextRef = useRef(null);
32
33
  var _useState = useState(false),
@@ -109,6 +110,8 @@ function ElementSearch(_ref) {
109
110
  ,
110
111
  className: "js-search-input",
111
112
  role: "combobox",
113
+ "aria-expanded": "true",
114
+ "aria-controls": ariaControlsId,
112
115
  "aria-activedescendant": ariaActiveDescendant,
113
116
  value: searchTerm
114
117
  }), jsx("span", {
@@ -413,7 +413,8 @@ function DesktopBrowser(_ref2) {
413
413
  onClick: setFocusOnSearch,
414
414
  searchTerm: searchTerm,
415
415
  items: items,
416
- selectedItemIndex: selectedItemIndex
416
+ selectedItemIndex: selectedItemIndex,
417
+ ariaControlsId: selectedCategory ? "browse-category-".concat(selectedCategory, "-tab") : 'browse-category-tab'
417
418
  })), jsx(ElementList, {
418
419
  items: items,
419
420
  mode: mode,
@@ -50,22 +50,37 @@ export default (function (extensionProviders) {
50
50
  // preload() has not been called yet
51
51
  return;
52
52
  }
53
+ var error;
53
54
  var _iterator = _createForOfIteratorHelper(providersCache),
54
55
  _step;
55
56
  try {
56
57
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
57
- var _provider$getPreloade;
58
58
  var provider = _step.value;
59
- var result = provider === null || provider === void 0 || (_provider$getPreloade = provider.getPreloadedExtension) === null || _provider$getPreloade === void 0 ? void 0 : _provider$getPreloade.call(provider, type, key);
60
- if (result) {
61
- return result;
59
+ // Similar to invokeSingle. We are returning the first result that not throwing an error.
60
+ // It's OK to get exception here because we have a lot of providers.
61
+ // The current provider may not have the extension type we are looking for.
62
+ try {
63
+ var _provider$getPreloade;
64
+ var result = provider === null || provider === void 0 || (_provider$getPreloade = provider.getPreloadedExtension) === null || _provider$getPreloade === void 0 ? void 0 : _provider$getPreloade.call(provider, type, key);
65
+ if (result) {
66
+ return result;
67
+ }
68
+ } catch (e) {
69
+ error = e instanceof Error ? e : new Error(String(e));
62
70
  }
63
71
  }
72
+
73
+ // If we exhausted all providers and none of them returned a result, we throw the last error.
74
+ // However as a extra precaution, we only throw in the dev environment.
75
+ // In production we will return undefined and getExtensionModuleNodeMaybePreloaded will fallback to regular getExtension call.
64
76
  } catch (err) {
65
77
  _iterator.e(err);
66
78
  } finally {
67
79
  _iterator.f();
68
80
  }
81
+ if (error && process.env.NODE_ENV !== 'production') {
82
+ throw error;
83
+ }
69
84
  },
70
85
  getExtension: function getExtension(type, key) {
71
86
  return invokeSingle('getExtension', [type, key]);
@@ -35,7 +35,7 @@ var DefaultExtensionProvider = /*#__PURE__*/function () {
35
35
  while (1) switch (_context.prev = _context.next) {
36
36
  case 0:
37
37
  _context.next = 2;
38
- return this.manifestsPromise;
38
+ return this.getExtensions();
39
39
  case 2:
40
40
  this.manifestsCache = _context.sent;
41
41
  preloadCalls = [];
@@ -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 = "105.8.4";
10
+ var packageVersion = "105.9.0";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -22,7 +22,7 @@ export var handleWrapperClass = 'resizer-handle-wrapper';
22
22
  export var resizerHandleZIndex = 1;
23
23
 
24
24
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766, Seems perfectly safe to autofix, but comments would be lost…
25
- export var resizerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.", " {\n\t\twill-change: width;\n\n\t\t&:hover,\n\t\t&.display-handle {\n\t\t\t& > .", " > .", " {\n\t\t\t\tvisibility: visible;\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\n\t\t&.is-resizing {\n\t\t\t& .", " {\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&.", " {\n\t\t\t& .", " {\n\t\t\t\ttransition: none;\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\t\tvisibility: hidden;\n\t\topacity: 0;\n\t\tflex-direction: column;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: 7px;\n\t\ttransition:\n\t\t\tvisibility 0.2s,\n\t\t\topacity 0.2s;\n\n\t\t/*\n NOTE: The below style is targeted at the div element added by the tooltip. We don't have any means of injecting styles\n into the tooltip\n */\n\t\t& div[role='presentation'] {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\t\t\tmargin-top: ", ";\n\t\t\twhite-space: normal;\n\t\t}\n\n\t\t/*\n Handle Positions\n */\n\t\t&.left {\n\t\t\talign-items: flex-start;\n\t\t}\n\t\t&.right {\n\t\t\talign-items: flex-end;\n\t\t}\n\n\t\t/*\n Handle Sizing\n */\n\t\t&.small {\n\t\t\t& .", " {\n\t\t\t\theight: 43px;\n\t\t\t}\n\t\t}\n\t\t&.medium {\n\t\t\t& .", " {\n\t\t\t\theight: 64px;\n\t\t\t}\n\t\t}\n\t\t&.large {\n\t\t\t& .", " {\n\t\t\t\theight: 96px;\n\t\t\t}\n\t\t}\n\t\t&.clamped {\n\t\t\t& .", " {\n\t\t\t\theight: clamp(43px, calc(100% - 32px), 96px);\n\t\t\t}\n\t\t}\n\n\t\t/*\n Handle Alignment\n */\n\t\t&.sticky {\n\t\t\t& .", " {\n\t\t\t\tposition: sticky;\n\t\t\t\ttop: ", ";\n\t\t\t\tbottom: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&:hover {\n\t\t\t& .", " {\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\n\t\t\t& .", " {\n\t\t\t\tvisibility: visible;\n\t\t\t\topacity: 0.5;\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tcontent: ' ';\n\t\tdisplay: flex;\n\t\twidth: 3px;\n\t\tmargin: 0 ", ";\n\t\theight: 64px;\n\t\ttransition: background-color 0.2s;\n\t\tborder-radius: 6px;\n\t\tborder: 0;\n\t\tpadding: 0;\n\t\tz-index: 2;\n\t\toutline: none;\n\t\tmin-height: 24px;\n\t\tbackground: ", ";\n\n\t\t&:hover {\n\t\t\tcursor: col-resize;\n\t\t}\n\n\t\t&:focus {\n\t\t\tbackground: ", ";\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: ", ";\n\t\t\t\tright: ", ";\n\t\t\t\tbottom: ", ";\n\t\t\t\tleft: ", ";\n\t\t\t\tborder: 2px solid ", ";\n\t\t\t\tborder-radius: inherit;\n\t\t\t\tz-index: -1;\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tvisibility: hidden;\n\t\tposition: absolute;\n\t\twidth: 7px;\n\t\theight: calc(100% - 40px);\n\t\tborder-radius: 4px;\n\t\topacity: 0;\n\t\ttransition:\n\t\t\tbackground-color 0.2s,\n\t\t\tvisibility 0.2s,\n\t\t\topacity 0.2s;\n\n\t\t&.none {\n\t\t\tbackground: none;\n\t\t}\n\n\t\t&.shadow {\n\t\t\tbackground: ", ";\n\t\t}\n\n\t\t&.full-height {\n\t\t\tbackground: ", ";\n\t\t\theight: 100%;\n\t\t\tmin-height: 36px;\n\t\t}\n\t}\n\n\t.", " {\n\t\t& .", " {\n\t\t\tbackground: ", ";\n\t\t}\n\t}\n\n\t.ak-editor-no-interaction\n\t\t.", "\n\t\t.", ":not(:hover)\n\t\t.", " {\n\t\tbackground: ", ";\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t\twidth: 100%;\n\n\t\t&.", " {\n\t\t\tpadding: 0 ", ";\n\t\t\tleft: ", ";\n\t\t}\n\t}\n\n\t/* This below style is here to make sure the image width is correct when nested in a table */\n\ttable .", ", table .", ".", " {\n\t\tpadding: unset;\n\t\tleft: unset;\n\t}\n"])), resizerItemClassName, handleWrapperClass, resizerHandleClassName, resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", resizerDangerClassName, resizerHandleThumbClassName, "var(--ds-icon-danger, ".concat(akEditorDeleteIconColor, ")"), resizerHandleClassName, "var(--ds-space-negative-200, -16px)", resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", resizerHandleTrackClassName, resizerHandleThumbClassName, "var(--ds-space-025, 2px)", "var(--ds-border, #091E4224)", "var(--ds-border-selected, #0C66E4)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-border-focused, #388BFF)", resizerHandleTrackClassName, "var(--ds-background-selected, #E9F2FF)", "var(--ds-background-selected, #E9F2FF)", akEditorSelectedNodeClassName, resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", akEditorSelectedNodeClassName, resizerHandleClassName, resizerHandleThumbClassName, "var(--ds-border, #091E4224)", resizerHoverZoneClassName, resizerExtendedZone, "var(--ds-space-150, 12px)", "var(--ds-space-negative-150, -12px)", resizerHoverZoneClassName, resizerHoverZoneClassName, resizerExtendedZone);
25
+ export var resizerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.", " {\n\t\twill-change: width;\n\n\t\t&:hover,\n\t\t&.display-handle {\n\t\t\t& > .", " > .", " {\n\t\t\t\tvisibility: visible;\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\n\t\t&.is-resizing {\n\t\t\t& .", " {\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&.", " {\n\t\t\t& .", " {\n\t\t\t\ttransition: none;\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\t\tvisibility: hidden;\n\t\topacity: 0;\n\t\tflex-direction: column;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: 7px;\n\t\ttransition:\n\t\t\tvisibility 0.2s,\n\t\t\topacity 0.2s;\n\n\t\t/*\n NOTE: The below style is targeted at the div element added by the tooltip. We don't have any means of injecting styles\n into the tooltip\n */\n\t\t& div[role='presentation'] {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\t\t\tmargin-top: ", ";\n\t\t\twhite-space: normal;\n\t\t}\n\n\t\t/*\n Handle Positions\n */\n\t\t&.left {\n\t\t\talign-items: flex-start;\n\t\t}\n\t\t&.right {\n\t\t\talign-items: flex-end;\n\t\t}\n\n\t\t/*\n Handle Sizing\n */\n\t\t&.small {\n\t\t\t& .", " {\n\t\t\t\theight: 43px;\n\t\t\t}\n\t\t}\n\t\t&.medium {\n\t\t\t& .", " {\n\t\t\t\theight: 64px;\n\t\t\t}\n\t\t}\n\t\t&.large {\n\t\t\t& .", " {\n\t\t\t\theight: 96px;\n\t\t\t}\n\t\t}\n\t\t&.clamped {\n\t\t\t& .", " {\n\t\t\t\theight: clamp(43px, calc(100% - 32px), 96px);\n\t\t\t}\n\t\t}\n\n\t\t/*\n Handle Alignment\n */\n\t\t&.sticky {\n\t\t\t& .", " {\n\t\t\t\tposition: sticky;\n\t\t\t\ttop: ", ";\n\t\t\t\tbottom: ", ";\n\t\t\t}\n\t\t}\n\n\t\t&:hover {\n\t\t\t& .", " {\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\n\t\t\t& .", " {\n\t\t\t\tvisibility: visible;\n\t\t\t\topacity: 0.5;\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tcontent: ' ';\n\t\tdisplay: flex;\n\t\twidth: 3px;\n\t\tmargin: 0 ", ";\n\t\theight: 64px;\n\t\ttransition: background-color 0.2s;\n\t\tborder-radius: 6px;\n\t\tborder: 0;\n\t\tpadding: 0;\n\t\tz-index: 2;\n\t\toutline: none;\n\t\tmin-height: 24px;\n\t\tbackground: ", ";\n\n\t\t&:hover {\n\t\t\tcursor: col-resize;\n\t\t}\n\n\t\t&:focus {\n\t\t\tbackground: ", ";\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: ", ";\n\t\t\t\tright: ", ";\n\t\t\t\tbottom: ", ";\n\t\t\t\tleft: ", ";\n\t\t\t\tborder: 2px solid ", ";\n\t\t\t\tborder-radius: inherit;\n\t\t\t\tz-index: -1;\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tvisibility: hidden;\n\t\tposition: absolute;\n\t\twidth: 7px;\n\t\theight: calc(100% - 40px);\n\t\tborder-radius: 4px;\n\t\topacity: 0;\n\t\ttransition:\n\t\t\tbackground-color 0.2s,\n\t\t\tvisibility 0.2s,\n\t\t\topacity 0.2s;\n\n\t\t&.none {\n\t\t\tbackground: none;\n\t\t}\n\n\t\t&.shadow {\n\t\t\tbackground: ", ";\n\t\t}\n\n\t\t&.full-height {\n\t\t\tbackground: ", ";\n\t\t\theight: 100%;\n\t\t\tmin-height: 36px;\n\t\t}\n\t}\n\n\t.", " {\n\t\t& .", " {\n\t\t\tbackground: ", ";\n\t\t}\n\t}\n\n\t// Remove when cleaning up platform_editor_interaction_api_refactor\n\t.ak-editor-no-interaction\n\t\t.", "\n\t\t.", ":not(:hover)\n\t\t.", " {\n\t\tbackground: ", ";\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t\twidth: 100%;\n\n\t\t&.", " {\n\t\t\tpadding: 0 ", ";\n\t\t\tleft: ", ";\n\t\t}\n\t}\n\n\t/* This below style is here to make sure the image width is correct when nested in a table */\n\ttable .", ", table .", ".", " {\n\t\tpadding: unset;\n\t\tleft: unset;\n\t}\n"])), resizerItemClassName, handleWrapperClass, resizerHandleClassName, resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", resizerDangerClassName, resizerHandleThumbClassName, "var(--ds-icon-danger, ".concat(akEditorDeleteIconColor, ")"), resizerHandleClassName, "var(--ds-space-negative-200, -16px)", resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, resizerHandleThumbClassName, "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", resizerHandleTrackClassName, resizerHandleThumbClassName, "var(--ds-space-025, 2px)", "var(--ds-border, #091E4224)", "var(--ds-border-selected, #0C66E4)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-space-negative-050, -4px)", "var(--ds-border-focused, #388BFF)", resizerHandleTrackClassName, "var(--ds-background-selected, #E9F2FF)", "var(--ds-background-selected, #E9F2FF)", akEditorSelectedNodeClassName, resizerHandleThumbClassName, "var(--ds-border-focused, #388BFF)", akEditorSelectedNodeClassName, resizerHandleClassName, resizerHandleThumbClassName, "var(--ds-border, #091E4224)", resizerHoverZoneClassName, resizerExtendedZone, "var(--ds-space-150, 12px)", "var(--ds-space-negative-150, -12px)", resizerHoverZoneClassName, resizerHoverZoneClassName, resizerExtendedZone);
26
26
 
27
27
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
28
28
  export var pragmaticResizerStyles = function pragmaticResizerStyles() {
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "105.8.4";
23
+ var packageVersion = "105.9.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -1,10 +1,15 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ 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; }
3
+ 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) { _defineProperty(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; }
1
4
  import { validator } from '@atlaskit/adf-utils/validator';
2
5
  import { ACTION_SUBJECT_ID } from '../analytics';
3
6
  export var UNSUPPORTED_NODE_ATTRIBUTE = 'unsupportedNodeAttribute';
4
7
  import { fireUnsupportedEvent } from './track-unsupported-content';
5
- var errorCallbackFor = function errorCallbackFor(marks, validate, dispatchAnalyticsEvent) {
8
+ var errorCallbackFor = function errorCallbackFor(marks, validate, dispatchAnalyticsEvent, validationOverrides) {
6
9
  return function (entity, error, options) {
7
- return validationErrorHandler(entity, error, options, marks, validate, dispatchAnalyticsEvent);
10
+ return validationErrorHandler(entity, error, _objectSpread(_objectSpread({}, options), {}, {
11
+ allowNestedTables: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowNestedTables
12
+ }), marks, validate, dispatchAnalyticsEvent);
8
13
  };
9
14
  };
10
15
  export var validationErrorHandler = function validationErrorHandler(entity, error, options, marks, validate, dispatchAnalyticsEvent) {
@@ -55,6 +60,19 @@ export var validationErrorHandler = function validationErrorHandler(entity, erro
55
60
  }
56
61
  }
57
62
  }
63
+
64
+ // Nested tables don't actually exist in ADF. In ADF they are stored as an `extension` node with the nested table content serialized in a property of that extension.
65
+ // Usually when we validate ADF we are validating this `extension` and then later transforming it into nested tables for usage by ProseMirror.
66
+ // Under certain circumstances however, ADF validation is performed on this already transformed extension and since nested tables aren't allowed by ADF this
67
+ // produces an error. For example, nested renderers in Confluence `bodiedExtension`'s. The nested renderer receives the already transformed nested tables that originated from the
68
+ // `extension` node and validates it. This is invalid ADF so an error is thrown.
69
+ // This override allows an exception to be made for nested tables in the validator in this circumstance.
70
+ if (options.allowNestedTables) {
71
+ var meta = error.meta;
72
+ if (options.allowNestedTables && meta !== null && meta !== void 0 && meta.parentType && ['tableCell', 'tableHeader'].includes(meta === null || meta === void 0 ? void 0 : meta.parentType) && error.code === 'INVALID_CONTENT' && entity.type === 'table') {
73
+ return entity;
74
+ }
75
+ }
58
76
  if (options.allowUnsupportedBlock) {
59
77
  return wrapWithUnsupported(entity);
60
78
  }
@@ -105,7 +123,7 @@ function trackValidationError(dispatchAnalyticsEvent, error, entity) {
105
123
  attrs: entity.attrs || {}
106
124
  }, error.code);
107
125
  }
108
- export var validateADFEntity = function validateADFEntity(schema, node, dispatchAnalyticsEvent) {
126
+ export var validateADFEntity = function validateADFEntity(schema, node, dispatchAnalyticsEvent, validationOverrides) {
109
127
  var nodes = Object.keys(schema.nodes);
110
128
  var marks = Object.keys(schema.marks);
111
129
  var validate = validator(nodes, marks, {
@@ -115,7 +133,7 @@ export var validateADFEntity = function validateADFEntity(schema, node, dispatch
115
133
  type: 'doc',
116
134
  content: []
117
135
  };
118
- var _validate = validate(node, errorCallbackFor(marks, validate, dispatchAnalyticsEvent)),
136
+ var _validate = validate(node, errorCallbackFor(marks, validate, dispatchAnalyticsEvent, validationOverrides)),
119
137
  _validate$entity = _validate.entity,
120
138
  entity = _validate$entity === void 0 ? emptyDoc : _validate$entity;
121
139
  return entity;
@@ -15,6 +15,7 @@ interface Props {
15
15
  searchTerm?: string;
16
16
  items: QuickInsertItem[];
17
17
  selectedItemIndex?: number;
18
+ ariaControlsId?: string;
18
19
  }
19
20
  declare const MemoizedElementSearchWithAnalytics: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<Props & WrappedComponentProps, "intl"> & {
20
21
  forwardedRef?: React.Ref<any> | undefined;
@@ -10,7 +10,9 @@ export declare const validationErrorHandler: (entity: ADFEntity, error: Validati
10
10
  originalValue: ADFEntity;
11
11
  };
12
12
  } | undefined;
13
- export declare const validateADFEntity: (schema: Schema, node: ADFEntity, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => ADFEntity;
13
+ export declare const validateADFEntity: (schema: Schema, node: ADFEntity, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, validationOverrides?: {
14
+ allowNestedTables?: boolean;
15
+ }) => ADFEntity;
14
16
  export declare function wrapWithUnsupported(originalValue: ADFEntity, type?: 'block' | 'inline' | 'mark'): {
15
17
  type: string;
16
18
  attrs: {
@@ -15,6 +15,7 @@ interface Props {
15
15
  searchTerm?: string;
16
16
  items: QuickInsertItem[];
17
17
  selectedItemIndex?: number;
18
+ ariaControlsId?: string;
18
19
  }
19
20
  declare const MemoizedElementSearchWithAnalytics: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<Props & WrappedComponentProps, "intl"> & {
20
21
  forwardedRef?: React.Ref<any> | undefined;
@@ -10,7 +10,9 @@ export declare const validationErrorHandler: (entity: ADFEntity, error: Validati
10
10
  originalValue: ADFEntity;
11
11
  };
12
12
  } | undefined;
13
- export declare const validateADFEntity: (schema: Schema, node: ADFEntity, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => ADFEntity;
13
+ export declare const validateADFEntity: (schema: Schema, node: ADFEntity, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, validationOverrides?: {
14
+ allowNestedTables?: boolean;
15
+ }) => ADFEntity;
14
16
  export declare function wrapWithUnsupported(originalValue: ADFEntity, type?: 'block' | 'inline' | 'mark'): {
15
17
  type: string;
16
18
  attrs: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "105.8.4",
3
+ "version": "105.9.0",
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/"
@@ -122,7 +122,7 @@
122
122
  "dependencies": {
123
123
  "@atlaskit/activity-provider": "^2.5.0",
124
124
  "@atlaskit/adf-schema": "^47.6.0",
125
- "@atlaskit/adf-utils": "^19.19.0",
125
+ "@atlaskit/adf-utils": "^19.20.0",
126
126
  "@atlaskit/analytics-listeners": "^9.0.0",
127
127
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
128
128
  "@atlaskit/analytics-next": "^11.0.0",
@@ -139,7 +139,7 @@
139
139
  "@atlaskit/editor-shared-styles": "^3.4.0",
140
140
  "@atlaskit/editor-tables": "^2.9.0",
141
141
  "@atlaskit/emoji": "^69.2.0",
142
- "@atlaskit/icon": "^26.1.0",
142
+ "@atlaskit/icon": "^26.2.0",
143
143
  "@atlaskit/icon-object": "^7.1.0",
144
144
  "@atlaskit/link": "^3.2.0",
145
145
  "@atlaskit/link-datasource": "^4.11.0",
@@ -162,13 +162,13 @@
162
162
  "@atlaskit/profilecard": "^23.16.0",
163
163
  "@atlaskit/react-ufo": "^3.13.0",
164
164
  "@atlaskit/section-message": "^8.2.0",
165
- "@atlaskit/smart-card": "^38.4.0",
165
+ "@atlaskit/smart-card": "^38.5.0",
166
166
  "@atlaskit/smart-user-picker": "^8.0.0",
167
167
  "@atlaskit/spinner": "^18.0.0",
168
168
  "@atlaskit/task-decision": "^19.2.0",
169
169
  "@atlaskit/textfield": "^8.0.0",
170
170
  "@atlaskit/theme": "^18.0.0",
171
- "@atlaskit/tmp-editor-statsig": "^4.24.0",
171
+ "@atlaskit/tmp-editor-statsig": "^4.25.0",
172
172
  "@atlaskit/tokens": "^4.9.0",
173
173
  "@atlaskit/tooltip": "^20.0.0",
174
174
  "@atlaskit/width-detector": "^5.0.0",