@atlaskit/renderer 145.0.1 → 145.0.3

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 145.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`df04549a2c45c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/df04549a2c45c) -
8
+ Update renderer annotation actions to produce `AddNodeMarkStep` results for eligible extension
9
+ nodes behind the `cc_maui_annotations_on_extensions` feature gate, while preserving existing text
10
+ and media annotation behavior.
11
+ - [`a13383c3c99b2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a13383c3c99b2) -
12
+ [FFCLEANUP-192944] clean up code references to patch gates
13
+ `platform_editor_lovability_text_bg_color_patch_1` and
14
+ `platform_editor_lovability_text_bg_color_patch_2`.
15
+ - Updated dependencies
16
+
17
+ ## 145.0.2
18
+
19
+ ### Patch Changes
20
+
21
+ - [`d7bc3969f1c0d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d7bc3969f1c0d) -
22
+ Clean up feature gate `platform_editor_nest_table_in_panel_patch_3`
23
+ - Updated dependencies
24
+
3
25
  ## 145.0.1
4
26
 
5
27
  ### Patch Changes
@@ -362,8 +362,9 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
362
362
  // hence, -1 is not needed
363
363
  var beforeNodePos = from;
364
364
  var possibleNode = this.doc.nodeAt(beforeNodePos);
365
- if ((possibleNode === null || possibleNode === void 0 ? void 0 : possibleNode.type.name) === 'media') {
366
- targetNodeType = 'media';
365
+ var isBlockTarget = possibleNode ? (0, _matchesUtils.isBlockAnnotationTarget)(possibleNode, this.schema) : false;
366
+ if (possibleNode && isBlockTarget) {
367
+ targetNodeType = possibleNode.type.name;
367
368
  step = new _transform.AddNodeMarkStep(beforeNodePos, this.schema.marks.annotation.create({
368
369
  id: annotationId,
369
370
  type: annotationType
@@ -5,6 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.countMatches = countMatches;
7
7
  exports.getIndexMatch = getIndexMatch;
8
+ exports.isBlockAnnotationTarget = isBlockAnnotationTarget;
9
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
10
+ /** Returns whether renderer annotations should use node-mark steps for this node. */
11
+ function isBlockAnnotationTarget(node, schema) {
12
+ var _schema$nodes = schema.nodes,
13
+ extension = _schema$nodes.extension,
14
+ media = _schema$nodes.media;
15
+ return node.type === media || node.type === extension && (0, _fg.fg)('cc_maui_annotations_on_extensions') && node.type.allowsMarkType(schema.marks.annotation);
16
+ }
17
+
8
18
  // Finds a string position using the Confluence annotation backend's serialisation rules.
9
19
  function getIndexMatch(doc, schema, selectedText, startIndex) {
10
20
  var textContent = '';
@@ -13,18 +23,17 @@ function getIndexMatch(doc, schema, selectedText, startIndex) {
13
23
  var blockNodePos;
14
24
  doc.descendants(function (node, pos) {
15
25
  var nodeType = node.type;
16
- var media = schema.nodes.media;
26
+ var isBlockTarget = isBlockAnnotationTarget(node, schema);
17
27
  var isBlockContainer = nodeType.isBlock && !nodeType.isLeaf && !nodeType.inlineContent;
18
28
 
19
29
  // Containers may allow annotations for their children; skip their own text to avoid double-counting.
20
- if ((node.isText || !nodeType.allowsMarkType(schema.marks.annotation) || isBlockContainer) && nodeType !== media) {
30
+ if ((node.isText || !nodeType.allowsMarkType(schema.marks.annotation) || isBlockContainer) && !isBlockTarget) {
21
31
  return true;
22
32
  }
23
33
  var nodeStart = pos;
24
34
  var nodeEnd = nodeStart + node.nodeSize;
25
35
  if (startIndex >= nodeStart && startIndex <= nodeEnd) {
26
- // MAUI-1255 will add eligible extensions as block annotation targets.
27
- if (nodeType === media) {
36
+ if (isBlockTarget) {
28
37
  blockNodePos = pos;
29
38
  }
30
39
  // If the start of the annotation selection is within the current node, we scan the document for previous occurrences
@@ -15,7 +15,6 @@ var _react = _interopRequireDefault(require("react"));
15
15
  var _panel = require("@atlaskit/adf-schema/panel");
16
16
  var _editorPalette = require("@atlaskit/editor-palette");
17
17
  var _consts = require("@atlaskit/editor-shared-styles/consts");
18
- var _fg = require("@atlaskit/platform-feature-flags/fg");
19
18
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
20
19
  var _excluded = ["backgroundColor", "children", "className", "hasIcon"];
21
20
  /**
@@ -48,7 +47,7 @@ var PanelStyledCompiled = exports.PanelStyledCompiled = function PanelStyledComp
48
47
  var customBackgroundColor = backgroundColor ? (0, _editorPalette.hexToEditorBackgroundPaletteColor)(backgroundColor) || backgroundColor : undefined;
49
48
  return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, props, {
50
49
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- intentional: preserve existing PanelSharedCssClassName.prefix class
51
- className: (0, _runtime.ax)(["_lklzfajl _imyb1bbz _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3jmsf _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hauowts _7c6p1t9x _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && (0, _fg.fg)('platform_editor_nest_table_in_panel_patch_3') && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_19mdyhbg", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === _panel.PanelType.CUSTOM && backgroundColor && "_122m1aok", "_9dunutpp _pzbautpp", "_1wvnia51", className]),
50
+ className: (0, _runtime.ax)(["_lklzfajl _imyb1bbz _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3jmsf _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hauowts _7c6p1t9x _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_19mdyhbg", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === _panel.PanelType.CUSTOM && backgroundColor && "_122m1aok", "_9dunutpp _pzbautpp", "_1wvnia51", className]),
52
51
  style: _objectSpread(_objectSpread({}, {
53
52
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- intentional: custom panel background is dynamic via CSS variable
54
53
  '--ak-renderer-panel-custom-bg-color': customBackgroundColor
@@ -12,7 +12,6 @@ var _react2 = require("@emotion/react");
12
12
  var _panel = require("@atlaskit/adf-schema/panel");
13
13
  var _editorPalette = require("@atlaskit/editor-palette");
14
14
  var _consts = require("@atlaskit/editor-shared-styles/consts");
15
- var _fg = require("@atlaskit/platform-feature-flags/fg");
16
15
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
16
  var _excluded = ["backgroundColor", "hasIcon"];
18
17
  /**
@@ -213,7 +212,7 @@ var PanelStyledEmotion = exports.PanelStyledEmotion = function PanelStyledEmotio
213
212
  {
214
213
  '--ak-renderer-panel-custom-bg-color': customBackgroundColor
215
214
  },
216
- css: [panelBaseStyles, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && (0, _fg.fg)('platform_editor_nest_table_in_panel_patch_3') && panelBackgroundColorVariableStyles, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelInfoIconStyles, !hasIcon && panelHasNoIconStyles, props['data-panel-type'] === _panel.PanelType.CUSTOM && backgroundColor && panelCustomBackground, panelNestedIconStyles, nestedPanelStyles]
215
+ css: [panelBaseStyles, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelBackgroundColorVariableStyles, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelInfoIconStyles, !hasIcon && panelHasNoIconStyles, props['data-panel-type'] === _panel.PanelType.CUSTOM && backgroundColor && panelCustomBackground, panelNestedIconStyles, nestedPanelStyles]
217
216
  // Ignored via go/ees005
218
217
  // eslint-disable-next-line react/jsx-props-no-spreading
219
218
  }, props), props.children);
@@ -13,7 +13,6 @@ var _react = _interopRequireDefault(require("react"));
13
13
  var _react2 = require("@emotion/react");
14
14
  var _styles = require("@atlaskit/editor-common/styles");
15
15
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
16
- var _fg = require("@atlaskit/platform-feature-flags/fg");
17
16
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
17
  var _injectProps = require("../../utils/inject-props");
19
18
  var _table = require("./table");
@@ -93,7 +92,7 @@ var FixedTableDiv = function FixedTableDiv(props) {
93
92
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
94
93
  ,
95
94
  className: allowTableResizing ? 'fixed-table-div-custom-table-resizing' : '',
96
- css: [fixedTableDivStaticStyles, modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode], (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && suppressExternalStickStyles, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && (0, _fg.fg)('platform_editor_nest_table_in_panel_patch_3') && panelAwareStickyTableStyles],
95
+ css: [fixedTableDivStaticStyles, modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode], (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && suppressExternalStickStyles, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelAwareStickyTableStyles],
97
96
  style: {
98
97
  '--ak-renderer-sticky-header-zindex': stickyHeaderZIndex,
99
98
  width: "".concat(wrapperWidth, "px"),
@@ -71,7 +71,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
71
71
  var TABLE_INFO_TIMEOUT = 10000;
72
72
  var RENDER_EVENT_SAMPLE_RATE = 0.1;
73
73
  var packageName = "@atlaskit/renderer";
74
- var packageVersion = "145.0.0";
74
+ var packageVersion = "145.0.2";
75
75
  var setAsQueryContainerStyles = (0, _react2.css)({
76
76
  containerName: 'ak-renderer-wrapper',
77
77
  containerType: 'inline-size'
@@ -8,7 +8,7 @@ import { AddNodeMarkStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/e
8
8
  import { fg } from '@atlaskit/platform-feature-flags/fg';
9
9
  import { createAnnotationStep, getPosFromRange } from '../steps';
10
10
  import { getRendererRangeInlineNodeNames, getRendererRangeAncestorNodeNames } from './get-renderer-range-inline-node-names';
11
- import { getIndexMatch } from './matches-utils';
11
+ import { getIndexMatch, isBlockAnnotationTarget } from './matches-utils';
12
12
  import { getSelectionContext } from './selection';
13
13
  export default class RendererActions {
14
14
  // Any kind of refence is allowed
@@ -328,8 +328,9 @@ export default class RendererActions {
328
328
  // hence, -1 is not needed
329
329
  const beforeNodePos = from;
330
330
  const possibleNode = this.doc.nodeAt(beforeNodePos);
331
- if ((possibleNode === null || possibleNode === void 0 ? void 0 : possibleNode.type.name) === 'media') {
332
- targetNodeType = 'media';
331
+ const isBlockTarget = possibleNode ? isBlockAnnotationTarget(possibleNode, this.schema) : false;
332
+ if (possibleNode && isBlockTarget) {
333
+ targetNodeType = possibleNode.type.name;
333
334
  step = new AddNodeMarkStep(beforeNodePos, this.schema.marks.annotation.create({
334
335
  id: annotationId,
335
336
  type: annotationType
@@ -1,3 +1,14 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
2
+
3
+ /** Returns whether renderer annotations should use node-mark steps for this node. */
4
+ export function isBlockAnnotationTarget(node, schema) {
5
+ const {
6
+ extension,
7
+ media
8
+ } = schema.nodes;
9
+ return node.type === media || node.type === extension && fg('cc_maui_annotations_on_extensions') && node.type.allowsMarkType(schema.marks.annotation);
10
+ }
11
+
1
12
  // Finds a string position using the Confluence annotation backend's serialisation rules.
2
13
  export function getIndexMatch(doc, schema, selectedText, startIndex) {
3
14
  let textContent = '';
@@ -6,20 +17,17 @@ export function getIndexMatch(doc, schema, selectedText, startIndex) {
6
17
  let blockNodePos;
7
18
  doc.descendants((node, pos) => {
8
19
  const nodeType = node.type;
9
- const {
10
- media
11
- } = schema.nodes;
20
+ const isBlockTarget = isBlockAnnotationTarget(node, schema);
12
21
  const isBlockContainer = nodeType.isBlock && !nodeType.isLeaf && !nodeType.inlineContent;
13
22
 
14
23
  // Containers may allow annotations for their children; skip their own text to avoid double-counting.
15
- if ((node.isText || !nodeType.allowsMarkType(schema.marks.annotation) || isBlockContainer) && nodeType !== media) {
24
+ if ((node.isText || !nodeType.allowsMarkType(schema.marks.annotation) || isBlockContainer) && !isBlockTarget) {
16
25
  return true;
17
26
  }
18
27
  const nodeStart = pos;
19
28
  const nodeEnd = nodeStart + node.nodeSize;
20
29
  if (startIndex >= nodeStart && startIndex <= nodeEnd) {
21
- // MAUI-1255 will add eligible extensions as block annotation targets.
22
- if (nodeType === media) {
30
+ if (isBlockTarget) {
23
31
  blockNodePos = pos;
24
32
  }
25
33
  // If the start of the annotation selection is within the current node, we scan the document for previous occurrences
@@ -12,7 +12,6 @@ import React from 'react';
12
12
  import { PanelType } from '@atlaskit/adf-schema/panel';
13
13
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
14
14
  import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
15
- import { fg } from '@atlaskit/platform-feature-flags/fg';
16
15
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
16
  // New custom icons are a little smaller than predefined icons.
18
17
  // To fix alignment issues with custom icons, vertical alignment is updated.
@@ -37,7 +36,7 @@ export const PanelStyledCompiled = ({
37
36
  const customBackgroundColor = backgroundColor ? hexToEditorBackgroundPaletteColor(backgroundColor) || backgroundColor : undefined;
38
37
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
39
38
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- intentional: preserve existing PanelSharedCssClassName.prefix class
40
- className: ax(["_lklzfajl _1alzoqnp _xmo1idpf _u70eidpf _1m1jidpf _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3ckbl _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hau12gs _7c6pj39m _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_19mdyhbg", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && "_122m1aok", "_9dunutpp _pzbautpp", "_1wvnia51", className]),
39
+ className: ax(["_lklzfajl _1alzoqnp _xmo1idpf _u70eidpf _1m1jidpf _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3ckbl _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hau12gs _7c6pj39m _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_19mdyhbg", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && "_122m1aok", "_9dunutpp _pzbautpp", "_1wvnia51", className]),
41
40
  style: {
42
41
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- intentional: custom panel background is dynamic via CSS variable
43
42
  '--ak-renderer-panel-custom-bg-color': customBackgroundColor
@@ -16,7 +16,6 @@ import { css, jsx } from '@emotion/react';
16
16
  import { PanelType } from '@atlaskit/adf-schema/panel';
17
17
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
18
18
  import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
19
- import { fg } from '@atlaskit/platform-feature-flags/fg';
20
19
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
21
20
  // New custom icons are a little smaller than predefined icons.
22
21
  // To fix alignment issues with custom icons, vertical alignment is updated.
@@ -206,7 +205,7 @@ export const PanelStyledEmotion = ({
206
205
  {
207
206
  '--ak-renderer-panel-custom-bg-color': customBackgroundColor
208
207
  },
209
- css: [panelBaseStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && panelBackgroundColorVariableStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelInfoIconStyles, !hasIcon && panelHasNoIconStyles, props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && panelCustomBackground, panelNestedIconStyles, nestedPanelStyles]
208
+ css: [panelBaseStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelBackgroundColorVariableStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelInfoIconStyles, !hasIcon && panelHasNoIconStyles, props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && panelCustomBackground, panelNestedIconStyles, nestedPanelStyles]
210
209
  // Ignored via go/ees005
211
210
  // eslint-disable-next-line react/jsx-props-no-spreading
212
211
  }, props), props.children);
@@ -9,7 +9,6 @@ import React from 'react';
9
9
  import { jsx, css } from '@emotion/react';
10
10
  import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
11
11
  import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
12
- import { fg } from '@atlaskit/platform-feature-flags/fg';
13
12
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
13
  import { recursivelyInjectProps } from '../../utils/inject-props';
15
14
  import { Table } from './table';
@@ -99,7 +98,7 @@ const FixedTableDiv = props => {
99
98
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
100
99
  ,
101
100
  className: allowTableResizing ? 'fixed-table-div-custom-table-resizing' : '',
102
- css: [fixedTableDivStaticStyles, modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode], expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && suppressExternalStickStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && panelAwareStickyTableStyles],
101
+ css: [fixedTableDivStaticStyles, modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode], expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && suppressExternalStickStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelAwareStickyTableStyles],
103
102
  style: {
104
103
  '--ak-renderer-sticky-header-zindex': stickyHeaderZIndex,
105
104
  width: `${wrapperWidth}px`,
@@ -56,7 +56,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
56
56
  const TABLE_INFO_TIMEOUT = 10000;
57
57
  const RENDER_EVENT_SAMPLE_RATE = 0.1;
58
58
  const packageName = "@atlaskit/renderer";
59
- const packageVersion = "145.0.0";
59
+ const packageVersion = "145.0.2";
60
60
  const setAsQueryContainerStyles = css({
61
61
  containerName: 'ak-renderer-wrapper',
62
62
  containerType: 'inline-size'
@@ -11,7 +11,7 @@ import { AddNodeMarkStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/e
11
11
  import { fg } from '@atlaskit/platform-feature-flags/fg';
12
12
  import { createAnnotationStep, getPosFromRange } from '../steps';
13
13
  import { getRendererRangeInlineNodeNames, getRendererRangeAncestorNodeNames } from './get-renderer-range-inline-node-names';
14
- import { getIndexMatch } from './matches-utils';
14
+ import { getIndexMatch, isBlockAnnotationTarget } from './matches-utils';
15
15
  import { getSelectionContext as _getSelectionContext } from './selection';
16
16
  var RendererActions = /*#__PURE__*/function () {
17
17
  // Any kind of refence is allowed
@@ -355,8 +355,9 @@ var RendererActions = /*#__PURE__*/function () {
355
355
  // hence, -1 is not needed
356
356
  var beforeNodePos = from;
357
357
  var possibleNode = this.doc.nodeAt(beforeNodePos);
358
- if ((possibleNode === null || possibleNode === void 0 ? void 0 : possibleNode.type.name) === 'media') {
359
- targetNodeType = 'media';
358
+ var isBlockTarget = possibleNode ? isBlockAnnotationTarget(possibleNode, this.schema) : false;
359
+ if (possibleNode && isBlockTarget) {
360
+ targetNodeType = possibleNode.type.name;
360
361
  step = new AddNodeMarkStep(beforeNodePos, this.schema.marks.annotation.create({
361
362
  id: annotationId,
362
363
  type: annotationType
@@ -1,3 +1,13 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
2
+
3
+ /** Returns whether renderer annotations should use node-mark steps for this node. */
4
+ export function isBlockAnnotationTarget(node, schema) {
5
+ var _schema$nodes = schema.nodes,
6
+ extension = _schema$nodes.extension,
7
+ media = _schema$nodes.media;
8
+ return node.type === media || node.type === extension && fg('cc_maui_annotations_on_extensions') && node.type.allowsMarkType(schema.marks.annotation);
9
+ }
10
+
1
11
  // Finds a string position using the Confluence annotation backend's serialisation rules.
2
12
  export function getIndexMatch(doc, schema, selectedText, startIndex) {
3
13
  var textContent = '';
@@ -6,18 +16,17 @@ export function getIndexMatch(doc, schema, selectedText, startIndex) {
6
16
  var blockNodePos;
7
17
  doc.descendants(function (node, pos) {
8
18
  var nodeType = node.type;
9
- var media = schema.nodes.media;
19
+ var isBlockTarget = isBlockAnnotationTarget(node, schema);
10
20
  var isBlockContainer = nodeType.isBlock && !nodeType.isLeaf && !nodeType.inlineContent;
11
21
 
12
22
  // Containers may allow annotations for their children; skip their own text to avoid double-counting.
13
- if ((node.isText || !nodeType.allowsMarkType(schema.marks.annotation) || isBlockContainer) && nodeType !== media) {
23
+ if ((node.isText || !nodeType.allowsMarkType(schema.marks.annotation) || isBlockContainer) && !isBlockTarget) {
14
24
  return true;
15
25
  }
16
26
  var nodeStart = pos;
17
27
  var nodeEnd = nodeStart + node.nodeSize;
18
28
  if (startIndex >= nodeStart && startIndex <= nodeEnd) {
19
- // MAUI-1255 will add eligible extensions as block annotation targets.
20
- if (nodeType === media) {
29
+ if (isBlockTarget) {
21
30
  blockNodePos = pos;
22
31
  }
23
32
  // If the start of the annotation selection is within the current node, we scan the document for previous occurrences
@@ -17,7 +17,6 @@ import React from 'react';
17
17
  import { PanelType } from '@atlaskit/adf-schema/panel';
18
18
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
19
19
  import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
20
- import { fg } from '@atlaskit/platform-feature-flags/fg';
21
20
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
22
21
  // New custom icons are a little smaller than predefined icons.
23
22
  // To fix alignment issues with custom icons, vertical alignment is updated.
@@ -41,7 +40,7 @@ var PanelStyledCompiled = function PanelStyledCompiled(_ref) {
41
40
  var customBackgroundColor = backgroundColor ? hexToEditorBackgroundPaletteColor(backgroundColor) || backgroundColor : undefined;
42
41
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
43
42
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- intentional: preserve existing PanelSharedCssClassName.prefix class
44
- className: ax(["_lklzfajl _imyb1bbz _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3jmsf _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hauowts _7c6p1t9x _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_19mdyhbg", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && "_122m1aok", "_9dunutpp _pzbautpp", "_1wvnia51", className]),
43
+ className: ax(["_lklzfajl _imyb1bbz _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3jmsf _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hauowts _7c6p1t9x _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_19mdyhbg", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && "_122m1aok", "_9dunutpp _pzbautpp", "_1wvnia51", className]),
45
44
  style: _objectSpread(_objectSpread({}, {
46
45
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- intentional: custom panel background is dynamic via CSS variable
47
46
  '--ak-renderer-panel-custom-bg-color': customBackgroundColor
@@ -18,7 +18,6 @@ import { css, jsx } from '@emotion/react';
18
18
  import { PanelType } from '@atlaskit/adf-schema/panel';
19
19
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
20
20
  import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
21
- import { fg } from '@atlaskit/platform-feature-flags/fg';
22
21
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
23
22
  // New custom icons are a little smaller than predefined icons.
24
23
  // To fix alignment issues with custom icons, vertical alignment is updated.
@@ -207,7 +206,7 @@ var PanelStyledEmotion = function PanelStyledEmotion(_ref) {
207
206
  {
208
207
  '--ak-renderer-panel-custom-bg-color': customBackgroundColor
209
208
  },
210
- css: [panelBaseStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && panelBackgroundColorVariableStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelInfoIconStyles, !hasIcon && panelHasNoIconStyles, props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && panelCustomBackground, panelNestedIconStyles, nestedPanelStyles]
209
+ css: [panelBaseStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelBackgroundColorVariableStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelInfoIconStyles, !hasIcon && panelHasNoIconStyles, props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && panelCustomBackground, panelNestedIconStyles, nestedPanelStyles]
211
210
  // Ignored via go/ees005
212
211
  // eslint-disable-next-line react/jsx-props-no-spreading
213
212
  }, props), props.children);
@@ -12,7 +12,6 @@ import React from 'react';
12
12
  import { jsx, css } from '@emotion/react';
13
13
  import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
14
14
  import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
15
- import { fg } from '@atlaskit/platform-feature-flags/fg';
16
15
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
16
  import { recursivelyInjectProps } from '../../utils/inject-props';
18
17
  import { Table } from './table';
@@ -85,7 +84,7 @@ var FixedTableDiv = function FixedTableDiv(props) {
85
84
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
86
85
  ,
87
86
  className: allowTableResizing ? 'fixed-table-div-custom-table-resizing' : '',
88
- css: [fixedTableDivStaticStyles, modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode], expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && suppressExternalStickStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && panelAwareStickyTableStyles],
87
+ css: [fixedTableDivStaticStyles, modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode], expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && suppressExternalStickStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelAwareStickyTableStyles],
89
88
  style: {
90
89
  '--ak-renderer-sticky-header-zindex': stickyHeaderZIndex,
91
90
  width: "".concat(wrapperWidth, "px"),
@@ -61,7 +61,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
61
61
  var TABLE_INFO_TIMEOUT = 10000;
62
62
  var RENDER_EVENT_SAMPLE_RATE = 0.1;
63
63
  var packageName = "@atlaskit/renderer";
64
- var packageVersion = "145.0.0";
64
+ var packageVersion = "145.0.2";
65
65
  var setAsQueryContainerStyles = css({
66
66
  containerName: 'ak-renderer-wrapper',
67
67
  containerType: 'inline-size'
@@ -1,4 +1,6 @@
1
1
  import type { Node, Schema } from '@atlaskit/editor-prosemirror/model';
2
+ /** Returns whether renderer annotations should use node-mark steps for this node. */
3
+ export declare function isBlockAnnotationTarget(node: Node, schema: Schema): boolean;
2
4
  export declare function getIndexMatch(doc: Node, schema: Schema, selectedText: string, startIndex: number): {
3
5
  blockNodePos?: number;
4
6
  matchIndex: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "145.0.1",
3
+ "version": "145.0.3",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -73,7 +73,7 @@
73
73
  "@atlaskit/status": "^5.12.0",
74
74
  "@atlaskit/task-decision": "^21.11.0",
75
75
  "@atlaskit/theme": "^28.2.0",
76
- "@atlaskit/tmp-editor-statsig": "^210.0.0",
76
+ "@atlaskit/tmp-editor-statsig": "^211.0.0",
77
77
  "@atlaskit/tokens": "^20.1.0",
78
78
  "@atlaskit/tooltip": "^24.3.0",
79
79
  "@atlaskit/visually-hidden": "^4.4.0",
@@ -162,6 +162,10 @@
162
162
  "editor_inline_comments_on_inline_nodes": {
163
163
  "type": "boolean"
164
164
  },
165
+ "cc_maui_annotations_on_extensions": {
166
+ "type": "boolean",
167
+ "referenceOnly": true
168
+ },
165
169
  "platform_editor_querySelector_fix_table_renderer": {
166
170
  "type": "boolean"
167
171
  },
@@ -194,9 +198,6 @@
194
198
  "platform_editor_bordered_panel_nested_in_table": {
195
199
  "type": "boolean"
196
200
  },
197
- "platform_editor_nest_table_in_panel_patch_3": {
198
- "type": "boolean"
199
- },
200
201
  "confluence_frontend_fix_view_page_slo": {
201
202
  "type": "boolean"
202
203
  },