@atlaskit/renderer 137.2.3 → 137.2.4

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,14 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 137.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`38efae8b5d945`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38efae8b5d945) -
8
+ Scope MultiBodiedExtension active frame styles to the owning frames article to avoid showing
9
+ nested inactive tab bodies.
10
+ - Updated dependencies
11
+
3
12
  ## 137.2.3
4
13
 
5
14
  ### Patch Changes
@@ -39,12 +39,30 @@ var containerStyles = (0, _react.css)({
39
39
  marginTop: 0
40
40
  }
41
41
  });
42
+ var getFramesActiveFrameStyles = function getFramesActiveFrameStyles(activeChildIndex) {
43
+ if (!(0, _fg.fg)('platform_editor_nested_mbe_frames')) {
44
+ return undefined;
45
+ }
46
+
47
+ // Apply the active-frame rule on the frames article itself so nested MBEs
48
+ // only target their own direct frames.
49
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
50
+ return (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);
51
+ };
52
+ var getContainerActiveFrameStyles = function getContainerActiveFrameStyles(activeChildIndex) {
53
+ if ((0, _fg.fg)('platform_editor_nested_mbe_frames')) {
54
+ return undefined;
55
+ }
56
+
57
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
58
+ return (0, _react.css)(_templateObject2 || (_templateObject2 = (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);
59
+ };
42
60
  var MultiBodiedExtensionChildrenContainer = function MultiBodiedExtensionChildrenContainer(_ref) {
43
- var children = _ref.children,
44
- frameId = _ref.frameId;
61
+ var activeChildIndex = _ref.activeChildIndex,
62
+ children = _ref.children;
45
63
  return (0, _react.jsx)("article", {
46
- "data-testid": "multiBodiedExtension--frames",
47
- "data-multibodiedextension-frames-id": frameId
64
+ css: getFramesActiveFrameStyles(activeChildIndex),
65
+ "data-testid": "multiBodiedExtension--frames"
48
66
  }, children);
49
67
  };
50
68
  var MultiBodiedExtensionNavigation = function MultiBodiedExtensionNavigation(_ref2) {
@@ -53,11 +71,6 @@ var MultiBodiedExtensionNavigation = function MultiBodiedExtensionNavigation(_re
53
71
  "data-testid": "multiBodiedExtension-navigation"
54
72
  }, children);
55
73
  };
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
- };
61
74
  var MultiBodiedExtensionWrapperLegacy = function MultiBodiedExtensionWrapperLegacy(_ref3) {
62
75
  var width = _ref3.width,
63
76
  path = _ref3.path,
@@ -144,15 +157,11 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
144
157
  }),
145
158
  loading = _useMultiBodiedExtens.loading,
146
159
  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();
151
160
  var actions = (0, _actions.useMultiBodiedExtensionActions)({
152
161
  updateActiveChild: setActiveChildIndex,
153
162
  children: children,
154
163
  childrenContainer: (0, _react.jsx)(MultiBodiedExtensionChildrenContainer, {
155
- frameId: frameId
164
+ activeChildIndex: activeChildIndex
156
165
  }, children),
157
166
  allowBodiedOverride: extensionContext === null || extensionContext === void 0 || (_extensionContext$pri = extensionContext.privateProps) === null || _extensionContext$pri === void 0 ? void 0 : _extensionContext$pri.__allowBodiedOverride,
158
167
  extensionKey: extensionKey,
@@ -188,13 +197,13 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
188
197
  node: node,
189
198
  actions: actions
190
199
  })), (0, _react.jsx)(MultiBodiedExtensionChildrenContainer, {
191
- frameId: frameId
200
+ activeChildIndex: activeChildIndex
192
201
  }, children));
193
202
  }
194
- }, [loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children, frameId]);
203
+ }, [activeChildIndex, loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children]);
195
204
 
196
205
  // make the frame visible
197
- var containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex, frameId);
206
+ var containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex);
198
207
  if ((0, _expValEquals.expValEquals)('platform_editor_renderer_extension_width_fix', 'isEnabled', true)) {
199
208
  var _isTopLevel = path.length < 1;
200
209
  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.2.2";
77
+ var packageVersion = "137.2.3";
78
78
  var setAsQueryContainerStyles = (0, _react2.css)({
79
79
  containerName: 'ak-renderer-wrapper',
80
80
  containerType: 'inline-size'
@@ -28,13 +28,39 @@ const containerStyles = css({
28
28
  marginTop: 0
29
29
  }
30
30
  });
31
+ const getFramesActiveFrameStyles = activeChildIndex => {
32
+ if (!fg('platform_editor_nested_mbe_frames')) {
33
+ return undefined;
34
+ }
35
+
36
+ // Apply the active-frame rule on the frames article itself so nested MBEs
37
+ // only target their own direct frames.
38
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
39
+ return css`
40
+ & > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) {
41
+ display: block;
42
+ }
43
+ `;
44
+ };
45
+ const getContainerActiveFrameStyles = activeChildIndex => {
46
+ if (fg('platform_editor_nested_mbe_frames')) {
47
+ return undefined;
48
+ }
49
+
50
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
51
+ return css`
52
+ & [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) {
53
+ display: block;
54
+ }
55
+ `;
56
+ };
31
57
  const MultiBodiedExtensionChildrenContainer = ({
32
- children,
33
- frameId
58
+ activeChildIndex,
59
+ children
34
60
  }) => {
35
61
  return jsx("article", {
36
- "data-testid": "multiBodiedExtension--frames",
37
- "data-multibodiedextension-frames-id": frameId
62
+ css: getFramesActiveFrameStyles(activeChildIndex),
63
+ "data-testid": "multiBodiedExtension--frames"
38
64
  }, children);
39
65
  };
40
66
  const MultiBodiedExtensionNavigation = ({
@@ -44,23 +70,6 @@ const MultiBodiedExtensionNavigation = ({
44
70
  "data-testid": "multiBodiedExtension-navigation"
45
71
  }, children);
46
72
  };
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
- };
64
73
  const MultiBodiedExtensionWrapperLegacy = ({
65
74
  width,
66
75
  path,
@@ -148,15 +157,11 @@ const MultiBodiedExtension = props => {
148
157
  extensionType,
149
158
  extensionKey
150
159
  });
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();
155
160
  const actions = useMultiBodiedExtensionActions({
156
161
  updateActiveChild: setActiveChildIndex,
157
162
  children,
158
163
  childrenContainer: jsx(MultiBodiedExtensionChildrenContainer, {
159
- frameId: frameId
164
+ activeChildIndex: activeChildIndex
160
165
  }, children),
161
166
  allowBodiedOverride: extensionContext === null || extensionContext === void 0 ? void 0 : (_extensionContext$pri = extensionContext.privateProps) === null || _extensionContext$pri === void 0 ? void 0 : _extensionContext$pri.__allowBodiedOverride,
162
167
  extensionKey,
@@ -192,13 +197,13 @@ const MultiBodiedExtension = props => {
192
197
  node: node,
193
198
  actions: actions
194
199
  })), jsx(MultiBodiedExtensionChildrenContainer, {
195
- frameId: frameId
200
+ activeChildIndex: activeChildIndex
196
201
  }, children));
197
202
  }
198
- }, [loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children, frameId]);
203
+ }, [activeChildIndex, loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children]);
199
204
 
200
205
  // make the frame visible
201
- const containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex, frameId);
206
+ const containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex);
202
207
  if (expValEquals('platform_editor_renderer_extension_width_fix', 'isEnabled', true)) {
203
208
  const isTopLevel = path.length < 1;
204
209
  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.2.2";
63
+ const packageVersion = "137.2.3";
64
64
  const setAsQueryContainerStyles = css({
65
65
  containerName: 'ak-renderer-wrapper',
66
66
  containerType: 'inline-size'
@@ -31,12 +31,30 @@ var containerStyles = css({
31
31
  marginTop: 0
32
32
  }
33
33
  });
34
+ var getFramesActiveFrameStyles = function getFramesActiveFrameStyles(activeChildIndex) {
35
+ if (!fg('platform_editor_nested_mbe_frames')) {
36
+ return undefined;
37
+ }
38
+
39
+ // Apply the active-frame rule on the frames article itself so nested MBEs
40
+ // only target their own direct frames.
41
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
42
+ return 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);
43
+ };
44
+ var getContainerActiveFrameStyles = function getContainerActiveFrameStyles(activeChildIndex) {
45
+ if (fg('platform_editor_nested_mbe_frames')) {
46
+ return undefined;
47
+ }
48
+
49
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
50
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\t& [data-extension-frame='true']:nth-of-type(", ") {\n\t\t\tdisplay: block;\n\t\t}\n\t"])), activeChildIndex + 1);
51
+ };
34
52
  var MultiBodiedExtensionChildrenContainer = function MultiBodiedExtensionChildrenContainer(_ref) {
35
- var children = _ref.children,
36
- frameId = _ref.frameId;
53
+ var activeChildIndex = _ref.activeChildIndex,
54
+ children = _ref.children;
37
55
  return jsx("article", {
38
- "data-testid": "multiBodiedExtension--frames",
39
- "data-multibodiedextension-frames-id": frameId
56
+ css: getFramesActiveFrameStyles(activeChildIndex),
57
+ "data-testid": "multiBodiedExtension--frames"
40
58
  }, children);
41
59
  };
42
60
  var MultiBodiedExtensionNavigation = function MultiBodiedExtensionNavigation(_ref2) {
@@ -45,11 +63,6 @@ var MultiBodiedExtensionNavigation = function MultiBodiedExtensionNavigation(_re
45
63
  "data-testid": "multiBodiedExtension-navigation"
46
64
  }, children);
47
65
  };
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
- };
53
66
  var MultiBodiedExtensionWrapperLegacy = function MultiBodiedExtensionWrapperLegacy(_ref3) {
54
67
  var width = _ref3.width,
55
68
  path = _ref3.path,
@@ -136,15 +149,11 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
136
149
  }),
137
150
  loading = _useMultiBodiedExtens.loading,
138
151
  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();
143
152
  var actions = useMultiBodiedExtensionActions({
144
153
  updateActiveChild: setActiveChildIndex,
145
154
  children: children,
146
155
  childrenContainer: jsx(MultiBodiedExtensionChildrenContainer, {
147
- frameId: frameId
156
+ activeChildIndex: activeChildIndex
148
157
  }, children),
149
158
  allowBodiedOverride: extensionContext === null || extensionContext === void 0 || (_extensionContext$pri = extensionContext.privateProps) === null || _extensionContext$pri === void 0 ? void 0 : _extensionContext$pri.__allowBodiedOverride,
150
159
  extensionKey: extensionKey,
@@ -180,13 +189,13 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
180
189
  node: node,
181
190
  actions: actions
182
191
  })), jsx(MultiBodiedExtensionChildrenContainer, {
183
- frameId: frameId
192
+ activeChildIndex: activeChildIndex
184
193
  }, children));
185
194
  }
186
- }, [loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children, frameId]);
195
+ }, [activeChildIndex, loading, extensionContext, marks, extensionKey, extensionType, parameters, content, getContent, localId, actions, children]);
187
196
 
188
197
  // make the frame visible
189
- var containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex, frameId);
198
+ var containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex);
190
199
  if (expValEquals('platform_editor_renderer_extension_width_fix', 'isEnabled', true)) {
191
200
  var _isTopLevel = path.length < 1;
192
201
  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.2.2";
68
+ var packageVersion = "137.2.3";
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.2.3",
3
+ "version": "137.2.4",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"