@atlaskit/editor-common 110.31.1 → 110.32.2

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 (45) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/cjs/messages/breakout.js +5 -0
  3. package/dist/cjs/monitoring/error.js +1 -1
  4. package/dist/cjs/resizer/ResizerBreakoutModeLabel.js +2 -0
  5. package/dist/cjs/selection/index.js +6 -0
  6. package/dist/cjs/selection/utils.js +25 -0
  7. package/dist/cjs/styles/shared/sync-block.js +4 -2
  8. package/dist/cjs/ui/DropList/index.js +1 -1
  9. package/dist/cjs/ui/MediaSingle/styled.js +14 -2
  10. package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +7 -3
  11. package/dist/es2019/messages/breakout.js +5 -0
  12. package/dist/es2019/monitoring/error.js +1 -1
  13. package/dist/es2019/resizer/ResizerBreakoutModeLabel.js +2 -0
  14. package/dist/es2019/selection/index.js +1 -1
  15. package/dist/es2019/selection/utils.js +25 -1
  16. package/dist/es2019/styles/shared/sync-block.js +3 -1
  17. package/dist/es2019/ui/DropList/index.js +1 -1
  18. package/dist/es2019/ui/MediaSingle/styled.js +14 -2
  19. package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +6 -2
  20. package/dist/esm/messages/breakout.js +5 -0
  21. package/dist/esm/monitoring/error.js +1 -1
  22. package/dist/esm/resizer/ResizerBreakoutModeLabel.js +2 -0
  23. package/dist/esm/selection/index.js +1 -1
  24. package/dist/esm/selection/utils.js +25 -1
  25. package/dist/esm/styles/shared/sync-block.js +3 -1
  26. package/dist/esm/ui/DropList/index.js +1 -1
  27. package/dist/esm/ui/MediaSingle/styled.js +14 -2
  28. package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +7 -3
  29. package/dist/types/messages/breakout.d.ts +5 -0
  30. package/dist/types/selection/index.d.ts +1 -1
  31. package/dist/types/selection/utils.d.ts +7 -1
  32. package/dist/types/styles/shared/sync-block.d.ts +2 -0
  33. package/dist/types/types/breakout.d.ts +1 -1
  34. package/dist/types/ui/MediaSingle/styled.d.ts +1 -1
  35. package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -0
  36. package/dist/types/utils/breakout.d.ts +1 -1
  37. package/dist/types-ts4.5/messages/breakout.d.ts +5 -0
  38. package/dist/types-ts4.5/selection/index.d.ts +1 -1
  39. package/dist/types-ts4.5/selection/utils.d.ts +7 -1
  40. package/dist/types-ts4.5/styles/shared/sync-block.d.ts +2 -0
  41. package/dist/types-ts4.5/types/breakout.d.ts +1 -1
  42. package/dist/types-ts4.5/ui/MediaSingle/styled.d.ts +1 -1
  43. package/dist/types-ts4.5/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -0
  44. package/dist/types-ts4.5/utils/breakout.d.ts +1 -1
  45. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 110.32.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`21110d2ba4a71`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/21110d2ba4a71) -
8
+ EDITOR-2893 disable editing sync block in live doc view mode
9
+ - Updated dependencies
10
+
11
+ ## 110.32.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`a05464ea42678`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a05464ea42678) -
16
+ EDITOR-2791 bump adf-schema
17
+ - Updated dependencies
18
+
19
+ ## 110.32.0
20
+
21
+ ### Minor Changes
22
+
23
+ - [`81ac927e830b5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81ac927e830b5) -
24
+ [ux] EDITOR-2866: Add max-width support and guideline wiring for node custom resizers
25
+
26
+ ### Patch Changes
27
+
28
+ - [`98517a05bfada`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/98517a05bfada) -
29
+ fix styling for full-width and wide media single
30
+ - Updated dependencies
31
+
3
32
  ## 110.31.1
4
33
 
5
34
  ### Patch Changes
@@ -6,6 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.messages = void 0;
7
7
  var _reactIntlNext = require("react-intl-next");
8
8
  var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
9
+ maxWidthLabel: {
10
+ id: 'fabric.editor.breakoutMaxWidthLabel',
11
+ defaultMessage: 'Max-width',
12
+ description: 'Resize current element to max-width mode'
13
+ },
9
14
  fullWidthLabel: {
10
15
  id: 'fabric.editor.breakoutFullWidthLabel',
11
16
  defaultMessage: 'Full-width',
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "0.0.0-development";
19
+ var packageVersion = "110.32.1";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -34,6 +34,8 @@ var ResizerBreakoutModeLabel = exports.ResizerBreakoutModeLabel = function Resiz
34
34
  formatMessage = _useIntl.formatMessage;
35
35
  var message = _react.default.useMemo(function () {
36
36
  switch (breakoutLayout) {
37
+ case 'max':
38
+ return formatMessage(_messages.breakoutMessages.maxWidthLabel);
37
39
  case 'full-width':
38
40
  return formatMessage(_messages.breakoutMessages.fullWidthLabel);
39
41
  case 'wide':
@@ -58,6 +58,12 @@ Object.defineProperty(exports, "atTheEndOfDoc", {
58
58
  }
59
59
  });
60
60
  exports.createSelectionClickHandler = createSelectionClickHandler;
61
+ Object.defineProperty(exports, "deleteSelectedRange", {
62
+ enumerable: true,
63
+ get: function get() {
64
+ return _utils2.deleteSelectedRange;
65
+ }
66
+ });
61
67
  Object.defineProperty(exports, "endPositionOfParent", {
62
68
  enumerable: true,
63
69
  get: function get() {
@@ -7,10 +7,12 @@ exports.atTheBeginningOfBlock = atTheBeginningOfBlock;
7
7
  exports.atTheBeginningOfDoc = atTheBeginningOfDoc;
8
8
  exports.atTheEndOfBlock = atTheEndOfBlock;
9
9
  exports.atTheEndOfDoc = atTheEndOfDoc;
10
+ exports.deleteSelectedRange = void 0;
10
11
  exports.endPositionOfParent = endPositionOfParent;
11
12
  exports.isSelectionAtStartOfNode = exports.isSelectionAtEndOfNode = exports.expandSelectionBounds = void 0;
12
13
  exports.startPositionOfParent = startPositionOfParent;
13
14
  var _state = require("@atlaskit/editor-prosemirror/state");
15
+ var _utils = require("@atlaskit/editor-tables/utils");
14
16
  var _selection = require("./gap-cursor/selection");
15
17
  var isSelectionAtStartOfNode = exports.isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
16
18
  if (!parentNode) {
@@ -123,4 +125,27 @@ var expandSelectionBounds = exports.expandSelectionBounds = function expandSelec
123
125
  $anchor: $anchor === $from ? $expandedFrom : $expandedTo,
124
126
  $head: $head === $to ? $expandedTo : $expandedFrom
125
127
  };
128
+ };
129
+
130
+ /**
131
+ * Delete what is selected in the given transaction.
132
+ * @param tr the transaction to delete the selection from
133
+ * @returns the updated transaction
134
+ */
135
+ var deleteSelectedRange = exports.deleteSelectedRange = function deleteSelectedRange(tr) {
136
+ var selection = tr.selection;
137
+ var from = selection.$from.pos;
138
+ var to = selection.$to.pos;
139
+ if (selection instanceof _state.TextSelection) {
140
+ from = from - 1;
141
+ to = to + 1;
142
+ } else if ((0, _utils.isTableSelected)(selection)) {
143
+ var table = (0, _utils.findTable)(selection);
144
+ if (table) {
145
+ from = table.pos;
146
+ to = table.pos + table.node.nodeSize;
147
+ }
148
+ }
149
+ tr.deleteRange(from, to);
150
+ return tr;
126
151
  };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.disabledClassName = exports.SyncBlockStateCssClassName = exports.SyncBlockSharedCssClassName = exports.SyncBlockLabelSharedCssClassName = exports.BodiedSyncBlockSharedCssClassName = void 0;
6
+ exports.viewModeClassName = exports.disabledClassName = exports.SyncBlockStateCssClassName = exports.SyncBlockSharedCssClassName = exports.SyncBlockLabelSharedCssClassName = exports.BodiedSyncBlockSharedCssClassName = void 0;
7
7
  var prefix = 'ak-editor-sync-block';
8
8
  var SyncBlockSharedCssClassName = exports.SyncBlockSharedCssClassName = {
9
9
  prefix: prefix,
@@ -21,6 +21,8 @@ var SyncBlockLabelSharedCssClassName = exports.SyncBlockLabelSharedCssClassName
21
21
  labelClassName: labelClassName
22
22
  };
23
23
  var disabledClassName = exports.disabledClassName = 'disabled';
24
+ var viewModeClassName = exports.viewModeClassName = 'view-mode';
24
25
  var SyncBlockStateCssClassName = exports.SyncBlockStateCssClassName = {
25
- disabledClassName: disabledClassName
26
+ disabledClassName: disabledClassName,
27
+ viewModeClassName: viewModeClassName
26
28
  };
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "0.0.0-development";
27
+ var packageVersion = "110.32.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -15,6 +15,7 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
15
15
  var _react = _interopRequireDefault(require("react"));
16
16
  var _react2 = require("@emotion/react");
17
17
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
18
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
19
  var _utils = require("../../utils");
19
20
  var _breakout = require("../../utils/breakout");
20
21
  var _excluded = ["children"];
@@ -154,6 +155,16 @@ function calcMargin(layout) {
154
155
  return '24px auto';
155
156
  }
156
157
  }
158
+ function calcMaxCssForPercentageTypeMedia(layout) {
159
+ switch (layout) {
160
+ case 'wide':
161
+ return "min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor-max-container-width))";
162
+ case 'full-width':
163
+ return "min(var(--ak-editor--full-width-layout-width), var(--ak-editor-max-container-width))";
164
+ default:
165
+ return 'var(--ak-editor-max-container-width)';
166
+ }
167
+ }
157
168
  function isImageAligned(layout) {
158
169
  switch (layout) {
159
170
  case 'align-end':
@@ -219,10 +230,11 @@ var MediaSingleDimensionHelper = exports.MediaSingleDimensionHelper = function M
219
230
  isInRenderer = _ref$isInRenderer === void 0 ? false : _ref$isInRenderer;
220
231
  var calculatedWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized, isInsideOfInlineExtension));
221
232
  var calculatedMaxWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(containerWidth, "px") : calcMaxWidth(layout, containerWidth));
233
+ var cssMaxWidth = isExtendedResizeExperienceOn ? 'var(--ak-editor-max-container-width)' : calcMaxCssForPercentageTypeMedia(layout);
222
234
 
223
235
  // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
224
236
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
225
- return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\t\t\n\t\t", "\n\n\t\t&:not(.is-resizing) {\n\t\t\ttransition: width 100ms ease-in;\n\t\t}\n\n\t\tfloat: ", ";\n\t\tmargin: ", ";\n\n\t\t&[class*='not-resizing'] {\n\t\t\t", "\n\t\t}\n\n\t\t", ";\n\t"])), calculatedWidth, layout === 'full-width' &&
237
+ return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\n\t\t", "\n\n\t\t&:not(.is-resizing) {\n\t\t\ttransition: width 100ms ease-in;\n\t\t}\n\n\t\tfloat: ", ";\n\t\tmargin: ", ";\n\n\t\t&[class*='not-resizing'] {\n\t\t\t", "\n\t\t}\n\n\t\t", ";\n\t"])), calculatedWidth, layout === 'full-width' &&
226
238
  /* This causes issues for new experience where we don't strip layout attributes
227
239
  when copying top-level node and pasting into a table/layout,
228
240
  because full-width layout will remain, causing node to be edge-to-edge */
@@ -233,7 +245,7 @@ var MediaSingleDimensionHelper = exports.MediaSingleDimensionHelper = function M
233
245
  '@container ak-renderer-wrapper (min-width: 1px)': {
234
246
  maxWidth: '100cqw'
235
247
  }
236
- }) : "max-width: ".concat(calculatedMaxWidth, ";"), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
248
+ }) : (0, _expValEquals.expValEquals)('platform_editor_media_vc_fixes', 'isEnabled', true) ? "max-width: ".concat(cssMaxWidth, ";") : "max-width: ".concat(calculatedMaxWidth, ";"), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
237
249
  };
238
250
  var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
239
251
  var hasFallbackContainer = _ref2.hasFallbackContainer,
@@ -18,7 +18,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
18
18
  var _react = _interopRequireWildcard(require("react"));
19
19
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
20
20
  var _ReactEditorViewContext = _interopRequireDefault(require("./ReactEditorViewContext"));
21
- var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab", "captureClick"];
21
+ var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "handleBackspaceDeleteKeydown", "closeOnTab", "captureClick"];
22
22
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
23
23
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
24
24
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
@@ -70,6 +70,8 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
70
70
  } else if (evt.code === 'Tab' && _this.props.handleEscapeKeydown && _this.props.closeOnTab) {
71
71
  // The menus should be closed when the tab is pressed as it takes the focus out of the menu
72
72
  _this.props.handleEscapeKeydown(evt);
73
+ } else if ((evt.code === 'Delete' || evt.code === 'Backspace') && _this.props.handleBackspaceDeleteKeydown) {
74
+ _this.props.handleBackspaceDeleteKeydown(evt);
73
75
  }
74
76
  });
75
77
  return _this;
@@ -86,7 +88,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
86
88
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
87
89
  document.addEventListener('click', this.handleClick, options);
88
90
  }
89
- if (this.props.handleEscapeKeydown) {
91
+ if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
90
92
  var _this$props$editorRef;
91
93
  // Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
92
94
  // Ignored via go/ees005
@@ -111,7 +113,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
111
113
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
112
114
  document.removeEventListener('click', this.handleClick, options);
113
115
  }
114
- if (this.props.handleEscapeKeydown) {
116
+ if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
115
117
  var _this$props$editorRef2;
116
118
  // Ignored via go/ees005
117
119
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
@@ -141,6 +143,7 @@ function withReactEditorViewOuterListeners(Component) {
141
143
  var handleClickOutside = _ref.handleClickOutside,
142
144
  handleEnterKeydown = _ref.handleEnterKeydown,
143
145
  handleEscapeKeydown = _ref.handleEscapeKeydown,
146
+ handleBackspaceDeleteKeydown = _ref.handleBackspaceDeleteKeydown,
144
147
  closeOnTab = _ref.closeOnTab,
145
148
  captureClick = _ref.captureClick,
146
149
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -174,6 +177,7 @@ function withReactEditorViewOuterListeners(Component) {
174
177
  handleClickOutside: handleClickOutside,
175
178
  handleEnterKeydown: handleEnterKeydown,
176
179
  handleEscapeKeydown: handleEscapeKeydown,
180
+ handleBackspaceDeleteKeydown: handleBackspaceDeleteKeydown,
177
181
  closeOnTab: closeOnTab,
178
182
  captureClick: captureClick
179
183
  }, /*#__PURE__*/_react.default.createElement(Component
@@ -1,5 +1,10 @@
1
1
  import { defineMessages } from 'react-intl-next';
2
2
  export const messages = defineMessages({
3
+ maxWidthLabel: {
4
+ id: 'fabric.editor.breakoutMaxWidthLabel',
5
+ defaultMessage: 'Max-width',
6
+ description: 'Resize current element to max-width mode'
7
+ },
3
8
  fullWidthLabel: {
4
9
  id: 'fabric.editor.breakoutFullWidthLabel',
5
10
  defaultMessage: 'Full-width',
@@ -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 = "0.0.0-development";
4
+ const packageVersion = "110.32.1";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -29,6 +29,8 @@ export const ResizerBreakoutModeLabel = ({
29
29
  } = useIntl();
30
30
  const message = React.useMemo(() => {
31
31
  switch (breakoutLayout) {
32
+ case 'max':
33
+ return formatMessage(messages.maxWidthLabel);
32
34
  case 'full-width':
33
35
  return formatMessage(messages.fullWidthLabel);
34
36
  case 'wide':
@@ -12,7 +12,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
12
12
  export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
13
13
  export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
14
14
  export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
15
- export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
15
+ export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
16
16
  export function getNodeSelectionAnalyticsPayload(selection) {
17
17
  if (selection instanceof NodeSelection) {
18
18
  return {
@@ -1,4 +1,5 @@
1
- import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
1
+ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
2
+ import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
2
3
  import { GapCursorSelection } from './gap-cursor/selection';
3
4
  export const isSelectionAtStartOfNode = ($pos, parentNode) => {
4
5
  if (!parentNode) {
@@ -123,4 +124,27 @@ export const expandSelectionBounds = ($anchor, $head) => {
123
124
  $anchor: $anchor === $from ? $expandedFrom : $expandedTo,
124
125
  $head: $head === $to ? $expandedTo : $expandedFrom
125
126
  };
127
+ };
128
+
129
+ /**
130
+ * Delete what is selected in the given transaction.
131
+ * @param tr the transaction to delete the selection from
132
+ * @returns the updated transaction
133
+ */
134
+ export const deleteSelectedRange = tr => {
135
+ const selection = tr.selection;
136
+ let from = selection.$from.pos;
137
+ let to = selection.$to.pos;
138
+ if (selection instanceof TextSelection) {
139
+ from = from - 1;
140
+ to = to + 1;
141
+ } else if (isTableSelected(selection)) {
142
+ const table = findTable(selection);
143
+ if (table) {
144
+ from = table.pos;
145
+ to = table.pos + table.node.nodeSize;
146
+ }
147
+ }
148
+ tr.deleteRange(from, to);
149
+ return tr;
126
150
  };
@@ -15,6 +15,8 @@ export const SyncBlockLabelSharedCssClassName = {
15
15
  labelClassName
16
16
  };
17
17
  export const disabledClassName = 'disabled';
18
+ export const viewModeClassName = 'view-mode';
18
19
  export const SyncBlockStateCssClassName = {
19
- disabledClassName
20
+ disabledClassName,
21
+ viewModeClassName
20
22
  };
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "0.0.0-development";
17
+ const packageVersion = "110.32.1";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -8,6 +8,7 @@ import React from 'react';
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
11
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
12
  import { nonWrappedLayouts } from '../../utils';
12
13
  import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
13
14
  function float(layout) {
@@ -132,6 +133,16 @@ function calcMargin(layout) {
132
133
  return '24px auto';
133
134
  }
134
135
  }
136
+ function calcMaxCssForPercentageTypeMedia(layout) {
137
+ switch (layout) {
138
+ case 'wide':
139
+ return `min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor-max-container-width))`;
140
+ case 'full-width':
141
+ return `min(var(--ak-editor--full-width-layout-width), var(--ak-editor-max-container-width))`;
142
+ default:
143
+ return 'var(--ak-editor-max-container-width)';
144
+ }
145
+ }
135
146
  function isImageAligned(layout) {
136
147
  switch (layout) {
137
148
  case 'align-end':
@@ -195,6 +206,7 @@ export const MediaSingleDimensionHelper = ({
195
206
  }) => {
196
207
  const calculatedWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? `${mediaSingleWidth || width}px` : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized, isInsideOfInlineExtension));
197
208
  const calculatedMaxWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? `${containerWidth}px` : calcMaxWidth(layout, containerWidth));
209
+ const cssMaxWidth = isExtendedResizeExperienceOn ? 'var(--ak-editor-max-container-width)' : calcMaxCssForPercentageTypeMedia(layout);
198
210
 
199
211
  // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
200
212
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
@@ -222,8 +234,8 @@ export const MediaSingleDimensionHelper = ({
222
234
  '@container ak-renderer-wrapper (min-width: 1px)': {
223
235
  maxWidth: '100cqw'
224
236
  }
225
- }) : `max-width: ${calculatedMaxWidth};`}
226
-
237
+ }) : expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) ? `max-width: ${cssMaxWidth};` : `max-width: ${calculatedMaxWidth};`}
238
+
227
239
  ${isExtendedResizeExperienceOn && `&[class*='is-resizing'] {
228
240
  .new-file-experience-wrapper {
229
241
  box-shadow: none !important;
@@ -44,6 +44,8 @@ class WithOutsideClick extends PureComponent {
44
44
  } else if (evt.code === 'Tab' && this.props.handleEscapeKeydown && this.props.closeOnTab) {
45
45
  // The menus should be closed when the tab is pressed as it takes the focus out of the menu
46
46
  this.props.handleEscapeKeydown(evt);
47
+ } else if ((evt.code === 'Delete' || evt.code === 'Backspace') && this.props.handleBackspaceDeleteKeydown) {
48
+ this.props.handleBackspaceDeleteKeydown(evt);
47
49
  }
48
50
  });
49
51
  }
@@ -56,7 +58,7 @@ class WithOutsideClick extends PureComponent {
56
58
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
57
59
  document.addEventListener('click', this.handleClick, options);
58
60
  }
59
- if (this.props.handleEscapeKeydown) {
61
+ if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
60
62
  var _this$props$editorRef;
61
63
  // Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
62
64
  // Ignored via go/ees005
@@ -79,7 +81,7 @@ class WithOutsideClick extends PureComponent {
79
81
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
80
82
  document.removeEventListener('click', this.handleClick, options);
81
83
  }
82
- if (this.props.handleEscapeKeydown) {
84
+ if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
83
85
  var _this$props$editorRef2;
84
86
  // Ignored via go/ees005
85
87
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
@@ -106,6 +108,7 @@ export default function withReactEditorViewOuterListeners(Component) {
106
108
  handleClickOutside,
107
109
  handleEnterKeydown,
108
110
  handleEscapeKeydown,
111
+ handleBackspaceDeleteKeydown,
109
112
  closeOnTab,
110
113
  captureClick,
111
114
  ...props
@@ -137,6 +140,7 @@ export default function withReactEditorViewOuterListeners(Component) {
137
140
  handleClickOutside: handleClickOutside,
138
141
  handleEnterKeydown: handleEnterKeydown,
139
142
  handleEscapeKeydown: handleEscapeKeydown,
143
+ handleBackspaceDeleteKeydown: handleBackspaceDeleteKeydown,
140
144
  closeOnTab: closeOnTab,
141
145
  captureClick: captureClick
142
146
  }, /*#__PURE__*/React.createElement(Component
@@ -1,5 +1,10 @@
1
1
  import { defineMessages } from 'react-intl-next';
2
2
  export var messages = defineMessages({
3
+ maxWidthLabel: {
4
+ id: 'fabric.editor.breakoutMaxWidthLabel',
5
+ defaultMessage: 'Max-width',
6
+ description: 'Resize current element to max-width mode'
7
+ },
3
8
  fullWidthLabel: {
4
9
  id: 'fabric.editor.breakoutFullWidthLabel',
5
10
  defaultMessage: 'Full-width',
@@ -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 = "0.0.0-development";
10
+ var packageVersion = "110.32.1";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -27,6 +27,8 @@ export var ResizerBreakoutModeLabel = function ResizerBreakoutModeLabel(_ref) {
27
27
  formatMessage = _useIntl.formatMessage;
28
28
  var message = React.useMemo(function () {
29
29
  switch (breakoutLayout) {
30
+ case 'max':
31
+ return formatMessage(messages.maxWidthLabel);
30
32
  case 'full-width':
31
33
  return formatMessage(messages.fullWidthLabel);
32
34
  case 'wide':
@@ -12,7 +12,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
12
12
  export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
13
13
  export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
14
14
  export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
15
- export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
15
+ export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
16
16
  export function getNodeSelectionAnalyticsPayload(selection) {
17
17
  if (selection instanceof NodeSelection) {
18
18
  return {
@@ -1,4 +1,5 @@
1
- import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
1
+ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
2
+ import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
2
3
  import { GapCursorSelection } from './gap-cursor/selection';
3
4
  export var isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
4
5
  if (!parentNode) {
@@ -111,4 +112,27 @@ export var expandSelectionBounds = function expandSelectionBounds($anchor, $head
111
112
  $anchor: $anchor === $from ? $expandedFrom : $expandedTo,
112
113
  $head: $head === $to ? $expandedTo : $expandedFrom
113
114
  };
115
+ };
116
+
117
+ /**
118
+ * Delete what is selected in the given transaction.
119
+ * @param tr the transaction to delete the selection from
120
+ * @returns the updated transaction
121
+ */
122
+ export var deleteSelectedRange = function deleteSelectedRange(tr) {
123
+ var selection = tr.selection;
124
+ var from = selection.$from.pos;
125
+ var to = selection.$to.pos;
126
+ if (selection instanceof TextSelection) {
127
+ from = from - 1;
128
+ to = to + 1;
129
+ } else if (isTableSelected(selection)) {
130
+ var table = findTable(selection);
131
+ if (table) {
132
+ from = table.pos;
133
+ to = table.pos + table.node.nodeSize;
134
+ }
135
+ }
136
+ tr.deleteRange(from, to);
137
+ return tr;
114
138
  };
@@ -15,6 +15,8 @@ export var SyncBlockLabelSharedCssClassName = {
15
15
  labelClassName: labelClassName
16
16
  };
17
17
  export var disabledClassName = 'disabled';
18
+ export var viewModeClassName = 'view-mode';
18
19
  export var SyncBlockStateCssClassName = {
19
- disabledClassName: disabledClassName
20
+ disabledClassName: disabledClassName,
21
+ viewModeClassName: viewModeClassName
20
22
  };
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "0.0.0-development";
24
+ var packageVersion = "110.32.1";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -12,6 +12,7 @@ import React from 'react';
12
12
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
13
13
  import { css, jsx } from '@emotion/react';
14
14
  import { akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
15
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
16
  import { nonWrappedLayouts } from '../../utils';
16
17
  import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
17
18
  function float(layout) {
@@ -144,6 +145,16 @@ function calcMargin(layout) {
144
145
  return '24px auto';
145
146
  }
146
147
  }
148
+ function calcMaxCssForPercentageTypeMedia(layout) {
149
+ switch (layout) {
150
+ case 'wide':
151
+ return "min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor-max-container-width))";
152
+ case 'full-width':
153
+ return "min(var(--ak-editor--full-width-layout-width), var(--ak-editor-max-container-width))";
154
+ default:
155
+ return 'var(--ak-editor-max-container-width)';
156
+ }
157
+ }
147
158
  function isImageAligned(layout) {
148
159
  switch (layout) {
149
160
  case 'align-end':
@@ -209,10 +220,11 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
209
220
  isInRenderer = _ref$isInRenderer === void 0 ? false : _ref$isInRenderer;
210
221
  var calculatedWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized, isInsideOfInlineExtension));
211
222
  var calculatedMaxWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(containerWidth, "px") : calcMaxWidth(layout, containerWidth));
223
+ var cssMaxWidth = isExtendedResizeExperienceOn ? 'var(--ak-editor-max-container-width)' : calcMaxCssForPercentageTypeMedia(layout);
212
224
 
213
225
  // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
214
226
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
215
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\t\t\n\t\t", "\n\n\t\t&:not(.is-resizing) {\n\t\t\ttransition: width 100ms ease-in;\n\t\t}\n\n\t\tfloat: ", ";\n\t\tmargin: ", ";\n\n\t\t&[class*='not-resizing'] {\n\t\t\t", "\n\t\t}\n\n\t\t", ";\n\t"])), calculatedWidth, layout === 'full-width' &&
227
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\n\t\t", "\n\n\t\t&:not(.is-resizing) {\n\t\t\ttransition: width 100ms ease-in;\n\t\t}\n\n\t\tfloat: ", ";\n\t\tmargin: ", ";\n\n\t\t&[class*='not-resizing'] {\n\t\t\t", "\n\t\t}\n\n\t\t", ";\n\t"])), calculatedWidth, layout === 'full-width' &&
216
228
  /* This causes issues for new experience where we don't strip layout attributes
217
229
  when copying top-level node and pasting into a table/layout,
218
230
  because full-width layout will remain, causing node to be edge-to-edge */
@@ -223,7 +235,7 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
223
235
  '@container ak-renderer-wrapper (min-width: 1px)': {
224
236
  maxWidth: '100cqw'
225
237
  }
226
- }) : "max-width: ".concat(calculatedMaxWidth, ";"), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
238
+ }) : expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) ? "max-width: ".concat(cssMaxWidth, ";") : "max-width: ".concat(calculatedMaxWidth, ";"), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
227
239
  };
228
240
  var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
229
241
  var hasFallbackContainer = _ref2.hasFallbackContainer,
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _inherits from "@babel/runtime/helpers/inherits";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab", "captureClick"];
9
+ var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "handleBackspaceDeleteKeydown", "closeOnTab", "captureClick"];
10
10
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
11
11
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
12
  import React, { PureComponent, useCallback, useEffect, useRef, useState } from 'react';
@@ -60,6 +60,8 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
60
60
  } else if (evt.code === 'Tab' && _this.props.handleEscapeKeydown && _this.props.closeOnTab) {
61
61
  // The menus should be closed when the tab is pressed as it takes the focus out of the menu
62
62
  _this.props.handleEscapeKeydown(evt);
63
+ } else if ((evt.code === 'Delete' || evt.code === 'Backspace') && _this.props.handleBackspaceDeleteKeydown) {
64
+ _this.props.handleBackspaceDeleteKeydown(evt);
63
65
  }
64
66
  });
65
67
  return _this;
@@ -76,7 +78,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
76
78
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
77
79
  document.addEventListener('click', this.handleClick, options);
78
80
  }
79
- if (this.props.handleEscapeKeydown) {
81
+ if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
80
82
  var _this$props$editorRef;
81
83
  // Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
82
84
  // Ignored via go/ees005
@@ -101,7 +103,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
101
103
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
102
104
  document.removeEventListener('click', this.handleClick, options);
103
105
  }
104
- if (this.props.handleEscapeKeydown) {
106
+ if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
105
107
  var _this$props$editorRef2;
106
108
  // Ignored via go/ees005
107
109
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
@@ -131,6 +133,7 @@ export default function withReactEditorViewOuterListeners(Component) {
131
133
  var handleClickOutside = _ref.handleClickOutside,
132
134
  handleEnterKeydown = _ref.handleEnterKeydown,
133
135
  handleEscapeKeydown = _ref.handleEscapeKeydown,
136
+ handleBackspaceDeleteKeydown = _ref.handleBackspaceDeleteKeydown,
134
137
  closeOnTab = _ref.closeOnTab,
135
138
  captureClick = _ref.captureClick,
136
139
  props = _objectWithoutProperties(_ref, _excluded);
@@ -164,6 +167,7 @@ export default function withReactEditorViewOuterListeners(Component) {
164
167
  handleClickOutside: handleClickOutside,
165
168
  handleEnterKeydown: handleEnterKeydown,
166
169
  handleEscapeKeydown: handleEscapeKeydown,
170
+ handleBackspaceDeleteKeydown: handleBackspaceDeleteKeydown,
167
171
  closeOnTab: closeOnTab,
168
172
  captureClick: captureClick
169
173
  }, /*#__PURE__*/React.createElement(Component
@@ -1,4 +1,9 @@
1
1
  export declare const messages: {
2
+ maxWidthLabel: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
2
7
  fullWidthLabel: {
3
8
  id: string;
4
9
  defaultMessage: string;
@@ -11,7 +11,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
11
11
  export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
12
12
  export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
13
13
  export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
14
- export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
14
+ export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
15
15
  export declare function getNodeSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
16
16
  export declare function getAllSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
17
17
  export declare function getCellSelectionAnalyticsPayload(state: EditorState): AnalyticsEventPayload | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { ResolvedPos, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
+ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  export declare const isSelectionAtStartOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
4
4
  export declare const isSelectionAtEndOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
5
5
  export declare function atTheEndOfDoc(state: EditorState): boolean;
@@ -18,3 +18,9 @@ export declare const expandSelectionBounds: ($anchor: ResolvedPos, $head: Resolv
18
18
  $anchor: ResolvedPos;
19
19
  $head: ResolvedPos;
20
20
  };
21
+ /**
22
+ * Delete what is selected in the given transaction.
23
+ * @param tr the transaction to delete the selection from
24
+ * @returns the updated transaction
25
+ */
26
+ export declare const deleteSelectedRange: (tr: Transaction) => Transaction;
@@ -12,6 +12,8 @@ export declare const SyncBlockLabelSharedCssClassName: {
12
12
  labelClassName: string;
13
13
  };
14
14
  export declare const disabledClassName = "disabled";
15
+ export declare const viewModeClassName = "view-mode";
15
16
  export declare const SyncBlockStateCssClassName: {
16
17
  disabledClassName: string;
18
+ viewModeClassName: string;
17
19
  };
@@ -1 +1 @@
1
- export type BreakoutMode = 'wide' | 'full-width' | 'center';
1
+ export type BreakoutMode = 'wide' | 'full-width' | 'max' | 'center';
@@ -60,6 +60,7 @@ export interface MediaSingleWrapperProps {
60
60
  fullWidthMode?: boolean;
61
61
  innerRef?: ((elem: HTMLDivElement) => void) | RefObject<HTMLDivElement>;
62
62
  isExtendedResizeExperienceOn?: boolean;
63
+ isInRenderer?: boolean;
63
64
  isInsideOfInlineExtension?: boolean;
64
65
  isNestedNode?: boolean;
65
66
  isResized?: boolean;
@@ -72,7 +73,6 @@ export interface MediaSingleWrapperProps {
72
73
  */
73
74
  pctWidth?: number;
74
75
  width?: number;
75
- isInRenderer?: boolean;
76
76
  }
77
77
  /**
78
78
  * Can't use `.attrs` to handle highly dynamic styles because we are still
@@ -9,6 +9,7 @@ export interface WithOutsideClickProps {
9
9
  */
10
10
  captureClick?: boolean;
11
11
  closeOnTab?: boolean;
12
+ handleBackspaceDeleteKeydown?: SimpleEventHandler<KeyboardEvent>;
12
13
  handleClickOutside?: SimpleEventHandler<MouseEvent>;
13
14
  handleEnterKeydown?: SimpleEventHandler<KeyboardEvent>;
14
15
  handleEscapeKeydown?: SimpleEventHandler<KeyboardEvent>;
@@ -59,7 +59,7 @@ export declare function calculateBreakoutStyles({ mode, widthStateLineLength, wi
59
59
  justifyContent?: undefined;
60
60
  };
61
61
  export declare function calcBreakoutWidthPx(mode: BreakoutMarkAttrs['mode'], widthStateWidth?: number, padding?: number): number;
62
- export declare const getNextBreakoutMode: (currentMode?: BreakoutMode) => BreakoutMode;
62
+ export declare const getNextBreakoutMode: (currentMode?: BreakoutMode) => Exclude<BreakoutMode, "max">;
63
63
  export declare const getTitle: (layout?: BreakoutMode) => {
64
64
  id: string;
65
65
  defaultMessage: string;
@@ -1,4 +1,9 @@
1
1
  export declare const messages: {
2
+ maxWidthLabel: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
2
7
  fullWidthLabel: {
3
8
  id: string;
4
9
  defaultMessage: string;
@@ -11,7 +11,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
11
11
  export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
12
12
  export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
13
13
  export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
14
- export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
14
+ export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
15
15
  export declare function getNodeSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
16
16
  export declare function getAllSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
17
17
  export declare function getCellSelectionAnalyticsPayload(state: EditorState): AnalyticsEventPayload | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { ResolvedPos, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
+ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  export declare const isSelectionAtStartOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
4
4
  export declare const isSelectionAtEndOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
5
5
  export declare function atTheEndOfDoc(state: EditorState): boolean;
@@ -18,3 +18,9 @@ export declare const expandSelectionBounds: ($anchor: ResolvedPos, $head: Resolv
18
18
  $anchor: ResolvedPos;
19
19
  $head: ResolvedPos;
20
20
  };
21
+ /**
22
+ * Delete what is selected in the given transaction.
23
+ * @param tr the transaction to delete the selection from
24
+ * @returns the updated transaction
25
+ */
26
+ export declare const deleteSelectedRange: (tr: Transaction) => Transaction;
@@ -12,6 +12,8 @@ export declare const SyncBlockLabelSharedCssClassName: {
12
12
  labelClassName: string;
13
13
  };
14
14
  export declare const disabledClassName = "disabled";
15
+ export declare const viewModeClassName = "view-mode";
15
16
  export declare const SyncBlockStateCssClassName: {
16
17
  disabledClassName: string;
18
+ viewModeClassName: string;
17
19
  };
@@ -1 +1 @@
1
- export type BreakoutMode = 'wide' | 'full-width' | 'center';
1
+ export type BreakoutMode = 'wide' | 'full-width' | 'max' | 'center';
@@ -60,6 +60,7 @@ export interface MediaSingleWrapperProps {
60
60
  fullWidthMode?: boolean;
61
61
  innerRef?: ((elem: HTMLDivElement) => void) | RefObject<HTMLDivElement>;
62
62
  isExtendedResizeExperienceOn?: boolean;
63
+ isInRenderer?: boolean;
63
64
  isInsideOfInlineExtension?: boolean;
64
65
  isNestedNode?: boolean;
65
66
  isResized?: boolean;
@@ -72,7 +73,6 @@ export interface MediaSingleWrapperProps {
72
73
  */
73
74
  pctWidth?: number;
74
75
  width?: number;
75
- isInRenderer?: boolean;
76
76
  }
77
77
  /**
78
78
  * Can't use `.attrs` to handle highly dynamic styles because we are still
@@ -9,6 +9,7 @@ export interface WithOutsideClickProps {
9
9
  */
10
10
  captureClick?: boolean;
11
11
  closeOnTab?: boolean;
12
+ handleBackspaceDeleteKeydown?: SimpleEventHandler<KeyboardEvent>;
12
13
  handleClickOutside?: SimpleEventHandler<MouseEvent>;
13
14
  handleEnterKeydown?: SimpleEventHandler<KeyboardEvent>;
14
15
  handleEscapeKeydown?: SimpleEventHandler<KeyboardEvent>;
@@ -59,7 +59,7 @@ export declare function calculateBreakoutStyles({ mode, widthStateLineLength, wi
59
59
  justifyContent?: undefined;
60
60
  };
61
61
  export declare function calcBreakoutWidthPx(mode: BreakoutMarkAttrs['mode'], widthStateWidth?: number, padding?: number): number;
62
- export declare const getNextBreakoutMode: (currentMode?: BreakoutMode) => BreakoutMode;
62
+ export declare const getNextBreakoutMode: (currentMode?: BreakoutMode) => Exclude<BreakoutMode, "max">;
63
63
  export declare const getTitle: (layout?: BreakoutMode) => {
64
64
  id: string;
65
65
  defaultMessage: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "110.31.1",
3
+ "version": "110.32.2",
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/"
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@atlaskit/activity-provider": "^2.5.0",
33
- "@atlaskit/adf-schema": "^51.3.2",
33
+ "@atlaskit/adf-schema": "^51.4.0",
34
34
  "@atlaskit/adf-utils": "^19.26.0",
35
35
  "@atlaskit/afm-i18n-platform-editor-editor-common": "2.10.0",
36
36
  "@atlaskit/analytics-listeners": "^9.1.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/editor-json-transformer": "^8.31.0",
47
47
  "@atlaskit/editor-palette": "^2.1.0",
48
48
  "@atlaskit/editor-prosemirror": "7.0.0",
49
- "@atlaskit/editor-shared-styles": "^3.9.0",
49
+ "@atlaskit/editor-shared-styles": "^3.10.0",
50
50
  "@atlaskit/editor-tables": "^2.9.0",
51
51
  "@atlaskit/editor-toolbar": "^0.17.0",
52
52
  "@atlaskit/editor-toolbar-model": "^0.2.0",
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/link": "^3.2.0",
57
57
  "@atlaskit/link-datasource": "^4.30.0",
58
58
  "@atlaskit/link-picker": "^3.16.0",
59
- "@atlaskit/media-card": "^79.7.0",
59
+ "@atlaskit/media-card": "^79.8.0",
60
60
  "@atlaskit/media-client": "^35.6.0",
61
61
  "@atlaskit/media-client-react": "^4.1.0",
62
62
  "@atlaskit/media-common": "^12.3.0",
@@ -73,7 +73,7 @@
73
73
  "@atlaskit/primitives": "^16.1.0",
74
74
  "@atlaskit/profilecard": "^24.21.0",
75
75
  "@atlaskit/prosemirror-history": "^0.2.0",
76
- "@atlaskit/react-ufo": "^4.14.0",
76
+ "@atlaskit/react-ufo": "^4.15.0",
77
77
  "@atlaskit/section-message": "^8.9.0",
78
78
  "@atlaskit/smart-card": "^43.7.0",
79
79
  "@atlaskit/smart-user-picker": "^8.4.0",