@akinon/pz-theme 2.0.122-beta.0 → 2.0.122

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,12 +1,12 @@
1
1
  # @akinon/pz-theme
2
2
 
3
- ## 2.0.122-beta.0
3
+ ## 2.0.122
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [cbbbfd757]
8
- - @akinon/next@2.0.122-beta.0
9
- - @akinon/theme-contract@2.0.122-beta.0
7
+ - 96129c1: ZERO-5109: A section no longer seals in the layers it raises. Its content box carried a z-index so the canvas could put the selection outline under it and the action toolbar over it, and that opened a stacking context on live pages too: a header section's open mega menu was ordered inside the box rather than against the page, so a product page's sticky bar painted straight over it. The box keeps that layer only while the editor is attached. Two consequences worth knowing, both needing merchant-authored CSS inside such a section: a negative z-index now sits behind the section's own background, and a section scrim written as a pseudo-element with a positive z-index now covers the content instead of sitting under it.
8
+ - @akinon/next@2.0.122
9
+ - @akinon/theme-contract@2.0.122
10
10
 
11
11
  ## 2.0.121
12
12
 
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@akinon/pz-theme",
3
3
  "description": "Theme package for Project Zero Next — ThemePlaceholder system and theme editor infrastructure",
4
- "version": "2.0.122-beta.0",
4
+ "version": "2.0.122",
5
5
  "license": "MIT",
6
6
  "main": "src/index.ts",
7
7
  "scripts": {
8
8
  "test": "jest"
9
9
  },
10
10
  "peerDependencies": {
11
- "@akinon/next": "2.0.122-beta.0",
11
+ "@akinon/next": "2.0.122",
12
12
  "react": "^18.0.0 || ^19.0.0",
13
13
  "react-dom": "^18.0.0 || ^19.0.0"
14
14
  },
15
15
  "dependencies": {
16
- "@akinon/theme-contract": "2.0.122-beta.0",
16
+ "@akinon/theme-contract": "2.0.122",
17
17
  "clsx": "2.1.1",
18
18
  "lottie-web": "^5.13.0",
19
19
  "react-multi-carousel": "2.8.4",
@@ -21,7 +21,7 @@
21
21
  "zod": "4.4.1"
22
22
  },
23
23
  "devDependencies": {
24
- "@akinon/next": "2.0.122-beta.0",
24
+ "@akinon/next": "2.0.122",
25
25
  "@testing-library/jest-dom": "5.16.4",
26
26
  "@testing-library/react": "16.3.2",
27
27
  "@testing-library/user-event": "14.1.1",
@@ -0,0 +1,61 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+
4
+ import SectionWrapper from '../section-wrapper';
5
+ import { SECTION_CONTENT_ATTRIBUTE } from '../../utils/section-content-width';
6
+ import type { Section } from '../../theme-section';
7
+
8
+ /**
9
+ * A section must not seal in the layers it raises.
10
+ *
11
+ * The content box carried `z-10` so it would sit between the canvas's
12
+ * selection outline (z-0) and its action toolbar (z-20). Both are the editor's
13
+ * and neither exists on a live page — but a z-index on a positioned box opens
14
+ * a stacking context wherever it renders, so a header section's mega menu
15
+ * panel (z-40) was ordered inside that box rather than against the page, and
16
+ * the product page's add-to-basket bar painted over an open menu. The number
17
+ * now belongs to the canvas alone.
18
+ */
19
+ const section = (): Section =>
20
+ ({
21
+ id: 's1',
22
+ type: 'custom:zsazsazsu:header',
23
+ label: 'Header',
24
+ properties: {},
25
+ styles: {},
26
+ order: 0,
27
+ hidden: false,
28
+ blocks: []
29
+ } as unknown as Section);
30
+
31
+ const contentBox = (container: HTMLElement) =>
32
+ container.querySelector(`[${SECTION_CONTENT_ATTRIBUTE}]`) as HTMLElement;
33
+
34
+ const renderSection = (isDesigner: boolean) =>
35
+ render(
36
+ <SectionWrapper section={section()} placeholderId="ph" isDesigner={isDesigner}>
37
+ <span>section content</span>
38
+ </SectionWrapper>
39
+ );
40
+
41
+ describe('the section content box', () => {
42
+ it('claims no layer on the storefront', () => {
43
+ const { container } = renderSection(false);
44
+ const box = contentBox(container);
45
+
46
+ expect(box.className).toContain('relative');
47
+ expect(box.className).not.toContain('z-10');
48
+ });
49
+
50
+ it('keeps the canvas layering while the editor is attached', () => {
51
+ const { container } = renderSection(true);
52
+
53
+ expect(contentBox(container).className).toContain('z-10');
54
+ });
55
+
56
+ it('still renders what the section put in it', () => {
57
+ const { container } = renderSection(false);
58
+
59
+ expect(contentBox(container).textContent).toBe('section content');
60
+ });
61
+ });
@@ -682,9 +682,9 @@ const PostsSliderSection: React.FC<PostsSliderSectionProps> = ({
682
682
  /**
683
683
  * Lift the section over a sticky header for as long as the panel is up.
684
684
  *
685
- * The band below is `relative z-10`, and so is `[data-section-content]`
685
+ * The band below is `relative z-10`, which is a stacking context of its own
686
686
  * that `SectionWrapper` renders around it — so the panel's own
687
- * `z-index: 1000` resolves INSIDE two nested stacking contexts and the
687
+ * `z-index: 1000` resolves INSIDE it and the
688
688
  * section still competes with the page at 10, losing to a sticky header at
689
689
  * 40. The element that has to move is the outermost of the two, which this
690
690
  * component does not render; reaching for it is the honest cost of not
@@ -170,8 +170,22 @@ export default function SectionWrapper({
170
170
  * switch — only the attribute the content-width rule is written against.
171
171
  * A section that renders through its own component also keeps its own
172
172
  * `display`: this box has always been the thing that carried it.
173
+ *
174
+ * THE LAYER IS THE CANVAS'S, NOT THE STOREFRONT'S. `z-10` puts the
175
+ * content between the selection outline (z-0) and the action toolbar
176
+ * (z-20), both of which exist only while the editor is attached. On a
177
+ * live page it drew nothing and cost everything: a z-index on a
178
+ * positioned box opens a stacking context, so every layer a section
179
+ * raised — the mega menu's panel at 40, a quick view, a drawer — was
180
+ * sealed inside it and the page's own furniture painted straight over
181
+ * the menu. Without the number the box is still positioned, still the
182
+ * content-width target, and still above the outline, which comes before
183
+ * it in the markup.
173
184
  */}
174
- <div {...{ [SECTION_CONTENT_ATTRIBUTE]: '' }} className="relative z-10">
185
+ <div
186
+ {...{ [SECTION_CONTENT_ATTRIBUTE]: '' }}
187
+ className={isDesigner ? 'relative z-10' : 'relative'}
188
+ >
175
189
  {children}
176
190
  </div>
177
191
  </section>