@monimesl/dot-cli 0.1.0-alpha.7 → 0.1.0-alpha.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.
Files changed (57) hide show
  1. package/README.md +17 -9
  2. package/dist/cli.js +158 -71
  3. package/dist/cli.js.map +1 -1
  4. package/dist/{server-DFOUQnLA.js → server-BfPAnsSf.js} +34 -81
  5. package/dist/{server-DFOUQnLA.js.map → server-BfPAnsSf.js.map} +1 -1
  6. package/dist/templates/showcase/.env +1 -1
  7. package/dist/templates/showcase/dot.ts +2 -0
  8. package/dist/templates/showcase/pages/cache/controller.ts +45 -0
  9. package/dist/templates/showcase/pages/cache/state.ts +17 -0
  10. package/dist/templates/showcase/pages/cache/view.dml +36 -0
  11. package/dist/templates/showcase/pages/carousel/controller.ts +33 -3
  12. package/dist/templates/showcase/pages/carousel/state.ts +61 -24
  13. package/dist/templates/showcase/pages/carousel/view.dml +18 -15
  14. package/dist/templates/showcase/pages/device/controller.ts +22 -12
  15. package/dist/templates/showcase/pages/device/state.ts +1 -1
  16. package/dist/templates/showcase/pages/device/view.dml +13 -8
  17. package/dist/templates/showcase/pages/feedback/controller.ts +6 -1
  18. package/dist/templates/showcase/pages/feedback/state.ts +1 -0
  19. package/dist/templates/showcase/pages/feedback/view.dml +23 -23
  20. package/dist/templates/showcase/pages/files/controller.ts +33 -14
  21. package/dist/templates/showcase/pages/files/state.ts +10 -2
  22. package/dist/templates/showcase/pages/files/view.dml +29 -14
  23. package/dist/templates/showcase/pages/filters/controller.ts +11 -12
  24. package/dist/templates/showcase/pages/filters/state.ts +107 -61
  25. package/dist/templates/showcase/pages/filters/view.dml +18 -17
  26. package/dist/templates/showcase/pages/forms/controller.ts +36 -12
  27. package/dist/templates/showcase/pages/forms/state.ts +25 -6
  28. package/dist/templates/showcase/pages/forms/view.dml +28 -18
  29. package/dist/templates/showcase/pages/images/controller.ts +26 -0
  30. package/dist/templates/showcase/pages/images/state.ts +3 -0
  31. package/dist/templates/showcase/pages/images/view.dml +18 -3
  32. package/dist/templates/showcase/pages/index/state.ts +26 -14
  33. package/dist/templates/showcase/pages/index/view.dml +2 -2
  34. package/dist/templates/showcase/pages/layout/controller.ts +36 -2
  35. package/dist/templates/showcase/pages/layout/state.ts +22 -2
  36. package/dist/templates/showcase/pages/layout/view.dml +45 -22
  37. package/dist/templates/showcase/pages/lists/controller.ts +12 -11
  38. package/dist/templates/showcase/pages/lists/state.ts +87 -66
  39. package/dist/templates/showcase/pages/lists/view.dml +15 -15
  40. package/dist/templates/showcase/pages/navigation/controller.ts +2 -1
  41. package/dist/templates/showcase/pages/navigation/view.dml +5 -5
  42. package/dist/templates/showcase/pages/network/controller.ts +68 -24
  43. package/dist/templates/showcase/pages/network/state.ts +13 -6
  44. package/dist/templates/showcase/pages/network/view.dml +29 -18
  45. package/dist/templates/showcase/pages/payments/controller.ts +16 -12
  46. package/dist/templates/showcase/pages/payments/state.ts +3 -0
  47. package/dist/templates/showcase/pages/payments/view.dml +22 -12
  48. package/dist/templates/showcase/pages/secrets/controller.ts +43 -0
  49. package/dist/templates/showcase/pages/secrets/state.ts +5 -0
  50. package/dist/templates/showcase/pages/secrets/view.dml +24 -0
  51. package/dist/templates/showcase/pages/state/state.ts +1 -1
  52. package/dist/templates/showcase/pages/state/view.dml +9 -9
  53. package/dist/templates/showcase/pages/text/controller.ts +3 -3
  54. package/dist/templates/showcase/pages/text/state.ts +6 -5
  55. package/dist/templates/showcase/pages/text/view.dml +22 -13
  56. package/dist/templates/showcase/statics/logo.png +0 -0
  57. package/package.json +6 -6
@@ -3,8 +3,8 @@ import state from './state';
3
3
  export default definePage({
4
4
  initialState: state,
5
5
  mutations: {
6
- addOne: (state) => ({ quantity: state.quantity + 1 }),
7
- removeOne: (state) => ({ quantity: Math.max(0, state.quantity - 1) }),
8
- toggleNickname: (state) => ({ nickname: state.nickname === null ? 'Countess' : null }),
6
+ addTicket: (state) => ({ tickets: state.tickets + 1 }),
7
+ removeTicket: (state) => ({ tickets: Math.max(0, state.tickets - 1) }),
8
+ toggleStageName: (state) => ({ stageName: state.stageName === null ? 'Lady M' : null }),
9
9
  },
10
10
  });
@@ -1,7 +1,8 @@
1
1
  export default {
2
- name: 'Ada',
3
- nickname: null as string | null,
4
- price: 2.5,
5
- quantity: 4,
6
- tags: ['fast', 'small', 'typed'],
2
+ name: 'Mariama',
3
+ stageName: null as string | null,
4
+ // Le, in the leone since 2022, when it dropped three zeros.
5
+ price: 150,
6
+ tickets: 4,
7
+ genres: ['kriofusion', 'palm-wine', 'gumbe'],
7
8
  };
@@ -2,12 +2,21 @@
2
2
  <Text variant="title">Text and bindings</Text>
3
3
 
4
4
  <View variant="card" gap="small">
5
- <Text variant="title">A title</Text>
6
- <Text>Body text, the default</Text>
7
- <Text variant="caption" tone="muted">A caption</Text>
5
+ <Text variant="title">Palm-wine</Text>
6
+ <Text>Guitar music for a calm evening. This is body text.</Text>
7
+ <Text variant="caption" tone="muted">S. E. Rogie and Ebenezer Calendar, in a caption</Text>
8
8
  <Text>Text can hold{{ ' ' }}<Text variant="title">bigger</Text>{{ ' ' }}and{{ ' ' }}<Text variant="caption" tone="muted">smaller</Text>{{ ' ' }}words.</Text>
9
9
  </View>
10
10
 
11
+ <Text variant="caption" tone="muted">Links open a web page or run something on this page</Text>
12
+ <View variant="card" gap="small">
13
+ <Text>Read about{{ ' ' }}<Link href="https://en.wikipedia.org/wiki/Music_of_Sierra_Leone">the music of Sierra Leone</Link>{{ ' ' }}on Wikipedia, in the phone's browser.</Text>
14
+ <View direction="row" gap="medium">
15
+ <Link onTap="addTicket">Add a ticket below</Link>
16
+ <Link tone="danger" onTap="removeTicket">Remove one</Link>
17
+ </View>
18
+ </View>
19
+
11
20
  <Text variant="caption" tone="muted">Tones, weights and alignment</Text>
12
21
  <View variant="card" gap="small">
13
22
  <View direction="row" wrap gap="medium">
@@ -24,26 +33,26 @@
24
33
  </View>
25
34
  <Text align="center">In the center</Text>
26
35
  <Text align="end">At the end</Text>
27
- <Text maxLines="2">A long description is cut off after the lines you allow, so a list of them stays tidy however much each one says about itself.</Text>
36
+ <Text maxLines="2">Sierra Leone's Refugee All Stars came together in refugee camps in Guinea, recorded their first album, Living Like a Refugee, back in Freetown, and went on to play Bonnaroo, open for Aerosmith and appear on Oprah. Two lines are allowed here, so the rest is cut off.</Text>
28
37
  </View>
29
38
 
30
- <Text variant="caption" tone="muted">Bindings put state into the view</Text>
39
+ <Text variant="caption" tone="muted">Bindings show state in the view</Text>
31
40
  <View variant="card" gap="small">
32
41
  <Text>Hello, {{ name }}</Text>
33
- <Text>{{ quantity }} {{ quantity === 1 ? 'item' : 'items' }} at {{ price }} each: {{ quantity * price }}</Text>
34
- <Text>Nickname: {{ nickname ?? 'none yet' }}</Text>
35
- <Text>{{ tags.length }} tags, the first is "{{ tags[0] }}"</Text>
42
+ <Text>{{ tickets }} {{ tickets === 1 ? 'ticket' : 'tickets' }} at Le {{ price }} each: Le {{ tickets * price }}</Text>
43
+ <Text>Stage name: {{ stageName ?? 'none yet' }}</Text>
44
+ <Text>{{ genres.length }} favourite genres, the first is "{{ genres[0] }}"</Text>
36
45
  <View direction="row" wrap gap="small">
37
- <Button variant="secondary" onClick="addOne">Add one</Button>
38
- <Button variant="secondary" onClick="removeOne" disabled="{{ quantity === 0 }}">Remove one</Button>
39
- <Button variant="secondary" onClick="toggleNickname">{{ nickname === null ? 'Give a nickname' : 'Drop the nickname' }}</Button>
46
+ <Button variant="secondary" onClick="addTicket">Add a ticket</Button>
47
+ <Button variant="secondary" onClick="removeTicket" disabled="{{ tickets === 0 }}">Remove one</Button>
48
+ <Button variant="secondary" onClick="toggleStageName">{{ stageName === null ? 'Give a stage name' : 'Drop the stage name' }}</Button>
40
49
  </View>
41
50
  </View>
42
51
 
43
52
  <Text variant="caption" tone="muted">A list, one line per item</Text>
44
53
  <View variant="card" gap="small">
45
- <For each="{{ tags }}" item="tag" index="position" key="*this">
46
- <Text>{{ position + 1 }}. {{ tag }}</Text>
54
+ <For each="{{ genres }}" item="genre" index="position" key="*this">
55
+ <Text>{{ position + 1 }}. {{ genre }}</Text>
47
56
  </For>
48
57
  </View>
49
58
  </View>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monimesl/dot-cli",
3
- "version": "0.1.0-alpha.7",
3
+ "version": "0.1.0-alpha.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": "0.1.0-alpha.7",
28
- "@monimesl/dot-script-parser": "0.1.0-alpha.7",
29
- "@monimesl/dot-core": "0.1.0-alpha.7",
30
- "@monimesl/dot-dml-parser": "0.1.0-alpha.7",
31
- "@monimesl/dot-simulator": "0.1.0-alpha.7"
27
+ "@monimesl/dot-compiler": "0.1.0-alpha.9",
28
+ "@monimesl/dot-core": "0.1.0-alpha.9",
29
+ "@monimesl/dot-script-parser": "0.1.0-alpha.9",
30
+ "@monimesl/dot-simulator": "0.1.0-alpha.9",
31
+ "@monimesl/dot-dml-parser": "0.1.0-alpha.9"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^22.20.4",