@wix/system-core-components 1.3.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.
- package/README.md +38 -0
- package/dist/bundles/debug/es/system-core-components.mjs +3679 -0
- package/dist/bundles/debug/es/system-core-components.mjs.map +1 -0
- package/dist/bundles/debug/style.css +1 -0
- package/dist/bundles/debug/umd/system-core-components.js +3680 -0
- package/dist/bundles/debug/umd/system-core-components.js.map +1 -0
- package/dist/bundles/es/system-core-components.mjs +3579 -0
- package/dist/bundles/es/system-core-components.mjs.map +1 -0
- package/dist/bundles/style.css +1 -0
- package/dist/bundles/umd/system-core-components.js +2 -0
- package/dist/bundles/umd/system-core-components.js.map +1 -0
- package/dist/esm/Anchor.d.ts +2 -0
- package/dist/esm/Anchor.js +5 -0
- package/dist/esm/Anchor.js.map +1 -0
- package/dist/esm/FooterContainer_TransparentScreen.d.ts +4 -0
- package/dist/esm/FooterContainer_TransparentScreen.js +6 -0
- package/dist/esm/FooterContainer_TransparentScreen.js.map +1 -0
- package/dist/esm/FooterSection.d.ts +4 -0
- package/dist/esm/FooterSection.js +6 -0
- package/dist/esm/FooterSection.js.map +1 -0
- package/dist/esm/HeaderContainer_TransparentScreen.d.ts +6 -0
- package/dist/esm/HeaderContainer_TransparentScreen.js +7 -0
- package/dist/esm/HeaderContainer_TransparentScreen.js.map +1 -0
- package/dist/esm/HeaderSection.d.ts +6 -0
- package/dist/esm/HeaderSection.js +7 -0
- package/dist/esm/HeaderSection.js.map +1 -0
- package/dist/esm/PageGroup.d.ts +4 -0
- package/dist/esm/PageGroup.js +6 -0
- package/dist/esm/PageGroup.js.map +1 -0
- package/dist/esm/PageSections.d.ts +4 -0
- package/dist/esm/PageSections.js +6 -0
- package/dist/esm/PageSections.js.map +1 -0
- package/dist/esm/Page_BasicPageSkin.d.ts +4 -0
- package/dist/esm/Page_BasicPageSkin.js +6 -0
- package/dist/esm/Page_BasicPageSkin.js.map +1 -0
- package/dist/esm/Page_ResponsivePageWithColorBG.d.ts +4 -0
- package/dist/esm/Page_ResponsivePageWithColorBG.js +6 -0
- package/dist/esm/Page_ResponsivePageWithColorBG.js.map +1 -0
- package/dist/esm/PagesContainer.d.ts +3 -0
- package/dist/esm/PagesContainer.js +5 -0
- package/dist/esm/PagesContainer.js.map +1 -0
- package/dist/esm/ResponsiveContainer.d.ts +4 -0
- package/dist/esm/ResponsiveContainer.js +6 -0
- package/dist/esm/ResponsiveContainer.js.map +1 -0
- package/dist/esm/ResponsivePopupPage_WithoutOverlay.d.ts +6 -0
- package/dist/esm/ResponsivePopupPage_WithoutOverlay.js +7 -0
- package/dist/esm/ResponsivePopupPage_WithoutOverlay.js.map +1 -0
- package/dist/esm/Section.d.ts +6 -0
- package/dist/esm/Section.js +7 -0
- package/dist/esm/Section.js.map +1 -0
- package/dist/esm/hocs.d.ts +28 -0
- package/dist/esm/hocs.js +23 -0
- package/dist/esm/hocs.js.map +1 -0
- package/dist/esm/index.d.ts +13 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types/Anchor.d.ts +3 -0
- package/dist/types/Anchor.d.ts.map +1 -0
- package/dist/types/FooterContainer_TransparentScreen.d.ts +5 -0
- package/dist/types/FooterContainer_TransparentScreen.d.ts.map +1 -0
- package/dist/types/FooterSection.d.ts +5 -0
- package/dist/types/FooterSection.d.ts.map +1 -0
- package/dist/types/HeaderContainer_TransparentScreen.d.ts +7 -0
- package/dist/types/HeaderContainer_TransparentScreen.d.ts.map +1 -0
- package/dist/types/HeaderSection.d.ts +7 -0
- package/dist/types/HeaderSection.d.ts.map +1 -0
- package/dist/types/PageGroup.d.ts +5 -0
- package/dist/types/PageGroup.d.ts.map +1 -0
- package/dist/types/PageSections.d.ts +5 -0
- package/dist/types/PageSections.d.ts.map +1 -0
- package/dist/types/Page_BasicPageSkin.d.ts +5 -0
- package/dist/types/Page_BasicPageSkin.d.ts.map +1 -0
- package/dist/types/Page_ResponsivePageWithColorBG.d.ts +5 -0
- package/dist/types/Page_ResponsivePageWithColorBG.d.ts.map +1 -0
- package/dist/types/PagesContainer.d.ts +4 -0
- package/dist/types/PagesContainer.d.ts.map +1 -0
- package/dist/types/ResponsiveContainer.d.ts +5 -0
- package/dist/types/ResponsiveContainer.d.ts.map +1 -0
- package/dist/types/ResponsivePopupPage_WithoutOverlay.d.ts +7 -0
- package/dist/types/ResponsivePopupPage_WithoutOverlay.d.ts.map +1 -0
- package/dist/types/Section.d.ts +7 -0
- package/dist/types/Section.d.ts.map +1 -0
- package/dist/types/hocs.d.ts +29 -0
- package/dist/types/hocs.d.ts.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +73 -0
- package/src/Anchor.tsx +5 -0
- package/src/FooterContainer_TransparentScreen.tsx +6 -0
- package/src/FooterSection.tsx +6 -0
- package/src/HeaderContainer_TransparentScreen.tsx +7 -0
- package/src/HeaderSection.tsx +7 -0
- package/src/PageGroup.tsx +6 -0
- package/src/PageSections.tsx +6 -0
- package/src/Page_BasicPageSkin.tsx +6 -0
- package/src/Page_ResponsivePageWithColorBG.tsx +6 -0
- package/src/PagesContainer.tsx +5 -0
- package/src/ResponsiveContainer.tsx +6 -0
- package/src/ResponsivePopupPage_WithoutOverlay.tsx +7 -0
- package/src/Section.tsx +7 -0
- package/src/hocs.tsx +34 -0
- package/src/index.ts +13 -0
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wix/system-core-components",
|
|
3
|
+
"version": "1.3.1",
|
|
4
|
+
"description": "System core structural components for Wix sites",
|
|
5
|
+
"types": "dist/types/index.d.ts",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"license": "UNLICENSED",
|
|
8
|
+
"files": [
|
|
9
|
+
"src",
|
|
10
|
+
"dist",
|
|
11
|
+
"!**/*.tsbuildinfo"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build:esm": "tsc --project tsconfig.json --outDir dist/esm --module ES2022 --moduleResolution Bundler",
|
|
15
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationMap --outDir dist/types",
|
|
16
|
+
"build": "yarn run build:esm && yarn run build:types && yarn run -T build:bundles system-core-components",
|
|
17
|
+
"lint": "yarn run -T lint:package $npm_package_name",
|
|
18
|
+
"test-type-check": "tsc --project tsconfig.test.json",
|
|
19
|
+
"test": "yarn test-type-check && vitest --run",
|
|
20
|
+
"clean": "rm -rf coverage dist target tsconfig.tsbuildinfo"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@wix/builder-state-react": "1.22.1",
|
|
24
|
+
"@wix/editor-components": "^1.14.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@testing-library/react": "^16.3.0",
|
|
28
|
+
"@wix/builder-state": "^1.0.0",
|
|
29
|
+
"jsdom": "^23.0.1",
|
|
30
|
+
"react": "^18.3.1",
|
|
31
|
+
"typescript": "^5.3.3",
|
|
32
|
+
"vitest": "^4.0.10"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^18.3.1"
|
|
36
|
+
},
|
|
37
|
+
"publishUnscoped": false,
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"registry": "https://registry.npmjs.org/",
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"wix": {
|
|
43
|
+
"artifact": {
|
|
44
|
+
"groupId": "com.wixpress.npm",
|
|
45
|
+
"artifactId": "system-core-components",
|
|
46
|
+
"targets": {
|
|
47
|
+
"static": {
|
|
48
|
+
"folderToUpload": "dist/bundles"
|
|
49
|
+
},
|
|
50
|
+
"docker": false
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"validations": {
|
|
54
|
+
"postBuild": [
|
|
55
|
+
"test",
|
|
56
|
+
"lint"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"exports": {
|
|
61
|
+
".": {
|
|
62
|
+
"import": "./dist/esm/index.js",
|
|
63
|
+
"require": "./dist/bundles/umd/system-core-components.js",
|
|
64
|
+
"types": "./dist/types/index.d.ts"
|
|
65
|
+
},
|
|
66
|
+
"./*": {
|
|
67
|
+
"import": "./dist/esm/*.js",
|
|
68
|
+
"types": "./dist/types/*.d.ts"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"module": "dist/esm/index.js",
|
|
72
|
+
"falconPackageHash": "53b6e87dd80f497049e2a61c6346623588b1a6d064067526a7fcc1dc"
|
|
73
|
+
}
|
package/src/Anchor.tsx
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import Component from '@wix/editor-components/skin/FooterContainer/TransparentScreen'
|
|
3
|
+
import '@wix/editor-components/skin/FooterContainer/TransparentScreen/css'
|
|
4
|
+
import { withNormalChildren } from './hocs'
|
|
5
|
+
|
|
6
|
+
export const FooterContainer_TransparentScreen = withNormalChildren(Component)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { FooterSection as Component } from '@wix/editor-components/component/FooterSection'
|
|
3
|
+
import '@wix/editor-components/component/FooterSection/css'
|
|
4
|
+
import { withNormalChildren } from './hocs'
|
|
5
|
+
|
|
6
|
+
export const FooterSection = withNormalChildren(Component)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import Component from '@wix/editor-components/skin/HeaderContainer/TransparentScreen'
|
|
3
|
+
import { HeaderContainer as controller } from '@wix/editor-components/controller/HeaderContainer'
|
|
4
|
+
import '@wix/editor-components/skin/HeaderContainer/TransparentScreen/css'
|
|
5
|
+
import { withController, withNormalChildren } from './hocs'
|
|
6
|
+
|
|
7
|
+
export const HeaderContainer_TransparentScreen = withNormalChildren(withController(Component, controller))
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
import '@wix/editor-components/component/HeaderSection/css'
|
|
5
|
+
import { withController, withNormalChildren } from './hocs'
|
|
6
|
+
|
|
7
|
+
export const HeaderSection = withNormalChildren(withController(Component, controller))
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ResponsiveContainer as Component } from '@wix/editor-components/component/ResponsiveContainer'
|
|
3
|
+
import '@wix/editor-components/component/ResponsiveContainer/css'
|
|
4
|
+
import { withNormalChildren } from './hocs'
|
|
5
|
+
|
|
6
|
+
export const PageSections = withNormalChildren(Component)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import Component from '@wix/editor-components/skin/Page/ResponsivePageWithColorBG'
|
|
3
|
+
import '@wix/editor-components/skin/Page/ResponsivePageWithColorBG/css'
|
|
4
|
+
import { withNormalChildren } from './hocs'
|
|
5
|
+
|
|
6
|
+
export const Page_ResponsivePageWithColorBG = withNormalChildren(Component)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ResponsiveContainer as Component } from '@wix/editor-components/component/ResponsiveContainer'
|
|
3
|
+
import '@wix/editor-components/component/ResponsiveContainer/css'
|
|
4
|
+
import { withNormalChildren } from './hocs'
|
|
5
|
+
|
|
6
|
+
export const ResponsiveContainer = withNormalChildren(Component)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ResponsivePopupPage as Component } from '@wix/editor-components/component/ResponsivePopupPage'
|
|
3
|
+
import { ResponsivePopupPage as controller } from '@wix/editor-components/controller/ResponsivePopupPage'
|
|
4
|
+
import '@wix/editor-components/component/ResponsivePopupPage/css'
|
|
5
|
+
import { withController, withNormalChildren } from './hocs'
|
|
6
|
+
|
|
7
|
+
export const ResponsivePopupPage_WithoutOverlay = withNormalChildren(withController(Component, controller))
|
package/src/Section.tsx
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
import '@wix/editor-components/component/Section/css'
|
|
5
|
+
import { withController, withNormalChildren } from './hocs'
|
|
6
|
+
|
|
7
|
+
export const Section = withNormalChildren(withController(Component, controller))
|
package/src/hocs.tsx
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import { useStateOverrides } from '@wix/builder-state-react'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* An HOC that gets a container component that expects children as a function (like EditorElement components)
|
|
8
|
+
* and returns a container component that gets children as an array.
|
|
9
|
+
*/
|
|
10
|
+
export const withNormalChildren =
|
|
11
|
+
<P extends object>(Component: React.ComponentType<P & { children: () => React.ReactNode }>) =>
|
|
12
|
+
({ children, ...props }: P & { children?: React.ReactNode }) =>
|
|
13
|
+
<Component {...(props as unknown as P)}>{() => children || []}</Component>
|
|
14
|
+
|
|
15
|
+
type Controller<P extends { nickname: string }> = {
|
|
16
|
+
useComponentProps: (props: P, services: Record<string, unknown>, setters: unknown) => Partial<P>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* An HOC that connects a component to its EditorElements controller.
|
|
21
|
+
* As this is a special code for EditorElements, it should be moved to their project in the future.
|
|
22
|
+
*
|
|
23
|
+
* Note:
|
|
24
|
+
* Since the controller can update props, and since they have to be synced with velo if exists,
|
|
25
|
+
* every component with a controller should be connected by default. Since the consumer (widget genreated code)
|
|
26
|
+
* doesn't always connect the component, we do the connection here for now.
|
|
27
|
+
*/
|
|
28
|
+
export const withController =
|
|
29
|
+
<P extends { nickname: string }>(Component: React.ComponentType<P>, controller: Controller<P>) =>
|
|
30
|
+
(props: P) => {
|
|
31
|
+
const [propsOverrides = {} as Partial<P>, , setters] = useStateOverrides(props.nickname)
|
|
32
|
+
const controllerProps = controller.useComponentProps({ ...props, ...propsOverrides }, {}, setters)
|
|
33
|
+
return <Component {...props} {...controllerProps} />
|
|
34
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { Anchor } from './Anchor'
|
|
2
|
+
export { FooterContainer_TransparentScreen } from './FooterContainer_TransparentScreen'
|
|
3
|
+
export { FooterSection } from './FooterSection'
|
|
4
|
+
export { HeaderContainer_TransparentScreen } from './HeaderContainer_TransparentScreen'
|
|
5
|
+
export { HeaderSection } from './HeaderSection'
|
|
6
|
+
export { Page_BasicPageSkin } from './Page_BasicPageSkin'
|
|
7
|
+
export { Page_ResponsivePageWithColorBG } from './Page_ResponsivePageWithColorBG'
|
|
8
|
+
export { PageGroup } from './PageGroup'
|
|
9
|
+
export { PagesContainer } from './PagesContainer'
|
|
10
|
+
export { PageSections } from './PageSections'
|
|
11
|
+
export { ResponsiveContainer } from './ResponsiveContainer'
|
|
12
|
+
export { ResponsivePopupPage_WithoutOverlay } from './ResponsivePopupPage_WithoutOverlay'
|
|
13
|
+
export { Section } from './Section'
|