@wix/origami-system-components
v1.13.8
Published
Editor structural and system components for standalone Origami sites
Maintainers
Keywords
Readme
Origami system components
Structural editor components for standalone Origami sites. Direct component entries have named and default exports; the root index has named exports only.
| Component | Upstream source | Wrapping |
| --- | --- | --- |
| InternalContainer | @wix/editor-system-components/InternalContainer | Fixed wrapper layers, derived classes, supported props |
| Anchor | @wix/editor-components/component/Anchor | None |
| UnsupportedWidgetPlaceholder | None (self-contained) | None |
UnsupportedWidgetPlaceholder stands in for vertical and non-builder widgets that have no
Origami rendering yet. It draws a dashed box and a message, "The {componentName} will be
rendered after importing the site back to {platformName}", that stays sticky in the
viewport while a tall placeholder scrolls. message replaces the whole text, and the
--placeholder-sticky-top custom property offsets it below a fixed header. It takes the
size the page's layout gives the widget, never its text's: with no set height it is square
on a small widget and 120px tall on a wide one, and a widget sized to its content gets a
48px square. When the box is too small for the text (120px wide or less, or too short for
two lines), it shows only the dashed box. It imports only React and its own
UnsupportedWidgetPlaceholder.css, which the build copies to dist.
There are no Thunderbolt-generated components (PageSections, PinnedLayer, ResponsiveContainer, PagesContainer, PageGroup, HeaderContainer, FooterContainer, ResponsivePopupPage). Anchor is for exported user anchors; Page renders the top/bottom scroll targets itself.
Importing
For hand-written site code:
import { Anchor, UnsupportedWidgetPlaceholder } from '@wix/origami-system-components'The index excludes InternalContainer: use the adapted component from
@wix/origami-system-components/InternalContainer. The structural components are
@wix/origami-system-components/Page, /Section, /HeaderSection
and /FooterSection. These plain React components render a section around
ordinary children, with the authored InternalContainer owning the background and
content layers. They do not include controllers, scroll effects or section CSS.
/Header and /Footer are also public named/default exports. Exported
files containing document.Header or document.Footer resolve to these landmarks.
A shared Header_<id> / Footer_<id> definition may receive ({ id, className })
and pass that identity to its landmark, wrapping exactly one matching
HeaderSection / FooterSection with its own InternalContainer. Lint recognizes
this shape and the renamed shared references. The generator does not introduce
landmarks into definitions that do not already contain them; server-side Editor
conversion of that structure remains a separate integration.
Vite production builds drop unused components while retaining used CSS
thanks to "sideEffects": ["**/*.css"]. There are no wildcard exports.
Delivery
InternalContainer is bundled because its upstream has a Wix dependency tree.
@wix/editor-system-components stays a development dependency, absent from consumer
installs. The adapter imports InternalContainer.css itself so Vite preserves it
during pre-bundling. The upstream implementation is private.
Anchor compiles with plain tsc (ES2022, classic React JSX) and installs
@wix/editor-components: ^1.16.0 at runtime. That public npm package is
pre-bundled per component with zero dependencies and React, React DOM, and lodash
peers. Only React is needed by Anchor; we add neither React DOM nor lodash.
Editor fixes—and behavior changes—can reach sites without a release here.
Anchor imports the real dist/**/*.css file: Vite dev pre-bundling drops
extensionless CSS imports. It has no copied CSS or CSS export.
React remains a peer. The semantic CSS compiler depends directly on this package;
only dist, metadata, and this README are published. Anchor's hand-written
declaration avoids unpublished upstream types; it accepts no children.
InternalContainer declarations are emitted from its adapted props.
Style contract
@wix/origami-system-components/InternalContainer/component-contract.json lists what the
import takes in an InternalContainer's style.css: no CSS property and no state, only its 18
custom properties (--borderTopWidth, …, --boxShadow, --backdropFilter), as the DMS
InternalContainer.Style schema allows them (TB-16696). It has the shape of a wrapper's
component-contract.json; origami-lint's style-properties-allowed and state-classes read it.
Change it when that schema changes.
@wix/origami-system-components/no-own-style.json lists, by DM type, the components style.css may not style
by their own class (.comp-x, .comp-x:hover, .comp-page:hover .comp-x): DM has no style for them, so the
import refuses such a rule with "component type has no style". RefComponent is a global component's tag on a page. A state on
Section or HeaderSection followed by another element (.comp-x:hover .comp-y) imports: it styles comp-y. None of them has parts
(DM gives parts only to builder components), so .comp-x .label is refused with "style.css does not parse:
Invalid selector". origami-lint's system-style-allowed reads it. Each type was checked by a live import
(2026-11-16, again 2026-11-24); a type not listed hasn't been.
Build and tests
Run pnpm --filter @wix/origami-system-components run build, then
pnpm --filter @wix/origami-system-components test. Build before packing.
build.mjs clears dist, bundles InternalContainer/CSS, and copies declarations;
tsc emits Anchor, the placeholder, the index and the structural components without
source maps, using the editor-components ambient shim. Only React imports may escape
InternalContainer's private bundle; tests check Anchor's imports, exports, and standalone React-only types.
Packed consumers verify InternalContainer without upstream packages, Anchor and Page CSS in
Vite dev, production CSS, and index tree-shaking.
Package DOM and ID-validation tests and the generator's packed-site test cover integration.
Adding a component
Add a client .tsx entry, named/default exports, a standalone declaration, explicit
package export, and packed-consumer coverage. For an upstream with dependencies,
bundle it as a development dependency, build/export CSS with a matching .css.d.ts,
and retain the leak check. For a self-contained upstream, install it as a production dependency,
include the source in tsconfig.build.json, and add its declaration to the copy list.
Use real .css imports. Editor-wrapping imports are limited to React, editor
component entries, and editor dist/**/*.css.
Release order
Publish this package before the consuming @wix/origami-site and generator releases.
Keep the source package version at 1.0.0 and generated site dependencies at ^1.0.0;
the release process bumps the published version automatically.
Standard artifact configuration publishes the built package; local builds and packs do not publish.
Layout contract
Page
@wix/origami-system-components/Page provides named/default Page exports
and PageProps. Exported sites import /Page, like the section components.
import Page from '@wix/origami-system-components/Page'
import Section from '@wix/origami-system-components/Section'
<Page id="page" className="authored-page"
backgroundLayer={[<div key="color" className="page-color" />]}
header={<SharedHeader id="header-instance" className="header-instance" />}
footer={<SharedFooter id="footer-instance" className="footer-instance" />}>
<Section id="first">{/* InternalContainer and content */}</Section>
<Section id="second">{/* InternalContainer and content */}</Section>
</Page>The required id and optional className belong to the outer div. Page adds its
structural origami-page class, without deriving a class from the ID. Only supported
props are forwarded. backgroundLayer is an optional array of React nodes; header,
footer, and children are optional React nodes. Callers supply at most one
Header-producing element and one Footer-producing element in their named slots,
and Section-producing children in authored order. Shared definitions are supported.
Page does not inspect component types or validate cardinality. Arrays require
caller-supplied stable keys. Additional slots are out of scope.
autoOpenPopup is the page's auto-open popup, DM's load → openPopup params with the
popup's pageUriSEO in place of its targetId:
<Page id="c1dmp" autoOpenPopup={{ pageUriSEO: 'newsletter', delay: 2 }}>delay seconds after the page mounts (at once without one), Page calls
@wix/site-service-lightbox's open({ slug: pageUriSEO }), and warns if it rejects.
Unmounting clears the timer. It opens once per visit: the sessionStorage key
wix-auto-popup-shown-<pageUriSEO> is set when it opens, the site's ?popup= sets it too, and
the site clears the keys on a hard reload. Other DM params are kept for the round trip. Page renders
inside the site's services: @wix/services-manager-react is a peer, so the site has one
services context.
Popup root
@wix/origami-system-components/PopupRoot provides named/default PopupRoot exports
and PopupRootProps. It is the root of a popup's structure.jsx, in place of Page,
and files containing document.PopupRoot resolve to it.
<CmsProvider_Items>
<PopupRoot id="s0avc" className="s0avc" skin="WithoutOverlay" data={{ type: 'Page', title: 'Newsletter' }}>
<PopupContainer id="comp-popup">{/* content */}</PopupContainer>
</PopupRoot>
</CmsProvider_Items>It carries the DM popup page's id, className, skin and data for the round trip,
and renders only its children, so it adds nothing to the DOM: no #top / #bottom
targets, landmarks or layers, and the className rule in layout.css matches nothing.
The site tree reads the popup's title from its data.title. A context provider above it
still reaches the popup's content.
Pinned to screen
A page child pinned to the screen (FixedItemLayout) is rendered in one of two ways.
A pinned Section, header or footer stays in its slot, wrapped in
@wix/origami-system-components/PinnedToScreen
(header={<PinnedToScreen><SharedHeader /></PinnedToScreen>}, or among the
children). The wrapper takes exactly one child and no props, and goes outside the
child's <interact-element>. Every other pinned page child (buttons, boxes, widgets)
goes in Page's viewportLayer array, in its saved relative order. The layer renders
after the footer, only when the array is non-empty.
Both are fixed, screen-covering one-cell grids with pointer-events: none. The child
docks with its own align-self, justify-self, margins and size, and sits in the one
cell through grid-row: 1 / 2; grid-column: 1 / 2 in its layout.css, which the JSX
converter writes for every pinned element. Both give their direct children
pointer-events: auto at zero specificity, so a child's own value still wins; it
inherits through a child's display: contents <interact-element> and
.wix-presets-wrapper. The z-index depends only on the slot:
header wrapper and viewport layer 52, footer wrapper 49, Section wrappers auto. Content z-indexes
must stay at 51 or below. Only direct page children can be pinned, on every breakpoint
or on none.
During the DM transition, structure.jsx also accepts Header, Footer, and Background
elements as Page children. The site's JSX compatibility pass moves these into
header, footer, and backgroundLayer at build time, including shared
Header_<id> / Footer_<id> imports and backgrounds inside literal fragments.
Sections retain their authored order. Props and legacy children can be mixed;
an explicit slot prop (including null) replaces children for that slot.
This uses import bindings rather than runtime component names and leaves the
authored structure unchanged for round trips. Outside the site's build pipeline,
pass the slot props directly.
Rendering order is the #top target, background wrapper, header, one main containing
children, footer, viewport layer, and the #bottom target.
Absent header/footer add no wrappers; the background, main and both targets remain when empty.
The targets are bare, childless divs with no role or ARIA, absolutely positioned at the
page's top and bottom edge so they take no cell in the authored grid. They are where the
#top / #bottom hrefs that link-utils emits for top/bottom anchor links land
(#top also works without an element). Page is the document page: popups must not
render it, or the IDs would repeat.
Header/Footer preserve their identities and remain direct Page children. Sections
are main's descendants, not necessarily its children: a Section with interactions
renders inside an <interact-element> boundary, which the interactions service styles
display: contents, so the section remains a page layout item. Target sections by their ID or class rather than with
main > .section, and account for main and the boundary in parent traversal.
A route shell must not add a second main landmark. Skip links can target Section IDs (sections have tabIndex=-1).
Page imports its own scoped CSS, retained through package imports in Vite dev and
production. The relative root contains an absolute inset background with background-only
clipping. Background children overlap in one grid cell; main uses display: contents.
Authored CSS owns foreground grid layout, sizing, overflow, and sticky/fixed placement
and z-index on Header/Footer instances. It must keep foreground content above the
positioned background for the chosen layout. Page adds no stacking context, negative
z-index, or foreground clipping.
The authored browser fixture is in test/fixtures/page. After building, run
pnpm --filter @wix/origami-system-components exec vite test/fixtures/page.
The default fixture exercises two background layers, transparent sections, a shared
sticky header/footer, skip links, pointer interaction, and foreground overflow.
Use ?fixed for fixed landmarks, ?bare for omitted landmarks, and ?empty for
omitted landmarks/children and an empty background array. Check desktop and mobile
widths, scroll positioning, one exposed main, section focus targets, and console warnings.
Validated in headless Chromium at 1280×800 and 390×800 (2026-10-22), for all four fixture variants: background bounds equal Page bounds, background nodes overlap, sections occupy consecutive rows without a background row, pointer clicks reach the button, and skip-link activation focuses the first section. Sticky and fixed landmarks remain at the viewport edges after scrolling. Chromium's accessibility tree exposes one main even for empty content (the empty Page itself has zero height). No duplicate IDs, React key warnings, or browser errors were observed. Screenshots confirm background clipping and visible foreground overflow. This covers the authored fixture shell; integration with generated route shells and other browser/accessibility combinations still requires verification during migration.
InternalContainer
import InternalContainer from '@wix/origami-system-components/InternalContainer'
<InternalContainer id="comp-example" className="custom">Content</InternalContainer>It preserves background and pinned layers, normal or function children, and caller
classes. role, tabIndex, data-scope, and data-repeater-items-indexes
target the content div. Authoring metadata stays in exported source for import-back
and is outside the typed component API. Only explicitly supported props are forwarded,
so extra metadata does not reach the DOM. IDs must match /^[a-zA-Z][\w-]*$/;
invalid IDs throw rather than being normalized.
The root receives the ID class and caller classes. Content and overflow layers
receive ${id}-container and ${id}-overflow-wrapper. Overflow and content wrappers
are always enabled, and content defaults to tabIndex={0}, matching the playground.
The generated-site build runtime compiles DM semantic CSS onto these layers in convert
mode. The published component's CSS is retained; special sticky positioning remains an
explicit limitation rather than a claim of complete Thunderbolt layout parity.
The pure @wix/origami-system-components/layout-contract entry exports
buildContainerClasses, isValidContainerId, and LAYOUT_FLAGS. Its emitted imports
resolve in Node without React, CSS, component implementations, or the package root.
The build-time compiler uses it to target the same retained wrappers.
