@puredesktop/create-app 2.1.7 → 2.1.9

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.
@@ -0,0 +1,154 @@
1
+ import styled from 'styled-components'
2
+ import { Heading } from '@puredesktop/puredesktop-ui-bridge/components/common/typography/Heading'
3
+ import { Text } from '@puredesktop/puredesktop-ui-bridge/components/common/typography/Text'
4
+ import {
5
+ readConfiguredSettingCount,
6
+ starterMilestones,
7
+ } from '../lib/starterWorkspace'
8
+ import type { AppSettings } from '../types'
9
+
10
+ const Root = styled.div`
11
+ display: flex;
12
+ min-height: 100%;
13
+ width: 100%;
14
+ align-items: center;
15
+ justify-content: center;
16
+ padding: var(--platform-spacing-xxl);
17
+ color: var(--platform-colors-text);
18
+ background:
19
+ linear-gradient(
20
+ 135deg,
21
+ color-mix(in srgb, var(--platform-colors-accent) 6%, transparent),
22
+ transparent 42%
23
+ ),
24
+ var(--platform-colors-bg);
25
+ `
26
+
27
+ const Panel = styled.section`
28
+ display: grid;
29
+ width: min(760px, 100%);
30
+ gap: var(--platform-spacing-xl);
31
+ `
32
+
33
+ const Header = styled.header`
34
+ display: grid;
35
+ gap: var(--platform-spacing-sm);
36
+ `
37
+
38
+ const MilestoneGrid = styled.div`
39
+ display: grid;
40
+ grid-template-columns: repeat(3, minmax(0, 1fr));
41
+ gap: var(--platform-spacing-md);
42
+
43
+ @media (max-width: 720px) {
44
+ grid-template-columns: 1fr;
45
+ }
46
+ `
47
+
48
+ const Milestone = styled.article`
49
+ display: grid;
50
+ gap: var(--platform-spacing-sm);
51
+ min-width: 0;
52
+ padding: var(--platform-spacing-lg);
53
+ border: 1px solid var(--platform-colors-border);
54
+ background: var(--platform-colors-surface);
55
+ box-shadow: var(--platform-shadow-sm);
56
+ `
57
+
58
+ const PulseTrack = styled.div`
59
+ position: relative;
60
+ overflow: hidden;
61
+ height: 3px;
62
+ background: var(--platform-colors-border);
63
+ `
64
+
65
+ const Pulse = styled.div`
66
+ position: absolute;
67
+ inset: 0 auto 0 0;
68
+ width: 44%;
69
+ background: var(--platform-colors-accent);
70
+ animation: starter-pulse 1600ms ease-in-out infinite;
71
+
72
+ @keyframes starter-pulse {
73
+ 0% {
74
+ transform: translateX(-100%);
75
+ opacity: 0.35;
76
+ }
77
+
78
+ 45%,
79
+ 60% {
80
+ opacity: 1;
81
+ }
82
+
83
+ 100% {
84
+ transform: translateX(230%);
85
+ opacity: 0.35;
86
+ }
87
+ }
88
+ `
89
+
90
+ const MetaRow = styled.div`
91
+ display: flex;
92
+ flex-wrap: wrap;
93
+ gap: var(--platform-spacing-sm);
94
+ `
95
+
96
+ const MetaPill = styled.span`
97
+ padding: 4px 8px;
98
+ border: 1px solid var(--platform-colors-border);
99
+ background: var(--platform-colors-surface);
100
+ color: var(--platform-colors-text-secondary);
101
+ font-size: var(--platform-typography-font-size-xs);
102
+ font-weight: var(--platform-typography-font-weight-medium);
103
+ `
104
+
105
+ interface StarterWorkspaceProps {
106
+ appName: string
107
+ settings: AppSettings
108
+ }
109
+
110
+ export function StarterWorkspace({
111
+ appName,
112
+ settings,
113
+ }: StarterWorkspaceProps): React.ReactElement {
114
+ const settingCount = readConfiguredSettingCount(settings)
115
+
116
+ return (
117
+ <Root>
118
+ <Panel aria-label={`${appName} starter workspace`}>
119
+ <Header>
120
+ <Text size="sm" tone="secondary">
121
+ PureDesktop app workspace
122
+ </Text>
123
+ <Heading level={1}>{appName}</Heading>
124
+ <Text tone="secondary">
125
+ This workspace is ready. The first build step will replace this
126
+ starter screen with the product experience.
127
+ </Text>
128
+ </Header>
129
+
130
+ <MilestoneGrid>
131
+ {starterMilestones.map(milestone => (
132
+ <Milestone key={milestone.id}>
133
+ <Text size="sm" weight="medium">
134
+ {milestone.title}
135
+ </Text>
136
+ <Text size="sm" tone="secondary">
137
+ {milestone.detail}
138
+ </Text>
139
+ <PulseTrack aria-hidden="true">
140
+ <Pulse />
141
+ </PulseTrack>
142
+ </Milestone>
143
+ ))}
144
+ </MilestoneGrid>
145
+
146
+ <MetaRow>
147
+ <MetaPill>{settingCount} setting key(s)</MetaPill>
148
+ <MetaPill>Theme active</MetaPill>
149
+ <MetaPill>Shell connected</MetaPill>
150
+ </MetaRow>
151
+ </Panel>
152
+ </Root>
153
+ )
154
+ }
@@ -1 +1,2 @@
1
- export const APP_SLUG = '{{APP_SLUG}}'
1
+ export const APP_SLUG = '{{APP_SLUG}}'
2
+ export const APP_TITLE = '{{APP_TITLE}}'
@@ -0,0 +1,29 @@
1
+ import type { AppSettings } from '../types'
2
+
3
+ export interface StarterMilestone {
4
+ detail: string
5
+ id: string
6
+ title: string
7
+ }
8
+
9
+ export const starterMilestones: StarterMilestone[] = [
10
+ {
11
+ detail: 'The starter screen is temporary and ready to be replaced by product UI.',
12
+ id: 'boot',
13
+ title: 'Workspace ready',
14
+ },
15
+ {
16
+ detail: 'PureDesktop styling is loaded so early screens match the shell.',
17
+ id: 'composition',
18
+ title: 'Theme active',
19
+ },
20
+ {
21
+ detail: 'Settings and shell capabilities are available through the app bridge.',
22
+ id: 'domain',
23
+ title: 'Shell connected',
24
+ },
25
+ ]
26
+
27
+ export function readConfiguredSettingCount(settings: AppSettings): number {
28
+ return Object.keys(settings).length
29
+ }
@@ -16,13 +16,16 @@ function devServerFromManifest(metaUrl) {
16
16
  }
17
17
  }
18
18
 
19
- export default defineConfig({
20
- plugins: [
21
- react({
22
- plugins: [
23
- ['@swc/plugin-styled-components', { displayName: true, fileName: true }],
24
- ],
25
- }),
26
- ],
27
- server: devServerFromManifest(import.meta.url),
28
- })
19
+ export default defineConfig({
20
+ plugins: [
21
+ react({
22
+ plugins: [
23
+ ['@swc/plugin-styled-components', { displayName: true, fileName: true }],
24
+ ],
25
+ }),
26
+ ],
27
+ optimizeDeps: {
28
+ include: ['react-dom'],
29
+ },
30
+ server: devServerFromManifest(import.meta.url),
31
+ })