@sdeck/plugin-basics 1.3.1 → 1.4.0
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/clock.d.ts +32 -6
- package/dist/clock.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +522 -384
- package/dist/index.js.map +9 -8
- package/dist/runs.d.ts +84 -0
- package/dist/runs.d.ts.map +1 -0
- package/dist/theme.d.ts +0 -3
- package/dist/theme.d.ts.map +1 -1
- package/dist/timers.d.ts +0 -9
- package/dist/timers.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/clock.tsx +217 -126
- package/src/index.tsx +44 -46
- package/src/plugin.ts +1 -1
- package/src/runs.ts +224 -0
- package/src/theme.ts +0 -11
- package/src/timers.tsx +182 -224
package/src/clock.tsx
CHANGED
|
@@ -1,18 +1,37 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The clock and the date. The look draws them from the values given here, so every part can be moved,
|
|
3
|
+
* restyled or left out in the composer.
|
|
4
|
+
*/
|
|
5
|
+
import {
|
|
6
|
+
type ActionValue,
|
|
7
|
+
type DateParts,
|
|
8
|
+
dateParts,
|
|
9
|
+
formatDate,
|
|
10
|
+
isTimeZone,
|
|
11
|
+
setting,
|
|
12
|
+
useNow,
|
|
13
|
+
} from "@sdeck/plugin";
|
|
14
|
+
import {
|
|
15
|
+
iconLayer,
|
|
16
|
+
type Layer,
|
|
17
|
+
type Look,
|
|
18
|
+
readable,
|
|
19
|
+
rectLayer,
|
|
20
|
+
surface,
|
|
21
|
+
textLayer,
|
|
22
|
+
} from "@sdeck/schema";
|
|
4
23
|
import { plugin } from "./plugin.ts";
|
|
5
|
-
import {
|
|
24
|
+
import { svg, THEME } from "./theme.ts";
|
|
6
25
|
|
|
7
|
-
/** An analog face at `
|
|
26
|
+
/** An analog face at `at`: twelve ticks, three hands. */
|
|
8
27
|
export function analogFace(
|
|
9
|
-
|
|
28
|
+
at: Pick<DateParts, "hour" | "minute" | "second">,
|
|
10
29
|
colors: { face: string; hands: string; accent: string; ticks: string },
|
|
11
30
|
seconds: boolean,
|
|
12
31
|
): string {
|
|
13
|
-
const h =
|
|
14
|
-
const m =
|
|
15
|
-
const s =
|
|
32
|
+
const h = at.hour % 12;
|
|
33
|
+
const m = at.minute;
|
|
34
|
+
const s = at.second;
|
|
16
35
|
const hand = (angle: number, length: number, width: number, color: string, tail = 0) =>
|
|
17
36
|
`<line x1="50" y1="${50 + tail}" x2="50" y2="${50 - length}" stroke="${color}" stroke-width="${width}" stroke-linecap="round" transform="rotate(${angle} 50 50)"/>`;
|
|
18
37
|
const ticks = Array.from({ length: 12 }, (_, i) => {
|
|
@@ -28,17 +47,90 @@ export function analogFace(
|
|
|
28
47
|
);
|
|
29
48
|
}
|
|
30
49
|
|
|
31
|
-
/**
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
50
|
+
/** Offered as "Time zone". Nothing chosen is the computer's own. */
|
|
51
|
+
export const zones = plugin.source("zones", () =>
|
|
52
|
+
Intl.supportedValuesOf("timeZone").map((value) => {
|
|
53
|
+
const [area = "", ...city] = value.split("/");
|
|
54
|
+
return {
|
|
55
|
+
value,
|
|
56
|
+
label: city.length > 0 ? `${city.join(", ")} (${area})`.replaceAll("_", " ") : value,
|
|
57
|
+
};
|
|
58
|
+
}),
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const zoneSetting = setting.pick("Time zone", zones, { first: { "": "This computer's" } });
|
|
62
|
+
|
|
63
|
+
const text = (name: string, description?: string): ActionValue => ({
|
|
64
|
+
name,
|
|
65
|
+
type: "string",
|
|
66
|
+
...(description && { description }),
|
|
67
|
+
});
|
|
68
|
+
const number = (name: string, description?: string): ActionValue => ({
|
|
69
|
+
...text(name, description),
|
|
70
|
+
type: "number",
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const DATE_VALUES = {
|
|
74
|
+
weekday: text("Weekday", "Thursday"),
|
|
75
|
+
weekdayShort: text("Weekday, short", "Thu"),
|
|
76
|
+
day: number("Day of the month"),
|
|
77
|
+
month: text("Month", "December"),
|
|
78
|
+
monthShort: text("Month, short", "Dec"),
|
|
79
|
+
monthNumber: number("Month, as a number"),
|
|
80
|
+
year: number("Year"),
|
|
81
|
+
now: number("Moment shown", 'For formats of your own: format(self.now, "D/M")'),
|
|
82
|
+
zone: text("Time zone", 'Empty for the computer\'s own: date("D MMM", self.now, self.zone)'),
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** The day at `now` in `zone`, in parts. */
|
|
86
|
+
export function dateValues(now: Date, zone: string) {
|
|
87
|
+
const at = dateParts(now, zone);
|
|
88
|
+
const part = (pattern: string) => formatDate(now, pattern, { zone });
|
|
89
|
+
return {
|
|
90
|
+
weekday: part("dddd"),
|
|
91
|
+
weekdayShort: part("ddd"),
|
|
92
|
+
day: at?.day,
|
|
93
|
+
month: part("MMMM"),
|
|
94
|
+
monthShort: part("MMM"),
|
|
95
|
+
monthNumber: at?.month,
|
|
96
|
+
year: at?.year,
|
|
97
|
+
now: now.getTime(),
|
|
98
|
+
zone,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The time at `now` in `zone`, in parts. `second` is empty while seconds are off. */
|
|
103
|
+
export function timeValues(
|
|
104
|
+
now: Date,
|
|
105
|
+
options: { zone: string; hour12: boolean; seconds: boolean },
|
|
106
|
+
) {
|
|
107
|
+
const { zone, hour12, seconds } = options;
|
|
108
|
+
const part = (pattern: string) => formatDate(now, pattern, { zone });
|
|
109
|
+
const hour = part(hour12 ? "h" : "HH");
|
|
110
|
+
const minute = part("mm");
|
|
111
|
+
const second = seconds ? part("ss") : "";
|
|
112
|
+
const period = hour12 ? part("A") : "";
|
|
35
113
|
return {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
114
|
+
hour,
|
|
115
|
+
minute,
|
|
116
|
+
second,
|
|
117
|
+
period,
|
|
118
|
+
hour24: dateParts(now, zone)?.hour,
|
|
119
|
+
time: `${hour}:${minute}${second && `:${second}`}${period && ` ${period}`}`,
|
|
39
120
|
};
|
|
40
121
|
}
|
|
41
122
|
|
|
123
|
+
/** The date as this computer writes it: `Thu, Dec 3`. */
|
|
124
|
+
const usualDate = (now: Date, zone: string) =>
|
|
125
|
+
now.toLocaleDateString(undefined, {
|
|
126
|
+
weekday: "short",
|
|
127
|
+
day: "numeric",
|
|
128
|
+
month: "short",
|
|
129
|
+
...(zone && { timeZone: zone }),
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const known = (zone: string) => (isTimeZone(zone) ? zone : "");
|
|
133
|
+
|
|
42
134
|
export const clock = plugin.action({
|
|
43
135
|
id: "clock",
|
|
44
136
|
name: "Clock",
|
|
@@ -52,78 +144,74 @@ export const clock = plugin.action({
|
|
|
52
144
|
hour12: setting.boolean("12-hour clock", { visibleIf: { style: "digital" } }),
|
|
53
145
|
seconds: setting.boolean("Show seconds", { default: true }),
|
|
54
146
|
date: setting.boolean("Show the date"),
|
|
147
|
+
dateFormat: setting.text("Date format", {
|
|
148
|
+
placeholder: "ddd D MMM",
|
|
149
|
+
description:
|
|
150
|
+
"YYYY year, MMMM or MMM month, M its number, D day, Do 3rd, dddd or ddd weekday. Empty: as your computer writes it.",
|
|
151
|
+
visibleIf: { date: true },
|
|
152
|
+
}),
|
|
153
|
+
zone: zoneSetting,
|
|
55
154
|
color: setting.color("Colour", { default: THEME.text }),
|
|
56
155
|
accent: setting.color("Accent", { default: THEME.accent }),
|
|
57
156
|
background: setting.color("Background", { default: THEME.background }),
|
|
58
157
|
},
|
|
59
|
-
|
|
158
|
+
display: true,
|
|
159
|
+
values: {
|
|
160
|
+
hour: text("Hour", "As the settings say: 16, or 4"),
|
|
161
|
+
minute: text("Minute", "05"),
|
|
162
|
+
second: text("Second", "Empty while seconds are off"),
|
|
163
|
+
period: text("AM or PM", "Empty on a 24-hour clock"),
|
|
164
|
+
hour24: number("Hour, 0 to 23"),
|
|
165
|
+
time: text("Time", "All of it: 4:41:07 PM"),
|
|
166
|
+
date: text("Date", "In the date format"),
|
|
167
|
+
...DATE_VALUES,
|
|
168
|
+
face: text("Clock face", "A picture, for an image layer"),
|
|
169
|
+
},
|
|
170
|
+
useValues: ({ settings }) => {
|
|
60
171
|
const now = useNow(settings.seconds ? 1000 : 10_000);
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
now,
|
|
172
|
+
const zone = known(settings.zone);
|
|
173
|
+
return {
|
|
174
|
+
...dateValues(now, zone),
|
|
175
|
+
...timeValues(now, { zone, hour12: settings.hour12, seconds: settings.seconds }),
|
|
176
|
+
date: settings.dateFormat
|
|
177
|
+
? formatDate(now, settings.dateFormat, { zone })
|
|
178
|
+
: usualDate(now, zone),
|
|
179
|
+
face: analogFace(
|
|
180
|
+
dateParts(now, zone) ?? { hour: 0, minute: 0, second: 0 },
|
|
70
181
|
{ face: THEME.faint, hands: settings.color, accent: settings.accent, ticks: THEME.muted },
|
|
71
182
|
settings.seconds,
|
|
183
|
+
),
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
look: (s, slot): Look => {
|
|
187
|
+
const wide = slot === "window";
|
|
188
|
+
const layers: Layer[] = [];
|
|
189
|
+
const row = wide ? "time" : "small";
|
|
190
|
+
if (s.style === "analog") {
|
|
191
|
+
const size = wide ? 86 : s.date ? 69 : 85;
|
|
192
|
+
layers.push(iconLayer("face", "{{self.face}}", { size, ...(wide && { row }) }));
|
|
193
|
+
} else {
|
|
194
|
+
layers.push(
|
|
195
|
+
textLayer("time", "{{self.hour}}:{{self.minute}}", {
|
|
196
|
+
color: s.color,
|
|
197
|
+
size: wide ? 34 : 28,
|
|
198
|
+
...(wide && { row }),
|
|
199
|
+
}),
|
|
72
200
|
);
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
{settings.date || wide ? (
|
|
85
|
-
<div
|
|
86
|
-
style={{
|
|
87
|
-
display: "flex",
|
|
88
|
-
color: THEME.muted,
|
|
89
|
-
fontSize: wide ? 18 : 12,
|
|
90
|
-
fontWeight: 700,
|
|
91
|
-
}}
|
|
92
|
-
>
|
|
93
|
-
{day}
|
|
94
|
-
</div>
|
|
95
|
-
) : null}
|
|
96
|
-
</div>
|
|
201
|
+
const small = { color: s.accent, size: wide ? 16 : 13, row };
|
|
202
|
+
if (s.seconds) layers.push(textLayer("seconds", ":{{self.second}}", small));
|
|
203
|
+
if (s.hour12) layers.push(textLayer("period", "{{self.period}}", small));
|
|
204
|
+
}
|
|
205
|
+
if (s.date || (wide && s.style === "analog")) {
|
|
206
|
+
layers.push(
|
|
207
|
+
textLayer("date", "{{self.date}}", {
|
|
208
|
+
color: THEME.muted,
|
|
209
|
+
size: wide ? 16 : 12,
|
|
210
|
+
...(wide && { row }),
|
|
211
|
+
}),
|
|
97
212
|
);
|
|
98
213
|
}
|
|
99
|
-
|
|
100
|
-
const small = [settings.seconds ? `:${seconds}` : "", period].filter(Boolean).join(" ");
|
|
101
|
-
const big = wide ? 34 : main.length > 4 ? 27 : 31;
|
|
102
|
-
return (
|
|
103
|
-
<div
|
|
104
|
-
style={{
|
|
105
|
-
...column,
|
|
106
|
-
...surfaceStyle(settings.background),
|
|
107
|
-
color: settings.color,
|
|
108
|
-
fontWeight: 700,
|
|
109
|
-
gap: wide ? 0 : 2,
|
|
110
|
-
...(wide && { flexDirection: "row", gap: 14 }),
|
|
111
|
-
}}
|
|
112
|
-
>
|
|
113
|
-
<div style={{ display: "flex", alignItems: "baseline", gap: 3 }}>
|
|
114
|
-
<div style={{ display: "flex", fontSize: big, letterSpacing: -0.5 }}>{main}</div>
|
|
115
|
-
{wide && small ? (
|
|
116
|
-
<div style={{ display: "flex", fontSize: 16, color: settings.accent }}>{small}</div>
|
|
117
|
-
) : null}
|
|
118
|
-
</div>
|
|
119
|
-
{!wide && small ? (
|
|
120
|
-
<div style={{ display: "flex", fontSize: 13, color: settings.accent }}>{small}</div>
|
|
121
|
-
) : null}
|
|
122
|
-
{settings.date ? (
|
|
123
|
-
<div style={{ display: "flex", fontSize: wide ? 16 : 12, color: THEME.muted }}>{day}</div>
|
|
124
|
-
) : null}
|
|
125
|
-
</div>
|
|
126
|
-
);
|
|
214
|
+
return { background: surface(s.background), layers };
|
|
127
215
|
},
|
|
128
216
|
});
|
|
129
217
|
|
|
@@ -135,57 +223,60 @@ export const date = plugin.action({
|
|
|
135
223
|
icon: "calendar",
|
|
136
224
|
slots: ["key", "window"],
|
|
137
225
|
settings: {
|
|
226
|
+
zone: zoneSetting,
|
|
138
227
|
accent: setting.color("Accent", { default: THEME.danger }),
|
|
139
228
|
background: setting.color("Background", { default: THEME.background }),
|
|
140
229
|
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (slot
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
230
|
+
display: true,
|
|
231
|
+
values: DATE_VALUES,
|
|
232
|
+
useValues: ({ settings }) => dateValues(useNow(60_000), known(settings.zone)),
|
|
233
|
+
look: (s, slot): Look => {
|
|
234
|
+
if (slot === "window") {
|
|
235
|
+
return {
|
|
236
|
+
background: surface(s.background),
|
|
237
|
+
layers: [
|
|
238
|
+
textLayer("day", "{{self.day}}", {
|
|
239
|
+
size: 36,
|
|
240
|
+
color: THEME.text,
|
|
241
|
+
align: "right",
|
|
242
|
+
frame: { x: 4, y: 0, width: 32, height: 100 },
|
|
243
|
+
}),
|
|
244
|
+
textLayer("weekday", "{{self.weekday}}", {
|
|
245
|
+
size: 15,
|
|
246
|
+
color: s.accent,
|
|
247
|
+
align: "left",
|
|
248
|
+
frame: { x: 41, y: 14, width: 57, height: 36 },
|
|
249
|
+
}),
|
|
250
|
+
textLayer("month", "{{self.month}} {{self.year}}", {
|
|
251
|
+
size: 14,
|
|
252
|
+
color: THEME.muted,
|
|
253
|
+
align: "left",
|
|
254
|
+
frame: { x: 41, y: 50, width: 57, height: 36 },
|
|
255
|
+
}),
|
|
256
|
+
],
|
|
257
|
+
};
|
|
159
258
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
{weekday.toUpperCase()}
|
|
183
|
-
</div>
|
|
184
|
-
<div style={{ display: "flex", fontSize: 40, color: THEME.text, marginTop: 4 }}>
|
|
185
|
-
{now.getDate()}
|
|
186
|
-
</div>
|
|
187
|
-
<div style={{ display: "flex", fontSize: 12, color: THEME.muted }}>{month}</div>
|
|
188
|
-
</div>
|
|
189
|
-
);
|
|
259
|
+
const banner = { x: 0, y: 0, width: 100, height: 27 };
|
|
260
|
+
return {
|
|
261
|
+
background: surface(s.background),
|
|
262
|
+
layers: [
|
|
263
|
+
rectLayer("banner", { fill: s.accent, frame: banner }),
|
|
264
|
+
textLayer("weekday", "{{upper(self.weekdayShort)}}", {
|
|
265
|
+
size: 13,
|
|
266
|
+
color: readable("#ffffff", s.accent),
|
|
267
|
+
frame: banner,
|
|
268
|
+
}),
|
|
269
|
+
textLayer("day", "{{self.day}}", {
|
|
270
|
+
size: 40,
|
|
271
|
+
color: THEME.text,
|
|
272
|
+
frame: { x: 0, y: 29, width: 100, height: 46 },
|
|
273
|
+
}),
|
|
274
|
+
textLayer("month", "{{self.monthShort}}", {
|
|
275
|
+
size: 12,
|
|
276
|
+
color: THEME.muted,
|
|
277
|
+
frame: { x: 0, y: 75, width: 100, height: 18 },
|
|
278
|
+
}),
|
|
279
|
+
],
|
|
280
|
+
};
|
|
190
281
|
},
|
|
191
282
|
});
|
package/src/index.tsx
CHANGED
|
@@ -2,24 +2,25 @@
|
|
|
2
2
|
* Basics: what most decks want. Labels, time (clock, date, timer, stopwatch), a counter, page
|
|
3
3
|
* navigation and the deck's brightness.
|
|
4
4
|
*/
|
|
5
|
-
import { setting, useKeyPress
|
|
5
|
+
import { setting, useKeyPress } from "@sdeck/plugin";
|
|
6
6
|
import {
|
|
7
7
|
iconLayer,
|
|
8
8
|
iconLook,
|
|
9
9
|
type Layer,
|
|
10
10
|
type Look,
|
|
11
|
+
rectLayer,
|
|
11
12
|
surface,
|
|
12
|
-
surfaceStyle,
|
|
13
13
|
textLayer,
|
|
14
14
|
} from "@sdeck/schema";
|
|
15
|
-
import { clock, date } from "./clock.tsx";
|
|
15
|
+
import { clock, date, zones } from "./clock.tsx";
|
|
16
16
|
import { plugin } from "./plugin.ts";
|
|
17
|
-
import {
|
|
17
|
+
import { followButtons, stopwatches, timers } from "./runs.ts";
|
|
18
|
+
import { THEME } from "./theme.ts";
|
|
18
19
|
import { stopwatch, timer, timerEnded } from "./timers.tsx";
|
|
19
20
|
|
|
20
|
-
export { analogFace,
|
|
21
|
+
export { analogFace, dateValues, timeValues } from "./clock.tsx";
|
|
22
|
+
export { elapsed, namedButtons, type Run, timerValues, toggled, variableName } from "./runs.ts";
|
|
21
23
|
export { formatDuration } from "./theme.ts";
|
|
22
|
-
export { elapsed, type Run, toggled } from "./timers.tsx";
|
|
23
24
|
|
|
24
25
|
// -- Label --------------------------------------------------------------------
|
|
25
26
|
|
|
@@ -79,49 +80,43 @@ const counter = plugin.action({
|
|
|
79
80
|
accent: setting.color("Colour", { default: THEME.accent }),
|
|
80
81
|
background: setting.color("Background", { default: THEME.background }),
|
|
81
82
|
},
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
values: {
|
|
84
|
+
count: { name: "Count", type: "number" },
|
|
85
|
+
title: { name: "Title", type: "string" },
|
|
86
|
+
},
|
|
87
|
+
useValues: ({ settings, setSettings }) => {
|
|
84
88
|
useKeyPress(() => setSettings({ count: settings.count + settings.step }), {
|
|
85
89
|
onLongPress: () => setSettings({ count: 0 }),
|
|
86
90
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
width: 26,
|
|
117
|
-
height: 3,
|
|
118
|
-
borderRadius: 2,
|
|
119
|
-
background: pressed ? "#ffffff" : settings.accent,
|
|
120
|
-
marginTop: 2,
|
|
121
|
-
}}
|
|
122
|
-
/>
|
|
123
|
-
</div>
|
|
124
|
-
);
|
|
91
|
+
return { count: settings.count, title: settings.title };
|
|
92
|
+
},
|
|
93
|
+
look: (s): Look => {
|
|
94
|
+
const { length } = String(s.count);
|
|
95
|
+
return {
|
|
96
|
+
background: surface(s.background),
|
|
97
|
+
layers: [
|
|
98
|
+
rectLayer("pressed", { fill: surface(s.accent), visible: "self.held" }),
|
|
99
|
+
...(s.title
|
|
100
|
+
? [
|
|
101
|
+
textLayer("title", "{{self.title}}", {
|
|
102
|
+
size: 12,
|
|
103
|
+
color: "#b6b8c4",
|
|
104
|
+
position: "top",
|
|
105
|
+
}),
|
|
106
|
+
]
|
|
107
|
+
: []),
|
|
108
|
+
textLayer("count", "{{self.count}}", {
|
|
109
|
+
size: length <= 2 ? 44 : length <= 4 ? 32 : 22,
|
|
110
|
+
color: THEME.text,
|
|
111
|
+
}),
|
|
112
|
+
rectLayer("line", {
|
|
113
|
+
fill: s.accent,
|
|
114
|
+
frame: { x: 36.5, y: 82, width: 27, height: 3 },
|
|
115
|
+
radius: 2,
|
|
116
|
+
visible: "!self.held",
|
|
117
|
+
}),
|
|
118
|
+
],
|
|
119
|
+
};
|
|
125
120
|
},
|
|
126
121
|
});
|
|
127
122
|
|
|
@@ -285,4 +280,7 @@ const brightness = plugin.action({
|
|
|
285
280
|
export default plugin.define({
|
|
286
281
|
actions: [label, clock, date, timer, stopwatch, counter, navigate, pageName, brightness],
|
|
287
282
|
triggers: [timerEnded],
|
|
283
|
+
sources: [zones],
|
|
284
|
+
state: [timers, stopwatches],
|
|
285
|
+
activate: followButtons,
|
|
288
286
|
});
|
package/src/plugin.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { createPlugin } from "@sdeck/plugin";
|
|
|
3
3
|
export const plugin = createPlugin({
|
|
4
4
|
id: "@sdeck/plugin-basics",
|
|
5
5
|
name: "Basics",
|
|
6
|
-
version: "1.
|
|
6
|
+
version: "1.4.0",
|
|
7
7
|
description: "Labels, a clock, the date, timers, a counter, page navigation and brightness.",
|
|
8
8
|
author: "sdeck",
|
|
9
9
|
});
|