@atlaskit/editor-common 114.1.1 → 114.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/card/ui/assets/card.js +13 -7
  3. package/dist/cjs/card/ui/assets/embed.js +13 -7
  4. package/dist/cjs/card/ui/assets/inline.js +13 -7
  5. package/dist/cjs/card/ui/assets/url.js +13 -7
  6. package/dist/cjs/extensibility/ExtensionNodeWrapper.js +1 -1
  7. package/dist/cjs/extensibility/extensionNodeView.js +1 -1
  8. package/dist/cjs/monitoring/error.js +1 -1
  9. package/dist/cjs/resizer/BreakoutResizer.js +7 -4
  10. package/dist/cjs/resizer/Resizer.js +33 -12
  11. package/dist/cjs/table/content-mode.js +62 -0
  12. package/dist/cjs/table/index.js +19 -0
  13. package/dist/cjs/toolbar/context.js +14 -4
  14. package/dist/cjs/ui/DropList/index.js +1 -1
  15. package/dist/cjs/ui/MediaSingle/styled.js +1 -1
  16. package/dist/es2019/card/ui/assets/card.js +14 -7
  17. package/dist/es2019/card/ui/assets/embed.js +14 -7
  18. package/dist/es2019/card/ui/assets/inline.js +14 -7
  19. package/dist/es2019/card/ui/assets/url.js +14 -7
  20. package/dist/es2019/extensibility/ExtensionNodeWrapper.js +1 -1
  21. package/dist/es2019/extensibility/extensionNodeView.js +1 -1
  22. package/dist/es2019/monitoring/error.js +1 -1
  23. package/dist/es2019/resizer/BreakoutResizer.js +7 -4
  24. package/dist/es2019/resizer/Resizer.js +33 -13
  25. package/dist/es2019/table/content-mode.js +56 -0
  26. package/dist/es2019/table/index.js +2 -1
  27. package/dist/es2019/toolbar/context.js +17 -9
  28. package/dist/es2019/ui/DropList/index.js +1 -1
  29. package/dist/es2019/ui/MediaSingle/styled.js +1 -1
  30. package/dist/esm/card/ui/assets/card.js +14 -7
  31. package/dist/esm/card/ui/assets/embed.js +14 -7
  32. package/dist/esm/card/ui/assets/inline.js +14 -7
  33. package/dist/esm/card/ui/assets/url.js +14 -7
  34. package/dist/esm/extensibility/ExtensionNodeWrapper.js +1 -1
  35. package/dist/esm/extensibility/extensionNodeView.js +1 -1
  36. package/dist/esm/monitoring/error.js +1 -1
  37. package/dist/esm/resizer/BreakoutResizer.js +7 -4
  38. package/dist/esm/resizer/Resizer.js +33 -12
  39. package/dist/esm/table/content-mode.js +57 -0
  40. package/dist/esm/table/index.js +2 -1
  41. package/dist/esm/toolbar/context.js +15 -5
  42. package/dist/esm/ui/DropList/index.js +1 -1
  43. package/dist/esm/ui/MediaSingle/styled.js +1 -1
  44. package/dist/types/table/content-mode.d.ts +35 -0
  45. package/dist/types/table/index.d.ts +1 -0
  46. package/dist/types-ts4.5/table/content-mode.d.ts +35 -0
  47. package/dist/types-ts4.5/table/index.d.ts +1 -0
  48. package/package.json +2 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 114.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 114.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`3dba8a4e8c8b2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3dba8a4e8c8b2) -
14
+ Perf-linting cleanup: fix performance linting violations in editor-common, gated behind
15
+ platform_editor_perf_lint_cleanup experiment
16
+ - [`c1b397760c36c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c1b397760c36c) -
17
+ Perf-linting cleanup: fix performance linting violations in editor-common, gated behind
18
+ platform_editor_perf_lint_cleanup experiment
19
+ - [`3394e81c10e6e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3394e81c10e6e) -
20
+ Fix table flicker on focus: defer data-initial-width-mode removal to after colgroup update.
21
+ Consolidate isTableInContentMode and hasTableBeenResized into editor-common/table.
22
+
23
+ ### Patch Changes
24
+
25
+ - [`7f604c26ce22f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f604c26ce22f) -
26
+ Fixes casing issue with data-testid on extension node wrapper
27
+ - [`ddee349aeb565`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ddee349aeb565) -
28
+ Clean up ff platform_forge_ui_support_images_in_adfrenderer
29
+
3
30
  ## 114.1.1
4
31
 
5
32
  ### Patch Changes
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.IconCard = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
9
10
  // Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
10
11
  var IconCardGlyph = function IconCardGlyph(_ref) {
11
12
  var ariaLabel = _ref['aria-label'],
@@ -27,17 +28,22 @@ var IconCardGlyph = function IconCardGlyph(_ref) {
27
28
  fill: "currentColor"
28
29
  }));
29
30
  };
31
+ var iconCardStyle = {
32
+ width: '24px',
33
+ height: '24px'
34
+ };
30
35
  var IconCard = exports.IconCard = function IconCard(_ref2) {
31
36
  var label = _ref2.label;
37
+ var style = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconCardStyle :
38
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
39
+ {
40
+ width: '24px',
41
+ height: '24px'
42
+ };
32
43
  return /*#__PURE__*/_react.default.createElement(IconCardGlyph, {
33
44
  "aria-label": label
34
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
45
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
35
46
  ,
36
- style: {
37
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
38
- width: '24px',
39
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
40
- height: '24px'
41
- }
47
+ style: style
42
48
  });
43
49
  };
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.IconEmbed = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
9
10
  // Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
10
11
  var IconEmbedGlyph = function IconEmbedGlyph(_ref) {
11
12
  var ariaLabel = _ref['aria-label'],
@@ -27,17 +28,22 @@ var IconEmbedGlyph = function IconEmbedGlyph(_ref) {
27
28
  fill: "currentColor"
28
29
  }));
29
30
  };
31
+ var iconEmbedStyle = {
32
+ width: '24px',
33
+ height: '24px'
34
+ };
30
35
  var IconEmbed = exports.IconEmbed = function IconEmbed(_ref2) {
31
36
  var label = _ref2.label;
37
+ var style = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconEmbedStyle :
38
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
39
+ {
40
+ width: '24px',
41
+ height: '24px'
42
+ };
32
43
  return /*#__PURE__*/_react.default.createElement(IconEmbedGlyph, {
33
44
  "aria-label": label
34
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
45
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
35
46
  ,
36
- style: {
37
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
38
- width: '24px',
39
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
40
- height: '24px'
41
- }
47
+ style: style
42
48
  });
43
49
  };
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.IconInline = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
9
10
  // Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
10
11
  var IconInlineGlyph = function IconInlineGlyph(_ref) {
11
12
  var ariaLabel = _ref['aria-label'],
@@ -27,17 +28,22 @@ var IconInlineGlyph = function IconInlineGlyph(_ref) {
27
28
  fill: "currentColor"
28
29
  }));
29
30
  };
31
+ var iconInlineStyle = {
32
+ width: '24px',
33
+ height: '24px'
34
+ };
30
35
  var IconInline = exports.IconInline = function IconInline(_ref2) {
31
36
  var label = _ref2.label;
37
+ var style = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconInlineStyle :
38
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
39
+ {
40
+ width: '24px',
41
+ height: '24px'
42
+ };
32
43
  return /*#__PURE__*/_react.default.createElement(IconInlineGlyph, {
33
44
  "aria-label": label
34
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
45
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
35
46
  ,
36
- style: {
37
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
38
- width: '24px',
39
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
40
- height: '24px'
41
- }
47
+ style: style
42
48
  });
43
49
  };
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.IconUrl = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
9
10
  // Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
10
11
  var IconUrlGlyph = function IconUrlGlyph(_ref) {
11
12
  var ariaLabel = _ref['aria-label'],
@@ -29,17 +30,22 @@ var IconUrlGlyph = function IconUrlGlyph(_ref) {
29
30
  fill: "currentColor"
30
31
  }));
31
32
  };
33
+ var iconUrlStyle = {
34
+ width: '24px',
35
+ height: '24px'
36
+ };
32
37
  var IconUrl = exports.IconUrl = function IconUrl(_ref2) {
33
38
  var label = _ref2.label;
39
+ var style = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconUrlStyle :
40
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
41
+ {
42
+ width: '24px',
43
+ height: '24px'
44
+ };
34
45
  return /*#__PURE__*/_react.default.createElement(IconUrlGlyph, {
35
46
  "aria-label": label
36
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
37
48
  ,
38
- style: {
39
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
40
- width: '24px',
41
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
42
- height: '24px'
43
- }
49
+ style: style
44
50
  });
45
51
  };
@@ -78,7 +78,7 @@ var ExtensionNodeWrapper = exports.ExtensionNodeWrapper = function ExtensionNode
78
78
  relative: showMacroInteractionDesignUpdates
79
79
  });
80
80
  return (0, _react2.jsx)("span", {
81
- "data-testId": "extension-node-wrapper"
81
+ "data-testid": "extension-node-wrapper"
82
82
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
83
83
  ,
84
84
  className: wrapperClassNames,
@@ -155,7 +155,7 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
155
155
  if (this.didReuseSsrDom && (0, _expValEquals.expValEquals)('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
156
156
  var ssrElement = this.findSSRElement();
157
157
  if (ssrElement) {
158
- var extensionNodeWrapper = ssrElement.querySelector('[data-testId="extension-node-wrapper"]');
158
+ var extensionNodeWrapper = ssrElement.querySelector('[data-testid="extension-node-wrapper"]');
159
159
  if (extensionNodeWrapper) {
160
160
  extensionNodeWrapper.remove();
161
161
  }
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
19
19
  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); }
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "0.0.0-development";
22
+ var packageVersion = "114.2.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -11,6 +11,7 @@ var _react = _interopRequireWildcard(require("react"));
11
11
  var _bindEventListener = require("bind-event-listener");
12
12
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
13
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
15
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
15
16
  var _analytics = require("../analytics");
16
17
  var _styles = require("../styles");
@@ -78,6 +79,10 @@ var defaultStyles = {
78
79
  display: 'grid'
79
80
  };
80
81
  var RESIZE_STEP_VALUE = 10;
82
+ var RESIZER_ENABLE_HANDLES = {
83
+ left: true,
84
+ right: true
85
+ };
81
86
  /**
82
87
  * BreakoutResizer is a common component used to resize nodes that support the 'Breakout' mark, so it requires
83
88
  * correct ADF support.
@@ -330,10 +335,8 @@ var BreakoutResizer = exports.BreakoutResizer = function BreakoutResizer(_ref) {
330
335
  });
331
336
  }
332
337
  return /*#__PURE__*/_react.default.createElement(_Resizer.default, {
333
- ref: resizerRef
334
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
335
- ,
336
- enable: {
338
+ ref: resizerRef,
339
+ enable: (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? RESIZER_ENABLE_HANDLES : {
337
340
  left: true,
338
341
  right: true
339
342
  },
@@ -15,6 +15,7 @@ var _classnames3 = _interopRequireDefault(require("classnames"));
15
15
  var _reResizable = require("re-resizable");
16
16
  var _reactIntl = require("react-intl");
17
17
  var _primitives = require("@atlaskit/primitives");
18
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
19
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
19
20
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
20
21
  var _breakout = require("../messages/breakout");
@@ -127,16 +128,30 @@ var ResizerNext = function ResizerNext(props, ref) {
127
128
  left: (0, _classnames3.default)(handleClassName !== null && handleClassName !== void 0 ? handleClassName : _resizer.resizerHandleClassName, 'left', handleSize, handleAlignmentMethod),
128
129
  right: (0, _classnames3.default)(handleClassName !== null && handleClassName !== void 0 ? handleClassName : _resizer.resizerHandleClassName, 'right', handleSize, handleAlignmentMethod)
129
130
  };
131
+ var handleWidth = handlePositioning === 'adjacent' ? "var(--ds-space-100, 8px)" : "var(--ds-space-300, 24px)";
130
132
  var baseHandleStyles = {
131
- width: handlePositioning === 'adjacent' ? "var(--ds-space-100, 8px)" : "var(--ds-space-300, 24px)",
133
+ width: handleWidth,
132
134
  zIndex: _resizer.resizerHandleZIndex,
133
135
  pointerEvents: 'auto',
134
136
  alignItems: handlePositioning === 'adjacent' ? 'center' : undefined
135
137
  };
136
- var offset = handlePositioning === 'adjacent' ? "calc(".concat(baseHandleStyles.width, " * -1)") : "calc(".concat(baseHandleStyles.width, " * -0.5)");
137
-
138
- // eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
139
- var nextHandleStyles = SUPPORTED_HANDLES.reduce(function (result, position) {
138
+ var memoizedBaseHandleStyles = (0, _react.useMemo)(function () {
139
+ return {
140
+ width: handleWidth,
141
+ zIndex: _resizer.resizerHandleZIndex,
142
+ pointerEvents: 'auto',
143
+ alignItems: handlePositioning === 'adjacent' ? 'center' : undefined
144
+ };
145
+ }, [handleWidth, handlePositioning]);
146
+ var offset = handlePositioning === 'adjacent' ? "calc(".concat(handleWidth, " * -1)") : "calc(".concat(handleWidth, " * -0.5)");
147
+ var memoizedNextHandleStyles = (0, _react.useMemo)(function () {
148
+ return SUPPORTED_HANDLES.reduce(function (result, position) {
149
+ return _objectSpread(_objectSpread({}, result), {}, (0, _defineProperty2.default)({}, position, _objectSpread(_objectSpread({}, memoizedBaseHandleStyles), {}, (0, _defineProperty2.default)({}, position, offset), handleStyles === null || handleStyles === void 0 ? void 0 : handleStyles[position])));
150
+ }, {});
151
+ }, [memoizedBaseHandleStyles, offset, handleStyles]);
152
+ var nextHandleStyles = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedNextHandleStyles :
153
+ // eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- intentional fallback for experiment off path
154
+ SUPPORTED_HANDLES.reduce(function (result, position) {
140
155
  return _objectSpread(_objectSpread({}, result), {}, (0, _defineProperty2.default)({}, position, _objectSpread(_objectSpread({}, baseHandleStyles), {}, (0, _defineProperty2.default)({}, position, offset), handleStyles === null || handleStyles === void 0 ? void 0 : handleStyles[position])));
141
156
  }, {});
142
157
  var resizerClassName = (0, _classnames3.default)(className, _resizer.resizerItemClassName, (0, _defineProperty2.default)({
@@ -202,15 +217,21 @@ var ResizerNext = function ResizerNext(props, ref) {
202
217
  }
203
218
  return snapGap;
204
219
  }, [snap, snapGap]);
205
- return /*#__PURE__*/_react.default.createElement(_reResizable.Resizable, (0, _extends2.default)({
206
- ref: resizable
207
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
208
- ,
209
- size: {
220
+ var resizerAutoSize = (0, _react.useMemo)(function () {
221
+ return {
210
222
  width: width !== null && width !== void 0 ? width : 'auto',
211
- // just content itself (no paddings)
212
223
  height: 'auto'
213
- }
224
+ };
225
+ }, [width]);
226
+ var resizerSize = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? resizerAutoSize :
227
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional fallback for experiment off path
228
+ {
229
+ width: width !== null && width !== void 0 ? width : 'auto',
230
+ height: 'auto'
231
+ };
232
+ return /*#__PURE__*/_react.default.createElement(_reResizable.Resizable, (0, _extends2.default)({
233
+ ref: resizable,
234
+ size: resizerSize
214
235
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
215
236
  ,
216
237
  className: resizerClassName,
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isTableInContentMode = exports.hasTableColumnBeenResized = exports.hasTableBeenResized = void 0;
7
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
8
+ /**
9
+ * Returns true if any cell in the first row of the table has a colwidth attribute set.
10
+ *
11
+ * Used by both the editor (as `hasTableColumnBeenResized`) and the renderer (as `hasColWidths`)
12
+ * to determine whether a table has had its columns manually resized.
13
+ */
14
+ var hasTableColumnBeenResized = exports.hasTableColumnBeenResized = function hasTableColumnBeenResized(tableNode) {
15
+ var firstRow = tableNode.content.firstChild;
16
+ if (!firstRow) {
17
+ return false;
18
+ }
19
+ for (var i = 0; i < firstRow.childCount; i++) {
20
+ if (firstRow.child(i).attrs.colwidth) {
21
+ return true;
22
+ }
23
+ }
24
+ return false;
25
+ };
26
+
27
+ /**
28
+ * Returns true if the table has been explicitly resized — either the table itself has a width
29
+ * attribute set, or any column has been individually resized (colwidth present on cells).
30
+ */
31
+ var hasTableBeenResized = exports.hasTableBeenResized = function hasTableBeenResized(tableNode) {
32
+ return tableNode.attrs.width !== null || hasTableColumnBeenResized(tableNode);
33
+ };
34
+
35
+ /**
36
+ * Determines whether a table should render in content mode.
37
+ *
38
+ * Content mode tables have no fixed column widths — the browser sizes columns to fit their
39
+ * content (`table-layout: auto`). This is the shared core predicate used by both the editor
40
+ * and the renderer. Each consumer is responsible for computing `isSupported` from its own
41
+ * feature flags / props before calling this function.
42
+ *
43
+ * A table is in content mode when ALL of the following are true:
44
+ * 1. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
45
+ * 2. `isSupported` is true (caller has verified resizing is allowed and appearance is full-page)
46
+ * 3. The table is not nested inside another table or block node
47
+ * 4. The table node exists
48
+ * 5. The table has not been explicitly resized (`width === null` and no `colwidth` on cells)
49
+ * 6. The table's layout is `'align-start'`
50
+ */
51
+ var isTableInContentMode = exports.isTableInContentMode = function isTableInContentMode(_ref) {
52
+ var tableNode = _ref.tableNode,
53
+ isSupported = _ref.isSupported,
54
+ isTableNested = _ref.isTableNested;
55
+ if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
56
+ return false;
57
+ }
58
+ if (!tableNode || isTableNested) {
59
+ return false;
60
+ }
61
+ return isSupported && !hasTableBeenResized(tableNode) && tableNode.attrs.layout === 'align-start';
62
+ };
@@ -22,6 +22,25 @@ Object.defineProperty(exports, "StatusClassNames", {
22
22
  return _SortingIcon.StatusClassNames;
23
23
  }
24
24
  });
25
+ Object.defineProperty(exports, "hasTableBeenResized", {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _contentMode.hasTableBeenResized;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "hasTableColumnBeenResized", {
32
+ enumerable: true,
33
+ get: function get() {
34
+ return _contentMode.hasTableColumnBeenResized;
35
+ }
36
+ });
37
+ Object.defineProperty(exports, "isTableInContentMode", {
38
+ enumerable: true,
39
+ get: function get() {
40
+ return _contentMode.isTableInContentMode;
41
+ }
42
+ });
25
43
  var _consts = require("./consts");
26
44
  var _SortingIcon = _interopRequireWildcard(require("./SortingIcon"));
45
+ var _contentMode = require("./content-mode");
27
46
  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); }
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.useEditorToolbar = exports.EditorToolbarProvider = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
9
10
  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); }
10
11
  var EditorToolbarContext = /*#__PURE__*/(0, _react.createContext)({
11
12
  editorView: null,
@@ -31,14 +32,23 @@ var EditorToolbarProvider = exports.EditorToolbarProvider = function EditorToolb
31
32
  editorViewMode = _ref.editorViewMode,
32
33
  editorToolbarDockingPreference = _ref.editorToolbarDockingPreference,
33
34
  isOffline = _ref.isOffline;
34
- return /*#__PURE__*/_react.default.createElement(EditorToolbarContext.Provider, {
35
- // eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
36
- value: {
35
+ var memoizedValue = (0, _react.useMemo)(function () {
36
+ return {
37
37
  editorView: editorView,
38
38
  editorAppearance: editorAppearance,
39
39
  editorViewMode: editorViewMode,
40
40
  editorToolbarDockingPreference: editorToolbarDockingPreference,
41
41
  isOffline: isOffline
42
- }
42
+ };
43
+ }, [editorView, editorAppearance, editorViewMode, editorToolbarDockingPreference, isOffline]);
44
+ var contextValue = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedValue : {
45
+ editorView: editorView,
46
+ editorAppearance: editorAppearance,
47
+ editorViewMode: editorViewMode,
48
+ editorToolbarDockingPreference: editorToolbarDockingPreference,
49
+ isOffline: isOffline
50
+ };
51
+ return /*#__PURE__*/_react.default.createElement(EditorToolbarContext.Provider, {
52
+ value: contextValue
43
53
  }, children);
44
54
  };
@@ -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 = "114.2.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -260,7 +260,7 @@ var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
260
260
 
261
261
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
262
262
  var mediaWrapperStyle = exports.mediaWrapperStyle = function mediaWrapperStyle(props) {
263
- return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\tposition: relative;\n\n\t", "\n\n\t/* Editor */\n & > figure {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t/* Comments on media project adds comment badge as child of the media wrapper,\n\tthus we need to exclude it so that style is applied to intended div */\n\t& > div:not([data-media-badges='true']) {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t& * [data-mark-annotation-type='inlineComment'] {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\n\t&[data-node-type='embedCard'] > div {\n\t\twidth: 100%;\n\t}\n\n\t/* Renderer */\n\t[data-node-type='media'] {\n\t\tposition: static !important;\n\t\t", "\n\n\t\t> div {\n\t\t\tposition: absolute;\n\t\t\theight: 100%;\n\t\t}\n\t}\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative', (0, _platformFeatureFlags.fg)('platform_forge_ui_support_images_in_adfrenderer') ? 'height: auto !important;' : '');
263
+ return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\tposition: relative;\n\n\t", "\n\n\t/* Editor */\n & > figure {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t/* Comments on media project adds comment badge as child of the media wrapper,\n\tthus we need to exclude it so that style is applied to intended div */\n\t& > div:not([data-media-badges='true']) {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t& * [data-mark-annotation-type='inlineComment'] {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\n\t&[data-node-type='embedCard'] > div {\n\t\twidth: 100%;\n\t}\n\n\t/* Renderer */\n\t[data-node-type='media'] {\n\t\tposition: static !important;\n\t\theight: auto !important;\n\n\t\t> div {\n\t\t\tposition: absolute;\n\t\t\theight: 100%;\n\t\t}\n\t}\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
264
264
  };
265
265
  var MediaWrapper = exports.MediaWrapper = function MediaWrapper(_ref3) {
266
266
  var children = _ref3.children,
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
+
2
4
  // Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
3
5
  const IconCardGlyph = ({
4
6
  'aria-label': ariaLabel,
@@ -21,18 +23,23 @@ const IconCardGlyph = ({
21
23
  fill: "currentColor"
22
24
  }));
23
25
  };
26
+ const iconCardStyle = {
27
+ width: '24px',
28
+ height: '24px'
29
+ };
24
30
  export const IconCard = ({
25
31
  label
26
32
  }) => {
33
+ const style = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconCardStyle :
34
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
35
+ {
36
+ width: '24px',
37
+ height: '24px'
38
+ };
27
39
  return /*#__PURE__*/React.createElement(IconCardGlyph, {
28
40
  "aria-label": label
29
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
41
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
30
42
  ,
31
- style: {
32
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
33
- width: '24px',
34
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
35
- height: '24px'
36
- }
43
+ style: style
37
44
  });
38
45
  };
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
+
2
4
  // Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
3
5
  const IconEmbedGlyph = ({
4
6
  'aria-label': ariaLabel,
@@ -21,18 +23,23 @@ const IconEmbedGlyph = ({
21
23
  fill: "currentColor"
22
24
  }));
23
25
  };
26
+ const iconEmbedStyle = {
27
+ width: '24px',
28
+ height: '24px'
29
+ };
24
30
  export const IconEmbed = ({
25
31
  label
26
32
  }) => {
33
+ const style = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconEmbedStyle :
34
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
35
+ {
36
+ width: '24px',
37
+ height: '24px'
38
+ };
27
39
  return /*#__PURE__*/React.createElement(IconEmbedGlyph, {
28
40
  "aria-label": label
29
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
41
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
30
42
  ,
31
- style: {
32
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
33
- width: '24px',
34
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
35
- height: '24px'
36
- }
43
+ style: style
37
44
  });
38
45
  };
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
+
2
4
  // Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
3
5
  const IconInlineGlyph = ({
4
6
  'aria-label': ariaLabel,
@@ -21,18 +23,23 @@ const IconInlineGlyph = ({
21
23
  fill: "currentColor"
22
24
  }));
23
25
  };
26
+ const iconInlineStyle = {
27
+ width: '24px',
28
+ height: '24px'
29
+ };
24
30
  export const IconInline = ({
25
31
  label
26
32
  }) => {
33
+ const style = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconInlineStyle :
34
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
35
+ {
36
+ width: '24px',
37
+ height: '24px'
38
+ };
27
39
  return /*#__PURE__*/React.createElement(IconInlineGlyph, {
28
40
  "aria-label": label
29
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
41
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
30
42
  ,
31
- style: {
32
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
33
- width: '24px',
34
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
35
- height: '24px'
36
- }
43
+ style: style
37
44
  });
38
45
  };
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
+
2
4
  // Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
3
5
  const IconUrlGlyph = ({
4
6
  'aria-label': ariaLabel,
@@ -23,18 +25,23 @@ const IconUrlGlyph = ({
23
25
  fill: "currentColor"
24
26
  }));
25
27
  };
28
+ const iconUrlStyle = {
29
+ width: '24px',
30
+ height: '24px'
31
+ };
26
32
  export const IconUrl = ({
27
33
  label
28
34
  }) => {
35
+ const style = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconUrlStyle :
36
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
37
+ {
38
+ width: '24px',
39
+ height: '24px'
40
+ };
29
41
  return /*#__PURE__*/React.createElement(IconUrlGlyph, {
30
42
  "aria-label": label
31
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
43
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
32
44
  ,
33
- style: {
34
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
35
- width: '24px',
36
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
37
- height: '24px'
38
- }
45
+ style: style
39
46
  });
40
47
  };
@@ -72,7 +72,7 @@ export const ExtensionNodeWrapper = ({
72
72
  relative: showMacroInteractionDesignUpdates
73
73
  });
74
74
  return jsx("span", {
75
- "data-testId": "extension-node-wrapper"
75
+ "data-testid": "extension-node-wrapper"
76
76
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
77
77
  ,
78
78
  className: wrapperClassNames,