@algorisys/tinyfly 0.69.0 → 0.70.2

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.
@@ -46,7 +46,7 @@ export * from '../drivers';
46
46
  export * from '../interaction';
47
47
  export { tf, live, createLive, Stage, LiveTimeline, CompatTimeline, quickPlay, mapEase, CustomEase, CustomBounce, CustomWiggle, } from '../compat/gsap';
48
48
  export { createControls, DEFAULT_LABELS } from '../embed/controls';
49
- export type { Controls, ControlsOptions, ControlLabels } from '../embed/controls';
49
+ export type { Controls, ControlsOptions, ControlLabels, FullscreenControl } from '../embed/controls';
50
50
  export { mount, mountAll, unmount } from '../embed/mount';
51
51
  export { bindChoiceHotspots } from '../embed/choices';
52
52
  export type { MountedEmbed, MountOptions } from '../embed/mount';
@@ -4,6 +4,9 @@ import type { TinyflyPlayer } from '../player/player';
4
4
  * (through markers), restart, a scrub bar, speed, the current step's caption, a
5
5
  * question to answer before the next step is revealed, and — when the player has
6
6
  * scenarios — a choice between them (a group of options, or a stepped slider).
7
+ * With `fullscreen: true`, a button shows the figure full screen: through the
8
+ * Fullscreen API where the browser has it, and as a fixed overlay where it
9
+ * doesn't (iPhone Safari supports element fullscreen only on iPad).
7
10
  *
8
11
  * Kept out of the player and engine builds. Styled only through CSS custom
9
12
  * properties on the bar (`--tf-ctl-fg`, `--tf-ctl-bg`, `--tf-ctl-accent`,
@@ -12,7 +15,8 @@ import type { TinyflyPlayer } from '../player/player';
12
15
  * can speak its own language.
13
16
  *
14
17
  * Keys work while focus is inside the figure, so several figures on one page
15
- * never react to the same key: Space plays or pauses, ← and → step, Home restarts.
18
+ * never react to the same key: Space plays or pauses, ← and → step, Home restarts,
19
+ * and F toggles full screen when it's enabled.
16
20
  */
17
21
  export interface ControlLabels {
18
22
  play: string;
@@ -33,6 +37,8 @@ export interface ControlLabels {
33
37
  stepFormat: string;
34
38
  /** Names the scenario choice: "Scenario", or what is being chosen ("Cache", "Servers") */
35
39
  scenario: string;
40
+ fullscreen: string;
41
+ exitFullscreen: string;
36
42
  }
37
43
  export declare const DEFAULT_LABELS: ControlLabels;
38
44
  export interface ControlsOptions {
@@ -51,9 +57,19 @@ export interface ControlsOptions {
51
57
  * or `'slider'`, for scenarios that are points on a scale (1, 10, 100 servers).
52
58
  */
53
59
  scenarioControl?: 'buttons' | 'slider';
60
+ /** Add a full screen button for the player's container (default false). F toggles it too. */
61
+ fullscreen?: boolean;
62
+ }
63
+ export interface FullscreenControl {
64
+ /** Whether the figure is full screen now, by either route */
65
+ readonly active: boolean;
66
+ enter(): Promise<void>;
67
+ exit(): Promise<void>;
54
68
  }
55
69
  export interface Controls {
56
70
  readonly element: HTMLElement;
71
+ /** Present when `fullscreen` was enabled */
72
+ readonly fullscreen?: FullscreenControl;
57
73
  destroy(): void;
58
74
  }
59
75
  export declare function createControls(player: TinyflyPlayer, container: HTMLElement, options?: ControlsOptions): Controls;
@@ -10,7 +10,7 @@
10
10
  export { TinyflyPlayer, play, create } from '../player/player';
11
11
  export type { PlayerOptions, Scenario, LoadScenariosOptions } from '../player/player';
12
12
  export { createControls, DEFAULT_LABELS } from './controls';
13
- export type { Controls, ControlsOptions, ControlLabels } from './controls';
13
+ export type { Controls, ControlsOptions, ControlLabels, FullscreenControl } from './controls';
14
14
  export { mount, mountAll, unmount } from './mount';
15
15
  export type { MountedEmbed, MountOptions } from './mount';
16
16
  export { bindChoiceHotspots } from './choices';
@@ -26,6 +26,8 @@ import { type Controls, type ControlsOptions } from './controls';
26
26
  * makes it a stepped slider instead of a group of options. Elements with
27
27
  * `data-tinyfly-choose="id"` become buttons that choose that scenario.
28
28
  *
29
+ * `data-fullscreen="true"` adds a full screen button to the controls.
30
+ *
29
31
  * Embeds default to `playWhenVisible: true`. Each SVG without a role becomes a
30
32
  * labelled image (`role="img"`, named by `data-alt` or the figcaption), and the
31
33
  * step captions are announced as they change.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algorisys/tinyfly",
3
- "version": "0.69.0",
3
+ "version": "0.70.2",
4
4
  "type": "module",
5
5
  "description": "Lightweight, API-driven animation engine and editor. The engine is framework-agnostic and runs in browsers, Web Workers, and Node.",
6
6
  "license": "MIT",