@ossy/analytics 1.10.2 → 3.0.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ossy/analytics",
3
3
  "description": "Analytics module — workspace analytics for website traffic",
4
- "version": "1.10.2",
4
+ "version": "3.0.1",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
7
7
  "module": "./src/index.js",
@@ -27,5 +27,5 @@
27
27
  "@ossy/sdk-react": "*",
28
28
  "react": "*"
29
29
  },
30
- "gitHead": "2b8745d57fee8b6c08787e2755b4df489291a5cd"
30
+ "gitHead": "4a70ec216448680d2fddc57b2a8a0077489720ae"
31
31
  }
package/src/Definition.js CHANGED
@@ -3,5 +3,5 @@ export const Definition = {
3
3
  title: 'Analytics',
4
4
  description: 'Workspace analytics for website traffic and top performing pages.',
5
5
  icon: 'chart',
6
- statuses: ['beta'],
6
+ status: ['beta'],
7
7
  }
@@ -1,8 +1,8 @@
1
1
  import React, { useMemo } from 'react'
2
- import { GetWorkspace } from '@ossy/workspaces'
3
- import { useSdk } from '@ossy/sdk-react'
4
- import { Text, Title, View, useLocale } from '@ossy/design-system'
2
+ import { Text, View, Page, useLocale } from '@ossy/design-system'
5
3
  import { usePageViewStats } from './usePageViewStats.js'
4
+ import { useSdk } from '@ossy/sdk-react'
5
+ import { GetWorkspace } from '@ossy/workspaces'
6
6
 
7
7
  export const metadata = {
8
8
  id: 'analytics/home',
@@ -21,7 +21,7 @@ function SummaryCard({ label, value }) {
21
21
  style={{ border: '1px solid var(--separator)' }}
22
22
  >
23
23
  <Text variant="small" style={{ opacity: 0.75 }}>{label}</Text>
24
- <Title variant="secondary">{value}</Title>
24
+ <Text variant="heading-secondary" as="h2">{value}</Text>
25
25
  </View>
26
26
  )
27
27
  }
@@ -43,12 +43,11 @@ export default function AnalyticsPage() {
43
43
  })
44
44
 
45
45
  return (
46
- <View inset="l" gap="l" style={{ width: '100%', boxSizing: 'border-box' }}>
47
- <View gap="s">
48
- <Title>{t('analytics.home.title')}</Title>
49
- <Text>{t('analytics.home.description')}</Text>
50
- </View>
51
-
46
+ <Page
47
+ title="analytics.home.title"
48
+ description="analytics.home.description"
49
+ >
50
+ <View gap="m">
52
51
  {status === 'loading' && (
53
52
  <View surface="primary" roundness="m" inset="m">
54
53
  <Text>{t('analytics.home.loading')}</Text>
@@ -77,8 +76,8 @@ export default function AnalyticsPage() {
77
76
  gap="s"
78
77
  style={{ border: '1px solid var(--separator)', flex: 1 }}
79
78
  >
80
- <Title variant="secondary">{t('analytics.home.topPaths')}</Title>
81
- {topPaths.length === 0 && <Text variant="small">{t('analytics.home.noPageViews')}</Text>}
79
+ <Text variant="heading-secondary" as="h2" text="analytics.home.topPaths" />
80
+ {topPaths.length === 0 && <Text variant="small" text="analytics.home.noPageViews" />}
82
81
  {topPaths.map((item) => (
83
82
  <View key={item.path || 'unknown'} layout="row" justifyContent="space-between">
84
83
  <Text variant="small">{item.path || t('analytics.home.unknownPath')}</Text>
@@ -94,8 +93,8 @@ export default function AnalyticsPage() {
94
93
  gap="s"
95
94
  style={{ border: '1px solid var(--separator)', flex: 1 }}
96
95
  >
97
- <Title variant="secondary">{t('analytics.home.dailyPageViews')}</Title>
98
- {dailyViews.length === 0 && <Text variant="small">{t('analytics.home.noDailyData')}</Text>}
96
+ <Text variant="heading-secondary" as="h2" text="analytics.home.dailyPageViews" />
97
+ {dailyViews.length === 0 && <Text variant="small" text="analytics.home.noDailyData" />}
99
98
  {dailyViews.map((item) => (
100
99
  <View key={item.date} layout="row" justifyContent="space-between">
101
100
  <Text variant="small">{item.date}</Text>
@@ -106,6 +105,7 @@ export default function AnalyticsPage() {
106
105
  </View>
107
106
  </>
108
107
  )}
109
- </View>
108
+ </View>
109
+ </Page>
110
110
  )
111
111
  }