@wix/origami-system-components 0.0.0-stage → 1.10.2
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 +215 -2
- package/dist/Anchor.d.ts +12 -0
- package/dist/Anchor.js +6 -0
- package/dist/FooterSection.d.ts +10 -0
- package/dist/FooterSection.js +7 -0
- package/dist/HeaderSection.d.ts +11 -0
- package/dist/HeaderSection.js +8 -0
- package/dist/InternalContainer.css +88 -0
- package/dist/InternalContainer.css.d.ts +1 -0
- package/dist/Page.d.ts +10 -0
- package/dist/Page.js +7 -0
- package/dist/Section.d.ts +11 -0
- package/dist/Section.js +8 -0
- package/dist/UnsupportedWidgetPlaceholder.css +56 -0
- package/dist/UnsupportedWidgetPlaceholder.d.ts +12 -0
- package/dist/UnsupportedWidgetPlaceholder.js +15 -0
- package/dist/hocs.js +22 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/layout/BaseInternalContainer.d.ts +21 -0
- package/dist/layout/BaseInternalContainer.js +133 -0
- package/dist/layout/Footer.d.ts +15 -0
- package/dist/layout/Footer.js +13 -0
- package/dist/layout/FooterSection.d.ts +9 -0
- package/dist/layout/FooterSection.js +12 -0
- package/dist/layout/Header.d.ts +15 -0
- package/dist/layout/Header.js +13 -0
- package/dist/layout/HeaderSection.d.ts +10 -0
- package/dist/layout/HeaderSection.js +13 -0
- package/dist/layout/InternalContainer.d.ts +15 -0
- package/dist/layout/InternalContainer.js +21 -0
- package/dist/layout/Page.css +23 -0
- package/dist/layout/Page.css.d.ts +1 -0
- package/dist/layout/Page.d.ts +21 -0
- package/dist/layout/Page.js +12 -0
- package/dist/layout/Section.d.ts +12 -0
- package/dist/layout/Section.js +10 -0
- package/dist/layout/container-contract.d.ts +5 -0
- package/dist/layout/container-contract.js +10 -0
- package/dist/layout/layout-constants.d.ts +5 -0
- package/dist/layout/layout-constants.js +7 -0
- package/dist/layout/layout-contract.d.ts +2 -0
- package/dist/layout/layout-contract.js +3 -0
- package/dist/site.global.css +5 -0
- package/package.json +124 -3
package/README.md
CHANGED
|
@@ -1,3 +1,216 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Origami system components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Structural editor components for standalone Origami sites. Direct component entries
|
|
4
|
+
have named and default exports; the root index has named exports only.
|
|
5
|
+
|
|
6
|
+
| Component | Upstream source | Wrapping |
|
|
7
|
+
| --- | --- | --- |
|
|
8
|
+
| InternalContainer | `@wix/editor-system-components/InternalContainer` | Fixed wrapper layers, derived classes, supported props |
|
|
9
|
+
| Page | `@wix/editor-components/skin/Page/ResponsivePageWithColorBG` | `withNormalChildren` |
|
|
10
|
+
| Section | `@wix/editor-components/component/Section` | `withNormalChildren(withController(...))` |
|
|
11
|
+
| HeaderSection | `@wix/editor-components/component/HeaderSection` | `withNormalChildren(withController(...))` |
|
|
12
|
+
| FooterSection | `@wix/editor-components/component/FooterSection` | `withNormalChildren`, no controller |
|
|
13
|
+
| Anchor | `@wix/editor-components/component/Anchor` | None |
|
|
14
|
+
| UnsupportedWidgetPlaceholder | None (self-contained) | None |
|
|
15
|
+
|
|
16
|
+
UnsupportedWidgetPlaceholder stands in for vertical and non-builder widgets that have no
|
|
17
|
+
Origami rendering yet. It draws a dashed box and a message, "The {componentName} will be
|
|
18
|
+
rendered after importing the site back to {platformName}", that stays sticky in the
|
|
19
|
+
viewport while a tall placeholder scrolls. `message` replaces the whole text, and the
|
|
20
|
+
`--placeholder-sticky-top` custom property offsets it below a fixed header. It imports only
|
|
21
|
+
React and its own `UnsupportedWidgetPlaceholder.css`, which the build copies to `dist`.
|
|
22
|
+
|
|
23
|
+
There is one Page skin, no `Page_*` exports, and no Thunderbolt-generated components
|
|
24
|
+
(PageSections, PinnedLayer, ResponsiveContainer, PagesContainer, PageGroup,
|
|
25
|
+
HeaderContainer, FooterContainer, ResponsivePopupPage). Anchor supports future
|
|
26
|
+
`SCROLL_TO_TOP` / `SCROLL_TO_BOTTOM` work. Logic and HOCs come from wix-next's
|
|
27
|
+
system-core, without depending on that package; Page is renamed and defaults added.
|
|
28
|
+
The controller still passes empty services and accepts no services argument.
|
|
29
|
+
|
|
30
|
+
## Importing
|
|
31
|
+
|
|
32
|
+
For hand-written site code:
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { Page, Section } from '@wix/origami-system-components'
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The index excludes InternalContainer: use the adapted component from
|
|
39
|
+
`@wix/origami-system-components/InternalContainer`. Direct paths such as
|
|
40
|
+
`@wix/origami-system-components/Section` remain available for legacy exports.
|
|
41
|
+
New exports use `@wix/origami-system-components/layout/Section`,
|
|
42
|
+
`layout/HeaderSection` and `layout/FooterSection`. These plain React components
|
|
43
|
+
render a section around ordinary children, with the authored InternalContainer
|
|
44
|
+
owning the background and content layers. They do not include legacy controllers,
|
|
45
|
+
scroll effects or section CSS. Both import forms map back to document components
|
|
46
|
+
when importing a site.
|
|
47
|
+
|
|
48
|
+
`layout/Header` and `layout/Footer` are also public named/default exports. Exported
|
|
49
|
+
files containing `document.Header` or `document.Footer` resolve to these landmarks.
|
|
50
|
+
A shared `Header_<id>` / `Footer_<id>` definition may receive `({ id, className })`
|
|
51
|
+
and pass that identity to its landmark, wrapping exactly one matching
|
|
52
|
+
HeaderSection / FooterSection with its own InternalContainer. Lint recognizes
|
|
53
|
+
this shape and the renamed shared references. The generator does not introduce
|
|
54
|
+
landmarks into definitions that do not already contain them; server-side Editor
|
|
55
|
+
conversion of that structure remains a separate integration.
|
|
56
|
+
|
|
57
|
+
Vite production builds drop unused components while retaining used CSS
|
|
58
|
+
thanks to `"sideEffects": ["**/*.css"]`. There are no wildcard exports.
|
|
59
|
+
|
|
60
|
+
## Delivery
|
|
61
|
+
|
|
62
|
+
InternalContainer is bundled because its upstream has a Wix dependency tree.
|
|
63
|
+
`@wix/editor-system-components` stays a development dependency, absent from consumer
|
|
64
|
+
installs. The adapter imports `InternalContainer.css` itself so Vite preserves it
|
|
65
|
+
during pre-bundling. The upstream implementation is private.
|
|
66
|
+
|
|
67
|
+
The five structural entries compile with plain tsc (ES2022, classic React JSX) and
|
|
68
|
+
install `@wix/editor-components: ^1.16.0` at runtime. This public npm package is
|
|
69
|
+
pre-bundled per component with zero dependencies and React, React DOM, and lodash
|
|
70
|
+
peers. Only React is needed by these five; we add neither React DOM nor lodash.
|
|
71
|
+
Editor fixes—and behavior changes—can reach sites without a release here.
|
|
72
|
+
|
|
73
|
+
The deliberate CSS difference from system-core is importing real `dist/**/*.css`
|
|
74
|
+
files: Vite dev pre-bundling drops extensionless CSS imports. Each component imports
|
|
75
|
+
its own stylesheet; the five have no copied CSS or CSS exports. The internal
|
|
76
|
+
`hocs.js` helper uses extensionless `./hocs` imports, resolved by Vite.
|
|
77
|
+
|
|
78
|
+
Both builder-state packages remain external production dependencies: `useStateOverrides`
|
|
79
|
+
reads a module-level store that the whole site must share. React remains a peer.
|
|
80
|
+
The semantic CSS compiler depends directly on this package; only `dist`, metadata,
|
|
81
|
+
and this README are published. Hand-written structural declarations avoid unpublished
|
|
82
|
+
upstream types: containers accept normal React children and Anchor accepts none.
|
|
83
|
+
InternalContainer declarations are emitted from its adapted props.
|
|
84
|
+
|
|
85
|
+
## Build and tests
|
|
86
|
+
|
|
87
|
+
Run `pnpm --filter @wix/origami-system-components run build`, then
|
|
88
|
+
`pnpm --filter @wix/origami-system-components test`. Build before packing.
|
|
89
|
+
`build.mjs` clears dist, bundles InternalContainer/CSS, and copies declarations;
|
|
90
|
+
tsc emits the structural entries, index, helper, and layout implementation without
|
|
91
|
+
source maps, using the editor-components ambient shim. Only React imports may escape
|
|
92
|
+
InternalContainer's private bundle; tests check structural imports, exports, and standalone React-only types.
|
|
93
|
+
Packed consumers verify InternalContainer without upstream packages, Section CSS in
|
|
94
|
+
Vite dev through root/direct imports, production CSS, and index tree-shaking.
|
|
95
|
+
Package DOM and ID-validation tests and the generator's packed-site test cover integration.
|
|
96
|
+
|
|
97
|
+
## Adding a component
|
|
98
|
+
|
|
99
|
+
Add a client `.tsx` entry, named/default exports, a standalone declaration, explicit
|
|
100
|
+
package export, and packed-consumer coverage. For an upstream with dependencies,
|
|
101
|
+
bundle it as a development dependency, build/export CSS with a matching `.css.d.ts`,
|
|
102
|
+
and retain the leak check. For a self-contained upstream, install it as a production dependency,
|
|
103
|
+
include the source in `tsconfig.build.json`, and add its declaration to the copy list.
|
|
104
|
+
Preserve extensionless helper imports and use real `.css` imports. Structural imports
|
|
105
|
+
are limited to React, builder-state-react, editor component/controller/skin entries,
|
|
106
|
+
editor `dist/**/*.css`, and `./hocs`.
|
|
107
|
+
|
|
108
|
+
## Release order
|
|
109
|
+
|
|
110
|
+
Publish this package before the consuming site-runtime and generator releases.
|
|
111
|
+
Keep the source package version at `1.0.0` and generated site dependencies at `^1.0.0`;
|
|
112
|
+
the release process bumps the published version automatically.
|
|
113
|
+
Standard artifact configuration publishes the built package; local builds and packs do not publish.
|
|
114
|
+
|
|
115
|
+
## Layout contract
|
|
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
|
+
have main as their DOM parent: use `.authored-page > main > .section` for direct-child
|
|
161
|
+
selectors and account for main in parent traversal. A route shell must not add a
|
|
162
|
+
second main landmark. Skip links can target Section IDs (sections have `tabIndex=-1`).
|
|
163
|
+
|
|
164
|
+
Page imports its own scoped CSS, retained through package imports in Vite dev and
|
|
165
|
+
production. The relative root contains an absolute inset background with background-only
|
|
166
|
+
clipping. Background children overlap in one grid cell; main uses `display: contents`.
|
|
167
|
+
Authored CSS owns foreground grid layout, sizing, overflow, and sticky/fixed placement
|
|
168
|
+
and z-index on Header/Footer instances. It must keep foreground content above the
|
|
169
|
+
positioned background for the chosen layout. Page adds no stacking context, negative
|
|
170
|
+
z-index, or foreground clipping.
|
|
171
|
+
|
|
172
|
+
The authored browser fixture is in `test/fixtures/page`. After building, run
|
|
173
|
+
`pnpm --filter @wix/origami-system-components exec vite test/fixtures/page`.
|
|
174
|
+
The default fixture exercises two background layers, transparent sections, a shared
|
|
175
|
+
sticky header/footer, skip links, pointer interaction, and foreground overflow.
|
|
176
|
+
Use `?fixed` for fixed landmarks, `?bare` for omitted landmarks, and `?empty` for
|
|
177
|
+
omitted landmarks/children and an empty background array. Check desktop and mobile
|
|
178
|
+
widths, scroll positioning, one exposed main, section focus targets, and console warnings.
|
|
179
|
+
|
|
180
|
+
Validated in headless Chromium at 1280×800 and 390×800 (2026-10-22), for all four
|
|
181
|
+
fixture variants: background bounds equal Page bounds, background nodes overlap,
|
|
182
|
+
sections occupy consecutive rows without a background row, pointer clicks reach the
|
|
183
|
+
button, and skip-link activation focuses the first section. Sticky and fixed landmarks
|
|
184
|
+
remain at the viewport edges after scrolling. Chromium's accessibility tree exposes
|
|
185
|
+
one main even for empty content (the empty Page itself has zero height). No duplicate
|
|
186
|
+
IDs, React key warnings, or browser errors were observed. Screenshots confirm background
|
|
187
|
+
clipping and visible foreground overflow. This covers the authored fixture shell;
|
|
188
|
+
integration with generated route shells and other browser/accessibility combinations
|
|
189
|
+
still requires verification during migration.
|
|
190
|
+
|
|
191
|
+
### InternalContainer
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
import InternalContainer from '@wix/origami-system-components/InternalContainer'
|
|
195
|
+
|
|
196
|
+
<InternalContainer id="comp-example" className="custom">Content</InternalContainer>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
It preserves background and pinned layers, normal or function children, and caller
|
|
200
|
+
classes. `role`, `tabIndex`, `data-scope`, and `data-repeater-items-indexes`
|
|
201
|
+
target the content div. Authoring metadata stays in exported source for import-back
|
|
202
|
+
and is outside the typed component API. Only explicitly supported props are forwarded,
|
|
203
|
+
so extra metadata does not reach the DOM. IDs must match `/^[a-zA-Z][\w-]*$/`;
|
|
204
|
+
invalid IDs throw rather than being normalized.
|
|
205
|
+
|
|
206
|
+
The root receives the ID class and caller classes. Content and overflow layers
|
|
207
|
+
receive `${id}-container` and `${id}-overflow-wrapper`. Overflow and content wrappers
|
|
208
|
+
are always enabled, and content defaults to `tabIndex={0}`, matching the playground.
|
|
209
|
+
The generated-site build runtime compiles DM semantic CSS onto these layers in convert
|
|
210
|
+
mode. The published component's CSS is retained; special sticky positioning remains an
|
|
211
|
+
explicit limitation rather than a claim of complete Thunderbolt layout parity.
|
|
212
|
+
|
|
213
|
+
The pure `@wix/origami-system-components/layout-contract` entry exports
|
|
214
|
+
`buildContainerClasses`, `isValidContainerId`, and `LAYOUT_FLAGS`. Its emitted imports
|
|
215
|
+
resolve in Node without React, CSS, component implementations, or the package root.
|
|
216
|
+
The build-time compiler uses it to target the same retained wrappers.
|
package/dist/Anchor.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactElement } from 'react'
|
|
2
|
+
|
|
3
|
+
export interface AnchorProps {
|
|
4
|
+
id: string
|
|
5
|
+
className?: string | undefined
|
|
6
|
+
name?: string | undefined
|
|
7
|
+
urlFragment?: string | undefined
|
|
8
|
+
isAriaHidden?: boolean | undefined
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare function Anchor(props: AnchorProps): ReactElement
|
|
12
|
+
export default Anchor
|
package/dist/Anchor.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Anchor as Component } from '@wix/editor-components/component/Anchor';
|
|
3
|
+
// Real .css path: Vite's dev pre-bundling drops extensionless CSS imports.
|
|
4
|
+
import '@wix/editor-components/dist/component/Anchor/Anchor.min.css';
|
|
5
|
+
export const Anchor = Component;
|
|
6
|
+
export default Anchor;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
export interface FooterSectionProps {
|
|
4
|
+
id: string
|
|
5
|
+
className?: string | undefined
|
|
6
|
+
children?: ReactNode
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export declare function FooterSection(props: FooterSectionProps): ReactElement
|
|
10
|
+
export default FooterSection
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { FooterSection as Component } from '@wix/editor-components/component/FooterSection';
|
|
3
|
+
// Real .css path: Vite's dev pre-bundling drops extensionless CSS imports.
|
|
4
|
+
import '@wix/editor-components/dist/component/FooterSection/FooterSection.min.css';
|
|
5
|
+
import { withNormalChildren } from './hocs';
|
|
6
|
+
export const FooterSection = withNormalChildren(Component);
|
|
7
|
+
export default FooterSection;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
export interface HeaderSectionProps {
|
|
4
|
+
id: string
|
|
5
|
+
className?: string | undefined
|
|
6
|
+
children?: ReactNode
|
|
7
|
+
nickname: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export declare function HeaderSection(props: HeaderSectionProps): ReactElement
|
|
11
|
+
export default HeaderSection
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { HeaderSection as Component } from '@wix/editor-components/component/HeaderSection';
|
|
3
|
+
import { HeaderSection as controller } from '@wix/editor-components/controller/HeaderSection';
|
|
4
|
+
// Real .css path: Vite's dev pre-bundling drops extensionless CSS imports.
|
|
5
|
+
import '@wix/editor-components/dist/component/HeaderSection/HeaderSection.min.css';
|
|
6
|
+
import { withController, withNormalChildren } from './hocs';
|
|
7
|
+
export const HeaderSection = withNormalChildren(withController(Component, controller));
|
|
8
|
+
export default HeaderSection;
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
.internalContainerRoot__MJnN1 {
|
|
3
|
+
position: relative;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
--borderTopWidth: 0px;
|
|
7
|
+
--borderTopStyle: solid;
|
|
8
|
+
--borderTopColor: transparent;
|
|
9
|
+
--borderInlineEndWidth: 0px;
|
|
10
|
+
--borderInlineEndStyle: solid;
|
|
11
|
+
--borderInlineEndColor: transparent;
|
|
12
|
+
--borderBottomWidth: 0px;
|
|
13
|
+
--borderBottomStyle: solid;
|
|
14
|
+
--borderBottomColor: transparent;
|
|
15
|
+
--borderInlineStartWidth: 0px;
|
|
16
|
+
--borderInlineStartStyle: solid;
|
|
17
|
+
--borderInlineStartColor: transparent;
|
|
18
|
+
--borderStartStartRadius: 0px;
|
|
19
|
+
--borderStartEndRadius: 0px;
|
|
20
|
+
--borderEndStartRadius: 0px;
|
|
21
|
+
--borderEndEndRadius: 0px;
|
|
22
|
+
--boxShadow: none;
|
|
23
|
+
--backdropFilter: none;
|
|
24
|
+
}
|
|
25
|
+
.backgroundLayer__ZDd0Q {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
right: 0;
|
|
30
|
+
bottom: 0;
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: 1fr;
|
|
33
|
+
grid-template-rows: 1fr;
|
|
34
|
+
overflow: clip;
|
|
35
|
+
border-top: var(--borderTopWidth) var(--borderTopStyle) var(--borderTopColor);
|
|
36
|
+
border-inline-end: var(--borderInlineEndWidth) var(--borderInlineEndStyle) var(--borderInlineEndColor);
|
|
37
|
+
border-bottom: var(--borderBottomWidth) var(--borderBottomStyle) var(--borderBottomColor);
|
|
38
|
+
border-inline-start: var(--borderInlineStartWidth) var(--borderInlineStartStyle) var(--borderInlineStartColor);
|
|
39
|
+
border-start-start-radius: var(--borderStartStartRadius);
|
|
40
|
+
border-start-end-radius: var(--borderStartEndRadius);
|
|
41
|
+
border-end-start-radius: var(--borderEndStartRadius);
|
|
42
|
+
border-end-end-radius: var(--borderEndEndRadius);
|
|
43
|
+
box-shadow: var(--boxShadow);
|
|
44
|
+
backdrop-filter: var(--backdropFilter);
|
|
45
|
+
}
|
|
46
|
+
.pinnedLayer__i0Pg8 {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 0;
|
|
49
|
+
left: 0;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
right: 0;
|
|
52
|
+
z-index: 1;
|
|
53
|
+
display: grid;
|
|
54
|
+
grid-template-columns: 1fr;
|
|
55
|
+
grid-template-rows: 1fr;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
}
|
|
58
|
+
.pinnedLayer__i0Pg8 > * {
|
|
59
|
+
pointer-events: auto;
|
|
60
|
+
}
|
|
61
|
+
.overflowWrapper__-futq {
|
|
62
|
+
position: relative;
|
|
63
|
+
align-self: stretch;
|
|
64
|
+
border-start-start-radius: var(--borderStartStartRadius);
|
|
65
|
+
border-start-end-radius: var(--borderStartEndRadius);
|
|
66
|
+
border-end-start-radius: var(--borderEndStartRadius);
|
|
67
|
+
border-end-end-radius: var(--borderEndEndRadius);
|
|
68
|
+
}
|
|
69
|
+
.backgroundLayerNoBorder__cg1to {
|
|
70
|
+
border-color: transparent;
|
|
71
|
+
}
|
|
72
|
+
.borderFrame__YJBdZ {
|
|
73
|
+
position: absolute;
|
|
74
|
+
inset: 0;
|
|
75
|
+
z-index: 1;
|
|
76
|
+
pointer-events: none;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
border-top: var(--borderTopWidth) var(--borderTopStyle) var(--borderTopColor);
|
|
79
|
+
border-inline-end: var(--borderInlineEndWidth) var(--borderInlineEndStyle) var(--borderInlineEndColor);
|
|
80
|
+
border-bottom: var(--borderBottomWidth) var(--borderBottomStyle) var(--borderBottomColor);
|
|
81
|
+
border-inline-start: var(--borderInlineStartWidth) var(--borderInlineStartStyle) var(--borderInlineStartColor);
|
|
82
|
+
border-start-start-radius: var(--borderStartStartRadius);
|
|
83
|
+
border-start-end-radius: var(--borderStartEndRadius);
|
|
84
|
+
border-end-start-radius: var(--borderEndStartRadius);
|
|
85
|
+
border-end-end-radius: var(--borderEndEndRadius);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* src/InternalContainer.css */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/Page.d.ts
ADDED
package/dist/Page.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import Component from '@wix/editor-components/skin/Page/ResponsivePageWithColorBG';
|
|
3
|
+
// Real .css path: Vite's dev pre-bundling drops extensionless CSS imports.
|
|
4
|
+
import '@wix/editor-components/dist/skin/Page/ResponsivePageWithColorBG/Page.min.css';
|
|
5
|
+
import { withNormalChildren } from './hocs';
|
|
6
|
+
export const Page = withNormalChildren(Component);
|
|
7
|
+
export default Page;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
export interface SectionProps {
|
|
4
|
+
id: string
|
|
5
|
+
className?: string | undefined
|
|
6
|
+
children?: ReactNode
|
|
7
|
+
nickname: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export declare function Section(props: SectionProps): ReactElement
|
|
11
|
+
export default Section
|
package/dist/Section.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Section as Component } from '@wix/editor-components/component/Section';
|
|
3
|
+
import { Section as controller } from '@wix/editor-components/controller/Section';
|
|
4
|
+
// Real .css path: Vite's dev pre-bundling drops extensionless CSS imports.
|
|
5
|
+
import '@wix/editor-components/dist/component/Section/Section.min.css';
|
|
6
|
+
import { withController, withNormalChildren } from './hocs';
|
|
7
|
+
export const Section = withNormalChildren(withController(Component, controller));
|
|
8
|
+
export default Section;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.origami-unsupported-widget-placeholder {
|
|
2
|
+
--placeholder-bg: #f5f7fa;
|
|
3
|
+
--placeholder-border: #c9d2de;
|
|
4
|
+
--placeholder-text: #5b6b82;
|
|
5
|
+
--placeholder-radius: 16px;
|
|
6
|
+
/* Raise this when the site has a fixed header covering the top of the viewport. */
|
|
7
|
+
--placeholder-sticky-top: 0px;
|
|
8
|
+
|
|
9
|
+
position: relative;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-rows: minmax(0, 1fr);
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
min-height: 120px;
|
|
16
|
+
padding: 12px;
|
|
17
|
+
border: 2px dashed var(--placeholder-border);
|
|
18
|
+
border-radius: var(--placeholder-radius);
|
|
19
|
+
background-color: var(--placeholder-bg);
|
|
20
|
+
container-type: inline-size;
|
|
21
|
+
overflow: clip;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* The message box is as tall as the placeholder, but never taller than the viewport.
|
|
26
|
+
* Short placeholders center the text in themselves; tall ones keep it
|
|
27
|
+
* centered in the viewport while scrolling, until the placeholder ends.
|
|
28
|
+
*/
|
|
29
|
+
.origami-unsupported-widget-placeholder__message {
|
|
30
|
+
position: sticky;
|
|
31
|
+
top: var(--placeholder-sticky-top);
|
|
32
|
+
align-self: stretch;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
max-height: calc(100vh - var(--placeholder-sticky-top));
|
|
35
|
+
max-height: calc(100dvh - var(--placeholder-sticky-top));
|
|
36
|
+
min-height: 0;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
margin: 0;
|
|
41
|
+
padding: 16px;
|
|
42
|
+
color: var(--placeholder-text);
|
|
43
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
44
|
+
font-size: 16px;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
line-height: 1.5;
|
|
47
|
+
text-align: center;
|
|
48
|
+
overflow-wrap: anywhere;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@container (max-width: 220px) {
|
|
52
|
+
.origami-unsupported-widget-placeholder__message {
|
|
53
|
+
padding: 8px;
|
|
54
|
+
font-size: 13px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactElement } from 'react'
|
|
2
|
+
|
|
3
|
+
export interface UnsupportedWidgetPlaceholderProps {
|
|
4
|
+
id: string
|
|
5
|
+
className?: string | undefined
|
|
6
|
+
componentName?: string | undefined
|
|
7
|
+
platformName?: string | undefined
|
|
8
|
+
message?: string | undefined
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare function UnsupportedWidgetPlaceholder(props: UnsupportedWidgetPlaceholderProps): ReactElement
|
|
12
|
+
export default UnsupportedWidgetPlaceholder
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './UnsupportedWidgetPlaceholder.css';
|
|
4
|
+
const ROOT = 'origami-unsupported-widget-placeholder';
|
|
5
|
+
/**
|
|
6
|
+
* Stand-in for a vertical or non-builder widget that has no Origami rendering yet.
|
|
7
|
+
* The message stays in the viewport while a tall placeholder is scrolled.
|
|
8
|
+
*/
|
|
9
|
+
export const UnsupportedWidgetPlaceholder = ({ id, className, componentName, platformName = 'Wix Studio Two', message, }) => {
|
|
10
|
+
const name = componentName?.trim();
|
|
11
|
+
const text = message ?? `The ${name || 'widget'} will be rendered after importing the site back to ${platformName}`;
|
|
12
|
+
return (React.createElement("div", { id: id, className: className ? `${ROOT} ${className}` : ROOT, role: "note", "aria-label": name ? `${name} placeholder` : 'Widget placeholder', "data-component-name": name || undefined },
|
|
13
|
+
React.createElement("p", { className: `${ROOT}__message` }, text)));
|
|
14
|
+
};
|
|
15
|
+
export default UnsupportedWidgetPlaceholder;
|
package/dist/hocs.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useStateOverrides } from '@wix/builder-state-react';
|
|
4
|
+
/**
|
|
5
|
+
* An HOC that gets a container component that expects children as a function (like EditorElement components)
|
|
6
|
+
* and returns a container component that gets children as an array.
|
|
7
|
+
*/
|
|
8
|
+
export const withNormalChildren = (Component) => ({ children, ...props }) => React.createElement(Component, { ...props }, () => children || []);
|
|
9
|
+
/**
|
|
10
|
+
* An HOC that connects a component to its EditorElements controller.
|
|
11
|
+
* As this is a special code for EditorElements, it should be moved to their project in the future.
|
|
12
|
+
*
|
|
13
|
+
* Note:
|
|
14
|
+
* Since the controller can update props, and since they have to be synced with velo if exists,
|
|
15
|
+
* every component with a controller should be connected by default. Since the consumer (widget genreated code)
|
|
16
|
+
* doesn't always connect the component, we do the connection here for now.
|
|
17
|
+
*/
|
|
18
|
+
export const withController = (Component, controller) => (props) => {
|
|
19
|
+
const [propsOverrides = {}, , setters] = useStateOverrides(props.nickname);
|
|
20
|
+
const controllerProps = controller.useComponentProps({ ...props, ...propsOverrides }, {}, setters);
|
|
21
|
+
return React.createElement(Component, { ...props, ...controllerProps });
|
|
22
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Page, type PageProps } from './Page'
|
|
2
|
+
export { Section, type SectionProps } from './Section'
|
|
3
|
+
export { HeaderSection, type HeaderSectionProps } from './HeaderSection'
|
|
4
|
+
export { FooterSection, type FooterSectionProps } from './FooterSection'
|
|
5
|
+
export { Anchor, type AnchorProps } from './Anchor'
|
|
6
|
+
export { UnsupportedWidgetPlaceholder, type UnsupportedWidgetPlaceholderProps } from './UnsupportedWidgetPlaceholder'
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Page } from './Page';
|
|
2
|
+
export { Section } from './Section';
|
|
3
|
+
export { HeaderSection } from './HeaderSection';
|
|
4
|
+
export { FooterSection } from './FooterSection';
|
|
5
|
+
export { Anchor } from './Anchor';
|
|
6
|
+
export { UnsupportedWidgetPlaceholder } from './UnsupportedWidgetPlaceholder';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AriaRole, ReactElement, ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
export interface InternalContainerProps {
|
|
4
|
+
id: string
|
|
5
|
+
className?: string | undefined
|
|
6
|
+
containerLayoutClassName?: string | undefined
|
|
7
|
+
overlowWrapperClassName?: string | undefined
|
|
8
|
+
hasOverflow?: boolean | undefined
|
|
9
|
+
hasScrollOverflow?: boolean | undefined
|
|
10
|
+
shouldOmitWrapperLayers?: boolean | undefined
|
|
11
|
+
role?: AriaRole | undefined
|
|
12
|
+
tabIndex?: number | undefined
|
|
13
|
+
'data-scope'?: string | undefined
|
|
14
|
+
'data-repeater-items-indexes'?: string | undefined
|
|
15
|
+
backgroundLayer?: ReactNode[] | undefined
|
|
16
|
+
pinnedLayer?: ReactNode[] | undefined
|
|
17
|
+
children?: ReactNode | (() => ReactNode)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export declare function InternalContainer(props: InternalContainerProps): ReactElement
|
|
21
|
+
export default InternalContainer
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
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
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import React__default, { useCallback } from "react";
|
|
6
|
+
|
|
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
|
+
function r(e) {
|
|
9
|
+
var t, f, n = "";
|
|
10
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
11
|
+
else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
12
|
+
else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
13
|
+
return n;
|
|
14
|
+
}
|
|
15
|
+
function clsx() {
|
|
16
|
+
for (var e, t, f = 0, n = ""; f < arguments.length; ) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
17
|
+
return n;
|
|
18
|
+
}
|
|
19
|
+
|
|
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
|
+
var TestIds = {
|
|
22
|
+
overflow: "internal-container-overflow",
|
|
23
|
+
content: "internal-container-content",
|
|
24
|
+
backgroundLayer: "internal-container-background-layer",
|
|
25
|
+
pinnedLayer: "internal-container-pinned-layer",
|
|
26
|
+
root: "internal-container-root"
|
|
27
|
+
};
|
|
28
|
+
var INTERNAL_CONTAINER_ROOT_CLASS = "container";
|
|
29
|
+
|
|
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
|
+
var internalContainerRoot = "internalContainerRoot__MJnN1";
|
|
32
|
+
var backgroundLayer = "backgroundLayer__ZDd0Q";
|
|
33
|
+
var pinnedLayer = "pinnedLayer__i0Pg8";
|
|
34
|
+
var overflowWrapper = "overflowWrapper__-futq";
|
|
35
|
+
var backgroundLayerNoBorder = "backgroundLayerNoBorder__cg1to";
|
|
36
|
+
var borderFrame = "borderFrame__YJBdZ";
|
|
37
|
+
var style = {
|
|
38
|
+
internalContainerRoot,
|
|
39
|
+
backgroundLayer,
|
|
40
|
+
pinnedLayer,
|
|
41
|
+
overflowWrapper,
|
|
42
|
+
backgroundLayerNoBorder,
|
|
43
|
+
borderFrame
|
|
44
|
+
};
|
|
45
|
+
var OverflowWrapper = React__default.forwardRef(({ children, className }, ref) => {
|
|
46
|
+
return /* @__PURE__ */ jsx("div", { className, "data-testid": TestIds.overflow, ref, children });
|
|
47
|
+
});
|
|
48
|
+
var InternalContainer = ({
|
|
49
|
+
id,
|
|
50
|
+
containerLayoutClassName,
|
|
51
|
+
overlowWrapperClassName,
|
|
52
|
+
hasOverflow,
|
|
53
|
+
hasScrollOverflow,
|
|
54
|
+
children,
|
|
55
|
+
role,
|
|
56
|
+
tabIndex: tabIndexFromProps,
|
|
57
|
+
backgroundLayer: backgroundLayer2 = [],
|
|
58
|
+
pinnedLayer: pinnedLayer2 = [],
|
|
59
|
+
className,
|
|
60
|
+
shouldOmitWrapperLayers,
|
|
61
|
+
...restOfProps
|
|
62
|
+
}, ref) => {
|
|
63
|
+
const shouldWrapChildren = !shouldOmitWrapperLayers;
|
|
64
|
+
const tabIndexWithOverflow = hasScrollOverflow ? tabIndexFromProps || 0 : -1;
|
|
65
|
+
const tabIndex = hasOverflow ? tabIndexWithOverflow : void 0;
|
|
66
|
+
const hasPinnedLayer = pinnedLayer2 && pinnedLayer2.length > 0;
|
|
67
|
+
const wrapWithOverflowWrapperIfNeeded = useCallback(
|
|
68
|
+
(reactChildren) => hasOverflow ? /* @__PURE__ */ jsx(
|
|
69
|
+
OverflowWrapper,
|
|
70
|
+
{
|
|
71
|
+
className: clsx(overlowWrapperClassName, style.overflowWrapper),
|
|
72
|
+
children: reactChildren
|
|
73
|
+
}
|
|
74
|
+
) : reactChildren,
|
|
75
|
+
[hasOverflow, overlowWrapperClassName]
|
|
76
|
+
);
|
|
77
|
+
const contentProps = {
|
|
78
|
+
ref,
|
|
79
|
+
"data-testid": TestIds.content,
|
|
80
|
+
tabIndex,
|
|
81
|
+
...role ? { role } : {},
|
|
82
|
+
className: containerLayoutClassName,
|
|
83
|
+
...restOfProps["data-scope"] && {
|
|
84
|
+
"data-scope": restOfProps["data-scope"]
|
|
85
|
+
},
|
|
86
|
+
...restOfProps["data-repeater-items-indexes"] && {
|
|
87
|
+
"data-repeater-items-indexes": restOfProps["data-repeater-items-indexes"]
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const renderedChildren = typeof children === "function" ? children() : children;
|
|
91
|
+
return /* @__PURE__ */ jsxs(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
id,
|
|
95
|
+
className: clsx(
|
|
96
|
+
INTERNAL_CONTAINER_ROOT_CLASS,
|
|
97
|
+
style.internalContainerRoot,
|
|
98
|
+
className,
|
|
99
|
+
!shouldWrapChildren && containerLayoutClassName
|
|
100
|
+
),
|
|
101
|
+
"data-testid": TestIds.root,
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
className: clsx(
|
|
107
|
+
style.backgroundLayer,
|
|
108
|
+
hasOverflow && style.backgroundLayerNoBorder
|
|
109
|
+
),
|
|
110
|
+
"data-testid": TestIds.backgroundLayer,
|
|
111
|
+
children: backgroundLayer2
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
hasPinnedLayer && /* @__PURE__ */ jsx("div", { className: style.pinnedLayer, "data-testid": TestIds.pinnedLayer, children: pinnedLayer2 }),
|
|
115
|
+
wrapWithOverflowWrapperIfNeeded(
|
|
116
|
+
shouldWrapChildren ? /* @__PURE__ */ jsx("div", { ...contentProps, children: renderedChildren }) : /* @__PURE__ */ jsx(React__default.Fragment, { children: renderedChildren })
|
|
117
|
+
),
|
|
118
|
+
hasOverflow && /* @__PURE__ */ jsx("div", { className: style.borderFrame })
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
var InternalContainer$1 = React__default.forwardRef(InternalContainer);
|
|
124
|
+
function component(props) {
|
|
125
|
+
return /* @__PURE__ */ jsx(InternalContainer$1, { ...props });
|
|
126
|
+
}
|
|
127
|
+
|
|
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
|
+
var InternalContainer_default = component;
|
|
130
|
+
export {
|
|
131
|
+
component as InternalContainer,
|
|
132
|
+
InternalContainer_default as default
|
|
133
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface FooterProps {
|
|
3
|
+
id: string;
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Experimental footer landmark, the element Thunderbolt's RefComponent renders.
|
|
9
|
+
* It is the root of the shared Footer_<sharedCompId> definition and wraps its
|
|
10
|
+
* FooterSection. The page passes its instance ID and class through the definition's
|
|
11
|
+
* Structure props; the page layout.css targets them for placement,
|
|
12
|
+
* fixed positioning and z-index.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Footer({ id, className, children }: FooterProps): import("react").JSX.Element;
|
|
15
|
+
export default Footer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Experimental footer landmark, the element Thunderbolt's RefComponent renders.
|
|
5
|
+
* It is the root of the shared Footer_<sharedCompId> definition and wraps its
|
|
6
|
+
* FooterSection. The page passes its instance ID and class through the definition's
|
|
7
|
+
* Structure props; the page layout.css targets them for placement,
|
|
8
|
+
* fixed positioning and z-index.
|
|
9
|
+
*/
|
|
10
|
+
export function Footer({ id, className, children }) {
|
|
11
|
+
return (_jsx("footer", { id: id, className: className, children: children }));
|
|
12
|
+
}
|
|
13
|
+
export default Footer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SectionProps } from './Section.js';
|
|
2
|
+
export type FooterSectionProps = SectionProps;
|
|
3
|
+
/**
|
|
4
|
+
* Experimental plain FooterSection: the shared footer definition's root, rendered
|
|
5
|
+
* as the generic Section with the definition's ID and class. The `<footer>`
|
|
6
|
+
* landmark and the page's instance identity belong to the enclosing Footer.
|
|
7
|
+
*/
|
|
8
|
+
export declare function FooterSection({ id, className, children }: FooterSectionProps): import("react").JSX.Element;
|
|
9
|
+
export default FooterSection;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import Section from './Section.js';
|
|
4
|
+
/**
|
|
5
|
+
* Experimental plain FooterSection: the shared footer definition's root, rendered
|
|
6
|
+
* as the generic Section with the definition's ID and class. The `<footer>`
|
|
7
|
+
* landmark and the page's instance identity belong to the enclosing Footer.
|
|
8
|
+
*/
|
|
9
|
+
export function FooterSection({ id, className, children }) {
|
|
10
|
+
return (_jsx(Section, { id: id, className: className, children: children }));
|
|
11
|
+
}
|
|
12
|
+
export default FooterSection;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface HeaderProps {
|
|
3
|
+
id: string;
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Experimental header landmark, the element Thunderbolt's RefComponent renders.
|
|
9
|
+
* It is the root of the shared Header_<sharedCompId> definition and wraps its
|
|
10
|
+
* HeaderSection. The page passes its instance ID and class through the definition's
|
|
11
|
+
* Structure props; the page layout.css targets them for placement,
|
|
12
|
+
* sticky/fixed positioning and z-index.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Header({ id, className, children }: HeaderProps): import("react").JSX.Element;
|
|
15
|
+
export default Header;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Experimental header landmark, the element Thunderbolt's RefComponent renders.
|
|
5
|
+
* It is the root of the shared Header_<sharedCompId> definition and wraps its
|
|
6
|
+
* HeaderSection. The page passes its instance ID and class through the definition's
|
|
7
|
+
* Structure props; the page layout.css targets them for placement,
|
|
8
|
+
* sticky/fixed positioning and z-index.
|
|
9
|
+
*/
|
|
10
|
+
export function Header({ id, className, children }) {
|
|
11
|
+
return (_jsx("header", { id: id, className: className, children: children }));
|
|
12
|
+
}
|
|
13
|
+
export default Header;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SectionProps } from './Section.js';
|
|
2
|
+
export type HeaderSectionProps = SectionProps;
|
|
3
|
+
/**
|
|
4
|
+
* Experimental plain HeaderSection: the shared header definition's root, rendered
|
|
5
|
+
* as the generic Section with the definition's ID and class. The `<header>`
|
|
6
|
+
* landmark and the page's instance identity belong to the enclosing Header.
|
|
7
|
+
* Legacy scroll effects are not implemented here.
|
|
8
|
+
*/
|
|
9
|
+
export declare function HeaderSection({ id, className, children }: HeaderSectionProps): import("react").JSX.Element;
|
|
10
|
+
export default HeaderSection;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import Section from './Section.js';
|
|
4
|
+
/**
|
|
5
|
+
* Experimental plain HeaderSection: the shared header definition's root, rendered
|
|
6
|
+
* as the generic Section with the definition's ID and class. The `<header>`
|
|
7
|
+
* landmark and the page's instance identity belong to the enclosing Header.
|
|
8
|
+
* Legacy scroll effects are not implemented here.
|
|
9
|
+
*/
|
|
10
|
+
export function HeaderSection({ id, className, children }) {
|
|
11
|
+
return (_jsx(Section, { id: id, className: className, children: children }));
|
|
12
|
+
}
|
|
13
|
+
export default HeaderSection;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AriaRole, ReactNode } from 'react';
|
|
2
|
+
import '../InternalContainer.css';
|
|
3
|
+
export interface InternalContainerProps {
|
|
4
|
+
id: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
role?: AriaRole;
|
|
7
|
+
tabIndex?: number;
|
|
8
|
+
'data-scope'?: string;
|
|
9
|
+
'data-repeater-items-indexes'?: string;
|
|
10
|
+
backgroundLayer?: ReactNode[];
|
|
11
|
+
pinnedLayer?: ReactNode[];
|
|
12
|
+
children?: ReactNode | (() => ReactNode);
|
|
13
|
+
}
|
|
14
|
+
export declare function InternalContainer(props: InternalContainerProps): import("react").JSX.Element;
|
|
15
|
+
export default InternalContainer;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import BaseInternalContainer from './BaseInternalContainer.js';
|
|
4
|
+
import '../InternalContainer.css';
|
|
5
|
+
import { buildContainerClasses } from './container-contract.js';
|
|
6
|
+
import { LAYOUT_FLAGS } from './layout-constants.js';
|
|
7
|
+
export function InternalContainer(props) {
|
|
8
|
+
const classes = buildContainerClasses(props.id);
|
|
9
|
+
const supportedProps = {
|
|
10
|
+
id: props.id,
|
|
11
|
+
role: props.role,
|
|
12
|
+
tabIndex: props.tabIndex,
|
|
13
|
+
'data-scope': props['data-scope'],
|
|
14
|
+
'data-repeater-items-indexes': props['data-repeater-items-indexes'],
|
|
15
|
+
backgroundLayer: props.backgroundLayer,
|
|
16
|
+
pinnedLayer: props.pinnedLayer,
|
|
17
|
+
children: props.children,
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(BaseInternalContainer, { ...supportedProps, className: [props.id, props.className].filter(Boolean).join(' '), hasOverflow: LAYOUT_FLAGS.HAS_OVERFLOW, hasScrollOverflow: LAYOUT_FLAGS.HAS_SCROLL_OVERFLOW, shouldOmitWrapperLayers: LAYOUT_FLAGS.SHOULD_OMIT_WRAPPER_LAYERS, containerLayoutClassName: classes.contentClass, overlowWrapperClassName: classes.overflowClass }));
|
|
20
|
+
}
|
|
21
|
+
export default InternalContainer;
|
|
@@ -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;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface SectionProps {
|
|
3
|
+
id: string;
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
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;
|
|
12
|
+
export default Section;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Experimental plain Section. The authored InternalContainer child owns its
|
|
5
|
+
* background and content layers; this component does not create another container.
|
|
6
|
+
*/
|
|
7
|
+
export function Section({ id, className, children }) {
|
|
8
|
+
return (_jsx("section", { id: id, className: className, tabIndex: -1, children: children }));
|
|
9
|
+
}
|
|
10
|
+
export default Section;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const isValidContainerId = (id) => /^[a-zA-Z][\w-]*$/.test(id);
|
|
2
|
+
// Shared with the build-time semantic CSS compiler through the layout-contract subpath.
|
|
3
|
+
export function buildContainerClasses(id) {
|
|
4
|
+
if (!isValidContainerId(id))
|
|
5
|
+
throw new Error(`Unsupported container compId: ${id}`);
|
|
6
|
+
return {
|
|
7
|
+
contentClass: `${id}-container`,
|
|
8
|
+
overflowClass: `${id}-overflow-wrapper`,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Preserve the playground DOM contract. Content is focusable by default;
|
|
2
|
+
// semantic layout targets compile onto these retained wrapper layers.
|
|
3
|
+
export const LAYOUT_FLAGS = {
|
|
4
|
+
HAS_OVERFLOW: true,
|
|
5
|
+
HAS_SCROLL_OVERFLOW: true,
|
|
6
|
+
SHOULD_OMIT_WRAPPER_LAYERS: false,
|
|
7
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,127 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/origami-system-components",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.10.2",
|
|
4
|
+
"description": "Editor structural and system components for standalone Origami sites",
|
|
5
|
+
"sideEffects": [
|
|
6
|
+
"**/*.css"
|
|
7
|
+
],
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"!**/*.tsbuildinfo"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "node build.mjs && tsc -p tsconfig.build.json && tsc -p tsconfig.layout.json",
|
|
14
|
+
"lint": "oxlint .",
|
|
15
|
+
"test": "tsc -p tsconfig.test.json && vitest --run test/*.spec.ts test/*.spec.tsx && node --test --test-force-exit test/*.test.mjs",
|
|
16
|
+
"clean": "rm -rf dist"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@testing-library/react": "^16.3.0",
|
|
20
|
+
"@types/react": "^18.3.1",
|
|
21
|
+
"@wix/editor-system-components": "^1.1573.0",
|
|
22
|
+
"esbuild": "^0.28.1",
|
|
23
|
+
"jsdom": "^23.0.1",
|
|
24
|
+
"react": "^18.3.1",
|
|
25
|
+
"react-dom": "^18.3.1",
|
|
26
|
+
"typescript": "^6.0.3",
|
|
27
|
+
"vite": "^6.4.3",
|
|
28
|
+
"vitest": "^4.1.11"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"react": "^18.3.1"
|
|
32
|
+
},
|
|
33
|
+
"publishUnscoped": false,
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"registry": "https://registry.npmjs.org/",
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"wix": {
|
|
39
|
+
"artifact": {
|
|
40
|
+
"groupId": "com.wixpress.npm",
|
|
41
|
+
"artifactId": "origami-system-components",
|
|
42
|
+
"targets": {
|
|
43
|
+
"docker": false
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"validations": {
|
|
47
|
+
"postBuild": [
|
|
48
|
+
"test",
|
|
49
|
+
"lint"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"exports": {
|
|
54
|
+
".": {
|
|
55
|
+
"types": "./dist/index.d.ts",
|
|
56
|
+
"default": "./dist/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./InternalContainer": {
|
|
59
|
+
"types": "./dist/layout/InternalContainer.d.ts",
|
|
60
|
+
"default": "./dist/layout/InternalContainer.js"
|
|
61
|
+
},
|
|
62
|
+
"./site.global.css": "./dist/site.global.css",
|
|
63
|
+
"./InternalContainer.css": {
|
|
64
|
+
"types": "./dist/InternalContainer.css.d.ts",
|
|
65
|
+
"default": "./dist/InternalContainer.css"
|
|
66
|
+
},
|
|
67
|
+
"./Page": {
|
|
68
|
+
"types": "./dist/Page.d.ts",
|
|
69
|
+
"default": "./dist/Page.js"
|
|
70
|
+
},
|
|
71
|
+
"./Section": {
|
|
72
|
+
"types": "./dist/Section.d.ts",
|
|
73
|
+
"default": "./dist/Section.js"
|
|
74
|
+
},
|
|
75
|
+
"./HeaderSection": {
|
|
76
|
+
"types": "./dist/HeaderSection.d.ts",
|
|
77
|
+
"default": "./dist/HeaderSection.js"
|
|
78
|
+
},
|
|
79
|
+
"./FooterSection": {
|
|
80
|
+
"types": "./dist/FooterSection.d.ts",
|
|
81
|
+
"default": "./dist/FooterSection.js"
|
|
82
|
+
},
|
|
83
|
+
"./Anchor": {
|
|
84
|
+
"types": "./dist/Anchor.d.ts",
|
|
85
|
+
"default": "./dist/Anchor.js"
|
|
86
|
+
},
|
|
87
|
+
"./UnsupportedWidgetPlaceholder": {
|
|
88
|
+
"types": "./dist/UnsupportedWidgetPlaceholder.d.ts",
|
|
89
|
+
"default": "./dist/UnsupportedWidgetPlaceholder.js"
|
|
90
|
+
},
|
|
91
|
+
"./layout-contract": {
|
|
92
|
+
"types": "./dist/layout/layout-contract.d.ts",
|
|
93
|
+
"default": "./dist/layout/layout-contract.js"
|
|
94
|
+
},
|
|
95
|
+
"./layout/Page": {
|
|
96
|
+
"types": "./dist/layout/Page.d.ts",
|
|
97
|
+
"default": "./dist/layout/Page.js"
|
|
98
|
+
},
|
|
99
|
+
"./layout/Section": {
|
|
100
|
+
"types": "./dist/layout/Section.d.ts",
|
|
101
|
+
"default": "./dist/layout/Section.js"
|
|
102
|
+
},
|
|
103
|
+
"./layout/HeaderSection": {
|
|
104
|
+
"types": "./dist/layout/HeaderSection.d.ts",
|
|
105
|
+
"default": "./dist/layout/HeaderSection.js"
|
|
106
|
+
},
|
|
107
|
+
"./layout/FooterSection": {
|
|
108
|
+
"types": "./dist/layout/FooterSection.d.ts",
|
|
109
|
+
"default": "./dist/layout/FooterSection.js"
|
|
110
|
+
},
|
|
111
|
+
"./layout/Header": {
|
|
112
|
+
"types": "./dist/layout/Header.d.ts",
|
|
113
|
+
"default": "./dist/layout/Header.js"
|
|
114
|
+
},
|
|
115
|
+
"./layout/Footer": {
|
|
116
|
+
"types": "./dist/layout/Footer.d.ts",
|
|
117
|
+
"default": "./dist/layout/Footer.js"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"type": "module",
|
|
121
|
+
"dependencies": {
|
|
122
|
+
"@wix/builder-state-react": "^1.22.5",
|
|
123
|
+
"@wix/builder-state": "^1.49.3",
|
|
124
|
+
"@wix/editor-components": "^1.16.0"
|
|
125
|
+
},
|
|
126
|
+
"falconPackageHash": "84bd255c072dd6dfec4e41cd37099d708fe051fb05052aa46b89ac1b"
|
|
6
127
|
}
|