@monimesl/dot-cli 1.0.0-beta.8 → 1.0.0-beta.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.
- package/dist/templates/showcase/dot.ts +4 -1
- package/dist/templates/showcase/pages/basics/theme/view.dml +1 -1
- package/dist/templates/showcase/pages/components/capture/controller.ts +25 -0
- package/dist/templates/showcase/pages/components/capture/state.ts +7 -0
- package/dist/templates/showcase/pages/components/capture/view.dml +32 -0
- package/dist/templates/showcase/pages/components/forms/view.dml +1 -1
- package/dist/templates/showcase/pages/components/layout/view.dml +13 -0
- package/dist/templates/showcase/pages/components/pinned/controller.ts +10 -0
- package/dist/templates/showcase/pages/components/pinned/state.ts +25 -0
- package/dist/templates/showcase/pages/components/pinned/view.dml +42 -0
- package/dist/templates/showcase/pages/components/tabs/view.dml +4 -4
- package/dist/templates/showcase/pages/index/state.ts +13 -1
- package/package.json +6 -6
|
@@ -29,6 +29,8 @@ export default defineDot({
|
|
|
29
29
|
'components/carousel',
|
|
30
30
|
'components/lists',
|
|
31
31
|
'components/tabs',
|
|
32
|
+
'components/pinned',
|
|
33
|
+
'components/capture',
|
|
32
34
|
'components/forms',
|
|
33
35
|
'components/money',
|
|
34
36
|
'components/feedback',
|
|
@@ -65,13 +67,14 @@ export default defineDot({
|
|
|
65
67
|
gold: { light: '#f5c542', dark: '#d4a72c' },
|
|
66
68
|
// Dark text that reads on gold in both light and dark.
|
|
67
69
|
ink: { light: '#1c1c1e', dark: '#1c1c1e' },
|
|
70
|
+
amber: { light: '#e8952a', dark: '#f0a63a' },
|
|
68
71
|
...swatchColors(),
|
|
69
72
|
},
|
|
70
73
|
},
|
|
71
74
|
// The showcase's own icon, an SVG in statics/, used by name like Dot's icons.
|
|
72
75
|
icons: { 'ticket-stub': 'statics/icons/ticket-stub.svg' },
|
|
73
76
|
// A gradient between two of the theme's colours, for a View's background.
|
|
74
|
-
gradients: { goldenHour: { from: 'gold', to: '
|
|
77
|
+
gradients: { goldenHour: { from: 'gold', to: 'amber', direction: 'diagonal' } },
|
|
75
78
|
},
|
|
76
79
|
// logger() writes each page load, event, navigation and state change to the console.
|
|
77
80
|
plugins: [logger()],
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
<View gap="small">
|
|
30
30
|
<Text variant="subtitle">font, headingFont, headingWeight and textSize</Text>
|
|
31
|
-
<Text variant="caption" tone="muted">font is one of the phone's own fonts, so nothing is downloaded: system (the default), rounded, serif or mono. headingFont and headingWeight give titles their own. textSize, small, regular or large, makes
|
|
31
|
+
<Text variant="caption" tone="muted">font is one of the phone's own fonts, so nothing is downloaded: system (the default), rounded, serif or mono. headingFont and headingWeight give titles their own. textSize, small, regular or large, makes text a tenth smaller or larger, except what's typed into fields, amounts and codes.</Text>
|
|
32
32
|
</View>
|
|
33
33
|
|
|
34
34
|
<View gap="small">
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import state from './state';
|
|
2
|
+
|
|
3
|
+
export default definePage({
|
|
4
|
+
initialState: state,
|
|
5
|
+
configs: { navigationBar: { title: 'Pictures of a View' } },
|
|
6
|
+
actions: {
|
|
7
|
+
async capture() {
|
|
8
|
+
this.setState({ capturing: true, note: '' });
|
|
9
|
+
try {
|
|
10
|
+
const picture = await this.captureView('ticket');
|
|
11
|
+
this.setState({ picture, note: `${Math.round(picture.size / 1024)} KB` });
|
|
12
|
+
} catch (error) {
|
|
13
|
+
this.setState({ note: (error as Error).message });
|
|
14
|
+
} finally {
|
|
15
|
+
this.setState({ capturing: false });
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
async share() {
|
|
19
|
+
const { picture } = this.state;
|
|
20
|
+
if (picture) {
|
|
21
|
+
await this.dash.system.share({ file: picture });
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<View>
|
|
2
|
+
<Text variant="title">Pictures of a View</Text>
|
|
3
|
+
<Text>Give a View an id, and this.captureView makes a PNG of it, such as a ticket to share. It draws the whole View, even past the bottom of the screen.</Text>
|
|
4
|
+
|
|
5
|
+
<View id="ticket" variant="card" gap="medium">
|
|
6
|
+
<View direction="row" justify="between" align="center">
|
|
7
|
+
<Text variant="subtitle">Lumley Beach Sundown</Text>
|
|
8
|
+
<Icon name="ticket-stub" tone="gold" />
|
|
9
|
+
</View>
|
|
10
|
+
<Divider />
|
|
11
|
+
<DetailRow label="Name" value="Mariama Kamara" />
|
|
12
|
+
<DetailRow label="Where" value="Lumley Beach, Freetown" />
|
|
13
|
+
<DetailRow label="When" value="Friday, 6 pm" />
|
|
14
|
+
<DetailRow label="Paid" value="Le 300" />
|
|
15
|
+
<View align="center">
|
|
16
|
+
<QRCode value="SALONE-SOUNDS-4471" />
|
|
17
|
+
</View>
|
|
18
|
+
</View>
|
|
19
|
+
|
|
20
|
+
<Button loading="{{ capturing }}" onClick="capture">Make a picture</Button>
|
|
21
|
+
<If condition="{{ note }}">
|
|
22
|
+
<Text variant="caption" tone="muted">{{ note }}</Text>
|
|
23
|
+
</If>
|
|
24
|
+
|
|
25
|
+
<If condition="{{ picture }}">
|
|
26
|
+
<View gap="medium">
|
|
27
|
+
<Text variant="caption" tone="muted">captureView gives back a file, as a download does. Show it with an Image, or pass it to dash.system.share. A new picture of a View replaces the last one. A picture from another site shows only if that site allows CORS.</Text>
|
|
28
|
+
<Image src="{{ picture.url }}" alt="The ticket as a picture" />
|
|
29
|
+
<Button variant="secondary" onClick="share">Share the picture</Button>
|
|
30
|
+
</View>
|
|
31
|
+
</If>
|
|
32
|
+
</View>
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
<Notice tone="danger" title="Not booked">{{ failure }}</Notice>
|
|
91
91
|
</If>
|
|
92
92
|
|
|
93
|
-
<Text variant="caption" tone="muted">A Footer keeps its buttons at the bottom of the screen. Put it last in the page's View.</Text>
|
|
93
|
+
<Text variant="caption" tone="muted">A Footer keeps its buttons at the bottom of the screen, on a bar from side to side. Put it last in the page's View.</Text>
|
|
94
94
|
<Footer>
|
|
95
95
|
<Button onClick="send" loading="{{ sending }}" disabled="{{ !agreed }}">Buy tickets</Button>
|
|
96
96
|
</Footer>
|
|
@@ -111,6 +111,19 @@
|
|
|
111
111
|
</View>
|
|
112
112
|
</View>
|
|
113
113
|
|
|
114
|
+
<View gap="small">
|
|
115
|
+
<Text variant="subtitle">Cards in a Scroll</Text>
|
|
116
|
+
<Text variant="caption" tone="muted">A Scroll leaves room above and below for a low shadow, so a card's shadow isn't cut. A high shadow needs more than that, so use low here. paddingStart and paddingEnd give the first and last card room at the sides.</Text>
|
|
117
|
+
<Scroll gap="medium" paddingStart="medium" paddingEnd="medium">
|
|
118
|
+
<For each="{{ releases }}" item="release" key="id">
|
|
119
|
+
<View variant="card" elevation="low" border="none" width="144" gap="none">
|
|
120
|
+
<Text weight="medium" maxLines="1">{{ release.title }}</Text>
|
|
121
|
+
<Text variant="caption" tone="muted">{{ release.year }}</Text>
|
|
122
|
+
</View>
|
|
123
|
+
</For>
|
|
124
|
+
</Scroll>
|
|
125
|
+
</View>
|
|
126
|
+
|
|
114
127
|
<View gap="small">
|
|
115
128
|
<Text variant="subtitle">Grid</Text>
|
|
116
129
|
<Text variant="caption" tone="muted">A Grid keeps its columns the same width, 4 unless columns says. A GridItem shows an icon or a picture, with a label and an optional badge.</Text>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import state from './state';
|
|
2
|
+
|
|
3
|
+
export default definePage({
|
|
4
|
+
initialState: state,
|
|
5
|
+
// This page has its own tabs at the bottom, so it hides Dash's. Dash brings them back on leaving.
|
|
6
|
+
configs: { navigationBar: { title: 'Pinned bars' }, tabBar: { hidden: true } },
|
|
7
|
+
mutations: {
|
|
8
|
+
chooseTab: (_state, event: ValueEvent) => ({ tab: event.detail.value }),
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
tab: 'shows',
|
|
3
|
+
shows: [
|
|
4
|
+
{ id: 'lumley', title: 'Lumley Beach Sundown', place: 'Lumley Beach, Freetown', day: 'Fri' },
|
|
5
|
+
{ id: 'aberdeen', title: 'Aberdeen Live', place: 'Aberdeen, Freetown', day: 'Fri' },
|
|
6
|
+
{ id: 'wilberforce', title: 'Hilltop Sessions', place: 'Wilberforce, Freetown', day: 'Sat' },
|
|
7
|
+
{ id: 'bo', title: 'Bo Town Jam', place: 'Coronation Field, Bo', day: 'Sat' },
|
|
8
|
+
{ id: 'kenema', title: 'Eastern Beats', place: 'Kenema', day: 'Sat' },
|
|
9
|
+
{ id: 'makeni', title: 'Makeni Nights', place: 'Wusum Stadium, Makeni', day: 'Sun' },
|
|
10
|
+
{ id: 'tokeh', title: 'Tokeh Sands', place: 'Tokeh Beach', day: 'Sun' },
|
|
11
|
+
{ id: 'kono', title: 'Koidu Block Party', place: 'Koidu, Kono', day: 'Sun' },
|
|
12
|
+
{ id: 'bonthe', title: 'Bonthe Island Drums', place: 'Bonthe, Sherbro Island', day: 'Sun' },
|
|
13
|
+
{ id: 'monrovia', title: 'Mano River Night', place: 'Sinkor, Monrovia', day: 'Mon' },
|
|
14
|
+
],
|
|
15
|
+
saved: [
|
|
16
|
+
{ id: 'lumley', title: 'Lumley Beach Sundown', place: 'Lumley Beach, Freetown' },
|
|
17
|
+
{ id: 'bo', title: 'Bo Town Jam', place: 'Coronation Field, Bo' },
|
|
18
|
+
],
|
|
19
|
+
venues: [
|
|
20
|
+
{ id: 'national', name: 'National Stadium', town: 'Freetown' },
|
|
21
|
+
{ id: 'bintumani', name: 'Bintumani Hotel', town: 'Freetown' },
|
|
22
|
+
{ id: 'coronation', name: 'Coronation Field', town: 'Bo' },
|
|
23
|
+
{ id: 'wusum', name: 'Wusum Stadium', town: 'Makeni' },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<View>
|
|
2
|
+
<Pinned edge="top" background="surface" border="subtle" paddingTop="medium" paddingBottom="medium">
|
|
3
|
+
<Text weight="bold">Salone gig guide</Text>
|
|
4
|
+
</Pinned>
|
|
5
|
+
|
|
6
|
+
<Text variant="title">Pinned bars</Text>
|
|
7
|
+
<Text>A Pinned keeps its children on an edge of the screen while the page scrolls. Scroll this page: the title above and the tabs below stay put. Put edge="top" first in the page's View, and edge="bottom" last. At the bottom, use a Pinned or a Footer, not both.</Text>
|
|
8
|
+
<Text variant="caption" tone="muted">The bar reaches past the page's padding to both sides of the screen, and its children line up with the page. background fills the bar, and border draws a line on the side facing the page.</Text>
|
|
9
|
+
<Text variant="caption" tone="muted">Tabs in a Pinned make the page's own navigation. variant="bar" shares the width equally, with each Tab's icon over its label and its badge on the icon. The page shows the content for the chosen tab, so the state of each tab stays. This page sets tabBar: { hidden: true } in its configs, so Dash's tabs don't show under its own.</Text>
|
|
10
|
+
|
|
11
|
+
<If condition="{{ tab === 'shows' }}">
|
|
12
|
+
<List>
|
|
13
|
+
<For each="{{ shows }}" item="show" key="id">
|
|
14
|
+
<ListItem icon="music" title="{{ show.title }}" subtitle="{{ show.place }}">
|
|
15
|
+
<Badge>{{ show.day }}</Badge>
|
|
16
|
+
</ListItem>
|
|
17
|
+
</For>
|
|
18
|
+
</List>
|
|
19
|
+
</If>
|
|
20
|
+
<ElseIf condition="{{ tab === 'saved' }}">
|
|
21
|
+
<List>
|
|
22
|
+
<For each="{{ saved }}" item="show" key="id">
|
|
23
|
+
<ListItem icon="heart" title="{{ show.title }}" subtitle="{{ show.place }}" />
|
|
24
|
+
</For>
|
|
25
|
+
</List>
|
|
26
|
+
</ElseIf>
|
|
27
|
+
<Else>
|
|
28
|
+
<List>
|
|
29
|
+
<For each="{{ venues }}" item="venue" key="id">
|
|
30
|
+
<ListItem icon="home" title="{{ venue.name }}" subtitle="{{ venue.town }}" />
|
|
31
|
+
</For>
|
|
32
|
+
</List>
|
|
33
|
+
</Else>
|
|
34
|
+
|
|
35
|
+
<Pinned edge="bottom" background="surface" border="subtle" paddingBottom="medium">
|
|
36
|
+
<Tabs variant="bar" value="{{ tab }}" onChange="chooseTab">
|
|
37
|
+
<Tab value="shows" label="Shows" icon="music" />
|
|
38
|
+
<Tab value="saved" label="Saved" icon="heart" badge="{{ saved.length }}" />
|
|
39
|
+
<Tab value="venues" label="Venues" icon="location" />
|
|
40
|
+
</Tabs>
|
|
41
|
+
</Pinned>
|
|
42
|
+
</View>
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
<View gap="small">
|
|
6
6
|
<Text variant="subtitle">Tabs and Chip</Text>
|
|
7
|
-
<Text variant="caption" tone="muted">Tabs sends onChange with the chosen tab's value in event.detail.value. A Tab's badge shows a count. A Chip is selected only when the page says so. An Input with type="search" and clearable makes a search box.</Text>
|
|
7
|
+
<Text variant="caption" tone="muted">Tabs sends onChange with the chosen tab's value in event.detail.value. A Tab's icon goes before its label, and its badge shows a count. A Chip is selected only when the page says so. An Input with type="search" and clearable makes a search box.</Text>
|
|
8
8
|
<Tabs variant="underline" value="{{ tab }}" onChange="chooseTab">
|
|
9
9
|
<Tab value="all" label="All" />
|
|
10
|
-
<Tab value="album" label="Albums" badge="{{ albums }}" />
|
|
11
|
-
<Tab value="song" label="Songs" badge="{{ songs }}" />
|
|
10
|
+
<Tab value="album" label="Albums" icon="playlist" badge="{{ albums }}" />
|
|
11
|
+
<Tab value="song" label="Songs" icon="music" badge="{{ songs }}" />
|
|
12
12
|
</Tabs>
|
|
13
13
|
<Input type="search" placeholder="Search by title" clearable value="{{ query }}" onChange="search" />
|
|
14
14
|
<View direction="row" gap="small" wrap>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
<View gap="small">
|
|
45
45
|
<Text variant="subtitle">variant="segmented"</Text>
|
|
46
|
-
<Text variant="caption" tone="muted">For a few short choices. Shows at home and in the Mano River region.</Text>
|
|
46
|
+
<Text variant="caption" tone="muted">For a few short choices. Shows at home and in the Mano River region. For a page's own navigation, variant="bar" is on the Pinned bars page.</Text>
|
|
47
47
|
<Tabs variant="segmented" value="{{ where }}" onChange="chooseWhere">
|
|
48
48
|
<Tab value="home" label="Sierra Leone" />
|
|
49
49
|
<Tab value="abroad" label="Abroad" />
|
|
@@ -136,9 +136,21 @@ export default {
|
|
|
136
136
|
{
|
|
137
137
|
page: 'components/tabs',
|
|
138
138
|
title: 'Tabs and chips',
|
|
139
|
-
covers: 'Tabs, Tab, Chip',
|
|
139
|
+
covers: 'Tabs, Tab, Tab icons, Chip',
|
|
140
140
|
icon: 'search',
|
|
141
141
|
},
|
|
142
|
+
{
|
|
143
|
+
page: 'components/pinned',
|
|
144
|
+
title: 'Pinned bars',
|
|
145
|
+
covers: 'Pinned, Tabs variant="bar"',
|
|
146
|
+
icon: 'location',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
page: 'components/capture',
|
|
150
|
+
title: 'Pictures of a View',
|
|
151
|
+
covers: 'View id, captureView',
|
|
152
|
+
icon: 'image',
|
|
153
|
+
},
|
|
142
154
|
{
|
|
143
155
|
page: 'components/forms',
|
|
144
156
|
title: 'Forms',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monimesl/dot-cli",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.9",
|
|
4
4
|
"description": "The dotctl command: build mini apps and run them in the simulator",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"typescript": "^5.9.3",
|
|
26
26
|
"uqr": "^0.1.3",
|
|
27
|
-
"@monimesl/dot-compiler": "1.0.0-beta.
|
|
28
|
-
"@monimesl/dot-core": "1.0.0-beta.
|
|
29
|
-
"@monimesl/dot-dml-parser": "1.0.0-beta.
|
|
30
|
-
"@monimesl/dot-script-parser": "1.0.0-beta.
|
|
31
|
-
"@monimesl/dot-simulator": "1.0.0-beta.
|
|
27
|
+
"@monimesl/dot-compiler": "1.0.0-beta.9",
|
|
28
|
+
"@monimesl/dot-core": "1.0.0-beta.9",
|
|
29
|
+
"@monimesl/dot-dml-parser": "1.0.0-beta.9",
|
|
30
|
+
"@monimesl/dot-script-parser": "1.0.0-beta.9",
|
|
31
|
+
"@monimesl/dot-simulator": "1.0.0-beta.9"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^22.20.4",
|