@sdeck/plugin-basics 1.3.1 → 1.4.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 +33 -0
- 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 +9 -8
- 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/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Basics
|
|
2
|
+
|
|
3
|
+
The everyday keys: labels, a clock, the date, timers, a counter, page navigation and brightness. Studio installs it on its first start.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Open **Plugins** in [sdeck Studio](https://sdeck.one) and install **Basics**.
|
|
8
|
+
|
|
9
|
+
## Actions
|
|
10
|
+
|
|
11
|
+
| Action | What it does |
|
|
12
|
+
| -------------- | --------------------------------------------------------------------------------------------- |
|
|
13
|
+
| **Label** | Text with an icon or picture. The text can show live values, such as `CPU {{system.cpu}}%`. |
|
|
14
|
+
| **Clock** | Digits or hands, 12 or 24 hour, with or without seconds and the date, in any time zone. |
|
|
15
|
+
| **Date** | Today's date, like a page torn off a calendar. |
|
|
16
|
+
| **Timer** | Counts down. Press to start or pause, hold to reset. Blinks when it ends. |
|
|
17
|
+
| **Stopwatch** | Counts up. Press to start or stop, hold to reset. |
|
|
18
|
+
| **Counter** | Counts presses and keeps the count. Hold to reset. |
|
|
19
|
+
| **Navigate** | Goes to a page, back, forward, to the next or previous page, the first, or the next favorite. |
|
|
20
|
+
| **Page name** | Shows which page is open. |
|
|
21
|
+
| **Brightness** | Sets the deck's brightness, or cycles through levels. |
|
|
22
|
+
|
|
23
|
+
There is nothing to set up.
|
|
24
|
+
|
|
25
|
+
## Triggers and live values
|
|
26
|
+
|
|
27
|
+
**When a timer ends** fires for any Basics timer, also on a page that is not shown; `event.name` says
|
|
28
|
+
which.
|
|
29
|
+
|
|
30
|
+
Give a timer or stopwatch a **Variable name** to read it anywhere, for example
|
|
31
|
+
`{{basics.timers.tea.time}}` or `{{basics.stopwatches.run.time}}`.
|
|
32
|
+
|
|
33
|
+
Date formats are listed in [Formats](https://docs.sdeck.one/guides/formats).
|
package/dist/clock.d.ts
CHANGED
|
@@ -1,15 +1,41 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
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 { type DateParts } from "@sdeck/plugin";
|
|
6
|
+
/** An analog face at `at`: twelve ticks, three hands. */
|
|
7
|
+
export declare function analogFace(at: Pick<DateParts, "hour" | "minute" | "second">, colors: {
|
|
3
8
|
face: string;
|
|
4
9
|
hands: string;
|
|
5
10
|
accent: string;
|
|
6
11
|
ticks: string;
|
|
7
12
|
}, seconds: boolean): string;
|
|
8
|
-
/**
|
|
9
|
-
export declare
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
/** Offered as "Time zone". Nothing chosen is the computer's own. */
|
|
14
|
+
export declare const zones: import("@sdeck/plugin").Source;
|
|
15
|
+
/** The day at `now` in `zone`, in parts. */
|
|
16
|
+
export declare function dateValues(now: Date, zone: string): {
|
|
17
|
+
weekday: string;
|
|
18
|
+
weekdayShort: string;
|
|
19
|
+
day: number | undefined;
|
|
20
|
+
month: string;
|
|
21
|
+
monthShort: string;
|
|
22
|
+
monthNumber: number | undefined;
|
|
23
|
+
year: number | undefined;
|
|
24
|
+
now: number;
|
|
25
|
+
zone: string;
|
|
26
|
+
};
|
|
27
|
+
/** The time at `now` in `zone`, in parts. `second` is empty while seconds are off. */
|
|
28
|
+
export declare function timeValues(now: Date, options: {
|
|
29
|
+
zone: string;
|
|
30
|
+
hour12: boolean;
|
|
31
|
+
seconds: boolean;
|
|
32
|
+
}): {
|
|
33
|
+
hour: string;
|
|
34
|
+
minute: string;
|
|
35
|
+
second: string;
|
|
12
36
|
period: string;
|
|
37
|
+
hour24: number | undefined;
|
|
38
|
+
time: string;
|
|
13
39
|
};
|
|
14
40
|
export declare const clock: import("@sdeck/plugin").Action;
|
|
15
41
|
export declare const date: import("@sdeck/plugin").Action;
|
package/dist/clock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../src/clock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../src/clock.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,eAAe,CAAC;AAavB,yDAAyD;AACzD,wBAAgB,UAAU,CACxB,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC,EACjD,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACtE,OAAO,EAAE,OAAO,GACf,MAAM,CAiBR;AAED,oEAAoE;AACpE,eAAO,MAAM,KAAK,gCAQjB,CAAC;AA0BF,4CAA4C;AAC5C,wBAAgB,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM;;;;;;;;;;EAcjD;AAED,sFAAsF;AACtF,wBAAgB,UAAU,CACxB,GAAG,EAAE,IAAI,EACT,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE;;;;;;;EAgB7D;AAaD,eAAO,MAAM,KAAK,gCAkFhB,CAAC;AAEH,eAAO,MAAM,IAAI,gCAgEf,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { analogFace,
|
|
1
|
+
export { analogFace, dateValues, timeValues } from "./clock.tsx";
|
|
2
|
+
export { elapsed, namedButtons, type Run, timerValues, toggled, variableName } from "./runs.ts";
|
|
2
3
|
export { formatDuration } from "./theme.ts";
|
|
3
|
-
export { elapsed, type Run, toggled } from "./timers.tsx";
|
|
4
4
|
/** The levels of a "10, 40, 70, 100" list, in order. */
|
|
5
5
|
export declare function parseLevels(list: string): number[];
|
|
6
6
|
/** The level after `current` in `levels` (the first one when `current` is not in it). */
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA+L5C,wDAAwD;AACxD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAOlD;AAED,yFAAyF;AACzF,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIxF;AAkDD,2FAA2F"}
|