@atlaskit/editor-common 78.10.1 → 78.11.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 (44) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/extensibility/Extension/InlineExtension/index.js +40 -42
  3. package/dist/cjs/extensibility/Extension/InlineExtension/styles.js +32 -5
  4. package/dist/cjs/extensibility/ExtensionComponent.js +2 -1
  5. package/dist/cjs/monitoring/error.js +1 -1
  6. package/dist/cjs/ui/DropList/index.js +1 -1
  7. package/dist/cjs/ui/MediaSingle/index.js +5 -2
  8. package/dist/cjs/ui/MediaSingle/styled.js +44 -8
  9. package/dist/cjs/ui/MultiBodiedExtension/index.js +1 -8
  10. package/dist/cjs/ui/WidthProvider/index.js +35 -49
  11. package/dist/cjs/ui/index.js +6 -0
  12. package/dist/es2019/extensibility/Extension/InlineExtension/index.js +43 -28
  13. package/dist/es2019/extensibility/Extension/InlineExtension/styles.js +29 -22
  14. package/dist/es2019/extensibility/ExtensionComponent.js +2 -1
  15. package/dist/es2019/monitoring/error.js +1 -1
  16. package/dist/es2019/ui/DropList/index.js +1 -1
  17. package/dist/es2019/ui/MediaSingle/index.js +4 -2
  18. package/dist/es2019/ui/MediaSingle/styled.js +40 -10
  19. package/dist/es2019/ui/MultiBodiedExtension/index.js +1 -8
  20. package/dist/es2019/ui/WidthProvider/index.js +29 -35
  21. package/dist/es2019/ui/index.js +1 -1
  22. package/dist/esm/extensibility/Extension/InlineExtension/index.js +40 -45
  23. package/dist/esm/extensibility/Extension/InlineExtension/styles.js +31 -3
  24. package/dist/esm/extensibility/ExtensionComponent.js +2 -1
  25. package/dist/esm/monitoring/error.js +1 -1
  26. package/dist/esm/ui/DropList/index.js +1 -1
  27. package/dist/esm/ui/MediaSingle/index.js +5 -2
  28. package/dist/esm/ui/MediaSingle/styled.js +44 -9
  29. package/dist/esm/ui/MultiBodiedExtension/index.js +1 -8
  30. package/dist/esm/ui/WidthProvider/index.js +31 -49
  31. package/dist/esm/ui/index.js +1 -1
  32. package/dist/types/extensibility/Extension/InlineExtension/index.d.ts +5 -4
  33. package/dist/types/extensibility/Extension/InlineExtension/styles.d.ts +1 -0
  34. package/dist/types/ui/MediaSingle/index.d.ts +2 -1
  35. package/dist/types/ui/MediaSingle/styled.d.ts +11 -2
  36. package/dist/types/ui/WidthProvider/index.d.ts +3 -10
  37. package/dist/types/ui/index.d.ts +1 -1
  38. package/dist/types-ts4.5/extensibility/Extension/InlineExtension/index.d.ts +5 -4
  39. package/dist/types-ts4.5/extensibility/Extension/InlineExtension/styles.d.ts +1 -0
  40. package/dist/types-ts4.5/ui/MediaSingle/index.d.ts +2 -1
  41. package/dist/types-ts4.5/ui/MediaSingle/styled.d.ts +11 -2
  42. package/dist/types-ts4.5/ui/WidthProvider/index.d.ts +3 -10
  43. package/dist/types-ts4.5/ui/index.d.ts +1 -1
  44. package/package.json +6 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 78.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 78.11.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#63691](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63691) [`02293e70771b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/02293e70771b) - add allowWidthDetector option to be used to skip width detector in renderer, to make media single works in inline extension like excerpt include
14
+
15
+ ### Patch Changes
16
+
17
+ - [#78210](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78210) [`cf7638b2d3e9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cf7638b2d3e9) - [ux] ED-22329: removed additional CSS added for decisionItem margin-top
18
+
3
19
  ## 78.10.1
4
20
 
5
21
  ### Patch Changes
@@ -6,53 +6,51 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
9
  var _react = _interopRequireWildcard(require("react"));
15
10
  var _react2 = require("@emotion/react");
11
+ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
+ var _hooks = require("../../../hooks");
14
+ var _ui = require("../../../ui");
16
15
  var _Lozenge = _interopRequireDefault(require("../Lozenge"));
17
16
  var _styles = require("../styles");
18
17
  var _styles2 = require("./styles");
19
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
19
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
22
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
23
- var InlineExtension = exports.default = /*#__PURE__*/function (_Component) {
24
- (0, _inherits2.default)(InlineExtension, _Component);
25
- var _super = _createSuper(InlineExtension);
26
- function InlineExtension() {
27
- (0, _classCallCheck2.default)(this, InlineExtension);
28
- return _super.apply(this, arguments);
20
+ /** @jsx jsx */
21
+
22
+ var InlineExtension = function InlineExtension(props) {
23
+ var node = props.node,
24
+ pluginInjectionApi = props.pluginInjectionApi,
25
+ showMacroInteractionDesignUpdates = props.showMacroInteractionDesignUpdates,
26
+ isNodeSelected = props.isNodeSelected,
27
+ children = props.children;
28
+ var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['width']),
29
+ widthState = _useSharedPluginState.widthState;
30
+ var hasChildren = !!children;
31
+ var className = hasChildren ? 'with-overlay with-children' : 'with-overlay';
32
+ var rendererContainerWidth = widthState ? widthState.width - _editorSharedStyles.akEditorGutterPadding * 2 : 0;
33
+ var extendedInlineExtension = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.inline_extension.extended_lcqdn') || false;
34
+ var inlineExtensionInternal = (0, _react2.jsx)(_react.Fragment, null, showMacroInteractionDesignUpdates && (0, _react2.jsx)(_Lozenge.default, {
35
+ node: node,
36
+ isNodeSelected: isNodeSelected,
37
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
38
+ }), (0, _react2.jsx)("div", {
39
+ css: [_styles2.wrapperStyle, extendedInlineExtension && _styles2.inlineWrapperStyels],
40
+ className: "extension-container inline ".concat(className)
41
+ }, (0, _react2.jsx)("div", {
42
+ css: _styles.overlay,
43
+ className: "extension-overlay"
44
+ }), children ? children : (0, _react2.jsx)(_Lozenge.default, {
45
+ node: node,
46
+ isNodeSelected: isNodeSelected,
47
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
48
+ })));
49
+ if (extendedInlineExtension) {
50
+ return (0, _react2.jsx)(_ui.WidthContext.Provider, {
51
+ value: (0, _ui.createWidthContext)(rendererContainerWidth)
52
+ }, inlineExtensionInternal);
29
53
  }
30
- (0, _createClass2.default)(InlineExtension, [{
31
- key: "render",
32
- value: function render() {
33
- var _this$props = this.props,
34
- node = _this$props.node,
35
- children = _this$props.children,
36
- showMacroInteractionDesignUpdates = _this$props.showMacroInteractionDesignUpdates,
37
- isNodeSelected = _this$props.isNodeSelected;
38
- var hasChildren = !!children;
39
- var className = hasChildren ? 'with-overlay with-children' : 'with-overlay';
40
- return (0, _react2.jsx)(_react.Fragment, null, showMacroInteractionDesignUpdates && (0, _react2.jsx)(_Lozenge.default, {
41
- node: node,
42
- isNodeSelected: isNodeSelected,
43
- showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
44
- }), (0, _react2.jsx)("div", {
45
- css: _styles2.wrapperStyle,
46
- className: "extension-container inline ".concat(className)
47
- }, (0, _react2.jsx)("div", {
48
- css: _styles.overlay,
49
- className: "extension-overlay"
50
- }), children ? children : (0, _react2.jsx)(_Lozenge.default, {
51
- node: node,
52
- isNodeSelected: isNodeSelected,
53
- showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
54
- })));
55
- }
56
- }]);
57
- return InlineExtension;
58
- }(_react.Component);
54
+ return inlineExtensionInternal;
55
+ };
56
+ var _default = exports.default = InlineExtension;
@@ -1,12 +1,39 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports.wrapperStyle = void 0;
8
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
6
+ exports.wrapperStyle = exports.inlineWrapperStyels = void 0;
9
7
  var _react = require("@emotion/react");
10
8
  var _styles = require("../styles");
11
- var _templateObject;
12
- var wrapperStyle = exports.wrapperStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n\n cursor: pointer;\n display: inline-flex;\n margin: 1px 1px ", ";\n\n > img {\n border-radius: ", ";\n }\n\n &::after,\n &::before {\n vertical-align: text-top;\n display: inline-block;\n width: 1px;\n content: '';\n }\n\n &.with-children {\n padding: 0;\n background: ", ";\n }\n"])), _styles.wrapperDefault, "var(--ds-space-050, 4px)", "var(--ds-border-radius, 3px)", "var(--ds-background-neutral-subtle, white)");
9
+ var wrapperStyle = exports.wrapperStyle = (0, _react.css)(_styles.wrapperDefault, {
10
+ cursor: 'pointer',
11
+ display: 'inline-flex',
12
+ margin: "1px 1px ".concat("var(--ds-space-050, 4px)"),
13
+ '> img': {
14
+ borderRadius: "var(--ds-border-radius, 3px)"
15
+ },
16
+ '&::after, &::before': {
17
+ verticalAlign: 'text-top',
18
+ display: 'inline-block',
19
+ width: '1px',
20
+ content: "''"
21
+ },
22
+ '&.with-children': {
23
+ padding: 0,
24
+ background: "var(--ds-background-neutral-subtle, white)"
25
+ }
26
+ });
27
+ var inlineWrapperStyels = exports.inlineWrapperStyels = (0, _react.css)({
28
+ maxWidth: '100%',
29
+ display: 'inline-block',
30
+ '&::after, &::before': {
31
+ display: 'block'
32
+ },
33
+ 'tr &': {
34
+ maxWidth: 'inherit'
35
+ },
36
+ '.rich-media-item': {
37
+ maxWidth: '100%'
38
+ }
39
+ });
@@ -233,7 +233,8 @@ var ExtensionComponent = exports.ExtensionComponent = /*#__PURE__*/function (_Co
233
233
  return /*#__PURE__*/_react.default.createElement(_InlineExtension.default, {
234
234
  node: node,
235
235
  showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
236
- isNodeSelected: selectedNode === node
236
+ isNodeSelected: selectedNode === node,
237
+ pluginInjectionApi: pluginInjectionApi
237
238
  }, extensionHandlerResult);
238
239
  default:
239
240
  return null;
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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 = "78.10.1";
19
+ var packageVersion = "78.11.1";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -22,7 +22,7 @@ var _templateObject, _templateObject2, _templateObject3;
22
22
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
23
23
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
24
24
  var packageName = "@atlaskit/editor-common";
25
- var packageVersion = "78.10.1";
25
+ var packageVersion = "78.11.1";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
@@ -34,7 +34,9 @@ function MediaSingle(_ref) {
34
34
  editorWidth = _ref.lineLength,
35
35
  _ref$hasFallbackConta = _ref.hasFallbackContainer,
36
36
  hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta,
37
- handleMediaSingleRef = _ref.handleMediaSingleRef;
37
+ handleMediaSingleRef = _ref.handleMediaSingleRef,
38
+ _ref$isInsideOfInline = _ref.isInsideOfInlineExtension,
39
+ isInsideOfInlineExtension = _ref$isInsideOfInline === void 0 ? false : _ref$isInsideOfInline;
38
40
  var isPixelWidth = (size === null || size === void 0 ? void 0 : size.widthType) === 'pixel';
39
41
  var mediaSingleWidth = (size === null || size === void 0 ? void 0 : size.width) || pctWidth;
40
42
  var children = _react.default.Children.toArray(propsChildren);
@@ -93,7 +95,8 @@ function MediaSingle(_ref) {
93
95
  containerWidth: containerWidth,
94
96
  mediaSingleWidth: mediaSingleWidth,
95
97
  fullWidthMode: fullWidthMode,
96
- isExtendedResizeExperienceOn: isPixelWidth
98
+ isExtendedResizeExperienceOn: isPixelWidth,
99
+ isInsideOfInlineExtension: isInsideOfInlineExtension
97
100
  }),
98
101
  "data-layout": layout,
99
102
  "data-width": mediaSingleWidth,
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.MediaWrapper = exports.MediaSingleDimensionHelper = exports.MediaBorderGapFiller = void 0;
8
8
  exports.calcLegacyWidth = calcLegacyWidth;
9
+ exports.calcLegacyWidthForInline = calcLegacyWidthForInline;
9
10
  exports.calcResizedWidth = calcResizedWidth;
10
11
  exports.mediaWrapperStyle = void 0;
11
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
@@ -28,11 +29,17 @@ function float(layout) {
28
29
  return 'none';
29
30
  }
30
31
  }
31
- function getWidthIfFullWidthMode(width) {
32
- return width > _editorSharedStyles.akEditorFullWidthLayoutWidth ? '100%' : "".concat(width, "px");
32
+ function getWidthIfFullWidthMode(originalWidth, containerWidth, isInsideOfInlineExtension) {
33
+ if (isInsideOfInlineExtension) {
34
+ return originalWidth > _editorSharedStyles.akEditorFullWidthLayoutWidth ? "".concat(Math.min(containerWidth, _editorSharedStyles.akEditorFullWidthLayoutWidth), "px") : "".concat(originalWidth, "px");
35
+ }
36
+ return originalWidth > _editorSharedStyles.akEditorFullWidthLayoutWidth ? '100%' : "".concat(originalWidth, "px");
33
37
  }
34
- function getWidthIfDefaultMode(width) {
35
- return width > _editorSharedStyles.akEditorFullPageMaxWidth ? '100%' : "".concat(width, "px");
38
+ function getWidthIfDefaultMode(originalWidth, containerWidth, isInsideOfInlineExtension) {
39
+ if (isInsideOfInlineExtension) {
40
+ return originalWidth > _editorSharedStyles.akEditorFullPageMaxWidth ? "".concat(Math.min(containerWidth, _editorSharedStyles.akEditorDefaultLayoutWidth), "px") : "".concat(originalWidth, "px");
41
+ }
42
+ return originalWidth > _editorSharedStyles.akEditorFullPageMaxWidth ? '100%' : "".concat(originalWidth, "px");
36
43
  }
37
44
 
38
45
  /**
@@ -46,6 +53,7 @@ function calcLegacyWidth(layout, width) {
46
53
  var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
47
54
  var fullWidthMode = arguments.length > 3 ? arguments[3] : undefined;
48
55
  var isResized = arguments.length > 4 ? arguments[4] : undefined;
56
+ var isInsideOfInlineExtension = arguments.length > 5 ? arguments[5] : undefined;
49
57
  switch (layout) {
50
58
  case 'align-start':
51
59
  case 'align-end':
@@ -53,11 +61,37 @@ function calcLegacyWidth(layout, width) {
53
61
  case 'wrap-left':
54
62
  return width > containerWidth / 2 ? 'calc(50% - 12px)' : "".concat(width, "px");
55
63
  case 'wide':
56
- return (0, _breakout.calcWideWidth)(containerWidth);
64
+ return isInsideOfInlineExtension ? (0, _breakout.calcWideWidth)(containerWidth, Infinity, "".concat(containerWidth, "px")) : (0, _breakout.calcWideWidth)(containerWidth);
65
+ case 'full-width':
66
+ return (0, _breakout.calcBreakoutWidth)(layout, containerWidth);
67
+ default:
68
+ return isResized ? "".concat(width, "px") : fullWidthMode ? getWidthIfFullWidthMode(width, containerWidth, isInsideOfInlineExtension) : getWidthIfDefaultMode(width, containerWidth, isInsideOfInlineExtension);
69
+ }
70
+ }
71
+
72
+ /**
73
+ * Calculates the image width for non-resized images.
74
+ *
75
+ * If an image has not been resized using the pctWidth attribute,
76
+ * then an image in wide or full-width can not be wider than the image's
77
+ * original width.
78
+ */
79
+ function calcLegacyWidthForInline(layout, width) {
80
+ var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
81
+ var fullWidthMode = arguments.length > 3 ? arguments[3] : undefined;
82
+ var isResized = arguments.length > 4 ? arguments[4] : undefined;
83
+ switch (layout) {
84
+ case 'align-start':
85
+ case 'align-end':
86
+ case 'wrap-right':
87
+ case 'wrap-left':
88
+ return width > containerWidth / 2 ? 'calc(50% - 12px)' : "".concat(width, "px");
89
+ case 'wide':
90
+ return (0, _breakout.calcWideWidth)(containerWidth, Infinity, "".concat(containerWidth, "px"));
57
91
  case 'full-width':
58
92
  return (0, _breakout.calcBreakoutWidth)(layout, containerWidth);
59
93
  default:
60
- return isResized ? "".concat(width, "px") : fullWidthMode ? getWidthIfFullWidthMode(width) : getWidthIfDefaultMode(width);
94
+ return isResized ? "".concat(width, "px") : fullWidthMode ? getWidthIfFullWidthMode(width, containerWidth) : getWidthIfDefaultMode(width, containerWidth);
61
95
  }
62
96
  }
63
97
 
@@ -122,8 +156,10 @@ var MediaSingleDimensionHelper = exports.MediaSingleDimensionHelper = function M
122
156
  width = _ref.width,
123
157
  isExtendedResizeExperienceOn = _ref.isExtendedResizeExperienceOn,
124
158
  _ref$isNestedNode = _ref.isNestedNode,
125
- isNestedNode = _ref$isNestedNode === void 0 ? false : _ref$isNestedNode;
126
- return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] &,\n [data-panel-type] &,\n li & {\n max-width: 100%;\n }\n\n width: ", ";\n ", "\n max-width: ", ";\n\n ", "\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n\n float: ", ";\n margin: ", ";\n\n &[class*='not-resizing'] {\n ", "\n }\n\n ", ";\n"])), isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' &&
159
+ isNestedNode = _ref$isNestedNode === void 0 ? false : _ref$isNestedNode,
160
+ _ref$isInsideOfInline = _ref.isInsideOfInlineExtension,
161
+ isInsideOfInlineExtension = _ref$isInsideOfInline === void 0 ? false : _ref$isInsideOfInline;
162
+ return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] &,\n [data-panel-type] &,\n li & {\n max-width: 100%;\n }\n\n width: ", ";\n ", "\n max-width: ", ";\n\n ", "\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n\n float: ", ";\n margin: ", ";\n\n &[class*='not-resizing'] {\n ", "\n }\n\n ", ";\n"])), isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized, isInsideOfInlineExtension), layout === 'full-width' &&
127
163
  /* This causes issues for new experience where we don't strip layout attributes
128
164
  when copying top-level node and pasting into a table/layout,
129
165
  because full-width layout will remain, causing node to be edge-to-edge */
@@ -11,9 +11,8 @@ var _styles = require("../../styles");
11
11
 
12
12
  // Wraps the navigation bar and extensionFrames
13
13
  var mbeExtensionContainer = (0, _react.css)({
14
- background: 'transpaent !important',
14
+ background: 'transparent !important',
15
15
  'padding:': {
16
- bottom: "var(--ds-space-100, 8px)".concat(" !important"),
17
16
  left: "var(--ds-space-100, 8px)".concat(" !important"),
18
17
  right: "var(--ds-space-100, 8px)".concat(" !important")
19
18
  },
@@ -65,12 +64,6 @@ var extensionFrameContent = (0, _react.css)({
65
64
  },
66
65
  '.extensionView-content-wrap': {
67
66
  marginTop: "var(--ds-space-100, 8px)".concat(" !important")
68
- },
69
- '.decisionItemView-content-wrap': {
70
- marginTop: '0px !important'
71
- },
72
- '.decisionItemView-content-wrap > [data-decision-wrapper]': {
73
- marginTop: '0px !important'
74
67
  }
75
68
  });
76
69
  var sharedMultiBodiedExtensionStyles = exports.sharedMultiBodiedExtensionStyles = {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
@@ -8,20 +9,15 @@ exports.WidthProvider = exports.WidthContext = exports.WidthConsumer = void 0;
8
9
  exports.createWidthContext = createWidthContext;
9
10
  exports.getBreakpoint = getBreakpoint;
10
11
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
14
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
16
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
17
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
- var _react = _interopRequireDefault(require("react"));
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+ var _react = _interopRequireWildcard(require("react"));
19
14
  var _react2 = require("@emotion/react");
20
15
  var _rafSchd = _interopRequireDefault(require("raf-schd"));
21
16
  var _widthDetector = require("@atlaskit/width-detector");
22
17
  var _templateObject;
23
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
24
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
18
+ /** @jsx jsx */
19
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
21
  var SCROLLBAR_WIDTH = 30;
26
22
  function getBreakpoint() {
27
23
  var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
@@ -44,43 +40,33 @@ function createWidthContext() {
44
40
  var WidthContext = exports.WidthContext = /*#__PURE__*/_react.default.createContext(createWidthContext());
45
41
  var Provider = WidthContext.Provider,
46
42
  Consumer = exports.WidthConsumer = WidthContext.Consumer;
47
- var WidthProvider = exports.WidthProvider = /*#__PURE__*/function (_React$Component) {
48
- (0, _inherits2.default)(WidthProvider, _React$Component);
49
- var _super = _createSuper(WidthProvider);
50
- function WidthProvider(props) {
51
- var _this;
52
- (0, _classCallCheck2.default)(this, WidthProvider);
53
- _this = _super.call(this, props);
54
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
55
- width: 0
56
- });
57
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setWidth", (0, _rafSchd.default)(function (width) {
58
- // Ignore changes that are less than SCROLLBAR_WIDTH, otherwise it can cause infinite re-scaling
59
- if (Math.abs(_this.state.width - width) < SCROLLBAR_WIDTH) {
60
- return;
61
- }
62
- _this.setState({
63
- width: width
64
- });
65
- }));
66
- if (typeof document !== 'undefined') {
67
- _this.state.width = document.body.offsetWidth;
43
+ var WidthProvider = exports.WidthProvider = function WidthProvider(_ref) {
44
+ var className = _ref.className,
45
+ shouldCheckExistingValue = _ref.shouldCheckExistingValue,
46
+ children = _ref.children;
47
+ var existingContextValue = _react.default.useContext(WidthContext);
48
+ var _React$useState = _react.default.useState(typeof document !== 'undefined' ? document.body.offsetWidth : 0),
49
+ _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
50
+ width = _React$useState2[0],
51
+ setWidth = _React$useState2[1];
52
+ var providerValue = _react.default.useMemo(function () {
53
+ return createWidthContext(width);
54
+ }, [width]);
55
+ var updateWidth = (0, _rafSchd.default)(function (nextWidth) {
56
+ // Ignore changes that are less than SCROLLBAR_WIDTH, otherwise it can cause infinite re-scaling
57
+ if (Math.abs(width - nextWidth) < SCROLLBAR_WIDTH) {
58
+ return;
68
59
  }
69
- return _this;
70
- }
71
- (0, _createClass2.default)(WidthProvider, [{
72
- key: "render",
73
- value: function render() {
74
- return (0, _react2.jsx)("div", {
75
- css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n width: 100%;\n "]))),
76
- className: this.props.className
77
- }, (0, _react2.jsx)(_widthDetector.WidthObserver, {
78
- setWidth: this.setWidth,
79
- offscreen: true
80
- }), (0, _react2.jsx)(Provider, {
81
- value: createWidthContext(this.state.width)
82
- }, this.props.children));
83
- }
84
- }]);
85
- return WidthProvider;
86
- }(_react.default.Component);
60
+ setWidth(nextWidth);
61
+ });
62
+ var skipWidthDetection = shouldCheckExistingValue && existingContextValue.width > 0;
63
+ return (0, _react2.jsx)("div", {
64
+ css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n width: 100%;\n "]))),
65
+ className: className
66
+ }, !skipWidthDetection && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_widthDetector.WidthObserver, {
67
+ setWidth: updateWidth,
68
+ offscreen: true
69
+ }), (0, _react2.jsx)(Provider, {
70
+ value: providerValue
71
+ }, children)), skipWidthDetection && children);
72
+ };
@@ -269,6 +269,12 @@ Object.defineProperty(exports, "clearNextSiblingMarginTopStyle", {
269
269
  return _clearNextSiblingMarginTop.clearNextSiblingMarginTopStyle;
270
270
  }
271
271
  });
272
+ Object.defineProperty(exports, "createWidthContext", {
273
+ enumerable: true,
274
+ get: function get() {
275
+ return _WidthProvider.createWidthContext;
276
+ }
277
+ });
272
278
  Object.defineProperty(exports, "expandLayoutWrapperStyle", {
273
279
  enumerable: true,
274
280
  get: function get() {
@@ -1,33 +1,48 @@
1
1
  /** @jsx jsx */
2
- import React, { Component, Fragment } from 'react';
2
+ import React, { Fragment } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
+ import { akEditorGutterPadding } from '@atlaskit/editor-shared-styles';
5
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
+ import { useSharedPluginState } from '../../../hooks';
7
+ import { createWidthContext, WidthContext } from '../../../ui';
4
8
  import ExtensionLozenge from '../Lozenge';
5
9
  import { overlay } from '../styles';
6
- import { wrapperStyle } from './styles';
7
- export default class InlineExtension extends Component {
8
- render() {
9
- const {
10
- node,
11
- children,
12
- showMacroInteractionDesignUpdates,
13
- isNodeSelected
14
- } = this.props;
15
- const hasChildren = !!children;
16
- const className = hasChildren ? 'with-overlay with-children' : 'with-overlay';
17
- return jsx(Fragment, null, showMacroInteractionDesignUpdates && jsx(ExtensionLozenge, {
18
- node: node,
19
- isNodeSelected: isNodeSelected,
20
- showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
21
- }), jsx("div", {
22
- css: wrapperStyle,
23
- className: `extension-container inline ${className}`
24
- }, jsx("div", {
25
- css: overlay,
26
- className: "extension-overlay"
27
- }), children ? children : jsx(ExtensionLozenge, {
28
- node: node,
29
- isNodeSelected: isNodeSelected,
30
- showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
31
- })));
10
+ import { inlineWrapperStyels, wrapperStyle } from './styles';
11
+ const InlineExtension = props => {
12
+ const {
13
+ node,
14
+ pluginInjectionApi,
15
+ showMacroInteractionDesignUpdates,
16
+ isNodeSelected,
17
+ children
18
+ } = props;
19
+ const {
20
+ widthState
21
+ } = useSharedPluginState(pluginInjectionApi, ['width']);
22
+ const hasChildren = !!children;
23
+ const className = hasChildren ? 'with-overlay with-children' : 'with-overlay';
24
+ const rendererContainerWidth = widthState ? widthState.width - akEditorGutterPadding * 2 : 0;
25
+ const extendedInlineExtension = getBooleanFF('platform.editor.inline_extension.extended_lcqdn') || false;
26
+ const inlineExtensionInternal = jsx(Fragment, null, showMacroInteractionDesignUpdates && jsx(ExtensionLozenge, {
27
+ node: node,
28
+ isNodeSelected: isNodeSelected,
29
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
30
+ }), jsx("div", {
31
+ css: [wrapperStyle, extendedInlineExtension && inlineWrapperStyels],
32
+ className: `extension-container inline ${className}`
33
+ }, jsx("div", {
34
+ css: overlay,
35
+ className: "extension-overlay"
36
+ }), children ? children : jsx(ExtensionLozenge, {
37
+ node: node,
38
+ isNodeSelected: isNodeSelected,
39
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
40
+ })));
41
+ if (extendedInlineExtension) {
42
+ return jsx(WidthContext.Provider, {
43
+ value: createWidthContext(rendererContainerWidth)
44
+ }, inlineExtensionInternal);
32
45
  }
33
- }
46
+ return inlineExtensionInternal;
47
+ };
48
+ export default InlineExtension;
@@ -1,26 +1,33 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { wrapperDefault } from '../styles';
3
- export const wrapperStyle = css`
4
- ${wrapperDefault}
5
-
6
- cursor: pointer;
7
- display: inline-flex;
8
- margin: 1px 1px ${"var(--ds-space-050, 4px)"};
9
-
10
- > img {
11
- border-radius: ${"var(--ds-border-radius, 3px)"};
3
+ export const wrapperStyle = css(wrapperDefault, {
4
+ cursor: 'pointer',
5
+ display: 'inline-flex',
6
+ margin: `1px 1px ${"var(--ds-space-050, 4px)"}`,
7
+ '> img': {
8
+ borderRadius: "var(--ds-border-radius, 3px)"
9
+ },
10
+ '&::after, &::before': {
11
+ verticalAlign: 'text-top',
12
+ display: 'inline-block',
13
+ width: '1px',
14
+ content: "''"
15
+ },
16
+ '&.with-children': {
17
+ padding: 0,
18
+ background: "var(--ds-background-neutral-subtle, white)"
12
19
  }
13
-
14
- &::after,
15
- &::before {
16
- vertical-align: text-top;
17
- display: inline-block;
18
- width: 1px;
19
- content: '';
20
+ });
21
+ export const inlineWrapperStyels = css({
22
+ maxWidth: '100%',
23
+ display: 'inline-block',
24
+ '&::after, &::before': {
25
+ display: 'block'
26
+ },
27
+ 'tr &': {
28
+ maxWidth: 'inherit'
29
+ },
30
+ '.rich-media-item': {
31
+ maxWidth: '100%'
20
32
  }
21
-
22
- &.with-children {
23
- padding: 0;
24
- background: ${"var(--ds-background-neutral-subtle, white)"};
25
- }
26
- `;
33
+ });
@@ -188,7 +188,8 @@ export class ExtensionComponent extends Component {
188
188
  return /*#__PURE__*/React.createElement(InlineExtension, {
189
189
  node: node,
190
190
  showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates,
191
- isNodeSelected: selectedNode === node
191
+ isNodeSelected: selectedNode === node,
192
+ pluginInjectionApi: pluginInjectionApi
192
193
  }, extensionHandlerResult);
193
194
  default:
194
195
  return null;
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "78.10.1";
3
+ const packageVersion = "78.11.1";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
7
7
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
8
8
  import Layer from '../Layer';
9
9
  const packageName = "@atlaskit/editor-common";
10
- const packageVersion = "78.10.1";
10
+ const packageVersion = "78.11.1";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {