@kitlangton/knobs 0.4.0-next.15 → 0.4.0-next.17

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 (41) hide show
  1. package/README.md +46 -14
  2. package/dist/dev/{chunk-v2g91mrm.js → chunk-2g0znytq.js} +1 -0
  3. package/dist/dev/{chunk-bejz4qcg.js → chunk-3vag4n3q.js} +47 -10
  4. package/dist/dev/{chunk-49hkdggk.js → chunk-5cv3g7ca.js} +395 -104
  5. package/dist/dev/{chunk-902v1jgd.js → chunk-xzm0zawh.js} +6 -6
  6. package/dist/dev/index.js +9 -8
  7. package/dist/index.js +7 -5
  8. package/dist/panel.js +549 -121
  9. package/dist/review-react.js +1341 -880
  10. package/dist/review-solid.js +1341 -880
  11. package/dist/review.js +1711 -1248
  12. package/dist/themes.js +8 -0
  13. package/dist/types/core/schema.d.ts +11 -2
  14. package/dist/types/core/store.d.ts +29 -1
  15. package/dist/types/index.d.ts +1 -1
  16. package/dist/types/panel/active.d.ts +53 -0
  17. package/dist/types/panel/description-ids.d.ts +6 -0
  18. package/dist/types/panel/folds.d.ts +7 -4
  19. package/dist/types/panel/gpu/color.d.ts +2 -0
  20. package/dist/types/panel/gpu/renderer.d.ts +8 -2
  21. package/dist/types/panel/index.d.ts +1 -0
  22. package/dist/types/panel/page-hints.d.ts +3 -2
  23. package/dist/types/panel/page.d.ts +2 -15
  24. package/dist/types/panel/position.d.ts +23 -0
  25. package/dist/types/panel/summary.d.ts +22 -0
  26. package/dist/types/tokens/schema.d.ts +9 -0
  27. package/dist/types/ui/compare-css.d.ts +1 -1
  28. package/dist/types/ui/compare-frames.d.ts +64 -2
  29. package/dist/types/ui/compare-model.d.ts +23 -0
  30. package/dist/types/ui/compare.d.ts +6 -4
  31. package/dist/types/ui/player-css.d.ts +1 -1
  32. package/dist/types/ui/player.d.ts +6 -0
  33. package/dist/types/ui/react.d.ts +1 -1
  34. package/dist/types/ui/solid.d.ts +1 -1
  35. package/dist/types/ui/tooltip-model.d.ts +35 -0
  36. package/dist/types/ui/tooltip.d.ts +1 -1
  37. package/dist/types/ui/walkthrough-model.d.ts +4 -2
  38. package/dist/ui-react.js +2015 -1507
  39. package/dist/ui-solid.js +2014 -1506
  40. package/dist/ui.js +2013 -1505
  41. package/package.json +1 -1
@@ -0,0 +1,35 @@
1
+ /** Timers and the clock (the window's, or a test's). */
2
+ export interface TipClock {
3
+ set(run: () => void, ms: number): unknown;
4
+ clear(handle: unknown): void;
5
+ now(): number;
6
+ }
7
+ /** What the schedule asks of the page. */
8
+ export interface TipView<T> {
9
+ /** Shows `tip`; `snap` skips the entrance (a hand-off). */
10
+ show(tip: T, snap: boolean): void;
11
+ /** Hides the one showing; `now` skips the exit. */
12
+ hide(now: boolean): void;
13
+ /** Whether `tip`'s target is still in the page when its pause ends. */
14
+ connected(tip: T): boolean;
15
+ }
16
+ /** A neighbour within this long of a tip going shows at once. */
17
+ export declare const HANDOFF_MS = 400;
18
+ export declare const TIP_DELAY_MS = 500;
19
+ export interface TipSchedule<T extends {
20
+ readonly el: object;
21
+ }> {
22
+ readonly shown: T | null;
23
+ readonly pending: T | null;
24
+ /** `tip` wants to show: after its pause, or at once (`now`, or a hand-off). */
25
+ want(tip: T, options?: {
26
+ readonly now?: boolean;
27
+ readonly delay?: number;
28
+ }): void;
29
+ hide(now?: boolean): void;
30
+ /** Focus left: a tip shown or waiting for a target `within` matches goes, or never shows. */
31
+ leave(within: (tip: T) => boolean): void;
32
+ }
33
+ export declare function tipSchedule<T extends {
34
+ readonly el: object;
35
+ }>(clock: TipClock, view: TipView<T>): TipSchedule<T>;
@@ -13,7 +13,7 @@ export interface TooltipOptions {
13
13
  export type TooltipContent = string | (() => string) | ({
14
14
  readonly text: string | (() => string);
15
15
  } & TooltipOptions);
16
- /** Shows `content` over `el` after a pause (or on keyboard focus). Returns the remover. */
16
+ /** Shows `content` over `el` after a pause, or at once on keyboard focus. Returns the remover. */
17
17
  export declare function tooltip(el: HTMLElement, content: TooltipContent, options?: TooltipOptions): () => void;
18
18
  /** Turns on `data-tip` (and `data-tip-shortcut`, `data-tip-placement`) tooltips in a document. */
19
19
  export declare function tooltips(doc?: Document): void;
@@ -124,12 +124,12 @@ export type WalkthroughMedia = string | {
124
124
  readonly kind: "compare";
125
125
  readonly before: string | WalkthroughSource;
126
126
  readonly after: string | WalkthroughSource;
127
+ /** A small faint line over it, as every kind's `label` is. */
128
+ readonly label?: string;
127
129
  /** `"side"` by default (`"wipe"` where the slot is narrow). */
128
130
  readonly mode?: CompareMode;
129
131
  /** Width over height (`16 / 9`, or `"1100/900"`); read from the video when left out. */
130
132
  readonly aspect?: number | string;
131
- /** The frame strip over the timeline. */
132
- readonly strip?: boolean;
133
133
  /** Pills under it that seek, and markers on its timeline. */
134
134
  readonly chapters?: readonly WalkthroughChapter[];
135
135
  /** Marks on the pictures, on both sides (and under a zoom). */
@@ -193,6 +193,7 @@ export type WalkthroughMedia = string | {
193
193
  readonly kind: "diff";
194
194
  /** `git diff` / `git show` output. */
195
195
  readonly patch?: string;
196
+ readonly label?: string;
196
197
  readonly files?: readonly DiffSource[];
197
198
  readonly file?: string;
198
199
  readonly layout?: "split" | "unified";
@@ -239,6 +240,7 @@ export type WalkthroughMedia = string | {
239
240
  } | {
240
241
  readonly kind: "mount";
241
242
  readonly mount: (element: HTMLElement) => (() => void) | void;
243
+ readonly label?: string;
242
244
  /** Pixels held for it before it mounts. */
243
245
  readonly height?: number;
244
246
  };