@wix/origami-system-components 1.10.1 → 1.10.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/README.md CHANGED
@@ -114,6 +114,84 @@ Standard artifact configuration publishes the built package; local builds and pa
114
114
 
115
115
  ## Layout contract
116
116
 
117
+ ### Experimental Page
118
+
119
+ `@wix/origami-system-components/layout/Page` provides named/default `Page` exports
120
+ and `PageProps`. The root index and `./Page` continue to expose the legacy Page.
121
+ Newly exported sites import `layout/Page`, like the layout section components.
122
+ The site generator accepts both the legacy and layout Page imports when reading sites
123
+ back into Origami.
124
+
125
+ ```tsx
126
+ import Page from '@wix/origami-system-components/layout/Page'
127
+ import Section from '@wix/origami-system-components/layout/Section'
128
+
129
+ <Page id="page" className="authored-page"
130
+ backgroundLayer={[<div key="color" className="page-color" />]}
131
+ header={<SharedHeader id="header-instance" className="header-instance" />}
132
+ footer={<SharedFooter id="footer-instance" className="footer-instance" />}>
133
+ <Section id="first">{/* InternalContainer and content */}</Section>
134
+ <Section id="second">{/* InternalContainer and content */}</Section>
135
+ </Page>
136
+ ```
137
+
138
+ The required `id` and optional `className` belong to the outer div. Page adds its
139
+ structural `origami-page` class, without deriving a class from the ID. Only supported
140
+ props are forwarded. `backgroundLayer` is an optional array of React nodes; `header`,
141
+ `footer`, and `children` are optional React nodes. Callers supply at most one
142
+ Header-producing element and one Footer-producing element in their named slots,
143
+ and Section-producing children in authored order. Shared definitions are supported.
144
+ Page does not inspect component types or validate cardinality. Arrays require
145
+ caller-supplied stable keys. Additional slots and page-pinned content are out of scope.
146
+
147
+ During the DM transition, `structure.jsx` also accepts Header, Footer, and Background
148
+ elements as Page children. The site's JSX compatibility pass moves these into
149
+ `header`, `footer`, and `backgroundLayer` at build time, including shared
150
+ `Header_<id>` / `Footer_<id>` imports and backgrounds inside literal fragments.
151
+ Sections retain their authored order. Props and legacy children can be mixed;
152
+ an explicit slot prop (including `null`) replaces children for that slot.
153
+ This uses import bindings rather than runtime component names and leaves the
154
+ authored structure unchanged for round trips. Outside the site's build pipeline,
155
+ pass the slot props directly.
156
+
157
+ Rendering order is background wrapper, header, one main containing children, footer.
158
+ Absent header/footer add no wrappers; the background and main remain when empty.
159
+ Header/Footer preserve their identities and remain direct Page children. Sections
160
+ are main's descendants, not necessarily its children: a Section with interactions
161
+ renders inside an `<interact-element>` boundary, which the interactions service styles
162
+ `display: contents`, so the section remains a page layout item. Target sections by their ID or class rather than with
163
+ `main > .section`, and account for main and the boundary in parent traversal.
164
+ A route shell must not add a second main landmark. Skip links can target Section IDs (sections have `tabIndex=-1`).
165
+
166
+ Page imports its own scoped CSS, retained through package imports in Vite dev and
167
+ production. The relative root contains an absolute inset background with background-only
168
+ clipping. Background children overlap in one grid cell; main uses `display: contents`.
169
+ Authored CSS owns foreground grid layout, sizing, overflow, and sticky/fixed placement
170
+ and z-index on Header/Footer instances. It must keep foreground content above the
171
+ positioned background for the chosen layout. Page adds no stacking context, negative
172
+ z-index, or foreground clipping.
173
+
174
+ The authored browser fixture is in `test/fixtures/page`. After building, run
175
+ `pnpm --filter @wix/origami-system-components exec vite test/fixtures/page`.
176
+ The default fixture exercises two background layers, transparent sections, a shared
177
+ sticky header/footer, skip links, pointer interaction, and foreground overflow.
178
+ Use `?fixed` for fixed landmarks, `?bare` for omitted landmarks, and `?empty` for
179
+ omitted landmarks/children and an empty background array. Check desktop and mobile
180
+ widths, scroll positioning, one exposed main, section focus targets, and console warnings.
181
+
182
+ Validated in headless Chromium at 1280×800 and 390×800 (2026-10-22), for all four
183
+ fixture variants: background bounds equal Page bounds, background nodes overlap,
184
+ sections occupy consecutive rows without a background row, pointer clicks reach the
185
+ button, and skip-link activation focuses the first section. Sticky and fixed landmarks
186
+ remain at the viewport edges after scrolling. Chromium's accessibility tree exposes
187
+ one main even for empty content (the empty Page itself has zero height). No duplicate
188
+ IDs, React key warnings, or browser errors were observed. Screenshots confirm background
189
+ clipping and visible foreground overflow. This covers the authored fixture shell;
190
+ integration with generated route shells and other browser/accessibility combinations
191
+ still requires verification during migration.
192
+
193
+ ### InternalContainer
194
+
117
195
  ```tsx
118
196
  import InternalContainer from '@wix/origami-system-components/InternalContainer'
119
197
 
@@ -1,4 +1,4 @@
1
- /* ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_0716afec0a7d9e420f90135a7ccbacac/node_modules/@wix/editor-system-components/dist/site/components/InternalContainer/css.css */
1
+ /* ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_83b0c9fab67fcdbd3af97b6b9e87786a/node_modules/@wix/editor-system-components/dist/site/components/InternalContainer/css.css */
2
2
  .internalContainerRoot__MJnN1 {
3
3
  position: relative;
4
4
  width: 100%;
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
 
3
- // ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_0716afec0a7d9e420f90135a7ccbacac/node_modules/@wix/editor-system-components/dist/site/components/InternalContainer/component.js
3
+ // ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_83b0c9fab67fcdbd3af97b6b9e87786a/node_modules/@wix/editor-system-components/dist/site/components/InternalContainer/component.js
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import React__default, { useCallback } from "react";
6
6
 
7
- // ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_0716afec0a7d9e420f90135a7ccbacac/node_modules/@wix/editor-system-components/dist/site/components/chunks/clsx.js
7
+ // ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_83b0c9fab67fcdbd3af97b6b9e87786a/node_modules/@wix/editor-system-components/dist/site/components/chunks/clsx.js
8
8
  function r(e) {
9
9
  var t, f, n = "";
10
10
  if ("string" == typeof e || "number" == typeof e) n += e;
@@ -17,7 +17,7 @@ function clsx() {
17
17
  return n;
18
18
  }
19
19
 
20
- // ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_0716afec0a7d9e420f90135a7ccbacac/node_modules/@wix/editor-system-components/dist/site/components/chunks/constants.js
20
+ // ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_83b0c9fab67fcdbd3af97b6b9e87786a/node_modules/@wix/editor-system-components/dist/site/components/chunks/constants.js
21
21
  var TestIds = {
22
22
  overflow: "internal-container-overflow",
23
23
  content: "internal-container-content",
@@ -27,7 +27,7 @@ var TestIds = {
27
27
  };
28
28
  var INTERNAL_CONTAINER_ROOT_CLASS = "container";
29
29
 
30
- // ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_0716afec0a7d9e420f90135a7ccbacac/node_modules/@wix/editor-system-components/dist/site/components/InternalContainer/component.js
30
+ // ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_83b0c9fab67fcdbd3af97b6b9e87786a/node_modules/@wix/editor-system-components/dist/site/components/InternalContainer/component.js
31
31
  var internalContainerRoot = "internalContainerRoot__MJnN1";
32
32
  var backgroundLayer = "backgroundLayer__ZDd0Q";
33
33
  var pinnedLayer = "pinnedLayer__i0Pg8";
@@ -125,7 +125,7 @@ function component(props) {
125
125
  return /* @__PURE__ */ jsx(InternalContainer$1, { ...props });
126
126
  }
127
127
 
128
- // ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_0716afec0a7d9e420f90135a7ccbacac/node_modules/@wix/editor-system-components/dist/site/components/InternalContainer/index.js
128
+ // ../../node_modules/.pnpm/@wix+editor-system-components@1.1590.0_83b0c9fab67fcdbd3af97b6b9e87786a/node_modules/@wix/editor-system-components/dist/site/components/InternalContainer/index.js
129
129
  var InternalContainer_default = component;
130
130
  export {
131
131
  component as InternalContainer,
@@ -5,5 +5,5 @@ export type FooterSectionProps = SectionProps;
5
5
  * as the generic Section with the definition's ID and class. The `<footer>`
6
6
  * landmark and the page's instance identity belong to the enclosing Footer.
7
7
  */
8
- export declare function FooterSection({ id, className, children }: FooterSectionProps): import("react").JSX.Element;
8
+ export declare function FooterSection({ id, className, children, wix }: FooterSectionProps): import("react").JSX.Element;
9
9
  export default FooterSection;
@@ -6,7 +6,7 @@ import Section from './Section.js';
6
6
  * as the generic Section with the definition's ID and class. The `<footer>`
7
7
  * landmark and the page's instance identity belong to the enclosing Footer.
8
8
  */
9
- export function FooterSection({ id, className, children }) {
10
- return (_jsx(Section, { id: id, className: className, children: children }));
9
+ export function FooterSection({ id, className, children, wix }) {
10
+ return (_jsx(Section, { id: id, className: className, wix: wix, children: children }));
11
11
  }
12
12
  export default FooterSection;
@@ -6,5 +6,5 @@ export type HeaderSectionProps = SectionProps;
6
6
  * landmark and the page's instance identity belong to the enclosing Header.
7
7
  * Legacy scroll effects are not implemented here.
8
8
  */
9
- export declare function HeaderSection({ id, className, children }: HeaderSectionProps): import("react").JSX.Element;
9
+ export declare function HeaderSection({ id, className, children, wix }: HeaderSectionProps): import("react").JSX.Element;
10
10
  export default HeaderSection;
@@ -7,7 +7,7 @@ import Section from './Section.js';
7
7
  * landmark and the page's instance identity belong to the enclosing Header.
8
8
  * Legacy scroll effects are not implemented here.
9
9
  */
10
- export function HeaderSection({ id, className, children }) {
11
- return (_jsx(Section, { id: id, className: className, children: children }));
10
+ export function HeaderSection({ id, className, children, wix }) {
11
+ return (_jsx(Section, { id: id, className: className, wix: wix, children: children }));
12
12
  }
13
13
  export default HeaderSection;
@@ -0,0 +1,23 @@
1
+ .origami-page {
2
+ position: relative;
3
+ }
4
+
5
+ .origami-page__main {
6
+ display: contents;
7
+ }
8
+
9
+ .origami-page__background {
10
+ position: absolute;
11
+ top: 0;
12
+ left: 0;
13
+ right: 0;
14
+ bottom: 0;
15
+ display: grid;
16
+ grid-template-columns: 1fr;
17
+ grid-template-rows: 1fr;
18
+ overflow: clip;
19
+ }
20
+
21
+ .origami-page__background > * {
22
+ grid-area: 1 / 1 / 2 / 2;
23
+ }
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,21 @@
1
+ import type { ReactNode } from 'react';
2
+ import './Page.css';
3
+ export interface PageProps {
4
+ id: string;
5
+ className?: string | undefined;
6
+ /** Background nodes overlap in one cell. Supply stable keys for array entries. */
7
+ backgroundLayer?: Array<ReactNode> | undefined;
8
+ /** At most one Header-producing element, including a shared definition. */
9
+ header?: ReactNode;
10
+ /** At most one Footer-producing element, including a shared definition. */
11
+ footer?: ReactNode;
12
+ /** Section-producing elements. The site build routes legacy DM landmark/background children to slots. */
13
+ children?: ReactNode;
14
+ }
15
+ /**
16
+ * Experimental page composition. Slot semantics are the caller's responsibility;
17
+ * supplied nodes are rendered without component-type or cardinality validation.
18
+ * Authored CSS owns foreground layout and positioning. Main has no layout box.
19
+ */
20
+ export declare function Page({ id, className, backgroundLayer, header, footer, children }: PageProps): import("react").JSX.Element;
21
+ export default Page;
@@ -0,0 +1,12 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import './Page.css';
4
+ /**
5
+ * Experimental page composition. Slot semantics are the caller's responsibility;
6
+ * supplied nodes are rendered without component-type or cardinality validation.
7
+ * Authored CSS owns foreground layout and positioning. Main has no layout box.
8
+ */
9
+ export function Page({ id, className, backgroundLayer, header, footer, children }) {
10
+ return (_jsxs("div", { id: id, className: ['origami-page', className].filter(Boolean).join(' '), children: [_jsx("div", { className: "origami-page__background", children: backgroundLayer }), header, _jsx("main", { className: "origami-page__main", children: children }), footer] }));
11
+ }
12
+ export default Page;
@@ -3,10 +3,9 @@ export interface SectionProps {
3
3
  id: string;
4
4
  className?: string | undefined;
5
5
  children?: ReactNode;
6
+ wix?: {
7
+ compPath?: string | undefined;
8
+ } | undefined;
6
9
  }
7
- /**
8
- * Experimental plain Section. The authored InternalContainer child owns its
9
- * background and content layers; this component does not create another container.
10
- */
11
- export declare function Section({ id, className, children }: SectionProps): import("react").JSX.Element;
10
+ export declare function Section(props: SectionProps): import("react").JSX.Element;
12
11
  export default Section;
@@ -1,10 +1,15 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { withInteractions } from '@wix/origami-runtime';
3
4
  /**
4
5
  * Experimental plain Section. The authored InternalContainer child owns its
5
6
  * background and content layers; this component does not create another container.
6
7
  */
7
- export function Section({ id, className, children }) {
8
+ function BaseSection({ id, className, children }) {
8
9
  return (_jsx("section", { id: id, className: className, tabIndex: -1, children: children }));
9
10
  }
11
+ const InteractiveSection = withInteractions(BaseSection);
12
+ export function Section(props) {
13
+ return _jsx(InteractiveSection, { ...props });
14
+ }
10
15
  export default Section;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/origami-system-components",
3
- "version": "1.10.1",
3
+ "version": "1.10.3",
4
4
  "description": "Editor structural and system components for standalone Origami sites",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -19,14 +19,20 @@
19
19
  "@testing-library/react": "^16.3.0",
20
20
  "@types/react": "^18.3.1",
21
21
  "@wix/editor-system-components": "^1.1573.0",
22
+ "@wix/origami-runtime": "0.19.1",
23
+ "@wix/services-manager": "^1.0.7",
24
+ "@wix/services-manager-react": "^1.0.8",
25
+ "@wix/site-service-interactions": "^1.0.28",
22
26
  "esbuild": "^0.28.1",
23
27
  "jsdom": "^23.0.1",
24
28
  "react": "^18.3.1",
29
+ "react-dom": "^18.3.1",
25
30
  "typescript": "^6.0.3",
26
31
  "vite": "^6.4.3",
27
32
  "vitest": "^4.1.11"
28
33
  },
29
34
  "peerDependencies": {
35
+ "@wix/origami-runtime": "workspace:^",
30
36
  "react": "^18.3.1"
31
37
  },
32
38
  "publishUnscoped": false,
@@ -91,6 +97,10 @@
91
97
  "types": "./dist/layout/layout-contract.d.ts",
92
98
  "default": "./dist/layout/layout-contract.js"
93
99
  },
100
+ "./layout/Page": {
101
+ "types": "./dist/layout/Page.d.ts",
102
+ "default": "./dist/layout/Page.js"
103
+ },
94
104
  "./layout/Section": {
95
105
  "types": "./dist/layout/Section.d.ts",
96
106
  "default": "./dist/layout/Section.js"
@@ -118,5 +128,5 @@
118
128
  "@wix/builder-state": "^1.49.3",
119
129
  "@wix/editor-components": "^1.16.0"
120
130
  },
121
- "falconPackageHash": "f2d02ba186dfcd328aa5fa4a362b9a489e356163d1f3ae114a5a46d5"
131
+ "falconPackageHash": "43d80f18e678499c69ff4a8fe53954bac70cae1c07cc1bdac956be7f"
122
132
  }