@wix/origami-system-components 0.0.0-stage → 1.10.1

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.
Files changed (41) hide show
  1. package/README.md +139 -2
  2. package/dist/Anchor.d.ts +12 -0
  3. package/dist/Anchor.js +6 -0
  4. package/dist/FooterSection.d.ts +10 -0
  5. package/dist/FooterSection.js +7 -0
  6. package/dist/HeaderSection.d.ts +11 -0
  7. package/dist/HeaderSection.js +8 -0
  8. package/dist/InternalContainer.css +88 -0
  9. package/dist/InternalContainer.css.d.ts +1 -0
  10. package/dist/Page.d.ts +10 -0
  11. package/dist/Page.js +7 -0
  12. package/dist/Section.d.ts +11 -0
  13. package/dist/Section.js +8 -0
  14. package/dist/UnsupportedWidgetPlaceholder.css +56 -0
  15. package/dist/UnsupportedWidgetPlaceholder.d.ts +12 -0
  16. package/dist/UnsupportedWidgetPlaceholder.js +15 -0
  17. package/dist/hocs.js +22 -0
  18. package/dist/index.d.ts +6 -0
  19. package/dist/index.js +6 -0
  20. package/dist/layout/BaseInternalContainer.d.ts +21 -0
  21. package/dist/layout/BaseInternalContainer.js +133 -0
  22. package/dist/layout/Footer.d.ts +15 -0
  23. package/dist/layout/Footer.js +13 -0
  24. package/dist/layout/FooterSection.d.ts +9 -0
  25. package/dist/layout/FooterSection.js +12 -0
  26. package/dist/layout/Header.d.ts +15 -0
  27. package/dist/layout/Header.js +13 -0
  28. package/dist/layout/HeaderSection.d.ts +10 -0
  29. package/dist/layout/HeaderSection.js +13 -0
  30. package/dist/layout/InternalContainer.d.ts +15 -0
  31. package/dist/layout/InternalContainer.js +21 -0
  32. package/dist/layout/Section.d.ts +12 -0
  33. package/dist/layout/Section.js +10 -0
  34. package/dist/layout/container-contract.d.ts +5 -0
  35. package/dist/layout/container-contract.js +10 -0
  36. package/dist/layout/layout-constants.d.ts +5 -0
  37. package/dist/layout/layout-constants.js +7 -0
  38. package/dist/layout/layout-contract.d.ts +2 -0
  39. package/dist/layout/layout-contract.js +3 -0
  40. package/dist/site.global.css +5 -0
  41. package/package.json +119 -3
package/README.md CHANGED
@@ -1,3 +1,140 @@
1
- # Temporary Holding Version
1
+ # Origami system components
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
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
+ ```tsx
118
+ import InternalContainer from '@wix/origami-system-components/InternalContainer'
119
+
120
+ <InternalContainer id="comp-example" className="custom">Content</InternalContainer>
121
+ ```
122
+
123
+ It preserves background and pinned layers, normal or function children, and caller
124
+ classes. `role`, `tabIndex`, `data-scope`, and `data-repeater-items-indexes`
125
+ target the content div. Authoring metadata stays in exported source for import-back
126
+ and is outside the typed component API. Only explicitly supported props are forwarded,
127
+ so extra metadata does not reach the DOM. IDs must match `/^[a-zA-Z][\w-]*$/`;
128
+ invalid IDs throw rather than being normalized.
129
+
130
+ The root receives the ID class and caller classes. Content and overflow layers
131
+ receive `${id}-container` and `${id}-overflow-wrapper`. Overflow and content wrappers
132
+ are always enabled, and content defaults to `tabIndex={0}`, matching the playground.
133
+ The generated-site build runtime compiles DM semantic CSS onto these layers in convert
134
+ mode. The published component's CSS is retained; special sticky positioning remains an
135
+ explicit limitation rather than a claim of complete Thunderbolt layout parity.
136
+
137
+ The pure `@wix/origami-system-components/layout-contract` entry exports
138
+ `buildContainerClasses`, `isValidContainerId`, and `LAYOUT_FLAGS`. Its emitted imports
139
+ resolve in Node without React, CSS, component implementations, or the package root.
140
+ The build-time compiler uses it to target the same retained wrappers.
@@ -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_0716afec0a7d9e420f90135a7ccbacac/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
@@ -0,0 +1,10 @@
1
+ import type { ReactElement, ReactNode } from 'react'
2
+
3
+ export interface PageProps {
4
+ id: string
5
+ className?: string | undefined
6
+ children?: ReactNode
7
+ }
8
+
9
+ export declare function Page(props: PageProps): ReactElement
10
+ export default Page
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
@@ -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
+ };
@@ -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_0716afec0a7d9e420f90135a7ccbacac/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_0716afec0a7d9e420f90135a7ccbacac/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_0716afec0a7d9e420f90135a7ccbacac/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_0716afec0a7d9e420f90135a7ccbacac/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_0716afec0a7d9e420f90135a7ccbacac/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,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,5 @@
1
+ export declare const isValidContainerId: (id: string) => boolean;
2
+ export declare function buildContainerClasses(id: string): {
3
+ contentClass: string;
4
+ overflowClass: string;
5
+ };
@@ -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,5 @@
1
+ export declare const LAYOUT_FLAGS: {
2
+ readonly HAS_OVERFLOW: true;
3
+ readonly HAS_SCROLL_OVERFLOW: true;
4
+ readonly SHOULD_OMIT_WRAPPER_LAYERS: false;
5
+ };
@@ -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
+ };
@@ -0,0 +1,2 @@
1
+ export { buildContainerClasses, isValidContainerId } from './container-contract.js';
2
+ export { LAYOUT_FLAGS } from './layout-constants.js';
@@ -0,0 +1,3 @@
1
+ // Pure DOM contract shared by the React component and build-time CSS compiler.
2
+ export { buildContainerClasses, isValidContainerId } from './container-contract.js';
3
+ export { LAYOUT_FLAGS } from './layout-constants.js';
@@ -0,0 +1,5 @@
1
+ /* Root vars Thunderbolt sets on every site, as constants. Components' CSS reads them, e.g. the Menu dropdown's
2
+ `z-index: var(--above-all-z-index)`. Thunderbolt: MAX_Z_INDEX in thunderbolt-commons/src/zIndex.ts. */
3
+ :root {
4
+ --above-all-z-index: 100000;
5
+ }
package/package.json CHANGED
@@ -1,6 +1,122 @@
1
1
  {
2
2
  "name": "@wix/origami-system-components",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.10.1",
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
+ "typescript": "^6.0.3",
26
+ "vite": "^6.4.3",
27
+ "vitest": "^4.1.11"
28
+ },
29
+ "peerDependencies": {
30
+ "react": "^18.3.1"
31
+ },
32
+ "publishUnscoped": false,
33
+ "publishConfig": {
34
+ "registry": "https://registry.npmjs.org/",
35
+ "access": "public"
36
+ },
37
+ "wix": {
38
+ "artifact": {
39
+ "groupId": "com.wixpress.npm",
40
+ "artifactId": "origami-system-components",
41
+ "targets": {
42
+ "docker": false
43
+ }
44
+ },
45
+ "validations": {
46
+ "postBuild": [
47
+ "test",
48
+ "lint"
49
+ ]
50
+ }
51
+ },
52
+ "exports": {
53
+ ".": {
54
+ "types": "./dist/index.d.ts",
55
+ "default": "./dist/index.js"
56
+ },
57
+ "./InternalContainer": {
58
+ "types": "./dist/layout/InternalContainer.d.ts",
59
+ "default": "./dist/layout/InternalContainer.js"
60
+ },
61
+ "./site.global.css": "./dist/site.global.css",
62
+ "./InternalContainer.css": {
63
+ "types": "./dist/InternalContainer.css.d.ts",
64
+ "default": "./dist/InternalContainer.css"
65
+ },
66
+ "./Page": {
67
+ "types": "./dist/Page.d.ts",
68
+ "default": "./dist/Page.js"
69
+ },
70
+ "./Section": {
71
+ "types": "./dist/Section.d.ts",
72
+ "default": "./dist/Section.js"
73
+ },
74
+ "./HeaderSection": {
75
+ "types": "./dist/HeaderSection.d.ts",
76
+ "default": "./dist/HeaderSection.js"
77
+ },
78
+ "./FooterSection": {
79
+ "types": "./dist/FooterSection.d.ts",
80
+ "default": "./dist/FooterSection.js"
81
+ },
82
+ "./Anchor": {
83
+ "types": "./dist/Anchor.d.ts",
84
+ "default": "./dist/Anchor.js"
85
+ },
86
+ "./UnsupportedWidgetPlaceholder": {
87
+ "types": "./dist/UnsupportedWidgetPlaceholder.d.ts",
88
+ "default": "./dist/UnsupportedWidgetPlaceholder.js"
89
+ },
90
+ "./layout-contract": {
91
+ "types": "./dist/layout/layout-contract.d.ts",
92
+ "default": "./dist/layout/layout-contract.js"
93
+ },
94
+ "./layout/Section": {
95
+ "types": "./dist/layout/Section.d.ts",
96
+ "default": "./dist/layout/Section.js"
97
+ },
98
+ "./layout/HeaderSection": {
99
+ "types": "./dist/layout/HeaderSection.d.ts",
100
+ "default": "./dist/layout/HeaderSection.js"
101
+ },
102
+ "./layout/FooterSection": {
103
+ "types": "./dist/layout/FooterSection.d.ts",
104
+ "default": "./dist/layout/FooterSection.js"
105
+ },
106
+ "./layout/Header": {
107
+ "types": "./dist/layout/Header.d.ts",
108
+ "default": "./dist/layout/Header.js"
109
+ },
110
+ "./layout/Footer": {
111
+ "types": "./dist/layout/Footer.d.ts",
112
+ "default": "./dist/layout/Footer.js"
113
+ }
114
+ },
115
+ "type": "module",
116
+ "dependencies": {
117
+ "@wix/builder-state-react": "^1.22.5",
118
+ "@wix/builder-state": "^1.49.3",
119
+ "@wix/editor-components": "^1.16.0"
120
+ },
121
+ "falconPackageHash": "f2d02ba186dfcd328aa5fa4a362b9a489e356163d1f3ae114a5a46d5"
6
122
  }