@ossy/connected-components 0.1.4 → 0.1.6
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/build/index.js +638 -0
- package/package.json +7 -3
- package/.storybook/main.js +0 -19
- package/.storybook/preview.js +0 -13
- package/CHANGELOG.md +0 -166
- package/rollup.config.js +0 -31
- package/src/app/App.jsx +0 -29
- package/src/app/App.stories.jsx +0 -36
- package/src/app/AppSettings.jsx +0 -22
- package/src/app/index.js +0 -3
- package/src/app/useAnalytics.jsx +0 -18
- package/src/index.js +0 -11
- package/src/layout/Layout.jsx +0 -25
- package/src/layout/Layout.stories.jsx +0 -16
- package/src/layout/index.js +0 -1
- package/src/ossybot/Ossybot.jsx +0 -67
- package/src/ossybot/Ossybot.stories.jsx +0 -26
- package/src/ossybot/index.js +0 -1
- package/src/page/Page.jsx +0 -33
- package/src/page/Page.stories.jsx +0 -17
- package/src/page/index.js +0 -1
- package/src/page-data-loader/PageDataLoader.jsx +0 -90
- package/src/page-data-loader/PageDataLoader.stories.jsx +0 -16
- package/src/page-data-loader/index.js +0 -1
- package/src/pages-module/PagesModule.jsx +0 -8
- package/src/pages-module/PagesModule.stories.jsx +0 -17
- package/src/pages-module/index.js +0 -1
- package/src/resume/Resume.jsx +0 -13
- package/src/resume/Resume.stories.jsx +0 -23
- package/src/resume/Resume.template.js +0 -80
- package/src/resume/index.js +0 -3
- package/src/resume/useResume.js +0 -112
- package/src/section/Section.jsx +0 -93
- package/src/section/Section.stories.jsx +0 -17
- package/src/section/index.js +0 -1
- package/src/stories/Button.jsx +0 -39
- package/src/stories/Button.stories.js +0 -49
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.jsx +0 -56
- package/src/stories/Header.stories.js +0 -29
- package/src/stories/Page.jsx +0 -69
- package/src/stories/Page.stories.js +0 -28
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -68
- package/src/theme-editor/ThemeEditor.jsx +0 -132
- package/src/theme-editor/ThemeEditor.stories.jsx +0 -16
- package/src/theme-editor/index.js +0 -1
- package/src/theme-provider/ThemeProvider.jsx +0 -9
- package/src/theme-provider/ThemeProvider.stories.jsx +0 -16
- package/src/theme-provider/index.js +0 -1
- package/src/use-active-page-location/index.js +0 -1
- package/src/use-active-page-location/useActivePageLocation.js +0 -54
package/CHANGELOG.md
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## 0.1.4 (2025-10-31)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* **app:** add @babel/preset-env ([#7](https://github.com/ossy-se/packages/issues/7)) ([252b41a](https://github.com/ossy-se/packages/commit/252b41a6d4e3d7d3750661091c97186b0d9cdde2))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## 0.1.3 (2025-10-31)
|
|
18
|
-
|
|
19
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## 0.1.2 (2025-10-31)
|
|
26
|
-
|
|
27
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## 0.1.1 (2025-10-31)
|
|
34
|
-
|
|
35
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# 0.1.0 (2025-10-30)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
### Features
|
|
45
|
-
|
|
46
|
-
* **sdk:** get current workspace ([#4](https://github.com/ossy-se/packages/issues/4)) ([afce7d5](https://github.com/ossy-se/packages/commit/afce7d5787af42691f62c9eba672ea1be000e19e))
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
## 0.0.16 (2025-10-30)
|
|
53
|
-
|
|
54
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
## 0.0.15 (2025-10-27)
|
|
61
|
-
|
|
62
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
## 0.0.14 (2025-10-27)
|
|
69
|
-
|
|
70
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
## 0.0.13 (2025-10-27)
|
|
77
|
-
|
|
78
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
## 0.0.12 (2025-10-27)
|
|
85
|
-
|
|
86
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
## 0.0.11 (2025-10-27)
|
|
93
|
-
|
|
94
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
## 0.0.10 (2025-10-25)
|
|
101
|
-
|
|
102
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
## 0.0.9 (2025-10-25)
|
|
109
|
-
|
|
110
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
## 0.0.8 (2025-10-25)
|
|
117
|
-
|
|
118
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
## 0.0.7 (2025-10-25)
|
|
125
|
-
|
|
126
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
## 0.0.6 (2025-10-25)
|
|
133
|
-
|
|
134
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
## 0.0.5 (2025-10-25)
|
|
141
|
-
|
|
142
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
## 0.0.4 (2025-10-25)
|
|
149
|
-
|
|
150
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
## 0.0.3 (2025-10-25)
|
|
157
|
-
|
|
158
|
-
**Note:** Version bump only for package @ossy/connected-components
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
## 0.0.2 (2025-10-25)
|
|
165
|
-
|
|
166
|
-
**Note:** Version bump only for package @ossy/connected-components
|
package/rollup.config.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import babel from '@rollup/plugin-babel'
|
|
2
|
-
import { nodeResolve as resolveDependencies } from '@rollup/plugin-node-resolve'
|
|
3
|
-
import resolveCommonJsDependencies from '@rollup/plugin-commonjs'
|
|
4
|
-
import removeOwnPeerDependencies from 'rollup-plugin-peer-deps-external'
|
|
5
|
-
import minifyJS from '@rollup/plugin-terser'
|
|
6
|
-
// import typescript from '@rollup/plugin-typescript'
|
|
7
|
-
import preserveDirectives from "rollup-plugin-preserve-directives"
|
|
8
|
-
|
|
9
|
-
export default [
|
|
10
|
-
{
|
|
11
|
-
input: 'src/index.js',
|
|
12
|
-
output: [
|
|
13
|
-
{
|
|
14
|
-
dir: 'build',
|
|
15
|
-
format: 'esm'
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
plugins: [
|
|
19
|
-
removeOwnPeerDependencies(),
|
|
20
|
-
resolveCommonJsDependencies(),
|
|
21
|
-
resolveDependencies(),
|
|
22
|
-
babel({
|
|
23
|
-
exclude: ['**/node_modules/**/*'],
|
|
24
|
-
presets: ['@babel/preset-react']
|
|
25
|
-
}),
|
|
26
|
-
preserveDirectives(),
|
|
27
|
-
// minifyJS(),
|
|
28
|
-
// typescript({ tsconfig: "./tsconfig.json" }),
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
]
|
package/src/app/App.jsx
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { createContext } from 'react'
|
|
2
|
-
import { SDK } from '@ossy/sdk'
|
|
3
|
-
import { WorkspaceProvider } from '@ossy/sdk-react'
|
|
4
|
-
import { Theme } from '@ossy/design-system'
|
|
5
|
-
import { ThemeEditor } from '../theme-editor/ThemeEditor.jsx'
|
|
6
|
-
import { defaultAppSettings } from './AppSettings.jsx'
|
|
7
|
-
import { Router } from '@ossy/router-react'
|
|
8
|
-
|
|
9
|
-
export const AppContext = createContext(defaultAppSettings())
|
|
10
|
-
|
|
11
|
-
export const App = (_appSettings) => {
|
|
12
|
-
const appSettings = { ...defaultAppSettings(), ..._appSettings }
|
|
13
|
-
|
|
14
|
-
const sdk = SDK.of({
|
|
15
|
-
apiUrl: appSettings.apiUrl,
|
|
16
|
-
workspaceId: appSettings.workspaceId
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<AppContext.Provider value={appSettings}>
|
|
21
|
-
<Theme theme={appSettings.theme} themes={appSettings.themes}>
|
|
22
|
-
<WorkspaceProvider sdk={sdk}>
|
|
23
|
-
<Router {..._appSettings} />
|
|
24
|
-
{ appSettings.devMode && <ThemeEditor />}
|
|
25
|
-
</WorkspaceProvider>
|
|
26
|
-
</Theme>
|
|
27
|
-
</AppContext.Provider>
|
|
28
|
-
)
|
|
29
|
-
}
|
package/src/app/App.stories.jsx
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { App } from './App.jsx'
|
|
3
|
-
import { Ossy } from '@ossy/themes'
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'App',
|
|
7
|
-
component: App,
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const Story = props => <></>
|
|
12
|
-
|
|
13
|
-
export const Default = Story.bind({})
|
|
14
|
-
Default.args = {
|
|
15
|
-
workspaceId: '',
|
|
16
|
-
theme: Ossy,
|
|
17
|
-
routes: [
|
|
18
|
-
{
|
|
19
|
-
path: '/',
|
|
20
|
-
element: (
|
|
21
|
-
<>
|
|
22
|
-
<a href="/test">Click me</a>
|
|
23
|
-
<a href="test">me me me</a>
|
|
24
|
-
<a href="localhost">No click me</a>
|
|
25
|
-
<a href="https://www.google.com" target="_blank">External with target</a>
|
|
26
|
-
<a href="http://www.google.com">External http link!</a>
|
|
27
|
-
<a href="https://www.google.com">External https link!</a>
|
|
28
|
-
</>
|
|
29
|
-
)
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
path: '/test',
|
|
33
|
-
element: <>test </>
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
package/src/app/AppSettings.jsx
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { useContext } from 'react'
|
|
3
|
-
import { AppContext } from './App.jsx'
|
|
4
|
-
|
|
5
|
-
export const useAppSettings = () => useContext(AppContext)
|
|
6
|
-
|
|
7
|
-
export function defaultAppSettings() {
|
|
8
|
-
return {
|
|
9
|
-
workspaceId: undefined,
|
|
10
|
-
defaultLanguage: undefined,
|
|
11
|
-
supportedLanguages: [],
|
|
12
|
-
theme: undefined,
|
|
13
|
-
themes: undefined,
|
|
14
|
-
routes: [],
|
|
15
|
-
initialEntries: [],
|
|
16
|
-
initialIndex: 0,
|
|
17
|
-
router: 'browser',
|
|
18
|
-
gaId: undefined,
|
|
19
|
-
apiUrl: undefined,
|
|
20
|
-
devMode: false
|
|
21
|
-
}
|
|
22
|
-
}
|
package/src/app/index.js
DELETED
package/src/app/useAnalytics.jsx
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// import { useEffect } from 'react'
|
|
2
|
-
// import Analytics from 'react-ga4'
|
|
3
|
-
// import { useAppSettings } from './AppSettings.jsx'
|
|
4
|
-
|
|
5
|
-
// function useAnalytics(url) {
|
|
6
|
-
// const { gaId } = useAppSettings()
|
|
7
|
-
|
|
8
|
-
// useEffect(() => {
|
|
9
|
-
// if (!gaId) return
|
|
10
|
-
// Analytics.initialize(gaId)
|
|
11
|
-
// }, [gaId])
|
|
12
|
-
|
|
13
|
-
// useEffect(() => {
|
|
14
|
-
// if (!url) return
|
|
15
|
-
// Analytics.send({ hitType: 'pageview', page: url, path: url })
|
|
16
|
-
// }, [url])
|
|
17
|
-
|
|
18
|
-
// }
|
package/src/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './app/index.js'
|
|
2
|
-
export * from './layout/index.js'
|
|
3
|
-
export * from './ossybot/index.js'
|
|
4
|
-
export * from './page/index.js'
|
|
5
|
-
export * from './page-data-loader/index.js'
|
|
6
|
-
export * from './pages-module/index.js'
|
|
7
|
-
export * from './resume/index.js'
|
|
8
|
-
// export * from './section/index.js'
|
|
9
|
-
export * from './theme-editor/index.js'
|
|
10
|
-
export * from './theme-provider/index.js'
|
|
11
|
-
export * from './use-active-page-location/index.js'
|
package/src/layout/Layout.jsx
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { useMemo, useEffect, useState } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
useResource,
|
|
4
|
-
AsyncStatus
|
|
5
|
-
} from '@ossy/sdk-react'
|
|
6
|
-
|
|
7
|
-
export const Layout = ({
|
|
8
|
-
layoutId,
|
|
9
|
-
...props
|
|
10
|
-
}) => {
|
|
11
|
-
const { status, resource } = useResource(layoutId)
|
|
12
|
-
|
|
13
|
-
const layoutStyles = useMemo(() => !resource.data
|
|
14
|
-
? {}
|
|
15
|
-
: ({
|
|
16
|
-
display: 'grid',
|
|
17
|
-
gridTemplateRows: resource.data.rows,
|
|
18
|
-
gridTemplateColumns: resource.data.columns,
|
|
19
|
-
gridTemplateAreas: resource.data.areas
|
|
20
|
-
}), [resource])
|
|
21
|
-
|
|
22
|
-
return status === AsyncStatus.Success
|
|
23
|
-
? (<div {...props} style={layoutStyles} />)
|
|
24
|
-
: <></>
|
|
25
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Layout } from './Layout.jsx'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Connected components/Layout',
|
|
6
|
-
component: Layout,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'fullscreen',
|
|
9
|
-
workspaceId: '36zDqF0TKZZ5KkJdyg7NH'
|
|
10
|
-
},
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const Story = props => <Layout {...props}/>
|
|
14
|
-
|
|
15
|
-
export const Default = Story.bind({})
|
|
16
|
-
Default.args = { }
|
package/src/layout/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Layout.jsx'
|
package/src/ossybot/Ossybot.jsx
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from '@ossy/design-system';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// https://twitter.com/jh3yy/status/1762979019446698310
|
|
6
|
-
// button:hover span:after {
|
|
7
|
-
// animation: flip 0.2s calc(var(--i) * 0.05s);
|
|
8
|
-
// }
|
|
9
|
-
// @keyframes flip {
|
|
10
|
-
// 20% { content: '_'; }
|
|
11
|
-
// 40% { content: var(--c1); }
|
|
12
|
-
// 60% { content: var(--c2); }
|
|
13
|
-
// }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// <button>
|
|
17
|
-
// <span style="--i: 0; --c1: 'x'; --c2: '$'; --c3: '≈';">C</span>
|
|
18
|
-
// <span style="--i: 1; --c1: 'ç'; --c2: '&'; --c3: 'π';">l</span>
|
|
19
|
-
// <!-- Other characters -->
|
|
20
|
-
// <span class="sr-only">Click Me</span>
|
|
21
|
-
// </button>
|
|
22
|
-
|
|
23
|
-
export const Ossybot = ({
|
|
24
|
-
style = {},
|
|
25
|
-
surface = "cta",
|
|
26
|
-
icon,
|
|
27
|
-
...props
|
|
28
|
-
}) => {
|
|
29
|
-
return (
|
|
30
|
-
<>
|
|
31
|
-
<style href="@ossy/design-system/ossybot" precedence="high">
|
|
32
|
-
{`
|
|
33
|
-
@keyframes flip {
|
|
34
|
-
0% {
|
|
35
|
-
content: '_';
|
|
36
|
-
}
|
|
37
|
-
60% {
|
|
38
|
-
content: var(--c1);
|
|
39
|
-
}
|
|
40
|
-
100% {
|
|
41
|
-
content: var(--c2);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* Define the animation */
|
|
46
|
-
[data-animation="flip"] {
|
|
47
|
-
animation: flip 0.2s calc(var(--i) * 0.05s) infinite;
|
|
48
|
-
}
|
|
49
|
-
`}
|
|
50
|
-
</style>
|
|
51
|
-
<Button
|
|
52
|
-
data-animation="flip"
|
|
53
|
-
prefix={{ name: icon, size: 'm'}}
|
|
54
|
-
variant={surface}
|
|
55
|
-
{...props}
|
|
56
|
-
style={{
|
|
57
|
-
'--size': '64px',
|
|
58
|
-
width: 'var(--size)',
|
|
59
|
-
height: 'var(--size)',
|
|
60
|
-
padding: 'var(--space-m)',
|
|
61
|
-
borderRadius: '999px',
|
|
62
|
-
...style,
|
|
63
|
-
}}
|
|
64
|
-
/>
|
|
65
|
-
</>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Ossybot } from './Ossybot.jsx'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Connected components/Ossybot',
|
|
6
|
-
component: Ossybot,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'centered',
|
|
9
|
-
workspaceId: '36zDqF0TKZZ5KkJdyg7NH',
|
|
10
|
-
renderInsideApp: true
|
|
11
|
-
},
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Story = props => <Ossybot {...props} />
|
|
15
|
-
|
|
16
|
-
export const Default = Story.bind({})
|
|
17
|
-
Default.args = { }
|
|
18
|
-
|
|
19
|
-
export const Add = Story.bind({})
|
|
20
|
-
Add.args = { icon: 'math-plus'}
|
|
21
|
-
|
|
22
|
-
export const Custom = Story.bind({})
|
|
23
|
-
Custom.args = { icon: 'loadbar-sound' }
|
|
24
|
-
|
|
25
|
-
export const Ascii = Story.bind({})
|
|
26
|
-
Ascii.args = { label: '(≧︿≦)' }
|
package/src/ossybot/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Ossybot.jsx'
|
package/src/page/Page.jsx
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useResources } from '@ossy/sdk-react'
|
|
2
|
-
import { useActivePageLocation } from '../use-active-page-location'
|
|
3
|
-
import { Layout } from '../layout'
|
|
4
|
-
import { Section } from '../section'
|
|
5
|
-
|
|
6
|
-
export const Page = () => {
|
|
7
|
-
const activePageLocation = useActivePageLocation()
|
|
8
|
-
const { resources: folder } = useResources(`/pages${activePageLocation}`)
|
|
9
|
-
const pageSettings = folder.find(entry => entry.name === 'Page settings')
|
|
10
|
-
const sections = folder.filter(entry => entry.name.endsWith('Section'))
|
|
11
|
-
|
|
12
|
-
const title = pageSettings?.data?.title
|
|
13
|
-
const layout = pageSettings?.data?.layout
|
|
14
|
-
|
|
15
|
-
if (!pageSettings) return
|
|
16
|
-
|
|
17
|
-
setSections(sections)
|
|
18
|
-
|
|
19
|
-
return !!pageSettings && (
|
|
20
|
-
(
|
|
21
|
-
<Layout layoutId={pageSettings.layout}>
|
|
22
|
-
{ sections.map(section => (
|
|
23
|
-
<Section
|
|
24
|
-
key={section.data.slotName}
|
|
25
|
-
slotName={section.data.slotName}
|
|
26
|
-
componentId={section.data.componentId}
|
|
27
|
-
componentProps={section.data.componentProps}
|
|
28
|
-
/>
|
|
29
|
-
))}
|
|
30
|
-
</Layout>
|
|
31
|
-
)
|
|
32
|
-
)
|
|
33
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Page } from './Page.jsx'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Connected components/Page',
|
|
6
|
-
component: Page,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'fullscreen',
|
|
9
|
-
workspaceId: '36zDqF0TKZZ5KkJdyg7NH',
|
|
10
|
-
renderInsideApp: true
|
|
11
|
-
},
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Story = props => <Page {...props}/>
|
|
15
|
-
|
|
16
|
-
export const Default = Story.bind({})
|
|
17
|
-
Default.args = { }
|
package/src/page/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Page.jsx'
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react'
|
|
2
|
-
import { useResources, AsyncStatus } from '@ossy/sdk-react'
|
|
3
|
-
import { Switch, useDocumentTitle } from '@ossy/design-system'
|
|
4
|
-
import { useActivePageLocation } from '../use-active-page-location'
|
|
5
|
-
|
|
6
|
-
const getLoadingPageSettings = () => ({
|
|
7
|
-
title: 'Loading...'
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
const getErrorPageSettings = () => ({
|
|
11
|
-
title: 'Error'
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
const getNotFoundPageSettings = () => ({
|
|
15
|
-
title: 'Not found'
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
const getDefaultPageSettings = () => ({
|
|
19
|
-
title: undefined
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const PageStatus = {
|
|
23
|
-
Loading: 'Loading',
|
|
24
|
-
Error: 'Error',
|
|
25
|
-
Success: 'Success',
|
|
26
|
-
NotFound: 'NotFound'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const PageDataLoader = ({ children }) => {
|
|
30
|
-
const activePageLocation = useActivePageLocation()
|
|
31
|
-
const { status, resources: folder } = useResources(`/pages${activePageLocation}`)
|
|
32
|
-
const [pageStatus, setPageStatus] = useState(PageStatus.Loading)
|
|
33
|
-
const [pageSettings, setPageSettings] = useState(getLoadingPageSettings())
|
|
34
|
-
|
|
35
|
-
useDocumentTitle(pageSettings.title)
|
|
36
|
-
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if ([AsyncStatus.NotInitialized, AsyncStatus.Loading].includes(status)) {
|
|
39
|
-
setPageSettings(getLoadingPageSettings())
|
|
40
|
-
return setPageStatus(PageStatus.Loading)
|
|
41
|
-
} else if ([AsyncStatus.Error].includes(status)) {
|
|
42
|
-
setPageSettings(getErrorPageSettings())
|
|
43
|
-
return setPageStatus(PageStatus.Error)
|
|
44
|
-
} else if ([AsyncStatus.Success].includes(status)) {
|
|
45
|
-
const pageSettings = folder.find(entry => entry.name === 'Page settings')
|
|
46
|
-
|
|
47
|
-
if (!pageSettings) {
|
|
48
|
-
setPageSettings(getNotFoundPageSettings())
|
|
49
|
-
return setPageStatus(PageStatus.NotFound)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
setPageSettings({
|
|
53
|
-
title: pageSettings.data.title,
|
|
54
|
-
layout: pageSettings.data.layout,
|
|
55
|
-
slots: pageSettings.data.slots
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
setPageStatus(PageStatus.Success)
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return () => {
|
|
63
|
-
setPageSettings(getDefaultPageSettings())
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
}, [status, folder])
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<Switch on={pageStatus}>
|
|
70
|
-
|
|
71
|
-
<Switch.Case match={[PageStatus.NotFound]}>
|
|
72
|
-
Page not found
|
|
73
|
-
</Switch.Case>
|
|
74
|
-
|
|
75
|
-
<Switch.Case match={[PageStatus.Error]}>
|
|
76
|
-
Couldn't load the page
|
|
77
|
-
</Switch.Case>
|
|
78
|
-
|
|
79
|
-
<Switch.Case match={[PageStatus.Loading]}>
|
|
80
|
-
Page Loading
|
|
81
|
-
</Switch.Case>
|
|
82
|
-
|
|
83
|
-
<Switch.Case match={[PageStatus.Success]}>
|
|
84
|
-
{children}
|
|
85
|
-
</Switch.Case>
|
|
86
|
-
|
|
87
|
-
</Switch>
|
|
88
|
-
|
|
89
|
-
)
|
|
90
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { PageDataLoader } from './PageDataLoader.jsx'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Connected components/PageDataLoader',
|
|
6
|
-
component: PageDataLoader,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'fullscreen',
|
|
9
|
-
workspaceId: '36zDqF0TKZZ5KkJdyg7NH'
|
|
10
|
-
},
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const Story = props => <PageDataLoader {...props}/>
|
|
14
|
-
|
|
15
|
-
export const Default = Story.bind({})
|
|
16
|
-
Default.args = { }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './PageDataLoader.jsx'
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { PagesModule } from './PagesModule.jsx'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Connected components/PagesModule',
|
|
6
|
-
component: PagesModule,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'fullscreen',
|
|
9
|
-
workspaceId: '36zDqF0TKZZ5KkJdyg7NH',
|
|
10
|
-
renderInsideApp: true
|
|
11
|
-
},
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Story = props => <PagesModule {...props}/>
|
|
15
|
-
|
|
16
|
-
export const Default = Story.bind({})
|
|
17
|
-
Default.args = { }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './PagesModule.jsx'
|
package/src/resume/Resume.jsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Resume as _Resume } from '@ossy/design-system-extras'
|
|
3
|
-
import { useResume } from './useResume.js'
|
|
4
|
-
|
|
5
|
-
export const Resume = ({
|
|
6
|
-
resumeId,
|
|
7
|
-
...props
|
|
8
|
-
}) => {
|
|
9
|
-
const resumeProps = useResume(resumeId)
|
|
10
|
-
return resumeProps.status === 'Success'
|
|
11
|
-
? <_Resume {...resumeProps} profileCardVariant="resume" {...props}/>
|
|
12
|
-
: <></>
|
|
13
|
-
}
|