@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 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
- /** An analog face at `date`: twelve ticks, three hands. */
2
- export declare function analogFace(date: Date, colors: {
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
- /** The parts of a digital time: `16:41` or `4:41` with `PM`, and the seconds. */
9
- export declare function timeParts(date: Date, hour12: boolean): {
10
- main: string;
11
- seconds: string;
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;
@@ -1 +1 @@
1
- {"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../src/clock.tsx"],"names":[],"mappings":"AAMA,2DAA2D;AAC3D,wBAAgB,UAAU,CACxB,IAAI,EAAE,IAAI,EACV,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,iFAAiF;AACjF,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO;;;;EAQpD;AAED,eAAO,MAAM,KAAK,gCAsFhB,CAAC;AAEH,eAAO,MAAM,IAAI,gCA6Df,CAAC"}
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, timeParts } from "./clock.tsx";
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). */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,KAAK,GAAG,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAqM1D,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"}
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"}