@atlaskit/navigation-system 12.0.0 → 12.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlassian/navigation-system
2
2
 
3
+ ## 12.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f21efa21bc985`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f21efa21bc985) -
8
+ Keep the initial PanelLayout container query attached to its layout after a hydration ID mismatch,
9
+ behind platform-dst-chat-panel-layout.
10
+
3
11
  ## 12.0.0
4
12
 
5
13
  ### Major Changes
@@ -60,6 +60,16 @@ function PanelLayoutShell(_ref) {
60
60
  // CSS query conditions cannot read custom properties. Only the numeric minimums and
61
61
  // instance selector are generated here; this rule is removed after the first measurement,
62
62
  // so live resizing never rewrites stylesheet text. The named container is local to this shell.
63
+ // Scope each query to its own following grid. Hydration can retain the server's ID
64
+ // while subsequent renders use a different client ID. Include both minimums so
65
+ // layouts with different query conditions cannot apply their rules to each other.
66
+ // Encode punctuation to keep the CSS attribute selector unquoted (React 18 escapes
67
+ // quotes in server-rendered style text).
68
+ var queryKey = "m".concat(mainMinWidth, "p").concat(panelMinWidth).replace(/[^a-zA-Z0-9_-]/g, function (character) {
69
+ return "_".concat(character.charCodeAt(0), "_");
70
+ });
71
+ var useSiblingSelector = (0, _fg.fg)('platform-dst-chat-panel-layout');
72
+ var inlineSelector = useSiblingSelector ? "style[data-panel-layout-query=".concat(queryKey, "] + div") : "#".concat(id);
63
73
  var inlineQuery = "@container local-panel-layout (min-width: ".concat(mainMinWidth + panelMinWidth, "px)");
64
74
  return /*#__PURE__*/React.createElement("div", {
65
75
  className: (0, _runtime.ax)([styles.container])
@@ -67,10 +77,14 @@ function PanelLayoutShell(_ref) {
67
77
  /*#__PURE__*/
68
78
  // Keep the inline motion cap available during exit, after the open-only track rule is removed.
69
79
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped query matches the SSR inline allocation, including caller-defined minimums.
70
- React.createElement("style", null, "".concat(inlineQuery, " {\n\t\t\t\t\t#").concat(id, " { --p_lclPnlMotionMaxW: calc(100cqw - ").concat(mainMinWidth, "px); }\n\t\t\t\t}")), mode === undefined && isPanelOpen &&
80
+ React.createElement("style", {
81
+ "data-panel-layout-motion-query": queryKey
82
+ }, "".concat(inlineQuery, " {\n\t\t\t\t\tstyle[data-panel-layout-motion-query=").concat(queryKey, "] ~ div { --p_lclPnlMotionMaxW: calc(100cqw - ").concat(mainMinWidth, "px); }\n\t\t\t\t}")), mode === undefined && isPanelOpen &&
71
83
  /*#__PURE__*/
72
84
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped SSR query supports caller-defined minimums; CSS variables are not allowed in query conditions.
73
- React.createElement("style", null, "".concat(inlineQuery, " {\n\t\t\t\t\t#").concat(id, " {\n\t\t\t\t\t\t--p_lclPnlSsrAreas: var(--p_lclPnlSsrInlineAreas);\n\t\t\t\t\t\t--p_lclPnlSsrColumns: minmax(0, 1fr) min(var(--p_lclPnlSsrPreferredW), calc(100% - ").concat(mainMinWidth, "px));\n\t\t\t\t\t\t--p_lclPnlSsrArea: panel;\n\t\t\t\t\t\t--p_lclPnlSsrWidth: 100%;\n\t\t\t\t\t\t--p_lclPnlSsrBackground: ", "var(--ds-surface, #FFFFFF)", ";\n\t\t\t\t\t\t--p_lclPnlSsrShadow: none;\n\t\t\t\t\t\t--p_lclPnlSsrBorder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #0B120E24)", ";\n\t\t\t\t\t}\n\t\t\t\t}")), /*#__PURE__*/React.createElement("div", {
85
+ React.createElement("style", {
86
+ "data-panel-layout-query": useSiblingSelector ? queryKey : undefined
87
+ }, "".concat(inlineQuery, " {\n\t\t\t\t\t").concat(inlineSelector, " {\n\t\t\t\t\t\t--p_lclPnlSsrAreas: var(--p_lclPnlSsrInlineAreas);\n\t\t\t\t\t\t--p_lclPnlSsrColumns: minmax(0, 1fr) min(var(--p_lclPnlSsrPreferredW), calc(100% - ").concat(mainMinWidth, "px));\n\t\t\t\t\t\t--p_lclPnlSsrArea: panel;\n\t\t\t\t\t\t--p_lclPnlSsrWidth: 100%;\n\t\t\t\t\t\t--p_lclPnlSsrBackground: ", "var(--ds-surface, #FFFFFF)", ";\n\t\t\t\t\t\t--p_lclPnlSsrShadow: none;\n\t\t\t\t\t\t--p_lclPnlSsrBorder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #0B120E24)", ";\n\t\t\t\t\t}\n\t\t\t\t}")), /*#__PURE__*/React.createElement("div", {
74
88
  id: id,
75
89
  "data-testid": testId,
76
90
  ref: layoutRef,
@@ -50,6 +50,14 @@ export function PanelLayoutShell({
50
50
  // CSS query conditions cannot read custom properties. Only the numeric minimums and
51
51
  // instance selector are generated here; this rule is removed after the first measurement,
52
52
  // so live resizing never rewrites stylesheet text. The named container is local to this shell.
53
+ // Scope each query to its own following grid. Hydration can retain the server's ID
54
+ // while subsequent renders use a different client ID. Include both minimums so
55
+ // layouts with different query conditions cannot apply their rules to each other.
56
+ // Encode punctuation to keep the CSS attribute selector unquoted (React 18 escapes
57
+ // quotes in server-rendered style text).
58
+ const queryKey = `m${mainMinWidth}p${panelMinWidth}`.replace(/[^a-zA-Z0-9_-]/g, character => `_${character.charCodeAt(0)}_`);
59
+ const useSiblingSelector = fg('platform-dst-chat-panel-layout');
60
+ const inlineSelector = useSiblingSelector ? `style[data-panel-layout-query=${queryKey}] + div` : `#${id}`;
53
61
  const inlineQuery = `@container local-panel-layout (min-width: ${mainMinWidth + panelMinWidth}px)`;
54
62
  return /*#__PURE__*/React.createElement("div", {
55
63
  className: ax([styles.container])
@@ -57,13 +65,17 @@ export function PanelLayoutShell({
57
65
  /*#__PURE__*/
58
66
  // Keep the inline motion cap available during exit, after the open-only track rule is removed.
59
67
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped query matches the SSR inline allocation, including caller-defined minimums.
60
- React.createElement("style", null, `${inlineQuery} {
61
- #${id} { --p_lclPnlMotionMaxW: calc(100cqw - ${mainMinWidth}px); }
68
+ React.createElement("style", {
69
+ "data-panel-layout-motion-query": queryKey
70
+ }, `${inlineQuery} {
71
+ style[data-panel-layout-motion-query=${queryKey}] ~ div { --p_lclPnlMotionMaxW: calc(100cqw - ${mainMinWidth}px); }
62
72
  }`), mode === undefined && isPanelOpen &&
63
73
  /*#__PURE__*/
64
74
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped SSR query supports caller-defined minimums; CSS variables are not allowed in query conditions.
65
- React.createElement("style", null, `${inlineQuery} {
66
- #${id} {
75
+ React.createElement("style", {
76
+ "data-panel-layout-query": useSiblingSelector ? queryKey : undefined
77
+ }, `${inlineQuery} {
78
+ ${inlineSelector} {
67
79
  --p_lclPnlSsrAreas: var(--p_lclPnlSsrInlineAreas);
68
80
  --p_lclPnlSsrColumns: minmax(0, 1fr) min(var(--p_lclPnlSsrPreferredW), calc(100% - ${mainMinWidth}px));
69
81
  --p_lclPnlSsrArea: panel;
@@ -52,6 +52,16 @@ export function PanelLayoutShell(_ref) {
52
52
  // CSS query conditions cannot read custom properties. Only the numeric minimums and
53
53
  // instance selector are generated here; this rule is removed after the first measurement,
54
54
  // so live resizing never rewrites stylesheet text. The named container is local to this shell.
55
+ // Scope each query to its own following grid. Hydration can retain the server's ID
56
+ // while subsequent renders use a different client ID. Include both minimums so
57
+ // layouts with different query conditions cannot apply their rules to each other.
58
+ // Encode punctuation to keep the CSS attribute selector unquoted (React 18 escapes
59
+ // quotes in server-rendered style text).
60
+ var queryKey = "m".concat(mainMinWidth, "p").concat(panelMinWidth).replace(/[^a-zA-Z0-9_-]/g, function (character) {
61
+ return "_".concat(character.charCodeAt(0), "_");
62
+ });
63
+ var useSiblingSelector = fg('platform-dst-chat-panel-layout');
64
+ var inlineSelector = useSiblingSelector ? "style[data-panel-layout-query=".concat(queryKey, "] + div") : "#".concat(id);
55
65
  var inlineQuery = "@container local-panel-layout (min-width: ".concat(mainMinWidth + panelMinWidth, "px)");
56
66
  return /*#__PURE__*/React.createElement("div", {
57
67
  className: ax([styles.container])
@@ -59,10 +69,14 @@ export function PanelLayoutShell(_ref) {
59
69
  /*#__PURE__*/
60
70
  // Keep the inline motion cap available during exit, after the open-only track rule is removed.
61
71
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped query matches the SSR inline allocation, including caller-defined minimums.
62
- React.createElement("style", null, "".concat(inlineQuery, " {\n\t\t\t\t\t#").concat(id, " { --p_lclPnlMotionMaxW: calc(100cqw - ").concat(mainMinWidth, "px); }\n\t\t\t\t}")), mode === undefined && isPanelOpen &&
72
+ React.createElement("style", {
73
+ "data-panel-layout-motion-query": queryKey
74
+ }, "".concat(inlineQuery, " {\n\t\t\t\t\tstyle[data-panel-layout-motion-query=").concat(queryKey, "] ~ div { --p_lclPnlMotionMaxW: calc(100cqw - ").concat(mainMinWidth, "px); }\n\t\t\t\t}")), mode === undefined && isPanelOpen &&
63
75
  /*#__PURE__*/
64
76
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped SSR query supports caller-defined minimums; CSS variables are not allowed in query conditions.
65
- React.createElement("style", null, "".concat(inlineQuery, " {\n\t\t\t\t\t#").concat(id, " {\n\t\t\t\t\t\t--p_lclPnlSsrAreas: var(--p_lclPnlSsrInlineAreas);\n\t\t\t\t\t\t--p_lclPnlSsrColumns: minmax(0, 1fr) min(var(--p_lclPnlSsrPreferredW), calc(100% - ").concat(mainMinWidth, "px));\n\t\t\t\t\t\t--p_lclPnlSsrArea: panel;\n\t\t\t\t\t\t--p_lclPnlSsrWidth: 100%;\n\t\t\t\t\t\t--p_lclPnlSsrBackground: ", "var(--ds-surface, #FFFFFF)", ";\n\t\t\t\t\t\t--p_lclPnlSsrShadow: none;\n\t\t\t\t\t\t--p_lclPnlSsrBorder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #0B120E24)", ";\n\t\t\t\t\t}\n\t\t\t\t}")), /*#__PURE__*/React.createElement("div", {
77
+ React.createElement("style", {
78
+ "data-panel-layout-query": useSiblingSelector ? queryKey : undefined
79
+ }, "".concat(inlineQuery, " {\n\t\t\t\t\t").concat(inlineSelector, " {\n\t\t\t\t\t\t--p_lclPnlSsrAreas: var(--p_lclPnlSsrInlineAreas);\n\t\t\t\t\t\t--p_lclPnlSsrColumns: minmax(0, 1fr) min(var(--p_lclPnlSsrPreferredW), calc(100% - ").concat(mainMinWidth, "px));\n\t\t\t\t\t\t--p_lclPnlSsrArea: panel;\n\t\t\t\t\t\t--p_lclPnlSsrWidth: 100%;\n\t\t\t\t\t\t--p_lclPnlSsrBackground: ", "var(--ds-surface, #FFFFFF)", ";\n\t\t\t\t\t\t--p_lclPnlSsrShadow: none;\n\t\t\t\t\t\t--p_lclPnlSsrBorder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #0B120E24)", ";\n\t\t\t\t\t}\n\t\t\t\t}")), /*#__PURE__*/React.createElement("div", {
66
80
  id: id,
67
81
  "data-testid": testId,
68
82
  ref: layoutRef,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "12.0.0",
3
+ "version": "12.0.1",
4
4
  "description": "The latest navigation system for Atlassian apps.",
5
5
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
6
6
  "license": "Apache-2.0",
@@ -63,7 +63,7 @@
63
63
  "@atlaskit/button": "^25.8.0",
64
64
  "@atlaskit/css": "^1.1.0",
65
65
  "@atlaskit/ds-lib": "^9.0.0",
66
- "@atlaskit/icon": "^38.1.0",
66
+ "@atlaskit/icon": "^38.2.0",
67
67
  "@atlaskit/layering": "^6.1.0",
68
68
  "@atlaskit/logo": "^23.3.0",
69
69
  "@atlaskit/motion": "^10.0.0",
@@ -101,13 +101,13 @@
101
101
  "@atlaskit/flag": "^19.0.0",
102
102
  "@atlaskit/form": "^18.3.0",
103
103
  "@atlaskit/heading": "^8.0.0",
104
- "@atlaskit/icon-lab": "^7.12.0",
104
+ "@atlaskit/icon-lab": "^7.13.0",
105
105
  "@atlaskit/image": "^5.2.0",
106
106
  "@atlaskit/inline-dialog": "^20.3.0",
107
107
  "@atlaskit/link": "^5.1.0",
108
108
  "@atlaskit/lozenge": "^17.0.0",
109
109
  "@atlaskit/menu": "^11.0.0",
110
- "@atlaskit/modal-dialog": "^17.2.0",
110
+ "@atlaskit/modal-dialog": "^17.3.0",
111
111
  "@atlaskit/onboarding": "^15.4.0",
112
112
  "@atlaskit/page-header": "^13.3.0",
113
113
  "@atlaskit/page-layout": "^5.5.0",
@@ -126,7 +126,7 @@
126
126
  "@atlaskit/textfield": "^11.0.0",
127
127
  "@atlassian/feature-flags-test-utils": "^2.0.0",
128
128
  "@atlassian/gemini": "^1.55.0",
129
- "@atlassian/panel-system": "^2.3.0",
129
+ "@atlassian/panel-system": "^2.4.0",
130
130
  "@atlassian/react-async": "^0.23.0",
131
131
  "@atlassian/react-entrypoint": "^1.1.0",
132
132
  "@atlassian/relay-test-utils": "workspace:^",