@monimesl/dot-cli 0.1.0-alpha.9 → 1.0.0-beta.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/README.md +72 -59
- package/dist/cli.js +539 -341
- package/dist/cli.js.map +1 -1
- package/dist/{server-BfPAnsSf.js → server-DMnWDdJ6.js} +570 -478
- package/dist/server-DMnWDdJ6.js.map +1 -0
- package/dist/templates/showcase/dot.ts +53 -16
- package/dist/templates/showcase/pages/basics/bars/controller.ts +47 -0
- package/dist/templates/showcase/pages/basics/bars/state.ts +7 -0
- package/dist/templates/showcase/pages/basics/bars/view.dml +36 -0
- package/dist/templates/showcase/pages/{text → basics/bindings}/controller.ts +5 -0
- package/dist/templates/showcase/pages/basics/bindings/state.ts +14 -0
- package/dist/templates/showcase/pages/basics/bindings/view.dml +41 -0
- package/dist/templates/showcase/pages/basics/colors/controller.ts +112 -0
- package/dist/templates/showcase/pages/basics/colors/palette.ts +52 -0
- package/dist/templates/showcase/pages/basics/colors/state.ts +17 -0
- package/dist/templates/showcase/pages/basics/colors/view.dml +142 -0
- package/dist/templates/showcase/pages/basics/concert/controller.ts +16 -0
- package/dist/templates/showcase/pages/basics/concert/state.ts +7 -0
- package/dist/templates/showcase/pages/basics/concert/view.dml +20 -0
- package/dist/templates/showcase/pages/basics/control-flow/controller.ts +18 -0
- package/dist/templates/showcase/pages/basics/control-flow/state.ts +16 -0
- package/dist/templates/showcase/pages/basics/control-flow/view.dml +55 -0
- package/dist/templates/showcase/pages/basics/events/controller.ts +43 -0
- package/dist/templates/showcase/pages/basics/events/state.ts +11 -0
- package/dist/templates/showcase/pages/basics/events/view.dml +51 -0
- package/dist/templates/showcase/pages/basics/hooks/controller.ts +43 -0
- package/dist/templates/showcase/pages/basics/hooks/state.ts +10 -0
- package/dist/templates/showcase/pages/basics/hooks/view.dml +37 -0
- package/dist/templates/showcase/pages/basics/navigation/controller.ts +41 -0
- package/dist/templates/showcase/pages/basics/navigation/state.ts +11 -0
- package/dist/templates/showcase/pages/basics/navigation/view.dml +48 -0
- package/dist/templates/showcase/pages/basics/pick-genre/controller.ts +18 -0
- package/dist/templates/showcase/pages/basics/pick-genre/state.ts +3 -0
- package/dist/templates/showcase/pages/basics/pick-genre/view.dml +10 -0
- package/dist/templates/showcase/pages/basics/share/concerts.ts +31 -0
- package/dist/templates/showcase/pages/basics/share/controller.ts +12 -0
- package/dist/templates/showcase/pages/basics/share/state.ts +5 -0
- package/dist/templates/showcase/pages/basics/share/view.dml +21 -0
- package/dist/templates/showcase/pages/{state → basics/state}/controller.ts +1 -0
- package/dist/templates/showcase/pages/basics/state/view.dml +46 -0
- package/dist/templates/showcase/pages/{carousel → components/carousel}/controller.ts +2 -1
- package/dist/templates/showcase/pages/{carousel → components/carousel}/state.ts +5 -5
- package/dist/templates/showcase/pages/{carousel → components/carousel}/view.dml +7 -5
- package/dist/templates/showcase/pages/{feedback → components/feedback}/controller.ts +13 -2
- package/dist/templates/showcase/pages/components/feedback/state.ts +41 -0
- package/dist/templates/showcase/pages/{feedback → components/feedback}/view.dml +38 -9
- package/dist/templates/showcase/pages/{forms → components/forms}/controller.ts +23 -19
- package/dist/templates/showcase/pages/{forms → components/forms}/state.ts +6 -3
- package/dist/templates/showcase/pages/components/forms/view.dml +97 -0
- package/dist/templates/showcase/pages/components/icons/controller.ts +15 -0
- package/dist/templates/showcase/pages/components/icons/state.ts +75 -0
- package/dist/templates/showcase/pages/components/icons/view.dml +36 -0
- package/dist/templates/showcase/pages/{images → components/images}/controller.ts +4 -1
- package/dist/templates/showcase/pages/components/images/view.dml +83 -0
- package/dist/templates/showcase/pages/{layout → components/layout}/controller.ts +3 -2
- package/dist/templates/showcase/pages/components/layout/view.dml +143 -0
- package/dist/templates/showcase/pages/components/lists/controller.ts +18 -0
- package/dist/templates/showcase/pages/{lists → components/lists}/state.ts +43 -30
- package/dist/templates/showcase/pages/components/lists/view.dml +88 -0
- package/dist/templates/showcase/pages/{payments → components/money}/controller.ts +7 -8
- package/dist/templates/showcase/pages/components/money/view.dml +54 -0
- package/dist/templates/showcase/pages/components/reading/controller.ts +6 -0
- package/dist/templates/showcase/pages/components/reading/state.ts +23 -0
- package/dist/templates/showcase/pages/components/reading/view.dml +42 -0
- package/dist/templates/showcase/pages/{lists → components/sheets}/controller.ts +10 -11
- package/dist/templates/showcase/pages/components/sheets/state.ts +26 -0
- package/dist/templates/showcase/pages/components/sheets/view.dml +38 -0
- package/dist/templates/showcase/pages/components/styles/controller.ts +6 -0
- package/dist/templates/showcase/pages/components/styles/state.ts +3 -0
- package/dist/templates/showcase/pages/components/styles/view.dml +101 -0
- package/dist/templates/showcase/pages/components/tabs/controller.ts +41 -0
- package/dist/templates/showcase/pages/{filters → components/tabs}/state.ts +32 -23
- package/dist/templates/showcase/pages/components/tabs/view.dml +57 -0
- package/dist/templates/showcase/pages/components/text/controller.ts +10 -0
- package/dist/templates/showcase/pages/components/text/state.ts +3 -0
- package/dist/templates/showcase/pages/components/text/view.dml +95 -0
- package/dist/templates/showcase/pages/dash/account/controller.ts +32 -0
- package/dist/templates/showcase/pages/dash/account/state.ts +9 -0
- package/dist/templates/showcase/pages/dash/account/view.dml +33 -0
- package/dist/templates/showcase/pages/{cache → dash/cache}/controller.ts +9 -4
- package/dist/templates/showcase/pages/dash/cache/view.dml +48 -0
- package/dist/templates/showcase/pages/dash/calls/controller.ts +67 -0
- package/dist/templates/showcase/pages/dash/calls/state.ts +9 -0
- package/dist/templates/showcase/pages/dash/calls/view.dml +69 -0
- package/dist/templates/showcase/pages/dash/contacts/controller.ts +30 -0
- package/dist/templates/showcase/pages/dash/contacts/state.ts +6 -0
- package/dist/templates/showcase/pages/dash/contacts/view.dml +33 -0
- package/dist/templates/showcase/pages/dash/crypto/controller.ts +38 -0
- package/dist/templates/showcase/pages/dash/crypto/state.ts +10 -0
- package/dist/templates/showcase/pages/dash/crypto/view.dml +48 -0
- package/dist/templates/showcase/pages/{files → dash/files}/controller.ts +7 -2
- package/dist/templates/showcase/pages/{files → dash/files}/state.ts +4 -0
- package/dist/templates/showcase/pages/dash/files/view.dml +78 -0
- package/dist/templates/showcase/pages/dash/media/controller.ts +65 -0
- package/dist/templates/showcase/pages/dash/media/state.ts +12 -0
- package/dist/templates/showcase/pages/dash/media/view.dml +53 -0
- package/dist/templates/showcase/pages/{network → dash/network}/controller.ts +84 -20
- package/dist/templates/showcase/pages/{network → dash/network}/state.ts +14 -1
- package/dist/templates/showcase/pages/dash/network/view.dml +108 -0
- package/dist/templates/showcase/pages/dash/payments/cases.ts +445 -0
- package/dist/templates/showcase/pages/dash/payments/controller.ts +149 -0
- package/dist/templates/showcase/pages/dash/payments/state.ts +33 -0
- package/dist/templates/showcase/pages/dash/payments/view.dml +71 -0
- package/dist/templates/showcase/pages/{secrets → dash/secrets}/controller.ts +2 -1
- package/dist/templates/showcase/pages/dash/secrets/view.dml +26 -0
- package/dist/templates/showcase/pages/dash/system/controller.ts +89 -0
- package/dist/templates/showcase/pages/dash/system/state.ts +13 -0
- package/dist/templates/showcase/pages/dash/system/view.dml +96 -0
- package/dist/templates/showcase/pages/dash/ui/controller.ts +70 -0
- package/dist/templates/showcase/pages/dash/ui/state.ts +8 -0
- package/dist/templates/showcase/pages/dash/ui/view.dml +31 -0
- package/dist/templates/showcase/pages/index/controller.ts +1 -1
- package/dist/templates/showcase/pages/index/state.ts +175 -60
- package/dist/templates/showcase/pages/index/view.dml +6 -3
- package/package.json +6 -6
- package/dist/server-BfPAnsSf.js.map +0 -1
- package/dist/templates/showcase/pages/cache/view.dml +0 -36
- package/dist/templates/showcase/pages/device/controller.ts +0 -80
- package/dist/templates/showcase/pages/device/state.ts +0 -7
- package/dist/templates/showcase/pages/device/view.dml +0 -49
- package/dist/templates/showcase/pages/feedback/state.ts +0 -8
- package/dist/templates/showcase/pages/files/view.dml +0 -50
- package/dist/templates/showcase/pages/filters/controller.ts +0 -27
- package/dist/templates/showcase/pages/filters/view.dml +0 -44
- package/dist/templates/showcase/pages/forms/view.dml +0 -49
- package/dist/templates/showcase/pages/images/view.dml +0 -53
- package/dist/templates/showcase/pages/layout/view.dml +0 -103
- package/dist/templates/showcase/pages/lists/view.dml +0 -59
- package/dist/templates/showcase/pages/navigation/controller.ts +0 -65
- package/dist/templates/showcase/pages/navigation/state.ts +0 -17
- package/dist/templates/showcase/pages/navigation/view.dml +0 -34
- package/dist/templates/showcase/pages/network/view.dml +0 -67
- package/dist/templates/showcase/pages/payments/view.dml +0 -45
- package/dist/templates/showcase/pages/secrets/view.dml +0 -24
- package/dist/templates/showcase/pages/state/view.dml +0 -33
- package/dist/templates/showcase/pages/text/state.ts +0 -8
- package/dist/templates/showcase/pages/text/view.dml +0 -58
- /package/dist/templates/showcase/pages/{state → basics/state}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{images → components/images}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{layout → components/layout}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{payments → components/money}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{cache → dash/cache}/state.ts +0 -0
- /package/dist/templates/showcase/pages/{secrets → dash/secrets}/state.ts +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface HookRun {
|
|
2
|
-
id: number;
|
|
3
|
-
hook: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
depth: 1,
|
|
8
|
-
maxDepth: 8,
|
|
9
|
-
// The trail of the page that opened this one.
|
|
10
|
-
from: '',
|
|
11
|
-
trail: '',
|
|
12
|
-
hooks: [] as HookRun[],
|
|
13
|
-
// What this page set in Dash's bars.
|
|
14
|
-
colored: false,
|
|
15
|
-
navigationBarHidden: false,
|
|
16
|
-
tabBarHidden: false,
|
|
17
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<View>
|
|
2
|
-
<Text variant="caption" tone="muted">{{ trail }}</Text>
|
|
3
|
-
<Text variant="title">Navigation and hooks</Text>
|
|
4
|
-
<Text>Each new page opens on top. Back returns to the page below. A dot can have {{ maxDepth }} pages open at once.</Text>
|
|
5
|
-
|
|
6
|
-
<View variant="card" gap="small">
|
|
7
|
-
<Text>This is page {{ depth }} of {{ maxDepth }}</Text>
|
|
8
|
-
<View direction="row" wrap gap="small">
|
|
9
|
-
<Button onClick="openAnother" disabled="{{ depth >= maxDepth }}">Open another</Button>
|
|
10
|
-
<Button variant="secondary" onClick="replaceThis">Replace this one</Button>
|
|
11
|
-
<Button variant="secondary" onClick="back">Back</Button>
|
|
12
|
-
<Button variant="secondary" onClick="backTwo" disabled="{{ depth < 3 }}">Back two</Button>
|
|
13
|
-
<Button variant="secondary" onClick="home">Start over</Button>
|
|
14
|
-
</View>
|
|
15
|
-
</View>
|
|
16
|
-
|
|
17
|
-
<Text variant="caption" tone="muted">Each page sets Dash's bars. This page's title is its number.</Text>
|
|
18
|
-
<View variant="card" gap="small">
|
|
19
|
-
<View direction="row" wrap gap="small">
|
|
20
|
-
<Button variant="secondary" onClick="toggleColors">{{ colored ? 'Plain bar' : 'Green bar' }}</Button>
|
|
21
|
-
<Button variant="secondary" onClick="toggleNavigationBar">{{ navigationBarHidden ? 'Show the navigation bar' : 'Hide the navigation bar' }}</Button>
|
|
22
|
-
<Button variant="secondary" onClick="toggleTabBar">{{ tabBarHidden ? 'Show the tab bar' : 'Hide the tab bar' }}</Button>
|
|
23
|
-
</View>
|
|
24
|
-
<Text variant="caption" tone="muted">Going back shows that page's bars again. Leaving the dot brings back Dash's bars.</Text>
|
|
25
|
-
</View>
|
|
26
|
-
|
|
27
|
-
<Text variant="caption" tone="muted">The hooks this page ran, in order</Text>
|
|
28
|
-
<View variant="card" gap="small">
|
|
29
|
-
<For each="{{ hooks }}" item="run" key="id">
|
|
30
|
-
<Text>{{ run.id }}. {{ run.hook }}</Text>
|
|
31
|
-
</For>
|
|
32
|
-
<Text variant="caption" tone="muted">Open another page and come back. This page runs onHide, then onShow.</Text>
|
|
33
|
-
</View>
|
|
34
|
-
</View>
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<View>
|
|
2
|
-
<Text variant="title">Network</Text>
|
|
3
|
-
<Text>Dash sends the dot's requests, only to hosts listed in dot.json. This page searches Apple's music catalog.</Text>
|
|
4
|
-
|
|
5
|
-
<View variant="card" gap="small">
|
|
6
|
-
<Input label="Artist" placeholder="Drizilik" value="{{ artist }}" maxLength="40" onChange="setArtist" onSubmit="search" />
|
|
7
|
-
<View direction="row" wrap gap="small">
|
|
8
|
-
<Button onClick="search" loading="{{ searching }}" disabled="{{ !artist }}">Search</Button>
|
|
9
|
-
<Button variant="secondary" onClick="searchAsText" disabled="{{ !artist }}">Read as text</Button>
|
|
10
|
-
</View>
|
|
11
|
-
<If condition="{{ raw }}">
|
|
12
|
-
<Text variant="caption" tone="muted">The answer as text starts with: {{ raw }}</Text>
|
|
13
|
-
</If>
|
|
14
|
-
</View>
|
|
15
|
-
|
|
16
|
-
<Text variant="caption" tone="muted">The same answer read as JSON, with artwork. Near the end, the list loads 10 more, up to 50. {{ releases.length }} so far.</Text>
|
|
17
|
-
<If condition="{{ releases.length > 0 }}">
|
|
18
|
-
<List onEndReached="loadMore">
|
|
19
|
-
<For each="{{ releases }}" item="release" key="id">
|
|
20
|
-
<ListItem image="{{ release.artwork }}" title="{{ release.title }}" subtitle="{{ release.album }} · {{ release.year }}" />
|
|
21
|
-
</For>
|
|
22
|
-
</List>
|
|
23
|
-
</If>
|
|
24
|
-
<Else>
|
|
25
|
-
<View variant="card">
|
|
26
|
-
<EmptyState icon="search" title="No songs yet" text="Search for an artist, such as Drizilik, Kao Denero or Emmerson." />
|
|
27
|
-
</View>
|
|
28
|
-
</Else>
|
|
29
|
-
|
|
30
|
-
<Text variant="caption" tone="muted">JSON sent to httpbin, which sends it back</Text>
|
|
31
|
-
<View variant="card" gap="small">
|
|
32
|
-
<Button variant="secondary" onClick="sendJson">Send the first song as JSON</Button>
|
|
33
|
-
<If condition="{{ echo }}">
|
|
34
|
-
<Text>httpbin got {{ echo }}</Text>
|
|
35
|
-
</If>
|
|
36
|
-
</View>
|
|
37
|
-
|
|
38
|
-
<Text variant="caption" tone="muted">Files: download the first song's artwork, upload it, and save it</Text>
|
|
39
|
-
<View variant="card" gap="small">
|
|
40
|
-
<View direction="row" wrap gap="small">
|
|
41
|
-
<Button variant="secondary" onClick="download" disabled="{{ releases.length === 0 }}">Download</Button>
|
|
42
|
-
<Button variant="secondary" onClick="upload" disabled="{{ !picture.id }}">Upload</Button>
|
|
43
|
-
<Button variant="secondary" onClick="sharePicture" disabled="{{ !picture.id }}">Share</Button>
|
|
44
|
-
<Button variant="secondary" onClick="keep" disabled="{{ !picture.id || kept }}">Keep</Button>
|
|
45
|
-
</View>
|
|
46
|
-
<If condition="{{ picture.url }}">
|
|
47
|
-
<View direction="row" align="center" gap="medium">
|
|
48
|
-
<Image src="{{ picture.url }}" alt="Artwork" width="64" height="64" />
|
|
49
|
-
<Text variant="caption" tone="muted">{{ picture.size }} bytes, in a temporary file until the dot closes</Text>
|
|
50
|
-
</View>
|
|
51
|
-
</If>
|
|
52
|
-
<If condition="{{ uploaded }}">
|
|
53
|
-
<Text>httpbin got the file field "{{ uploaded }}"</Text>
|
|
54
|
-
</If>
|
|
55
|
-
<If condition="{{ kept }}">
|
|
56
|
-
<Text>Saved in the dot's files. See the Files page.</Text>
|
|
57
|
-
</If>
|
|
58
|
-
</View>
|
|
59
|
-
|
|
60
|
-
<Text variant="caption" tone="muted">A host that dot.json does not list</Text>
|
|
61
|
-
<View variant="card" gap="small">
|
|
62
|
-
<Button variant="secondary" onClick="tryUnlistedHost">Reach example.com</Button>
|
|
63
|
-
<If condition="{{ note }}">
|
|
64
|
-
<Text variant="caption" tone="muted">{{ note }}</Text>
|
|
65
|
-
</If>
|
|
66
|
-
</View>
|
|
67
|
-
</View>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<View>
|
|
2
|
-
<Text variant="title">Payments</Text>
|
|
3
|
-
<Text>Fields for money and codes. Tip the band with a QR code. Confirm tickets with a code.</Text>
|
|
4
|
-
|
|
5
|
-
<View gap="small">
|
|
6
|
-
<Text variant="caption" tone="muted">An amount. It is formatted as you type and sent as a number.</Text>
|
|
7
|
-
<AmountInput label="Tip for the band" value="{{ amount }}" disabled="{{ locked }}" onChange="setAmount" hint="The QR code below asks for it" />
|
|
8
|
-
<Switch label="Lock the tip" checked="{{ locked }}" onChange="setLocked" />
|
|
9
|
-
<View variant="card" align="center" gap="medium">
|
|
10
|
-
<If condition="{{ request }}">
|
|
11
|
-
<QRCode value="{{ request }}" size="180" label="A QR code to tip SLE {{ amountText }}" />
|
|
12
|
-
<Text tone="muted">Scan to tip the band SLE {{ amountText }}</Text>
|
|
13
|
-
</If>
|
|
14
|
-
<Else>
|
|
15
|
-
<EmptyState icon="qr-code" title="No tip yet" text="Type an amount above to make a QR code the crowd can scan." />
|
|
16
|
-
</Else>
|
|
17
|
-
</View>
|
|
18
|
-
</View>
|
|
19
|
-
|
|
20
|
-
<View gap="small">
|
|
21
|
-
<Text variant="caption" tone="muted">Another currency: US dollars. This one sends dollars, not cents</Text>
|
|
22
|
-
<AmountInput label="Pledge for the band's tour" currency="USD" unit="major" value="{{ pledge }}" error="{{ pledgeError }}" hint="Up to USD 1,000" onChange="setPledge" />
|
|
23
|
-
</View>
|
|
24
|
-
|
|
25
|
-
<View gap="small">
|
|
26
|
-
<Text variant="caption" tone="muted">A one-time code. Type it, paste it, or let the phone fill it from an SMS.</Text>
|
|
27
|
-
<If condition="{{ verified }}">
|
|
28
|
-
<Notice tone="success" title="Code accepted">Your two tickets are confirmed.</Notice>
|
|
29
|
-
<Button variant="secondary" onClick="startAgain">Start again</Button>
|
|
30
|
-
</If>
|
|
31
|
-
<Else>
|
|
32
|
-
<CodeInput label="The code we sent to 076 •••• 21" value="{{ code }}" onChange="setCode" onComplete="checkCode" error="{{ codeError }}" hint="Use 123456" />
|
|
33
|
-
</Else>
|
|
34
|
-
</View>
|
|
35
|
-
|
|
36
|
-
<View gap="small">
|
|
37
|
-
<Text variant="caption" tone="muted">A PIN. It is hidden as you type and locks when complete.</Text>
|
|
38
|
-
<CodeInput label="PIN" length="4" secure value="{{ pin }}" disabled="{{ pin.length === 4 }}" onChange="setPin" />
|
|
39
|
-
<View direction="row" align="center" gap="small">
|
|
40
|
-
<Text tone="muted">{{ pin.length }} of 4 digits</Text>
|
|
41
|
-
<View grow />
|
|
42
|
-
<Button variant="secondary" onClick="clearPin" disabled="{{ pin.length === 0 }}">Clear the PIN</Button>
|
|
43
|
-
</View>
|
|
44
|
-
</View>
|
|
45
|
-
</View>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<View>
|
|
2
|
-
<Text variant="title">Secrets</Text>
|
|
3
|
-
<Text>Secrets hold sign-in tokens from the dot's own server. Dash keeps them encrypted on the phone. A dot can keep up to 8.</Text>
|
|
4
|
-
|
|
5
|
-
<Text variant="caption" tone="muted">A sign-in that stays</Text>
|
|
6
|
-
<View variant="card" gap="small">
|
|
7
|
-
<If condition="{{ token }}">
|
|
8
|
-
<Text>Signed in as {{ signedInAs }}</Text>
|
|
9
|
-
<Text variant="caption" tone="muted">Session token {{ token }}</Text>
|
|
10
|
-
<View direction="row" gap="small">
|
|
11
|
-
<Button variant="secondary" onClick="signOut">Sign out</Button>
|
|
12
|
-
<Button variant="secondary" onClick="forgetAll">Forget every secret</Button>
|
|
13
|
-
</View>
|
|
14
|
-
</If>
|
|
15
|
-
<Else>
|
|
16
|
-
<Input label="Name" placeholder="Mariama" value="{{ name }}" maxLength="40" onChange="setName" onSubmit="signIn" />
|
|
17
|
-
<Button onClick="signIn" disabled="{{ !name }}">Sign in</Button>
|
|
18
|
-
<Text variant="caption" tone="muted">Sign in, then close and reopen the dot. You stay signed in.</Text>
|
|
19
|
-
</Else>
|
|
20
|
-
</View>
|
|
21
|
-
|
|
22
|
-
<Text variant="caption" tone="muted">Your name is saved in the cache. Only the token is a secret.</Text>
|
|
23
|
-
<Text variant="caption" tone="muted">Never put your API keys in the dot's code: it is open to read.</Text>
|
|
24
|
-
</View>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<View>
|
|
2
|
-
<Text variant="title">State, mutations and actions</Text>
|
|
3
|
-
<Text>The page keeps its data in state. A mutation changes state when something happens. An action can run several steps or wait for Dash. Here, the crowd wants one more song.</Text>
|
|
4
|
-
|
|
5
|
-
<View variant="card" gap="small">
|
|
6
|
-
<Text variant="title">{{ count }} of {{ limit }} {{ title }}</Text>
|
|
7
|
-
<If condition="{{ count >= limit }}">
|
|
8
|
-
<Text>Encore! The band comes back on</Text>
|
|
9
|
-
</If>
|
|
10
|
-
<ElseIf condition="{{ count > 0 }}">
|
|
11
|
-
<Text>{{ limit - count }} more and the band comes back</Text>
|
|
12
|
-
</ElseIf>
|
|
13
|
-
<Else>
|
|
14
|
-
<Text>Tap Cheer to start</Text>
|
|
15
|
-
</Else>
|
|
16
|
-
<View direction="row" wrap gap="small">
|
|
17
|
-
<Button onClick="increment" disabled="{{ count >= limit }}">Cheer</Button>
|
|
18
|
-
<Button variant="secondary" onClick="fillUp" disabled="{{ count >= limit }}">Whole crowd</Button>
|
|
19
|
-
<Button variant="secondary" onClick="undo" disabled="{{ count === 0 }}">Undo</Button>
|
|
20
|
-
<Button variant="secondary" onClick="reset" disabled="{{ count === 0 }}">Reset</Button>
|
|
21
|
-
</View>
|
|
22
|
-
</View>
|
|
23
|
-
|
|
24
|
-
<Text variant="caption" tone="muted">Each cheer, newest first</Text>
|
|
25
|
-
<View variant="card" gap="small">
|
|
26
|
-
<For each="{{ taps }}" index="position" item="tap" key="id">
|
|
27
|
-
<Text>{{ position + 1 }}. Cheer #{{ tap.id }}</Text>
|
|
28
|
-
</For>
|
|
29
|
-
<If condition="{{ taps.length === 0 }}">
|
|
30
|
-
<Text variant="caption" tone="muted">No cheers yet</Text>
|
|
31
|
-
</If>
|
|
32
|
-
</View>
|
|
33
|
-
</View>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<View>
|
|
2
|
-
<Text variant="title">Text and bindings</Text>
|
|
3
|
-
|
|
4
|
-
<View variant="card" gap="small">
|
|
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
|
-
<Text>Text can hold{{ ' ' }}<Text variant="title">bigger</Text>{{ ' ' }}and{{ ' ' }}<Text variant="caption" tone="muted">smaller</Text>{{ ' ' }}words.</Text>
|
|
9
|
-
</View>
|
|
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
|
-
|
|
20
|
-
<Text variant="caption" tone="muted">Tones, weights and alignment</Text>
|
|
21
|
-
<View variant="card" gap="small">
|
|
22
|
-
<View direction="row" wrap gap="medium">
|
|
23
|
-
<Text tone="muted">muted</Text>
|
|
24
|
-
<Text tone="info">info</Text>
|
|
25
|
-
<Text tone="success">success</Text>
|
|
26
|
-
<Text tone="warning">warning</Text>
|
|
27
|
-
<Text tone="danger">danger</Text>
|
|
28
|
-
</View>
|
|
29
|
-
<View direction="row" gap="medium">
|
|
30
|
-
<Text weight="regular">regular</Text>
|
|
31
|
-
<Text weight="medium">medium</Text>
|
|
32
|
-
<Text weight="bold">bold</Text>
|
|
33
|
-
</View>
|
|
34
|
-
<Text align="center">In the center</Text>
|
|
35
|
-
<Text align="end">At the end</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>
|
|
37
|
-
</View>
|
|
38
|
-
|
|
39
|
-
<Text variant="caption" tone="muted">Bindings show state in the view</Text>
|
|
40
|
-
<View variant="card" gap="small">
|
|
41
|
-
<Text>Hello, {{ name }}</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>
|
|
45
|
-
<View direction="row" wrap gap="small">
|
|
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>
|
|
49
|
-
</View>
|
|
50
|
-
</View>
|
|
51
|
-
|
|
52
|
-
<Text variant="caption" tone="muted">A list, one line per item</Text>
|
|
53
|
-
<View variant="card" gap="small">
|
|
54
|
-
<For each="{{ genres }}" item="genre" index="position" key="*this">
|
|
55
|
-
<Text>{{ position + 1 }}. {{ genre }}</Text>
|
|
56
|
-
</For>
|
|
57
|
-
</View>
|
|
58
|
-
</View>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|