@atlaskit/renderer 137.1.4 → 137.1.6

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,20 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 137.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 137.1.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`6f34a5002d9ed`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6f34a5002d9ed) -
14
+ [ux] Fix nested multi-bodied extensions so a parent active tab does not force a nested extension's
15
+ first frame to render behind the `platform_editor_nested_mbe_frames` feature gate.
16
+ - Updated dependencies
17
+
3
18
  ## 137.1.4
4
19
 
5
20
  ### Patch Changes
@@ -6,19 +6,20 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
11
  var _react = require("@emotion/react");
12
12
  var _react2 = _interopRequireWildcard(require("react"));
13
13
  var _ui = require("@atlaskit/editor-common/ui");
14
14
  var _consts = require("../../consts");
15
15
  var _utils = require("@atlaskit/editor-common/utils");
16
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
16
17
  var _actions = require("./multiBodiedExtension/actions");
17
18
  var _context = require("./multiBodiedExtension/context");
18
19
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
19
20
  var _breakout = require("../utils/breakout");
20
21
  var _analyticsContext = _interopRequireDefault(require("../../analytics/analyticsContext"));
21
- var _templateObject;
22
+ var _templateObject, _templateObject2;
22
23
  /* eslint-disable @atlaskit/design-system/prefer-primitives, @atlaskit/design-system/consistent-css-prop-usage */
23
24
  /**
24
25
  * @jsxRuntime classic
@@ -39,9 +40,11 @@ var containerStyles = (0, _react.css)({
39
40
  }
40
41
  });
41
42
  var MultiBodiedExtensionChildrenContainer = function MultiBodiedExtensionChildrenContainer(_ref) {
42
- var children = _ref.children;
43
+ var children = _ref.children,
44
+ frameId = _ref.frameId;
43
45
  return (0, _react.jsx)("article", {
44
- "data-testid": "multiBodiedExtension--frames"
46
+ "data-testid": "multiBodiedExtension--frames",
47
+ "data-multibodiedextension-frames-id": frameId
45
48
  }, children);
46
49
  };
47
50
  var MultiBodiedExtensionNavigation = function MultiBodiedExtensionNavigation(_ref2) {
@@ -50,6 +53,11 @@ var MultiBodiedExtensionNavigation = function MultiBodiedExtensionNavigation(_re
50
53
  "data-testid": "multiBodiedExtension-navigation"
51
54
  }, children);
52
55
  };
56
+ var getContainerActiveFrameStyles = function getContainerActiveFrameStyles(activeChildIndex, frameId) {
57
+ return (0, _fg.fg)('platform_editor_nested_mbe_frames') ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
58
+ (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t&\n\t\t\t\t\t[data-multibodiedextension-frames-id='", "']\n\t\t\t\t\t> [data-extension-frame='true']:nth-of-type(", ") {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t}\n\t\t\t"])), frameId, activeChildIndex + 1) : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
59
+ (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t& [data-extension-frame='true']:nth-of-type(", ") {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t}\n\t\t\t"])), activeChildIndex + 1);
60
+ };
53
61
  var MultiBodiedExtensionWrapperLegacy = function MultiBodiedExtensionWrapperLegacy(_ref3) {
54
62
  var width = _ref3.width,
55
63
  path = _ref3.path,
@@ -136,10 +144,16 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
136
144
  }),
137
145
  loading = _useMultiBodiedExtens.loading,
138
146
  extensionContext = _useMultiBodiedExtens.extensionContext;
147
+ // Used by the gated active-frame styles to scope selection to this MBE instance.
148
+ // Renderer frames are direct children of this article, so the id prevents a parent
149
+ // MBE selector from reaching into nested MBEs.
150
+ var frameId = _react2.default.useId();
139
151
  var actions = (0, _actions.useMultiBodiedExtensionActions)({
140
152
  updateActiveChild: setActiveChildIndex,
141
153
  children: children,
142
- childrenContainer: (0, _react.jsx)(MultiBodiedExtensionChildrenContainer, null, children),
154
+ childrenContainer: (0, _react.jsx)(MultiBodiedExtensionChildrenContainer, {
155
+ frameId: frameId
156
+ }, children),
143
157
  allowBodiedOverride: extensionContext === null || extensionContext === void 0 || (_extensionContext$pri = extensionContext.privateProps) === null || _extensionContext$pri === void 0 ? void 0 : _extensionContext$pri.__allowBodiedOverride,
144
158
  extensionKey: extensionKey,
145
159
  extensionType: extensionType,
@@ -173,13 +187,14 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
173
187
  return (0, _react.jsx)(_react2.default.Fragment, null, (0, _react.jsx)(MultiBodiedExtensionNavigation, null, (0, _react.jsx)(NodeRenderer, {
174
188
  node: node,
175
189
  actions: actions
176
- })), (0, _react.jsx)(MultiBodiedExtensionChildrenContainer, null, children));
190
+ })), (0, _react.jsx)(MultiBodiedExtensionChildrenContainer, {
191
+ frameId: frameId
192
+ }, children));
177
193
  }
178
- }, [loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children]);
194
+ }, [loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children, frameId]);
179
195
 
180
196
  // make the frame visible
181
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
182
- var containerActiveFrameStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t& [data-extension-frame='true']:nth-of-type(", ") {\n\t\t\tdisplay: block;\n\t\t}\n\t"])), activeChildIndex + 1);
197
+ var containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex, frameId);
183
198
  if ((0, _expValEquals.expValEquals)('platform_editor_renderer_extension_width_fix', 'isEnabled', true)) {
184
199
  var _isTopLevel = path.length < 1;
185
200
  var _useCenterWrapper = _isTopLevel && ['wide', 'full-width'].includes(layout);
@@ -74,7 +74,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
74
74
  var TABLE_INFO_TIMEOUT = 10000;
75
75
  var RENDER_EVENT_SAMPLE_RATE = 0.1;
76
76
  var packageName = "@atlaskit/renderer";
77
- var packageVersion = "137.1.3";
77
+ var packageVersion = "137.1.5";
78
78
  var setAsQueryContainerStyles = (0, _react2.css)({
79
79
  containerName: 'ak-renderer-wrapper',
80
80
  containerType: 'inline-size'
@@ -10,6 +10,7 @@ import React, { useContext, useState } from 'react';
10
10
  import { WidthConsumer } from '@atlaskit/editor-common/ui';
11
11
  import { RendererCssClassName } from '../../consts';
12
12
  import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
13
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
13
14
  import { useMultiBodiedExtensionActions } from './multiBodiedExtension/actions';
14
15
  import { useMultiBodiedExtensionContext } from './multiBodiedExtension/context';
15
16
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -28,10 +29,12 @@ const containerStyles = css({
28
29
  }
29
30
  });
30
31
  const MultiBodiedExtensionChildrenContainer = ({
31
- children
32
+ children,
33
+ frameId
32
34
  }) => {
33
35
  return jsx("article", {
34
- "data-testid": "multiBodiedExtension--frames"
36
+ "data-testid": "multiBodiedExtension--frames",
37
+ "data-multibodiedextension-frames-id": frameId
35
38
  }, children);
36
39
  };
37
40
  const MultiBodiedExtensionNavigation = ({
@@ -41,6 +44,23 @@ const MultiBodiedExtensionNavigation = ({
41
44
  "data-testid": "multiBodiedExtension-navigation"
42
45
  }, children);
43
46
  };
47
+ const getContainerActiveFrameStyles = (activeChildIndex, frameId) => {
48
+ return fg('platform_editor_nested_mbe_frames') ?
49
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
50
+ css`
51
+ &
52
+ [data-multibodiedextension-frames-id='${frameId}']
53
+ > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) {
54
+ display: block;
55
+ }
56
+ ` :
57
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
58
+ css`
59
+ & [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) {
60
+ display: block;
61
+ }
62
+ `;
63
+ };
44
64
  const MultiBodiedExtensionWrapperLegacy = ({
45
65
  width,
46
66
  path,
@@ -128,10 +148,16 @@ const MultiBodiedExtension = props => {
128
148
  extensionType,
129
149
  extensionKey
130
150
  });
151
+ // Used by the gated active-frame styles to scope selection to this MBE instance.
152
+ // Renderer frames are direct children of this article, so the id prevents a parent
153
+ // MBE selector from reaching into nested MBEs.
154
+ const frameId = React.useId();
131
155
  const actions = useMultiBodiedExtensionActions({
132
156
  updateActiveChild: setActiveChildIndex,
133
157
  children,
134
- childrenContainer: jsx(MultiBodiedExtensionChildrenContainer, null, children),
158
+ childrenContainer: jsx(MultiBodiedExtensionChildrenContainer, {
159
+ frameId: frameId
160
+ }, children),
135
161
  allowBodiedOverride: extensionContext === null || extensionContext === void 0 ? void 0 : (_extensionContext$pri = extensionContext.privateProps) === null || _extensionContext$pri === void 0 ? void 0 : _extensionContext$pri.__allowBodiedOverride,
136
162
  extensionKey,
137
163
  extensionType,
@@ -165,17 +191,14 @@ const MultiBodiedExtension = props => {
165
191
  return jsx(React.Fragment, null, jsx(MultiBodiedExtensionNavigation, null, jsx(NodeRenderer, {
166
192
  node: node,
167
193
  actions: actions
168
- })), jsx(MultiBodiedExtensionChildrenContainer, null, children));
194
+ })), jsx(MultiBodiedExtensionChildrenContainer, {
195
+ frameId: frameId
196
+ }, children));
169
197
  }
170
- }, [loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children]);
198
+ }, [loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children, frameId]);
171
199
 
172
200
  // make the frame visible
173
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
174
- const containerActiveFrameStyles = css`
175
- & [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) {
176
- display: block;
177
- }
178
- `;
201
+ const containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex, frameId);
179
202
  if (expValEquals('platform_editor_renderer_extension_width_fix', 'isEnabled', true)) {
180
203
  const isTopLevel = path.length < 1;
181
204
  const useCenterWrapper = isTopLevel && ['wide', 'full-width'].includes(layout);
@@ -60,7 +60,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
60
60
  const TABLE_INFO_TIMEOUT = 10000;
61
61
  const RENDER_EVENT_SAMPLE_RATE = 0.1;
62
62
  const packageName = "@atlaskit/renderer";
63
- const packageVersion = "137.1.3";
63
+ const packageVersion = "137.1.5";
64
64
  const setAsQueryContainerStyles = css({
65
65
  containerName: 'ak-renderer-wrapper',
66
66
  containerType: 'inline-size'
@@ -1,6 +1,6 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- var _templateObject;
2
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
+ var _templateObject, _templateObject2;
4
4
  /* eslint-disable @atlaskit/design-system/prefer-primitives, @atlaskit/design-system/consistent-css-prop-usage */
5
5
  /**
6
6
  * @jsxRuntime classic
@@ -13,6 +13,7 @@ import React, { useContext, useState } from 'react';
13
13
  import { WidthConsumer } from '@atlaskit/editor-common/ui';
14
14
  import { RendererCssClassName } from '../../consts';
15
15
  import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
16
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
16
17
  import { useMultiBodiedExtensionActions } from './multiBodiedExtension/actions';
17
18
  import { useMultiBodiedExtensionContext } from './multiBodiedExtension/context';
18
19
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -31,9 +32,11 @@ var containerStyles = css({
31
32
  }
32
33
  });
33
34
  var MultiBodiedExtensionChildrenContainer = function MultiBodiedExtensionChildrenContainer(_ref) {
34
- var children = _ref.children;
35
+ var children = _ref.children,
36
+ frameId = _ref.frameId;
35
37
  return jsx("article", {
36
- "data-testid": "multiBodiedExtension--frames"
38
+ "data-testid": "multiBodiedExtension--frames",
39
+ "data-multibodiedextension-frames-id": frameId
37
40
  }, children);
38
41
  };
39
42
  var MultiBodiedExtensionNavigation = function MultiBodiedExtensionNavigation(_ref2) {
@@ -42,6 +45,11 @@ var MultiBodiedExtensionNavigation = function MultiBodiedExtensionNavigation(_re
42
45
  "data-testid": "multiBodiedExtension-navigation"
43
46
  }, children);
44
47
  };
48
+ var getContainerActiveFrameStyles = function getContainerActiveFrameStyles(activeChildIndex, frameId) {
49
+ return fg('platform_editor_nested_mbe_frames') ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
50
+ css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t\t\t&\n\t\t\t\t\t[data-multibodiedextension-frames-id='", "']\n\t\t\t\t\t> [data-extension-frame='true']:nth-of-type(", ") {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t}\n\t\t\t"])), frameId, activeChildIndex + 1) : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
51
+ css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\t\t\t& [data-extension-frame='true']:nth-of-type(", ") {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t}\n\t\t\t"])), activeChildIndex + 1);
52
+ };
45
53
  var MultiBodiedExtensionWrapperLegacy = function MultiBodiedExtensionWrapperLegacy(_ref3) {
46
54
  var width = _ref3.width,
47
55
  path = _ref3.path,
@@ -128,10 +136,16 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
128
136
  }),
129
137
  loading = _useMultiBodiedExtens.loading,
130
138
  extensionContext = _useMultiBodiedExtens.extensionContext;
139
+ // Used by the gated active-frame styles to scope selection to this MBE instance.
140
+ // Renderer frames are direct children of this article, so the id prevents a parent
141
+ // MBE selector from reaching into nested MBEs.
142
+ var frameId = React.useId();
131
143
  var actions = useMultiBodiedExtensionActions({
132
144
  updateActiveChild: setActiveChildIndex,
133
145
  children: children,
134
- childrenContainer: jsx(MultiBodiedExtensionChildrenContainer, null, children),
146
+ childrenContainer: jsx(MultiBodiedExtensionChildrenContainer, {
147
+ frameId: frameId
148
+ }, children),
135
149
  allowBodiedOverride: extensionContext === null || extensionContext === void 0 || (_extensionContext$pri = extensionContext.privateProps) === null || _extensionContext$pri === void 0 ? void 0 : _extensionContext$pri.__allowBodiedOverride,
136
150
  extensionKey: extensionKey,
137
151
  extensionType: extensionType,
@@ -165,13 +179,14 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
165
179
  return jsx(React.Fragment, null, jsx(MultiBodiedExtensionNavigation, null, jsx(NodeRenderer, {
166
180
  node: node,
167
181
  actions: actions
168
- })), jsx(MultiBodiedExtensionChildrenContainer, null, children));
182
+ })), jsx(MultiBodiedExtensionChildrenContainer, {
183
+ frameId: frameId
184
+ }, children));
169
185
  }
170
- }, [loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children]);
186
+ }, [loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children, frameId]);
171
187
 
172
188
  // make the frame visible
173
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
174
- var containerActiveFrameStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t& [data-extension-frame='true']:nth-of-type(", ") {\n\t\t\tdisplay: block;\n\t\t}\n\t"])), activeChildIndex + 1);
189
+ var containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex, frameId);
175
190
  if (expValEquals('platform_editor_renderer_extension_width_fix', 'isEnabled', true)) {
176
191
  var _isTopLevel = path.length < 1;
177
192
  var _useCenterWrapper = _isTopLevel && ['wide', 'full-width'].includes(layout);
@@ -65,7 +65,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
65
65
  var TABLE_INFO_TIMEOUT = 10000;
66
66
  var RENDER_EVENT_SAMPLE_RATE = 0.1;
67
67
  var packageName = "@atlaskit/renderer";
68
- var packageVersion = "137.1.3";
68
+ var packageVersion = "137.1.5";
69
69
  var setAsQueryContainerStyles = css({
70
70
  containerName: 'ak-renderer-wrapper',
71
71
  containerType: 'inline-size'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "137.1.4",
3
+ "version": "137.1.6",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,7 +30,7 @@
30
30
  }
31
31
  },
32
32
  "dependencies": {
33
- "@atlaskit/adf-schema": "^57.1.0",
33
+ "@atlaskit/adf-schema": "^57.2.0",
34
34
  "@atlaskit/adf-utils": "^20.7.0",
35
35
  "@atlaskit/afm-i18n-platform-editor-renderer": "2.200.0",
36
36
  "@atlaskit/analytics-listeners": "^11.1.0",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/browser-apis": "^1.2.0",
40
40
  "@atlaskit/button": "^25.2.0",
41
41
  "@atlaskit/code": "^19.1.0",
42
- "@atlaskit/css": "^1.0.0",
42
+ "@atlaskit/css": "^1.1.0",
43
43
  "@atlaskit/editor-card-provider": "^7.2.0",
44
44
  "@atlaskit/editor-json-transformer": "^9.6.0",
45
45
  "@atlaskit/editor-palette": "^3.4.0",
@@ -70,7 +70,7 @@
70
70
  "@atlaskit/status": "^5.8.0",
71
71
  "@atlaskit/task-decision": "^21.8.0",
72
72
  "@atlaskit/theme": "^28.1.0",
73
- "@atlaskit/tmp-editor-statsig": "^162.0.0",
73
+ "@atlaskit/tmp-editor-statsig": "^163.0.0",
74
74
  "@atlaskit/tokens": "^16.8.0",
75
75
  "@atlaskit/tooltip": "^24.2.0",
76
76
  "@atlaskit/visually-hidden": "^4.3.0",
@@ -128,7 +128,6 @@
128
128
  "@types/react-loadable": "^5.4.1",
129
129
  "@types/react-test-renderer": "^18.0.6",
130
130
  "ajv": "^6.12.6",
131
- "enzyme": "^3.10.0",
132
131
  "jsdom": "^25.0.0",
133
132
  "mockdate": "^3.0.5",
134
133
  "puppeteer": "13.7.0",
@@ -177,6 +176,9 @@
177
176
  "platform_editor_querySelector_fix_table_renderer": {
178
177
  "type": "boolean"
179
178
  },
179
+ "platform_editor_nested_mbe_frames": {
180
+ "type": "boolean"
181
+ },
180
182
  "platform_editor_fix_media_in_renderer": {
181
183
  "type": "boolean"
182
184
  },