@monimesl/dot-cli 0.1.0-alpha.15 → 0.1.0-alpha.18

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.
Files changed (109) hide show
  1. package/dist/cli.js +17 -10
  2. package/dist/cli.js.map +1 -1
  3. package/dist/{server-Dbrgkelo.js → server-uIyYmYnp.js} +7 -2
  4. package/dist/{server-Dbrgkelo.js.map → server-uIyYmYnp.js.map} +1 -1
  5. package/dist/templates/showcase/dot.ts +42 -16
  6. package/dist/templates/showcase/pages/basics/bars/controller.ts +36 -0
  7. package/dist/templates/showcase/pages/basics/bars/state.ts +6 -0
  8. package/dist/templates/showcase/pages/basics/bars/view.dml +28 -0
  9. package/dist/templates/showcase/pages/{text → basics/bindings}/controller.ts +4 -0
  10. package/dist/templates/showcase/pages/basics/bindings/state.ts +14 -0
  11. package/dist/templates/showcase/pages/basics/bindings/view.dml +41 -0
  12. package/dist/templates/showcase/pages/basics/control-flow/controller.ts +17 -0
  13. package/dist/templates/showcase/pages/basics/control-flow/state.ts +16 -0
  14. package/dist/templates/showcase/pages/basics/control-flow/view.dml +55 -0
  15. package/dist/templates/showcase/pages/basics/events/controller.ts +42 -0
  16. package/dist/templates/showcase/pages/basics/events/state.ts +11 -0
  17. package/dist/templates/showcase/pages/basics/events/view.dml +51 -0
  18. package/dist/templates/showcase/pages/basics/hooks/controller.ts +36 -0
  19. package/dist/templates/showcase/pages/basics/hooks/state.ts +10 -0
  20. package/dist/templates/showcase/pages/basics/hooks/view.dml +32 -0
  21. package/dist/templates/showcase/pages/basics/navigation/controller.ts +33 -0
  22. package/dist/templates/showcase/pages/basics/navigation/state.ts +9 -0
  23. package/dist/templates/showcase/pages/basics/navigation/view.dml +37 -0
  24. package/dist/templates/showcase/pages/basics/state/view.dml +46 -0
  25. package/dist/templates/showcase/pages/{carousel → components/carousel}/view.dml +7 -5
  26. package/dist/templates/showcase/pages/{feedback → components/feedback}/view.dml +18 -9
  27. package/dist/templates/showcase/pages/{forms → components/forms}/controller.ts +4 -1
  28. package/dist/templates/showcase/pages/{forms → components/forms}/state.ts +3 -0
  29. package/dist/templates/showcase/pages/components/forms/view.dml +90 -0
  30. package/dist/templates/showcase/pages/components/icons/controller.ts +14 -0
  31. package/dist/templates/showcase/pages/components/icons/state.ts +75 -0
  32. package/dist/templates/showcase/pages/components/icons/view.dml +36 -0
  33. package/dist/templates/showcase/pages/components/images/view.dml +70 -0
  34. package/dist/templates/showcase/pages/components/layout/view.dml +143 -0
  35. package/dist/templates/showcase/pages/components/lists/controller.ts +17 -0
  36. package/dist/templates/showcase/pages/{lists → components/lists}/state.ts +43 -30
  37. package/dist/templates/showcase/pages/components/lists/view.dml +70 -0
  38. package/dist/templates/showcase/pages/{payments → components/money}/view.dml +17 -8
  39. package/dist/templates/showcase/pages/components/reading/controller.ts +5 -0
  40. package/dist/templates/showcase/pages/components/reading/state.ts +23 -0
  41. package/dist/templates/showcase/pages/components/reading/view.dml +42 -0
  42. package/dist/templates/showcase/pages/{lists → components/sheets}/controller.ts +8 -10
  43. package/dist/templates/showcase/pages/components/sheets/state.ts +26 -0
  44. package/dist/templates/showcase/pages/components/sheets/view.dml +38 -0
  45. package/dist/templates/showcase/pages/components/styles/controller.ts +5 -0
  46. package/dist/templates/showcase/pages/components/styles/state.ts +3 -0
  47. package/dist/templates/showcase/pages/components/styles/view.dml +101 -0
  48. package/dist/templates/showcase/pages/{filters → components/tabs}/controller.ts +1 -0
  49. package/dist/templates/showcase/pages/{filters → components/tabs}/state.ts +1 -0
  50. package/dist/templates/showcase/pages/components/tabs/view.dml +56 -0
  51. package/dist/templates/showcase/pages/components/text/controller.ts +9 -0
  52. package/dist/templates/showcase/pages/components/text/state.ts +3 -0
  53. package/dist/templates/showcase/pages/components/text/view.dml +95 -0
  54. package/dist/templates/showcase/pages/{cache → dash/cache}/controller.ts +4 -0
  55. package/dist/templates/showcase/pages/dash/cache/view.dml +48 -0
  56. package/dist/templates/showcase/pages/dash/calls/controller.ts +48 -0
  57. package/dist/templates/showcase/pages/dash/calls/state.ts +6 -0
  58. package/dist/templates/showcase/pages/dash/calls/view.dml +51 -0
  59. package/dist/templates/showcase/pages/{files → dash/files}/controller.ts +23 -1
  60. package/dist/templates/showcase/pages/{files → dash/files}/state.ts +8 -0
  61. package/dist/templates/showcase/pages/dash/files/view.dml +79 -0
  62. package/dist/templates/showcase/pages/dash/media/controller.ts +32 -0
  63. package/dist/templates/showcase/pages/dash/media/state.ts +12 -0
  64. package/dist/templates/showcase/pages/dash/media/view.dml +34 -0
  65. package/dist/templates/showcase/pages/dash/network/view.dml +80 -0
  66. package/dist/templates/showcase/pages/dash/secrets/view.dml +26 -0
  67. package/dist/templates/showcase/pages/{device → dash/system}/controller.ts +11 -30
  68. package/dist/templates/showcase/pages/dash/system/state.ts +9 -0
  69. package/dist/templates/showcase/pages/dash/system/view.dml +59 -0
  70. package/dist/templates/showcase/pages/dash/ui/controller.ts +69 -0
  71. package/dist/templates/showcase/pages/dash/ui/state.ts +8 -0
  72. package/dist/templates/showcase/pages/dash/ui/view.dml +31 -0
  73. package/dist/templates/showcase/pages/index/state.ts +137 -60
  74. package/dist/templates/showcase/pages/index/view.dml +6 -3
  75. package/package.json +6 -6
  76. package/dist/templates/showcase/pages/cache/view.dml +0 -36
  77. package/dist/templates/showcase/pages/device/state.ts +0 -7
  78. package/dist/templates/showcase/pages/device/view.dml +0 -49
  79. package/dist/templates/showcase/pages/files/view.dml +0 -50
  80. package/dist/templates/showcase/pages/filters/view.dml +0 -44
  81. package/dist/templates/showcase/pages/forms/view.dml +0 -49
  82. package/dist/templates/showcase/pages/images/view.dml +0 -53
  83. package/dist/templates/showcase/pages/layout/view.dml +0 -103
  84. package/dist/templates/showcase/pages/lists/view.dml +0 -59
  85. package/dist/templates/showcase/pages/navigation/controller.ts +0 -65
  86. package/dist/templates/showcase/pages/navigation/state.ts +0 -17
  87. package/dist/templates/showcase/pages/navigation/view.dml +0 -34
  88. package/dist/templates/showcase/pages/network/view.dml +0 -67
  89. package/dist/templates/showcase/pages/secrets/view.dml +0 -24
  90. package/dist/templates/showcase/pages/state/view.dml +0 -33
  91. package/dist/templates/showcase/pages/text/state.ts +0 -8
  92. package/dist/templates/showcase/pages/text/view.dml +0 -58
  93. /package/dist/templates/showcase/pages/{state → basics/state}/controller.ts +0 -0
  94. /package/dist/templates/showcase/pages/{state → basics/state}/state.ts +0 -0
  95. /package/dist/templates/showcase/pages/{carousel → components/carousel}/controller.ts +0 -0
  96. /package/dist/templates/showcase/pages/{carousel → components/carousel}/state.ts +0 -0
  97. /package/dist/templates/showcase/pages/{feedback → components/feedback}/controller.ts +0 -0
  98. /package/dist/templates/showcase/pages/{feedback → components/feedback}/state.ts +0 -0
  99. /package/dist/templates/showcase/pages/{images → components/images}/controller.ts +0 -0
  100. /package/dist/templates/showcase/pages/{images → components/images}/state.ts +0 -0
  101. /package/dist/templates/showcase/pages/{layout → components/layout}/controller.ts +0 -0
  102. /package/dist/templates/showcase/pages/{layout → components/layout}/state.ts +0 -0
  103. /package/dist/templates/showcase/pages/{payments → components/money}/controller.ts +0 -0
  104. /package/dist/templates/showcase/pages/{payments → components/money}/state.ts +0 -0
  105. /package/dist/templates/showcase/pages/{cache → dash/cache}/state.ts +0 -0
  106. /package/dist/templates/showcase/pages/{network → dash/network}/controller.ts +0 -0
  107. /package/dist/templates/showcase/pages/{network → dash/network}/state.ts +0 -0
  108. /package/dist/templates/showcase/pages/{secrets → dash/secrets}/controller.ts +0 -0
  109. /package/dist/templates/showcase/pages/{secrets → dash/secrets}/state.ts +0 -0
@@ -1,3 +1,5 @@
1
+ import type { VibrationStyle } from '@monimesl/dot-runtime';
2
+
1
3
  import state from './state';
2
4
 
3
5
  export default definePage({
@@ -6,43 +8,22 @@ export default definePage({
6
8
  clearToast: () => ({ toast: '' }),
7
9
  },
8
10
  actions: {
9
- async greet() {
10
- try {
11
- const { action } = await this.dash.ui.alert({
12
- title: 'Kushé',
13
- message: env.GREETING,
14
- actions: [
15
- { id: 'tenki', label: 'Tenki' },
16
- { id: 'close', label: 'Close', role: 'cancel' },
17
- ],
18
- });
19
- this.setState({ choice: action });
20
- } catch (error) {
21
- this.setState({ note: (error as Error).message });
22
- }
11
+ async vibrate(_state, event: DotEvent<unknown, { style: VibrationStyle }>) {
12
+ await this.dash.system.vibrate({ style: event.data.style });
13
+ },
14
+ async copySong() {
15
+ await this.dash.system.copyText('Exodus, by Drizilik');
16
+ this.setState({ toast: 'Song copied' });
23
17
  },
24
- async confirmDelete() {
18
+ async shareText() {
25
19
  try {
26
- const { action } = await this.dash.ui.alert({
27
- title: 'Remove this song from your library?',
28
- message: 'Its download goes too.',
29
- actions: [
30
- { id: 'keep', label: 'Keep', role: 'cancel' },
31
- { id: 'remove', label: 'Remove', role: 'destructive' },
32
- ],
20
+ await this.dash.system.share({
21
+ text: 'Salone Sounds Live, Freetown, 24 October. See you there!',
33
22
  });
34
- this.setState({ choice: action });
35
23
  } catch (error) {
36
24
  this.setState({ note: (error as Error).message });
37
25
  }
38
26
  },
39
- async vibrate(_state, event: DotEvent<unknown, { style: 'light' | 'success' | 'error' }>) {
40
- await this.dash.system.vibrate({ style: event.data.style });
41
- },
42
- async copySong() {
43
- await this.dash.system.copyText('Exodus, by Drizilik');
44
- this.setState({ toast: 'Song copied' });
45
- },
46
27
  async shareLink() {
47
28
  try {
48
29
  await this.dash.system.share({
@@ -0,0 +1,9 @@
1
+ import type { VibrationStyle } from '@monimesl/dot-runtime';
2
+
3
+ export default {
4
+ styles: ['light', 'medium', 'heavy', 'success', 'warning', 'error'] as VibrationStyle[],
5
+ torch: 'off' as 'on' | 'off',
6
+ showIn: 0,
7
+ note: '',
8
+ toast: '',
9
+ };
@@ -0,0 +1,59 @@
1
+ <View>
2
+ <Text variant="title">dash.system</Text>
3
+ <Text>The phone's own features: vibration, the clipboard, sharing, the browser, timers and the torch.</Text>
4
+
5
+ <View gap="small">
6
+ <Text variant="subtitle">vibrate</Text>
7
+ <Text variant="caption" tone="muted">A short buzz, in a style that suits what happened.</Text>
8
+ <View variant="card" direction="row" wrap gap="small">
9
+ <For each="{{ styles }}" item="style" key="*this">
10
+ <Button variant="secondary" data-style="{{ style }}" onClick="vibrate">{{ style }}</Button>
11
+ </For>
12
+ </View>
13
+ </View>
14
+
15
+ <View gap="small">
16
+ <Text variant="subtitle">copyText</Text>
17
+ <View variant="card">
18
+ <Button variant="secondary" onClick="copySong">Copy a song's name</Button>
19
+ </View>
20
+ </View>
21
+
22
+ <View gap="small">
23
+ <Text variant="subtitle">share</Text>
24
+ <Text variant="caption" tone="muted">Opens the phone's share sheet with text, a link or a file. The dash.network page shares a file.</Text>
25
+ <View variant="card" direction="row" wrap gap="small">
26
+ <Button variant="secondary" onClick="shareText">Share text</Button>
27
+ <Button variant="secondary" onClick="shareLink">Share a link</Button>
28
+ </View>
29
+ </View>
30
+
31
+ <View gap="small">
32
+ <Text variant="subtitle">openUrl</Text>
33
+ <Text variant="caption" tone="muted">Opens a web page in the phone's browser.</Text>
34
+ <View variant="card">
35
+ <Button variant="secondary" onClick="openDrizilik">Open Drizilik's website</Button>
36
+ </View>
37
+ </View>
38
+
39
+ <View gap="small">
40
+ <Text variant="subtitle">delay</Text>
41
+ <Text variant="caption" tone="muted">Waits for a number of milliseconds. Dash keeps time, so it's cancelled when the page closes.</Text>
42
+ <View variant="card">
43
+ <Button variant="secondary" onClick="countDown" disabled="{{ showIn > 0 }}">{{ showIn > 0 ? 'Showtime in ' + showIn + 's' : 'Count down to showtime' }}</Button>
44
+ </View>
45
+ </View>
46
+
47
+ <View gap="small">
48
+ <Text variant="subtitle">torch</Text>
49
+ <Text variant="caption" tone="muted">Turns the camera's light on or off.</Text>
50
+ <View variant="card">
51
+ <Button variant="secondary" onClick="toggleTorch">{{ torch === 'on' ? 'Turn the torch off' : 'Lights up for the slow song' }}</Button>
52
+ </View>
53
+ </View>
54
+
55
+ <If condition="{{ note }}">
56
+ <Notice tone="danger">{{ note }}</Notice>
57
+ </If>
58
+ <Toast message="{{ toast }}" tone="success" onHide="clearToast" />
59
+ </View>
@@ -0,0 +1,69 @@
1
+ import { HostError } from '@monimesl/dot-runtime';
2
+
3
+ import state from './state';
4
+
5
+ // Closing a picker isn't a problem to show. Anything else is.
6
+ function problemToShow(error: unknown): string {
7
+ const closedByPerson = error instanceof HostError && error.code === 'cancelled';
8
+ return closedByPerson ? '' : (error as Error).message;
9
+ }
10
+
11
+ export default definePage({
12
+ initialState: state,
13
+ actions: {
14
+ async greet() {
15
+ try {
16
+ const { action } = await this.dash.ui.alert({
17
+ title: 'Kushé',
18
+ message: 'Kushé means hello in Krio, and tenki means thanks.',
19
+ actions: [
20
+ { id: 'tenki', label: 'Tenki' },
21
+ { id: 'close', label: 'Close', role: 'cancel' },
22
+ ],
23
+ });
24
+ this.setState({ choice: action, note: '' });
25
+ } catch (error) {
26
+ this.setState({ note: problemToShow(error) });
27
+ }
28
+ },
29
+ async confirmRemove() {
30
+ try {
31
+ const { action } = await this.dash.ui.alert({
32
+ title: 'Remove this song from your library?',
33
+ message: 'Its download goes too.',
34
+ actions: [
35
+ { id: 'keep', label: 'Keep', role: 'cancel' },
36
+ { id: 'remove', label: 'Remove', role: 'destructive' },
37
+ ],
38
+ });
39
+ this.setState({ choice: action, note: '' });
40
+ } catch (error) {
41
+ this.setState({ note: problemToShow(error) });
42
+ }
43
+ },
44
+ async chooseNight(state) {
45
+ try {
46
+ const night = await this.dash.ui.pickDate({
47
+ title: 'Choose a night',
48
+ value: state.night || undefined,
49
+ min: '2026-10-01',
50
+ max: '2026-12-31',
51
+ });
52
+ this.setState({ night, note: '' });
53
+ } catch (error) {
54
+ this.setState({ note: problemToShow(error) });
55
+ }
56
+ },
57
+ async chooseArrival(state) {
58
+ try {
59
+ const arrival = await this.dash.ui.pickTime({
60
+ title: 'Arriving at',
61
+ value: state.arrival || '18:00',
62
+ });
63
+ this.setState({ arrival, note: '' });
64
+ } catch (error) {
65
+ this.setState({ note: problemToShow(error) });
66
+ }
67
+ },
68
+ },
69
+ });
@@ -0,0 +1,8 @@
1
+ export default {
2
+ // The id of the alert button tapped.
3
+ choice: '',
4
+ // A date such as "2026-10-24", and a time such as "19:30", from the phone's own pickers.
5
+ night: '',
6
+ arrival: '',
7
+ note: '',
8
+ };
@@ -0,0 +1,31 @@
1
+ <View>
2
+ <Text variant="title">dash.ui</Text>
3
+ <Text>Dash shows these over the dot, in the phone's own style. Each call waits until the person answers.</Text>
4
+
5
+ <View gap="small">
6
+ <Text variant="subtitle">alert</Text>
7
+ <Text variant="caption" tone="muted">A title, a message and buttons. It gives back the id of the button tapped. role="cancel" and role="destructive" style a button.</Text>
8
+ <View variant="card" gap="small">
9
+ <View direction="row" wrap gap="small">
10
+ <Button onClick="greet">Say kushé</Button>
11
+ <Button variant="secondary" onClick="confirmRemove">Remove a song</Button>
12
+ </View>
13
+ <If condition="{{ choice }}">
14
+ <Text>You tapped "{{ choice }}"</Text>
15
+ </If>
16
+ </View>
17
+ </View>
18
+
19
+ <View gap="small">
20
+ <Text variant="subtitle">pickDate and pickTime</Text>
21
+ <Text variant="caption" tone="muted">The phone's own pickers. A date comes back as "2026-10-24" and a time as "19:30". min and max limit the dates. Closing a picker rejects with a HostError coded cancelled.</Text>
22
+ <List>
23
+ <ListItem icon="calendar" title="Night" subtitle="Shows run from October to December" value="{{ night || 'Choose' }}" onTap="chooseNight" />
24
+ <ListItem icon="clock" title="Arriving at" subtitle="Doors open at 18:00" value="{{ arrival || 'Choose' }}" onTap="chooseArrival" />
25
+ </List>
26
+ </View>
27
+
28
+ <If condition="{{ note }}">
29
+ <Notice tone="danger">{{ note }}</Notice>
30
+ </If>
31
+ </View>
@@ -1,127 +1,204 @@
1
- export interface Feature {
1
+ export interface Topic {
2
2
  page: PageId;
3
3
  title: string;
4
- summary: string;
4
+ // The API names the page shows, so it's easy to find the one you need.
5
+ covers: string;
5
6
  icon: string;
6
7
  }
7
8
 
8
9
  export interface Section {
9
10
  title: string;
10
- features: Feature[];
11
+ text: string;
12
+ topics: Topic[];
11
13
  }
12
14
 
13
15
  export default {
14
16
  title: 'Salone Sounds',
15
17
  sections: [
16
18
  {
17
- title: 'Views',
18
- features: [
19
+ title: 'Basics',
20
+ text: 'How a page works: pages/<name>/ with state.ts, view.dml and controller.ts',
21
+ topics: [
19
22
  {
20
- page: 'layout',
23
+ page: 'basics/state',
24
+ title: 'State, mutations and actions',
25
+ covers: 'state.ts, setState, mutations, actions',
26
+ icon: 'refresh',
27
+ },
28
+ {
29
+ page: 'basics/bindings',
30
+ title: 'Bindings',
31
+ covers: '{{ }}, expressions, env',
32
+ icon: 'link',
33
+ },
34
+ {
35
+ page: 'basics/control-flow',
36
+ title: 'If and For',
37
+ covers: 'If, ElseIf, Else, For',
38
+ icon: 'list',
39
+ },
40
+ {
41
+ page: 'basics/events',
42
+ title: 'Events',
43
+ covers: 'onTap, onChange, event.detail, data-*',
44
+ icon: 'bolt',
45
+ },
46
+ {
47
+ page: 'basics/navigation',
48
+ title: 'Navigation',
49
+ covers: 'push, replace, back, reset',
50
+ icon: 'arrow-right',
51
+ },
52
+ {
53
+ page: 'basics/hooks',
54
+ title: 'Page hooks',
55
+ covers: 'onLoad, onShow, onHide, onUnload',
56
+ icon: 'history',
57
+ },
58
+ {
59
+ page: 'basics/bars',
60
+ title: "Dash's bars",
61
+ covers: 'configs, setNavigationBar, setTabBar',
62
+ icon: 'settings',
63
+ },
64
+ ],
65
+ },
66
+ {
67
+ title: 'Components',
68
+ text: 'What a view.dml can show',
69
+ topics: [
70
+ {
71
+ page: 'components/layout',
21
72
  title: 'Layout',
22
- summary: 'Rows, columns, cards, a shelf to scroll and a grid',
73
+ covers: 'View, Stack, Scroll, Grid, Divider',
23
74
  icon: 'grid',
24
75
  },
25
76
  {
26
- page: 'text',
27
- title: 'Text and bindings',
28
- summary: 'Text styles, tones, links and bindings',
77
+ page: 'components/styles',
78
+ title: 'Styles',
79
+ covers: 'background, border, radius, sizes, theme colours',
80
+ icon: 'star',
81
+ },
82
+ {
83
+ page: 'components/text',
84
+ title: 'Text and links',
85
+ covers: 'Text, Link',
29
86
  icon: 'edit',
30
87
  },
31
88
  {
32
- page: 'images',
89
+ page: 'components/icons',
90
+ title: 'Icons',
91
+ covers: 'Icon, every name',
92
+ icon: 'heart',
93
+ },
94
+ {
95
+ page: 'components/reading',
96
+ title: 'Reading',
97
+ covers: 'Prose, Quote, BulletList, RichText',
98
+ icon: 'file',
99
+ },
100
+ {
101
+ page: 'components/images',
33
102
  title: 'Images',
34
- summary: 'Pictures from the dot and from the web',
103
+ covers: 'Image',
35
104
  icon: 'image',
36
105
  },
37
106
  {
38
- page: 'carousel',
107
+ page: 'components/carousel',
39
108
  title: 'Carousel',
40
- summary: 'Slides of Gen Z artists and Salone history',
41
- icon: 'image',
109
+ covers: 'Carousel',
110
+ icon: 'video',
42
111
  },
43
112
  {
44
- page: 'lists',
45
- title: 'Lists and icons',
46
- summary: 'Rows to tap, badges and icons',
113
+ page: 'components/lists',
114
+ title: 'Lists',
115
+ covers: 'List, ListItem, DetailRow, EmptyState',
47
116
  icon: 'list',
48
117
  },
49
118
  {
50
- page: 'filters',
51
- title: 'Tabs and filters',
52
- summary: 'Tabs, chips and empty states',
119
+ page: 'components/tabs',
120
+ title: 'Tabs and chips',
121
+ covers: 'Tabs, Tab, Chip',
53
122
  icon: 'search',
54
123
  },
55
124
  {
56
- page: 'forms',
125
+ page: 'components/forms',
57
126
  title: 'Forms',
58
- summary: 'Fields, choices and switches for buying tickets',
127
+ covers: 'Input, TextArea, Select, Checkbox, Radio, Switch, Slider, Footer',
59
128
  icon: 'check',
60
129
  },
61
130
  {
62
- page: 'payments',
63
- title: 'Payments',
64
- summary: 'Amounts, QR codes and one-time codes',
131
+ page: 'components/money',
132
+ title: 'Money and codes',
133
+ covers: 'AmountInput, CodeInput, QRCode',
65
134
  icon: 'cash',
66
135
  },
67
136
  {
68
- page: 'feedback',
137
+ page: 'components/feedback',
69
138
  title: 'Feedback',
70
- summary: 'Loading, toasts, progress and notices',
139
+ covers: 'Spinner, Skeleton, ProgressBar, Notice, Badge, Toast',
71
140
  icon: 'bell',
72
141
  },
73
- ],
74
- },
75
- {
76
- title: 'Logic',
77
- features: [
78
- {
79
- page: 'state',
80
- title: 'State, mutations and actions',
81
- summary: 'State, conditions and lists',
82
- icon: 'refresh',
83
- },
84
142
  {
85
- page: 'navigation',
86
- title: 'Navigation and hooks',
87
- summary: 'Opening pages, going back, and page hooks',
88
- icon: 'arrow-right',
143
+ page: 'components/sheets',
144
+ title: 'Sheets',
145
+ covers: 'Sheet',
146
+ icon: 'more',
89
147
  },
90
148
  ],
91
149
  },
92
150
  {
93
151
  title: 'Dash',
94
- features: [
152
+ text: "The phone's features, through this.dash",
153
+ topics: [
95
154
  {
96
- page: 'device',
97
- title: 'Alerts and device',
98
- summary: 'Alerts, copy, share, links and the torch',
155
+ page: 'dash/ui',
156
+ title: 'dash.ui',
157
+ covers: 'alert, pickDate, pickTime',
158
+ icon: 'calendar',
159
+ },
160
+ {
161
+ page: 'dash/system',
162
+ title: 'dash.system',
163
+ covers: 'vibrate, copyText, share, openUrl, delay, torch',
99
164
  icon: 'mobile',
100
165
  },
101
166
  {
102
- page: 'network',
103
- title: 'Network',
104
- summary: 'Requests, JSON, downloads and uploads',
167
+ page: 'dash/media',
168
+ title: 'dash.media',
169
+ covers: 'pickPhoto, scanCode',
170
+ icon: 'image',
171
+ },
172
+ {
173
+ page: 'dash/network',
174
+ title: 'dash.network.http',
175
+ covers: 'request, download, upload',
105
176
  icon: 'wifi',
106
177
  },
107
178
  {
108
- page: 'files',
109
- title: 'Files',
110
- summary: "Saving files in the dot's own folder",
179
+ page: 'dash/files',
180
+ title: 'dash.storage.file',
181
+ covers: 'write, read, list, move, copy, pick, save',
111
182
  icon: 'file',
112
183
  },
113
184
  {
114
- page: 'cache',
115
- title: 'Cache',
116
- summary: 'Values that expire after a while',
117
- icon: 'refresh',
185
+ page: 'dash/cache',
186
+ title: 'dash.storage.cache',
187
+ covers: 'set, get, keys, exists, remove, clear',
188
+ icon: 'history',
118
189
  },
119
190
  {
120
- page: 'secrets',
121
- title: 'Secrets',
122
- summary: 'Sign-in tokens kept encrypted',
191
+ page: 'dash/secrets',
192
+ title: 'dash.storage.secret',
193
+ covers: 'set, get, remove, clear',
123
194
  icon: 'lock',
124
195
  },
196
+ {
197
+ page: 'dash/calls',
198
+ title: 'Calls and errors',
199
+ covers: 'timeout, cancel, HostError',
200
+ icon: 'warning',
201
+ },
125
202
  ],
126
203
  },
127
204
  ] as Section[],
@@ -9,10 +9,13 @@
9
9
 
10
10
  <For each="{{ sections }}" item="section" key="title">
11
11
  <View gap="small">
12
- <Text variant="caption" tone="muted">{{ section.title }}</Text>
12
+ <View gap="none">
13
+ <Text variant="subtitle">{{ section.title }}</Text>
14
+ <Text variant="caption" tone="muted">{{ section.text }}</Text>
15
+ </View>
13
16
  <List>
14
- <For each="{{ section.features }}" item="feature" key="page">
15
- <ListItem icon="{{ feature.icon }}" title="{{ feature.title }}" subtitle="{{ feature.summary }}" data-page="{{ feature.page }}" onTap="open" />
17
+ <For each="{{ section.topics }}" item="topic" key="page">
18
+ <ListItem icon="{{ topic.icon }}" title="{{ topic.title }}" subtitle="{{ topic.covers }}" data-page="{{ topic.page }}" onTap="open" />
16
19
  </For>
17
20
  </List>
18
21
  </View>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monimesl/dot-cli",
3
- "version": "0.1.0-alpha.15",
3
+ "version": "0.1.0-alpha.18",
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": "0.1.0-alpha.15",
28
- "@monimesl/dot-script-parser": "0.1.0-alpha.15",
29
- "@monimesl/dot-core": "0.1.0-alpha.15",
30
- "@monimesl/dot-dml-parser": "0.1.0-alpha.15",
31
- "@monimesl/dot-simulator": "0.1.0-alpha.15"
27
+ "@monimesl/dot-compiler": "0.1.0-alpha.18",
28
+ "@monimesl/dot-dml-parser": "0.1.0-alpha.18",
29
+ "@monimesl/dot-core": "0.1.0-alpha.18",
30
+ "@monimesl/dot-script-parser": "0.1.0-alpha.18",
31
+ "@monimesl/dot-simulator": "0.1.0-alpha.18"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^22.20.4",
@@ -1,36 +0,0 @@
1
- <View>
2
- <Text variant="title">Cache</Text>
3
- <Text>The cache saves small values by name. A value can expire after a set time, or stay until it is removed.</Text>
4
-
5
- <Text variant="caption" tone="muted">Tap an artist. It is remembered for 30 seconds.</Text>
6
- <List>
7
- <For each="{{ artists }}" item="artist" key="id">
8
- <ListItem icon="microphone" title="{{ artist.name }}" data-id="{{ artist.id }}" data-name="{{ artist.name }}" onTap="view" />
9
- </For>
10
- </List>
11
- <View variant="card" gap="small">
12
- <If condition="{{ recent.length > 0 }}">
13
- <For each="{{ recent }}" item="name" key="name">
14
- <Text>{{ name }}</Text>
15
- </For>
16
- </If>
17
- <Else>
18
- <Text variant="caption" tone="muted">No artists viewed in the last 30 seconds</Text>
19
- </Else>
20
- <Button variant="secondary" onClick="refresh">Check again</Button>
21
- </View>
22
-
23
- <Text variant="caption" tone="muted">Your favourite genre. It stays until you clear the cache.</Text>
24
- <View variant="card">
25
- <Select label="Genre" placeholder="Choose a genre" value="{{ genre }}" onChange="setGenre">
26
- <Option value="Afropop" label="Afropop" />
27
- <Option value="Palm-wine" label="Palm-wine" />
28
- <Option value="Gumbe" label="Gumbe" />
29
- </Select>
30
- </View>
31
-
32
- <View variant="card" gap="small">
33
- <Text variant="caption" tone="muted">Keys in the cache: {{ keys || 'none' }}</Text>
34
- <Button variant="secondary" onClick="clear" disabled="{{ !keys }}">Clear the cache</Button>
35
- </View>
36
- </View>
@@ -1,7 +0,0 @@
1
- export default {
2
- choice: '',
3
- torch: 'off' as 'on' | 'off',
4
- note: '',
5
- toast: '',
6
- showIn: 0,
7
- };
@@ -1,49 +0,0 @@
1
- <View>
2
- <Text variant="title">Alerts and device</Text>
3
- <Text>Dash shows these, not the dot. The dot asks for them through dash.</Text>
4
-
5
- <Text variant="caption" tone="muted">dash.ui.alert</Text>
6
- <View variant="card" gap="small">
7
- <View direction="row" wrap gap="small">
8
- <Button onClick="greet">Say kushé</Button>
9
- <Button variant="secondary" onClick="confirmDelete">Remove a song</Button>
10
- </View>
11
- <If condition="{{ choice }}">
12
- <Text>You chose "{{ choice }}"</Text>
13
- </If>
14
- <Text variant="caption" tone="muted">Kushé means hello in Krio, and tenki means thanks. The message comes from GREETING in the .env file.</Text>
15
- </View>
16
-
17
- <Text variant="caption" tone="muted">dash.system.vibrate</Text>
18
- <View variant="card" direction="row" wrap gap="small">
19
- <Button variant="secondary" data-style="light" onClick="vibrate">Light</Button>
20
- <Button variant="secondary" data-style="success" onClick="vibrate">Success</Button>
21
- <Button variant="secondary" data-style="error" onClick="vibrate">Error</Button>
22
- </View>
23
-
24
- <Text variant="caption" tone="muted">dash.system.copyText and dash.system.share</Text>
25
- <View variant="card" direction="row" wrap gap="small">
26
- <Button variant="secondary" onClick="copySong">Copy a song</Button>
27
- <Button variant="secondary" onClick="shareLink">Share Sierra Leone's music</Button>
28
- </View>
29
-
30
- <Text variant="caption" tone="muted">dash.system.openUrl opens a web page in the phone's browser</Text>
31
- <View variant="card">
32
- <Button variant="secondary" onClick="openDrizilik">Open Drizilik's website</Button>
33
- </View>
34
-
35
- <Text variant="caption" tone="muted">dash.system.delay</Text>
36
- <View variant="card">
37
- <Button variant="secondary" onClick="countDown" disabled="{{ showIn > 0 }}">{{ showIn > 0 ? 'Showtime in ' + showIn + 's' : 'Count down to showtime' }}</Button>
38
- </View>
39
-
40
- <Text variant="caption" tone="muted">dash.system.torch</Text>
41
- <View variant="card" gap="small">
42
- <Button variant="secondary" onClick="toggleTorch">{{ torch === 'on' ? 'Turn the torch off' : 'Lights up for the slow song' }}</Button>
43
- <If condition="{{ note }}">
44
- <Text variant="caption" tone="muted">{{ note }}</Text>
45
- </If>
46
- </View>
47
-
48
- <Toast message="{{ toast }}" tone="success" onHide="clearToast" />
49
- </View>