@wix/origami-system-components 1.10.6 → 1.10.7
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 +22 -1
- package/dist/layout/Page.css +11 -0
- package/dist/layout/Page.d.ts +8 -1
- package/dist/layout/Page.js +3 -2
- package/dist/layout/PinnedToScreen.css +24 -0
- package/dist/layout/PinnedToScreen.css.d.ts +1 -0
- package/dist/layout/PinnedToScreen.d.ts +17 -0
- package/dist/layout/PinnedToScreen.js +16 -0
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -142,7 +142,28 @@ props are forwarded. `backgroundLayer` is an optional array of React nodes; `hea
|
|
|
142
142
|
Header-producing element and one Footer-producing element in their named slots,
|
|
143
143
|
and Section-producing children in authored order. Shared definitions are supported.
|
|
144
144
|
Page does not inspect component types or validate cardinality. Arrays require
|
|
145
|
-
caller-supplied stable keys. Additional slots
|
|
145
|
+
caller-supplied stable keys. Additional slots are out of scope.
|
|
146
|
+
|
|
147
|
+
### Pinned to screen
|
|
148
|
+
|
|
149
|
+
A page child pinned to the screen (`FixedItemLayout`) is rendered in one of two ways.
|
|
150
|
+
A pinned Section, header or footer stays in its slot, wrapped in
|
|
151
|
+
`@wix/origami-system-components/layout/PinnedToScreen`
|
|
152
|
+
(`header={<PinnedToScreen><SharedHeader /></PinnedToScreen>}`, or among the
|
|
153
|
+
children). The wrapper takes exactly one child and no props, and goes outside the
|
|
154
|
+
child's `<interact-element>`. Every other pinned page child (buttons, boxes, widgets)
|
|
155
|
+
goes in Page's `viewportLayer` array, in its saved relative order. The layer renders
|
|
156
|
+
after the footer, only when the array is non-empty.
|
|
157
|
+
|
|
158
|
+
Both are fixed, screen-covering one-cell grids with `pointer-events: none`. The child
|
|
159
|
+
docks with its own `align-self`, `justify-self`, margins and size. Both give their
|
|
160
|
+
direct children `grid-area: 1 / 1` and `pointer-events: auto` at zero specificity, so
|
|
161
|
+
a child's own values still win. A child's `<interact-element>` and a comp's
|
|
162
|
+
`.wix-presets-wrapper` are `display: contents`, so the element inside them (either or
|
|
163
|
+
both) gets the rule instead. The z-index depends only on the slot:
|
|
164
|
+
header wrapper and viewport layer 52, footer wrapper 49, Section wrappers `auto`. Content z-indexes
|
|
165
|
+
must stay at 51 or below. Only direct page children can be pinned, on every breakpoint
|
|
166
|
+
or on none.
|
|
146
167
|
|
|
147
168
|
During the DM transition, `structure.jsx` also accepts Header, Footer, and Background
|
|
148
169
|
elements as Page children. The site's JSX compatibility pass moves these into
|
package/dist/layout/Page.css
CHANGED
|
@@ -21,3 +21,14 @@
|
|
|
21
21
|
.origami-page__background > * {
|
|
22
22
|
grid-area: 1 / 1 / 2 / 2;
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
/* Pinned Sections stack with the page content; a pinned footer stays below a pinned
|
|
26
|
+
header (52) and the viewport layer (52, later in the DOM), as on live sites.
|
|
27
|
+
Custom properties inherit through main's `display: contents`. */
|
|
28
|
+
.origami-page__main {
|
|
29
|
+
--pin-z-index: auto;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.origami-page__main ~ .origami-pinned-to-screen {
|
|
33
|
+
--pin-z-index: 49;
|
|
34
|
+
}
|
package/dist/layout/Page.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import './PinnedToScreen.css';
|
|
2
3
|
import './Page.css';
|
|
3
4
|
export interface PageProps {
|
|
4
5
|
id: string;
|
|
@@ -11,6 +12,12 @@ export interface PageProps {
|
|
|
11
12
|
footer?: ReactNode;
|
|
12
13
|
/** Section-producing elements. The site build routes legacy DM landmark/background children to slots. */
|
|
13
14
|
children?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Page children pinned to the screen other than Sections, header and footer, in
|
|
17
|
+
* their saved relative order. They share one screen-covering layer after the
|
|
18
|
+
* footer, rendered only when non-empty. Supply stable keys for array entries.
|
|
19
|
+
*/
|
|
20
|
+
viewportLayer?: Array<ReactNode> | undefined;
|
|
14
21
|
/** The DM page data the converter writes on the Page. Accepted, not rendered. */
|
|
15
22
|
data?: any;
|
|
16
23
|
}
|
|
@@ -19,5 +26,5 @@ export interface PageProps {
|
|
|
19
26
|
* supplied nodes are rendered without component-type or cardinality validation.
|
|
20
27
|
* Authored CSS owns foreground layout and positioning. Main has no layout box.
|
|
21
28
|
*/
|
|
22
|
-
export declare function Page({ id, className, backgroundLayer, header, footer, children }: PageProps): import("react").JSX.Element;
|
|
29
|
+
export declare function Page({ id, className, backgroundLayer, header, footer, children, viewportLayer }: PageProps): import("react").JSX.Element;
|
|
23
30
|
export default Page;
|
package/dist/layout/Page.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import './PinnedToScreen.css';
|
|
3
4
|
import './Page.css';
|
|
4
5
|
/**
|
|
5
6
|
* Experimental page composition. Slot semantics are the caller's responsibility;
|
|
6
7
|
* supplied nodes are rendered without component-type or cardinality validation.
|
|
7
8
|
* Authored CSS owns foreground layout and positioning. Main has no layout box.
|
|
8
9
|
*/
|
|
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] }));
|
|
10
|
+
export function Page({ id, className, backgroundLayer, header, footer, children, viewportLayer }) {
|
|
11
|
+
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, viewportLayer?.length ? _jsx("div", { className: "origami-page__viewport-layer", children: viewportLayer }) : null] }));
|
|
11
12
|
}
|
|
12
13
|
export default Page;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* Shared by each pinned wrapper and the Page's viewportLayer. The z-index depends
|
|
2
|
+
only on where the Page renders the wrapper (see Page.css). */
|
|
3
|
+
.origami-pinned-to-screen,
|
|
4
|
+
.origami-page__viewport-layer {
|
|
5
|
+
position: fixed;
|
|
6
|
+
inset: 0;
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template: 1fr / 1fr;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
z-index: var(--pin-z-index, 52);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Each child sits in the one cell, so several children overlap instead of stacking
|
|
14
|
+
in implicit rows, and turns clicks back on. Zero specificity, so a child's own
|
|
15
|
+
grid-area and pointer-events win, and direct children only, so intentional `none`
|
|
16
|
+
deeper in a component is kept. A child's interactions boundary and a comp's presets
|
|
17
|
+
wrapper are `display: contents`, so the element inside them is the grid item and gets
|
|
18
|
+
the same rule. */
|
|
19
|
+
:where(.origami-pinned-to-screen, .origami-page__viewport-layer) > *,
|
|
20
|
+
:where(.origami-pinned-to-screen, .origami-page__viewport-layer) > :where(interact-element, .wix-presets-wrapper) > *,
|
|
21
|
+
:where(.origami-pinned-to-screen, .origami-page__viewport-layer) > :where(interact-element) > :where(.wix-presets-wrapper) > * {
|
|
22
|
+
grid-area: 1 / 1;
|
|
23
|
+
pointer-events: auto;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import './PinnedToScreen.css';
|
|
3
|
+
export interface PinnedToScreenProps {
|
|
4
|
+
/** Exactly one pinned Section, Header or Footer instance. */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Experimental screen-pinned wrapper for a page's Section, header or footer, rendered
|
|
9
|
+
* in place in its Page slot. It always covers the screen and lets clicks through;
|
|
10
|
+
* the child gets clicks back from PinnedToScreen.css and docks itself in the single
|
|
11
|
+
* grid cell with its own alignment, margins and size. The stacking order comes from the
|
|
12
|
+
* slot (see Page.css).
|
|
13
|
+
* Wrap outside the child's interactions boundary, so an entrance transform cannot
|
|
14
|
+
* become the fixed element's containing block. Other pinned comps go in Page's viewportLayer.
|
|
15
|
+
*/
|
|
16
|
+
export declare function PinnedToScreen({ children }: PinnedToScreenProps): import("react").JSX.Element;
|
|
17
|
+
export default PinnedToScreen;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import './PinnedToScreen.css';
|
|
4
|
+
/**
|
|
5
|
+
* Experimental screen-pinned wrapper for a page's Section, header or footer, rendered
|
|
6
|
+
* in place in its Page slot. It always covers the screen and lets clicks through;
|
|
7
|
+
* the child gets clicks back from PinnedToScreen.css and docks itself in the single
|
|
8
|
+
* grid cell with its own alignment, margins and size. The stacking order comes from the
|
|
9
|
+
* slot (see Page.css).
|
|
10
|
+
* Wrap outside the child's interactions boundary, so an entrance transform cannot
|
|
11
|
+
* become the fixed element's containing block. Other pinned comps go in Page's viewportLayer.
|
|
12
|
+
*/
|
|
13
|
+
export function PinnedToScreen({ children }) {
|
|
14
|
+
return _jsx("div", { className: "origami-pinned-to-screen", children: children });
|
|
15
|
+
}
|
|
16
|
+
export default PinnedToScreen;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/origami-system-components",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.7",
|
|
4
4
|
"description": "Editor structural and system components for standalone Origami sites",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -120,6 +120,10 @@
|
|
|
120
120
|
"./layout/Footer": {
|
|
121
121
|
"types": "./dist/layout/Footer.d.ts",
|
|
122
122
|
"default": "./dist/layout/Footer.js"
|
|
123
|
+
},
|
|
124
|
+
"./layout/PinnedToScreen": {
|
|
125
|
+
"types": "./dist/layout/PinnedToScreen.d.ts",
|
|
126
|
+
"default": "./dist/layout/PinnedToScreen.js"
|
|
123
127
|
}
|
|
124
128
|
},
|
|
125
129
|
"type": "module",
|
|
@@ -128,5 +132,5 @@
|
|
|
128
132
|
"@wix/builder-state": "^1.49.3",
|
|
129
133
|
"@wix/editor-components": "^1.16.0"
|
|
130
134
|
},
|
|
131
|
-
"falconPackageHash": "
|
|
135
|
+
"falconPackageHash": "48530f45cf02030c472beb10f31a0861ee155004ae5753a20b0a2a8a"
|
|
132
136
|
}
|