presently 0.25.1 → 0.26.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/presently/presentation_controller.rb +33 -7
- data/lib/presently/presenter_view.rb +15 -13
- data/lib/presently/recorder_view.rb +1 -1
- data/lib/presently/slide.rb +16 -2
- data/lib/presently/version.rb +1 -1
- data/readme.md +7 -5
- data/releases.md +7 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 57754e7cc66ec20e3ef797b20afbe147fda8979e96aafc14cdb9c35eaedb5495
|
|
4
|
+
data.tar.gz: 242278bc2177efc35609ece981bb3f6cb5fed099e628894d6c8ed9dcf77ce020
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 206d33b334f6d1ed9f4b7df2b328022bb5b332a43a53932840be6bd5c00a5b1a41d8df262b441309d04a17d0fc74bdf6120449f4ff1ec0f84228385856d3df9e
|
|
7
|
+
data.tar.gz: 42f72ece55c0c02160fd12b90006651f0cd3cb1d2b4a95fa12516dbc1d88172652d76afd5639a3ff7c7b8edd6e57eb7d7ba6fb6a6303a90109bcff005aefdb2a
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -89,6 +89,7 @@ module Presently
|
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
# The progress through the current slide's allocated time.
|
|
92
|
+
# Slides with durations of zero or less are complete once their expected start time is reached.
|
|
92
93
|
# @returns [Float] A value between 0.0 and 1.0.
|
|
93
94
|
def slide_progress
|
|
94
95
|
return 0.0 unless @clock.started?
|
|
@@ -97,7 +98,11 @@ module Presently
|
|
|
97
98
|
return 0.0 unless slide
|
|
98
99
|
|
|
99
100
|
time_into_slide = @clock.elapsed - @presentation.expected_time_at(@current_index)
|
|
100
|
-
|
|
101
|
+
if slide.duration <= 0
|
|
102
|
+
time_into_slide.negative? ? 0.0 : 1.0
|
|
103
|
+
else
|
|
104
|
+
(time_into_slide / slide.duration).clamp(0.0, 1.0)
|
|
105
|
+
end
|
|
101
106
|
end
|
|
102
107
|
|
|
103
108
|
# Reset the timer so that elapsed time matches the expected time for the current slide.
|
|
@@ -107,8 +112,9 @@ module Presently
|
|
|
107
112
|
end
|
|
108
113
|
|
|
109
114
|
# The current pacing status relative to the slide timing.
|
|
110
|
-
# @returns [Symbol] One of `:on_time`, `:ahead`, or `:behind
|
|
115
|
+
# @returns [Symbol | Nil] One of `:on_time`, `:ahead`, or `:behind`, or `nil` when no presentation time is allocated.
|
|
111
116
|
def pacing
|
|
117
|
+
return unless total_duration.positive?
|
|
112
118
|
return :on_time unless @clock.started?
|
|
113
119
|
|
|
114
120
|
elapsed = @clock.elapsed
|
|
@@ -137,19 +143,27 @@ module Presently
|
|
|
137
143
|
# Navigate to a specific slide by index.
|
|
138
144
|
# Ignores out-of-bounds indices. Notifies listeners on change.
|
|
139
145
|
# @parameter index [Integer] The slide index to navigate to.
|
|
140
|
-
|
|
141
|
-
|
|
146
|
+
# @parameter timer [Boolean] Whether to apply the outgoing slide's timer action before notifying listeners.
|
|
147
|
+
# @returns [Boolean] Whether the destination index was valid.
|
|
148
|
+
def go_to(index, timer: false)
|
|
149
|
+
return false if index < 0 || index >= slide_count
|
|
142
150
|
|
|
151
|
+
advance_timer! if timer
|
|
143
152
|
@current_index = index
|
|
144
153
|
notify_listeners!
|
|
154
|
+
return true
|
|
145
155
|
end
|
|
146
156
|
|
|
147
|
-
# Advance to the next slide.
|
|
148
|
-
|
|
149
|
-
|
|
157
|
+
# Advance to the next slide, applying the current slide's timer action.
|
|
158
|
+
# Timer actions only run when there is a next slide.
|
|
159
|
+
# @parameter timer [Boolean] Whether to apply the outgoing slide's timer action.
|
|
160
|
+
# @returns [Boolean] Whether the presentation advanced to the next slide.
|
|
161
|
+
def advance!(timer: true)
|
|
162
|
+
go_to(@current_index + 1, timer: timer)
|
|
150
163
|
end
|
|
151
164
|
|
|
152
165
|
# Go back to the previous slide.
|
|
166
|
+
# @returns [Boolean] Whether the presentation moved to the previous slide.
|
|
153
167
|
def retreat!
|
|
154
168
|
go_to(@current_index - 1)
|
|
155
169
|
end
|
|
@@ -180,6 +194,18 @@ module Presently
|
|
|
180
194
|
|
|
181
195
|
private
|
|
182
196
|
|
|
197
|
+
# Apply the outgoing slide's timer action without resetting elapsed time.
|
|
198
|
+
def advance_timer!
|
|
199
|
+
case current_slide.timer
|
|
200
|
+
when "start"
|
|
201
|
+
@clock.start! unless @clock.started?
|
|
202
|
+
when "pause"
|
|
203
|
+
@clock.pause!
|
|
204
|
+
when "resume"
|
|
205
|
+
@clock.resume! if @clock.started?
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
183
209
|
# Notify all registered listeners that the slide has changed, and persist state.
|
|
184
210
|
def notify_listeners!
|
|
185
211
|
@state&.save(self)
|
|
@@ -100,14 +100,14 @@ module Presently
|
|
|
100
100
|
# @parameter builder [XRB::Builder] The HTML builder.
|
|
101
101
|
# @parameter slide [Slide | Nil] The current slide.
|
|
102
102
|
def render_timing(builder, slide)
|
|
103
|
-
|
|
103
|
+
pacing = @controller.pacing
|
|
104
|
+
progress = pacing ? (@controller.slide_progress * 100).round(1) : 0.0
|
|
104
105
|
next_slide = @controller.next_slide
|
|
105
106
|
builder.tag(:div, class: "timing", style: "--slide-progress: #{progress}%") do
|
|
106
|
-
pacing = @controller.pacing
|
|
107
107
|
pacing_class = case pacing
|
|
108
108
|
when :behind then "behind"
|
|
109
109
|
when :ahead then "ahead"
|
|
110
|
-
|
|
110
|
+
when :on_time then "on-time"
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
builder.tag(:div, class: "toolbar timing-info #{pacing_class}") do
|
|
@@ -136,17 +136,19 @@ module Presently
|
|
|
136
136
|
builder.text("Elapsed: #{format_duration(@controller.clock.elapsed)}")
|
|
137
137
|
end
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
builder.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
if pacing
|
|
140
|
+
builder.tag(:span, class: "remaining") do
|
|
141
|
+
builder.text("Remaining: #{format_duration(@controller.time_remaining)}")
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
builder.tag(:span, class: "pacing-indicator") do
|
|
145
|
+
indicator = case pacing
|
|
146
|
+
when :behind then "⏩ Speed up"
|
|
147
|
+
when :ahead then "⏪ Slow down"
|
|
148
|
+
else "✓ On time"
|
|
149
|
+
end
|
|
150
|
+
builder.text(indicator)
|
|
148
151
|
end
|
|
149
|
-
builder.text(indicator)
|
|
150
152
|
end
|
|
151
153
|
|
|
152
154
|
if slide
|
data/lib/presently/slide.rb
CHANGED
|
@@ -349,9 +349,23 @@ module Presently
|
|
|
349
349
|
end
|
|
350
350
|
|
|
351
351
|
# The expected duration of this slide in seconds.
|
|
352
|
-
#
|
|
352
|
+
# Negative, invalid, or non-finite values are treated as zero.
|
|
353
|
+
# @returns [Float] A finite duration of at least `0.0`, defaulting to `0.0` when unspecified or null.
|
|
353
354
|
def duration
|
|
354
|
-
@front_matter&.fetch("duration",
|
|
355
|
+
if value = @front_matter&.fetch("duration", nil)
|
|
356
|
+
duration = Float(value, exception: false)
|
|
357
|
+
if duration&.finite?
|
|
358
|
+
return duration.clamp(0.0, nil)
|
|
359
|
+
end
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
return 0.0
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
# The timer action to apply when advancing from this slide.
|
|
366
|
+
# @returns [String | Nil] `"start"`, `"pause"`, `"resume"`, or `nil` when unspecified.
|
|
367
|
+
def timer
|
|
368
|
+
@front_matter&.fetch("timer", nil)
|
|
355
369
|
end
|
|
356
370
|
|
|
357
371
|
# Update the expected duration in the slide's YAML front matter.
|
data/lib/presently/version.rb
CHANGED
data/readme.md
CHANGED
|
@@ -67,6 +67,13 @@ The task records the presentation at 1920×1080 and 30 frames per second by defa
|
|
|
67
67
|
|
|
68
68
|
Please see the [project releases](https://socketry.github.io/presently/releases/index) for all releases.
|
|
69
69
|
|
|
70
|
+
### v0.26.0
|
|
71
|
+
|
|
72
|
+
- Add `timer: start`, `timer: pause`, and `timer: resume` slide metadata, applied when advancing away from a slide in the presenter or display.
|
|
73
|
+
- Normalize slide durations to finite, non-negative floating-point seconds. Missing or invalid durations now default to `0.0`, and negative durations are clamped to zero. Presentations relying on the previous 60-second default should set explicit durations.
|
|
74
|
+
- Handle zero-duration slide progress and hide pacing indicators, progress, and remaining-time estimates when a presentation has no allocated duration.
|
|
75
|
+
- Keep recorder navigation from changing the presentation timer.
|
|
76
|
+
|
|
70
77
|
### v0.24.1
|
|
71
78
|
|
|
72
79
|
- Use legible, customizable link colors on the default dark slide background.
|
|
@@ -117,11 +124,6 @@ Please see the [project releases](https://socketry.github.io/presently/releases/
|
|
|
117
124
|
|
|
118
125
|
- Fix slide rendering events for generated view identifiers that begin with a digit.
|
|
119
126
|
|
|
120
|
-
### v0.17.1
|
|
121
|
-
|
|
122
|
-
- Add slide-scoped resource cleanup with `Slide#defer`, `Slide#signal`, and idempotent `Slide#dispose`. Existing tracked timeouts now use the same disposal lifecycle.
|
|
123
|
-
- [Web Packages](https://socketry.github.io/presently/releases/index#web-packages)
|
|
124
|
-
|
|
125
127
|
## See Also
|
|
126
128
|
|
|
127
129
|
- [lively](https://github.com/socketry/lively) — The real-time application framework that powers Presently.
|
data/releases.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.26.0
|
|
4
|
+
|
|
5
|
+
- Add `timer: start`, `timer: pause`, and `timer: resume` slide metadata, applied when advancing away from a slide in the presenter or display.
|
|
6
|
+
- Normalize slide durations to finite, non-negative floating-point seconds. Missing or invalid durations now default to `0.0`, and negative durations are clamped to zero. Presentations relying on the previous 60-second default should set explicit durations.
|
|
7
|
+
- Handle zero-duration slide progress and hide pacing indicators, progress, and remaining-time estimates when a presentation has no allocated duration.
|
|
8
|
+
- Keep recorder navigation from changing the presentation timer.
|
|
9
|
+
|
|
3
10
|
## v0.24.1
|
|
4
11
|
|
|
5
12
|
- Use legible, customizable link colors on the default dark slide background.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
4��繼=��h��R4-w4a�E�~9FOTuB��!xb1���u���Ι����y�)ҿ��a�)Ү�.���[Śb��K2��vE_�?�Rٝ�A�Q�6JV�]G8Wĩ��Zn�m��p�2���ݿ���#���o@3��n�t��&�*Z�#�˕d�G���'fZS$�Dc��}�N��1%� �'xJ��>�U��?TC���8�y[����r+U
|
|
2
|
-
�d�)??u�]���!��|����&��y@��]->[�?U���E�{*a�q�Uvp����s=_���
|
|
3
1
|
7St�ϫQ:��H�B�� M��8r\}�9Ҫ ��`e�w�
|
|
2
|
+
[�����h���A�F�N=��"UO�yV��7�7� �DC�^�$�:�pn~�m�3@��I�1M�o4l�j�-< "f�7��WT&�u?k��B�{���*z�~�A�
|
|
3
|
+
���s�x���_:��u����x-��j�'-���/�u��r˃+��C/�9�H>������MxW�F���P�
|