@serene-pub/core-catalog 0.6.0-pr-7 → 0.6.0-pr-9
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 +1 -1
- package/components/genres/story/authors-note/AuthorsNote.svelte +2 -1
- package/components/genres/story/authors-note/AuthorsNoteWidget.svelte +177 -58
- package/components/shared/WidgetBoundary.svelte +37 -0
- package/components/shared/actions/Actions.svelte +2 -1
- package/components/shared/actions/ActionsWidget.svelte +31 -38
- package/components/shared/album/Album.svelte +2 -1
- package/components/shared/album/AlbumWidget.svelte +1 -7
- package/components/shared/annex/Annex.svelte +2 -1
- package/components/shared/annex/AnnexWidget.svelte +1 -1
- package/components/shared/attendance/Attendance.svelte +2 -1
- package/components/shared/attendance/AttendanceWidget.svelte +5 -8
- package/components/shared/backdrop/Backdrop.svelte +2 -1
- package/components/shared/backdrop/BackdropWidget.svelte +28 -22
- package/components/shared/chronicle/Chronicle.svelte +2 -1
- package/components/shared/chronicle/ChronicleWidget.svelte +211 -99
- package/components/shared/composer/Composer.svelte +25 -0
- package/components/shared/composer/ComposerWidget.svelte +146 -0
- package/components/shared/composer/composer.ts +10 -0
- package/components/shared/composer/settings.ts +59 -0
- package/components/shared/composer/target.ts +79 -0
- package/components/shared/dialogue-box/DialogueBoxMount.svelte +25 -0
- package/components/shared/dialogue-box/DialogueBoxWidget.svelte +207 -0
- package/components/shared/dialogue-box/dialogue-box.ts +10 -0
- package/components/shared/dialogue-box/settings.ts +25 -0
- package/components/shared/lore-entries/LoreEntries.svelte +2 -1
- package/components/shared/lore-entries/LoreEntriesWidget.svelte +44 -41
- package/components/shared/messages/MessageBlocksView.svelte +1 -1
- package/components/shared/messages/MessageControls.svelte +23 -5
- package/components/shared/messages/Messages.svelte +2 -1
- package/components/shared/messages/MessagesWidget.svelte +82 -191
- package/components/shared/messages/NextCharacterBlock.svelte +35 -20
- package/components/shared/messages/SceneDivider.svelte +40 -14
- package/components/shared/messages/SessionComposer.svelte +178 -123
- package/components/shared/messages/SessionContainer.svelte +89 -38
- package/components/shared/messages/SessionMessage.svelte +157 -54
- package/components/shared/messages/SpokenLine.svelte +57 -16
- package/components/shared/messages/StateProposalList.svelte +30 -20
- package/components/shared/messages/TurnLine.svelte +258 -66
- package/components/shared/messages/conversation.svelte.ts +83 -5
- package/components/shared/messages/readingPace.ts +101 -0
- package/components/shared/messages/rowFacts.ts +44 -0
- package/components/shared/messages/sceneMarks.ts +54 -0
- package/components/shared/messages/spokenLine.ts +63 -14
- package/components/shared/places/Places.svelte +2 -1
- package/components/shared/places/PlacesWidget.svelte +42 -33
- package/components/shared/routine-log/RoutineLog.svelte +2 -1
- package/components/shared/routine-log/RoutineLogWidget.svelte +0 -4
- package/components/shared/routine-log/routineLog.ts +5 -21
- package/components/shared/scene-portraits/ScenePortraits.svelte +2 -1
- package/components/shared/scene-portraits/ScenePortraitsWidget.svelte +54 -32
- package/components/shared/session-runs/SessionRuns.svelte +26 -0
- package/components/shared/session-runs/SessionRunsWidget.svelte +270 -0
- package/components/shared/session-runs/session-runs.ts +11 -0
- package/components/shared/state/PieceCard.svelte +36 -25
- package/components/shared/state/SlotControl.svelte +18 -5
- package/components/shared/stats/Stats.svelte +2 -1
- package/components/shared/stats/StatsWidget.svelte +104 -72
- package/components/shared/turn-line/TurnLineMount.svelte +25 -0
- package/components/shared/turn-line/TurnLineWidget.svelte +25 -0
- package/components/shared/turn-line/settings.ts +31 -0
- package/components/shared/turn-line/turn-line.ts +10 -0
- package/components/shared/turn-order/TurnOrder.svelte +2 -1
- package/components/shared/turn-order/TurnOrderWidget.svelte +1 -6
- package/dist/components/actions.js +71 -88
- package/dist/components/actions.source.json +1 -1
- package/dist/components/album.js +39 -44
- package/dist/components/album.source.json +1 -1
- package/dist/components/annex.js +17 -8
- package/dist/components/annex.source.json +1 -1
- package/dist/components/attendance.js +39 -48
- package/dist/components/attendance.source.json +1 -1
- package/dist/components/authors-note.js +329 -162
- package/dist/components/authors-note.source.json +1 -1
- package/dist/components/backdrop.js +52 -55
- package/dist/components/backdrop.source.json +1 -1
- package/dist/components/chronicle.js +798 -559
- package/dist/components/chronicle.source.json +1 -1
- package/dist/components/composer.js +1639 -0
- package/dist/components/composer.source.json +1 -0
- package/dist/components/core-ui.json +1 -1
- package/dist/components/dialogue-box.js +373 -0
- package/dist/components/dialogue-box.source.json +1 -0
- package/dist/components/lore-entries.js +134 -122
- package/dist/components/lore-entries.source.json +1 -1
- package/dist/components/messages.js +1517 -8930
- package/dist/components/messages.source.json +1 -1
- package/dist/components/places.js +267 -244
- package/dist/components/places.source.json +1 -1
- package/dist/components/routine-log.js +35 -51
- package/dist/components/routine-log.source.json +1 -1
- package/dist/components/scene-portraits.js +118 -59
- package/dist/components/scene-portraits.source.json +1 -1
- package/dist/components/session-runs.js +488 -0
- package/dist/components/session-runs.source.json +1 -0
- package/dist/components/{shared-7VDIXYAL.js → shared-47J4TNSF.js} +1 -1
- package/dist/components/{shared-W3XS5FEL.js → shared-5E4RQYRX.js} +3 -2
- package/dist/components/{shared-YDS7HYL6.js → shared-EFMMT76D.js} +57 -4
- package/dist/components/{shared-BIWKZFUU.js → shared-FOVKPMSK.js} +3 -3
- package/dist/components/{shared-JPG5DQO7.js → shared-HEAKNNZB.js} +92 -17
- package/dist/components/shared-JXP6SHKF.js +159 -0
- package/dist/components/{shared-XBDUENRA.js → shared-JXYPKSTQ.js} +1 -1
- package/dist/components/shared-KJIOSSE3.js +257 -0
- package/dist/components/{shared-WV3QTKZT.js → shared-KLURQFWI.js} +13 -9
- package/dist/components/shared-MHCNUDUT.js +1680 -0
- package/dist/components/{shared-QXF5CJVN.js → shared-NICRJ4Z2.js} +1 -1
- package/dist/components/{shared-BBF64YGL.js → shared-W2BBJCNE.js} +22 -16
- package/dist/components/shared-YYYXFDZU.js +4354 -0
- package/dist/components/stats.js +828 -678
- package/dist/components/stats.source.json +1 -1
- package/dist/components/turn-line.js +856 -0
- package/dist/components/turn-line.source.json +1 -0
- package/dist/components/turn-order.js +62 -67
- package/dist/components/turn-order.source.json +1 -1
- package/dist/factories/answerForm.d.ts +6 -0
- package/dist/factories/answerForm.js +104 -96
- package/dist/factories/turnOrder.d.ts +98 -105
- package/dist/factories/turnOrder.js +120 -136
- package/dist/functions/pieces.js +1 -0
- package/dist/functions/time.js +2 -0
- package/dist/genres/chat/create.js +2 -0
- package/dist/genres/chat/memory.js +64 -43
- package/dist/genres/chat/respond.d.ts +7 -6
- package/dist/genres/chat/respond.js +13 -4
- package/dist/genres/chat/turnOrder.d.ts +2 -2
- package/dist/genres/chat/turnOrder.js +28 -12
- package/dist/genres/defaults.d.ts +28 -6
- package/dist/genres/defaults.js +84 -26
- package/dist/genres/dungeon-crawler/calls.d.ts +3 -1
- package/dist/genres/dungeon-crawler/calls.js +5 -0
- package/dist/genres/dungeon-crawler/create.d.ts +9 -6
- package/dist/genres/dungeon-crawler/create.js +18 -8
- package/dist/genres/dungeon-crawler/death.d.ts +13 -6
- package/dist/genres/dungeon-crawler/death.js +26 -12
- package/dist/genres/dungeon-crawler/index.d.ts +1 -0
- package/dist/genres/dungeon-crawler/index.js +1 -0
- package/dist/genres/dungeon-crawler/journal.d.ts +1 -1
- package/dist/genres/dungeon-crawler/journal.js +1 -1
- package/dist/genres/dungeon-crawler/lore.d.ts +13 -12
- package/dist/genres/dungeon-crawler/lore.js +16 -25
- package/dist/genres/dungeon-crawler/names.d.ts +10 -3
- package/dist/genres/dungeon-crawler/names.js +10 -3
- package/dist/genres/dungeon-crawler/preamble.d.ts +5 -4
- package/dist/genres/dungeon-crawler/preamble.js +75 -33
- package/dist/genres/dungeon-crawler/respond.js +4 -2
- package/dist/genres/dungeon-crawler/rest.d.ts +8 -7
- package/dist/genres/dungeon-crawler/rest.js +39 -15
- package/dist/genres/dungeon-crawler/reveal.js +2 -2
- package/dist/genres/dungeon-crawler/roundScript.d.ts +2 -1
- package/dist/genres/dungeon-crawler/roundScript.js +23 -5
- package/dist/genres/dungeon-crawler/scripts.js +4 -5
- package/dist/genres/dungeon-crawler/shape.d.ts +16 -0
- package/dist/genres/dungeon-crawler/shape.js +5 -1
- package/dist/genres/dungeon-crawler/sheet.d.ts +20 -20
- package/dist/genres/dungeon-crawler/story.d.ts +27 -16
- package/dist/genres/dungeon-crawler/story.js +175 -46
- package/dist/genres/dungeon-crawler/storyScripts.d.ts +2 -2
- package/dist/genres/dungeon-crawler/storyScripts.js +109 -14
- package/dist/genres/dungeon-crawler/summarizeScene.d.ts +13 -0
- package/dist/genres/dungeon-crawler/summarizeScene.js +21 -0
- package/dist/genres/dungeon-crawler/turnOrder.d.ts +8 -9
- package/dist/genres/dungeon-crawler/turnOrder.js +33 -23
- package/dist/genres/guide/create.js +2 -0
- package/dist/genres/guide/turnOrder.d.ts +3 -3
- package/dist/genres/guide/turnOrder.js +29 -13
- package/dist/genres/lair/answerForm.js +4 -1
- package/dist/genres/lair/buildRoom.js +4 -3
- package/dist/genres/lair/castellanAction.js +160 -154
- package/dist/genres/lair/create.js +2 -0
- package/dist/genres/lair/fileCurrentRoom.js +13 -10
- package/dist/genres/lair/fileRoom.js +4 -3
- package/dist/genres/lair/keeper.js +6 -2
- package/dist/genres/lair/names.d.ts +2 -0
- package/dist/genres/lair/names.js +2 -0
- package/dist/genres/lair/reply.js +16 -6
- package/dist/genres/lair/roomAnswer.js +4 -3
- package/dist/genres/lair/scratchpad.js +9 -7
- package/dist/genres/lair/scripts.js +8 -6
- package/dist/genres/lair/turnOrder.d.ts +3 -2
- package/dist/genres/lair/turnOrder.js +45 -16
- package/dist/genres/story/ask.d.ts +4 -0
- package/dist/genres/story/ask.js +4 -0
- package/dist/genres/story/create.js +15 -0
- package/dist/genres/story/index.d.ts +1 -1
- package/dist/genres/story/index.js +1 -1
- package/dist/genres/story/narrate.js +8 -0
- package/dist/genres/story/narrateCharacter.js +8 -0
- package/dist/genres/story/reckon.d.ts +5 -19
- package/dist/genres/story/reckon.js +53 -40
- package/dist/genres/story/reckoning.js +3 -0
- package/dist/genres/story/respond.js +17 -28
- package/dist/genres/story/sweep.d.ts +1 -1
- package/dist/genres/story/sweep.js +1 -1
- package/dist/genres/story/turnOrder.d.ts +21 -3
- package/dist/genres/story/turnOrder.js +87 -21
- package/dist/index.d.ts +3 -0
- package/dist/index.js +23 -9
- package/dist/loadouts.d.ts +1 -0
- package/dist/loadouts.js +17 -1
- package/dist/primers/ninth-mile.d.ts +3 -4
- package/dist/registry/entries.d.ts +2 -0
- package/dist/registry/entries.js +18 -5
- package/dist/registry/genres.d.ts +146 -40
- package/dist/registry/genres.js +373 -101
- package/dist/registry/hostState.d.ts +1 -2
- package/dist/registry/hostState.js +2 -4
- package/dist/registry/layouts.d.ts +141 -111
- package/dist/registry/layouts.js +302 -141
- package/dist/registry/slots.d.ts +4 -3
- package/dist/registry/slots.js +4 -3
- package/dist/registry/widgets.d.ts +12 -2
- package/dist/registry/widgets.js +259 -106
- package/dist/rulesets/vis-itineris/ruleset.js +8 -5
- package/dist/rulesets/wherewithal/ruleset.js +2 -1
- package/dist/seed/presets.js +15 -9
- package/dist/seed/prompts.js +24 -5
- package/dist/seed/scripts.js +3 -0
- package/dist/shared/annexField.js +23 -3
- package/dist/shared/illustrateScene.d.ts +1 -0
- package/dist/shared/illustrateScene.js +29 -1
- package/dist/shared/lore.d.ts +13 -0
- package/dist/shared/lore.js +37 -1
- package/dist/shared/portrait.js +13 -4
- package/dist/shared/reckoning.d.ts +8 -2
- package/dist/shared/reckoning.js +47 -30
- package/dist/shared/roundTick.d.ts +20 -0
- package/dist/shared/roundTick.js +76 -0
- package/dist/shared/sceneBoundaries.d.ts +7 -0
- package/dist/shared/sceneBoundaries.js +62 -0
- package/dist/shared/sceneSummaries.d.ts +7 -0
- package/dist/shared/sceneSummaries.js +49 -0
- package/dist/shared/speakMessage.d.ts +9 -2
- package/dist/shared/speakMessage.js +32 -9
- package/dist/shared/speechFields.js +4 -0
- package/dist/shared/summarize/character.d.ts +1 -1
- package/dist/shared/summarize/history.d.ts +1 -1
- package/dist/shared/summarize/scene.d.ts +1 -1
- package/dist/shared/summarize/summarizeScene.js +1 -0
- package/dist/shared/summarize/summarizeSpec.d.ts +1 -1
- package/dist/shared/summarize/world.d.ts +1 -1
- package/dist/shared/ui/attendance/index.d.ts +3 -2
- package/dist/shared/ui/attendance/index.js +3 -7
- package/dist/shared/ui/chronicle/index.d.ts +24 -2
- package/dist/shared/ui/chronicle/index.js +58 -29
- package/dist/shared/ui/conversation/formAnswer.d.ts +16 -2
- package/dist/shared/ui/conversation/formAnswer.js +23 -9
- package/dist/shared/ui/conversation/index.d.ts +2 -0
- package/dist/shared/ui/conversation/index.js +4 -0
- package/dist/shared/ui/conversation/itemValues.d.ts +16 -3
- package/dist/shared/ui/conversation/itemValues.js +15 -5
- package/dist/shared/ui/conversation/messageVerbState.d.ts +17 -2
- package/dist/shared/ui/conversation/messageVerbState.js +5 -4
- package/dist/shared/ui/conversation/readingPlace.d.ts +40 -0
- package/dist/shared/ui/conversation/readingPlace.js +119 -0
- package/dist/shared/ui/conversation/rewindStrip.d.ts +13 -4
- package/dist/shared/ui/conversation/rewindStrip.js +29 -7
- package/dist/shared/ui/conversation/runsInProgress.d.ts +30 -0
- package/dist/shared/ui/conversation/runsInProgress.js +47 -0
- package/dist/shared/ui/conversation/storyDays.d.ts +7 -1
- package/dist/shared/ui/conversation/storyDays.js +8 -0
- package/dist/shared/ui/conversation/tableChannel.d.ts +8 -11
- package/dist/shared/ui/conversation/tableChannel.js +8 -9
- package/dist/shared/ui/places/index.d.ts +3 -2
- package/dist/shared/ui/places/index.js +4 -5
- package/dist/shared/ui/routine-log/index.d.ts +3 -0
- package/dist/shared/ui/routine-log/index.js +22 -0
- package/dist/shared/ui/scene-portraits/portraits.d.ts +50 -16
- package/dist/shared/ui/scene-portraits/portraits.js +84 -21
- package/dist/shared/ui/session-runs/index.d.ts +90 -0
- package/dist/shared/ui/session-runs/index.js +143 -0
- package/dist/shared/ui/session-state/stateView.d.ts +18 -5
- package/dist/shared/ui/session-state/stateView.js +29 -8
- package/dist/shared/ui/turn-order/index.d.ts +0 -9
- package/dist/shared/ui/turn-order/index.js +1 -2
- package/package.json +12 -8
- /package/dist/components/{shared-4ME6NFDK.js → shared-LUIF6DW7.js} +0 -0
|
@@ -11,17 +11,24 @@
|
|
|
11
11
|
*
|
|
12
12
|
* The player is the browser's own (`<audio controls>`): a component runs
|
|
13
13
|
* in the UI worker and speaks to the page in attributes and events only,
|
|
14
|
-
* so it cannot call `play()`.
|
|
14
|
+
* so it cannot call `play()`. A line of several files is still ONE element:
|
|
15
|
+
* it carries `playlist` (the files' app URLs, in play order) and no `src`,
|
|
16
|
+
* and the page moves it from file to file, so a small *2 of 3* names the
|
|
17
|
+
* file playing. A single file keeps `src`. Hence:
|
|
15
18
|
*
|
|
16
19
|
* - **Autoplay** is the `autoplay` attribute (core's alone), decided ONCE
|
|
17
|
-
* per audio part: under *Make and play*, the NEWEST line's audio, spoken
|
|
20
|
+
* per line (its first audio part): under *Make and play*, the NEWEST line's audio, spoken
|
|
18
21
|
* since this page opened and still fresh — never an older line, never
|
|
19
|
-
* on page load. A
|
|
22
|
+
* on page load. A Dialogue box's shown line may too (`atReadingPlace`).
|
|
23
|
+
* A browser that refuses a sound nobody asked for leaves
|
|
20
24
|
* the player waiting; its own play button is right there.
|
|
21
25
|
* - **The playhead** arrives as the host `audio` events (1.7: `play`,
|
|
22
26
|
* `pause`, `ended`, `timeupdate` with `{ currentTime, duration, paused }`,
|
|
23
|
-
* seconds
|
|
24
|
-
*
|
|
27
|
+
* seconds; on a playlist element also `playlistIndex`, `playlistLength`).
|
|
28
|
+
* They drive the state glyph, the clock (of the file playing) and the
|
|
29
|
+
* **caption**: the words of the cue playing now, read off the recorded cue
|
|
30
|
+
* map's spans of that file. A file that cannot load is skipped by the page
|
|
31
|
+
* and said once; every file failing reads *Not spoken yet*.
|
|
25
32
|
* - **Speaking…** (speech follow-ups A4): while the line's speak run is live
|
|
26
33
|
* (`metadata.spoken.pending`, a run id) the line reads *Speaking…* with a
|
|
27
34
|
* small **Stop** that raises `onStop(runId)` — the host cancels that run. The
|
|
@@ -30,15 +37,19 @@
|
|
|
30
37
|
* (the `at` of the new record is what freshness reads, not the marker).
|
|
31
38
|
*/
|
|
32
39
|
import type { SpokenMeta } from '@serene-pub/sdk/component'
|
|
40
|
+
import { SvelteSet } from 'svelte/reactivity'
|
|
33
41
|
import { mediaSrc, type MediaStripItem } from './mediaStrip'
|
|
34
42
|
import {
|
|
35
43
|
cueCaptionAt,
|
|
44
|
+
fileCountLabel,
|
|
45
|
+
fileCountSr,
|
|
36
46
|
formatClock,
|
|
37
47
|
isFresh,
|
|
38
48
|
isOwnVoice,
|
|
39
49
|
isSpeaking,
|
|
40
50
|
moodOf,
|
|
41
51
|
playbackOf,
|
|
52
|
+
playlistOf,
|
|
42
53
|
spokenAsLine,
|
|
43
54
|
spokenSinceLoad,
|
|
44
55
|
voiceNameOf,
|
|
@@ -55,8 +66,8 @@
|
|
|
55
66
|
liveRunIds?: readonly string[]
|
|
56
67
|
/** Stop was pressed: the host cancels this run. */
|
|
57
68
|
onStop?: (runId: string) => void
|
|
58
|
-
/** The line's
|
|
59
|
-
|
|
69
|
+
/** The line's spoken files in play order; empty while it has none. */
|
|
70
|
+
items: readonly MediaStripItem[]
|
|
60
71
|
/** The newest line of the log. */
|
|
61
72
|
isLastMessage: boolean
|
|
62
73
|
/** The session's Read aloud setting. */
|
|
@@ -79,13 +90,20 @@
|
|
|
79
90
|
onPlayback?: (paused: boolean) => void
|
|
80
91
|
/** The ⋮ › Speech player's playhead while it is the one playing this line: the caption and glyph follow it too. */
|
|
81
92
|
menuAt?: Playback | null
|
|
93
|
+
/**
|
|
94
|
+
* 🚧 Dialogue box only (PLAN-visual-novel-layout §1.3): this line has just
|
|
95
|
+
* become the box's reading place, so its audio may play on its own as the
|
|
96
|
+
* newest line's does — under Make and play and playback `auto`, once,
|
|
97
|
+
* spoken since this page opened — newest or not, fresh or not.
|
|
98
|
+
*/
|
|
99
|
+
atReadingPlace?: boolean
|
|
82
100
|
}
|
|
83
101
|
let {
|
|
84
102
|
spoken,
|
|
85
103
|
pending = null,
|
|
86
104
|
liveRunIds,
|
|
87
105
|
onStop,
|
|
88
|
-
|
|
106
|
+
items,
|
|
89
107
|
isLastMessage,
|
|
90
108
|
readAloud,
|
|
91
109
|
spokenPlayback = 'auto',
|
|
@@ -97,6 +115,7 @@
|
|
|
97
115
|
take = 0,
|
|
98
116
|
onPlayback,
|
|
99
117
|
menuAt = null,
|
|
118
|
+
atReadingPlace = false,
|
|
100
119
|
}: Props = $props()
|
|
101
120
|
|
|
102
121
|
/** Parts already auto-played this page life, so a re-render never plays twice. */
|
|
@@ -109,10 +128,10 @@
|
|
|
109
128
|
const yes =
|
|
110
129
|
spokenPlayback === 'auto' &&
|
|
111
130
|
readAloud === 'play' &&
|
|
112
|
-
isLastMessage &&
|
|
131
|
+
(isLastMessage || atReadingPlace) &&
|
|
113
132
|
!played.has(id) &&
|
|
114
133
|
!!spoken &&
|
|
115
|
-
isFresh(spoken) &&
|
|
134
|
+
(isFresh(spoken) || atReadingPlace) &&
|
|
116
135
|
spokenSinceLoad(spoken)
|
|
117
136
|
decided.set(id, yes)
|
|
118
137
|
if (yes) played.add(id)
|
|
@@ -132,9 +151,22 @@
|
|
|
132
151
|
failedPart = partId
|
|
133
152
|
onGone?.(partId)
|
|
134
153
|
}
|
|
135
|
-
|
|
154
|
+
/** `partId:index` of each file of a playlist that failed to load. */
|
|
155
|
+
const failedFiles = new SvelteSet<string>()
|
|
156
|
+
const item = $derived(items[0] ?? null)
|
|
157
|
+
const playlist = $derived(playlistOf(items))
|
|
158
|
+
const src = $derived(item && !playlist ? mediaSrc(item.assetId) : null)
|
|
136
159
|
const gone = $derived(!item || failedPart === item.partId)
|
|
137
|
-
|
|
160
|
+
const someFailed = $derived(!!item && !!playlist && items.some((_, i) => failedFiles.has(`${item.partId}:${i}`)))
|
|
161
|
+
function failFile(e: Event) {
|
|
162
|
+
if (!item) return
|
|
163
|
+
if (!playlist) return fail(item.partId)
|
|
164
|
+
const index = playbackOf((e as CustomEvent).detail)?.playlistIndex
|
|
165
|
+
if (index === undefined || index >= items.length) return
|
|
166
|
+
failedFiles.add(`${item.partId}:${index}`)
|
|
167
|
+
if (items.every((_, i) => failedFiles.has(`${item.partId}:${i}`))) fail(item.partId)
|
|
168
|
+
}
|
|
169
|
+
// Only the FIRST element of a line may autoplay: a Stop re-key (take > 0) never does.
|
|
138
170
|
const autoplay = $derived(item && spoken && !speaking && take === 0 ? decide(item.partId) : false)
|
|
139
171
|
|
|
140
172
|
/** The last thing the player said about itself, with the part it said it for. */
|
|
@@ -142,13 +174,16 @@
|
|
|
142
174
|
const playback = $derived(item && heard && heard.part === item.partId ? heard : null)
|
|
143
175
|
const playing = $derived(!!playback && !playback.ended && !playback.at.paused)
|
|
144
176
|
const menuPlaying = $derived(!!menuAt && !menuAt.paused)
|
|
177
|
+
const fileIndex = $derived(menuPlaying && menuAt ? (menuAt.playlistIndex ?? 0) : (playback?.at.playlistIndex ?? 0))
|
|
145
178
|
const caption = $derived(
|
|
146
179
|
spoken && menuPlaying && menuAt
|
|
147
|
-
? cueCaptionAt(spoken.cueMap, menuAt.currentTime)
|
|
180
|
+
? cueCaptionAt(spoken.cueMap, menuAt.currentTime, menuAt.playlistIndex ?? 0)
|
|
148
181
|
: spoken && playing && playback
|
|
149
|
-
? cueCaptionAt(spoken.cueMap, playback.at.currentTime)
|
|
182
|
+
? cueCaptionAt(spoken.cueMap, playback.at.currentTime, playback.at.playlistIndex ?? 0)
|
|
150
183
|
: null,
|
|
151
184
|
)
|
|
185
|
+
const count = $derived(fileCountLabel(fileIndex, items.length))
|
|
186
|
+
const countSr = $derived(fileCountSr(fileIndex, items.length))
|
|
152
187
|
const clock = $derived(
|
|
153
188
|
playback && playback.at.duration > 0
|
|
154
189
|
? `${formatClock(playback.ended ? playback.at.duration : playback.at.currentTime)} / ${formatClock(playback.at.duration)}`
|
|
@@ -162,6 +197,8 @@
|
|
|
162
197
|
}
|
|
163
198
|
/** The host `audio`'s `playing` attribute (1.8): present while the conversation says so. */
|
|
164
199
|
const playAttr = $derived(shouldPlay ? { playing: '' } : {})
|
|
200
|
+
/** A line of several files: `playlist` and no `src`. */
|
|
201
|
+
const playlistAttr = $derived(playlist ? { playlist } : {})
|
|
165
202
|
/** The player's events, spread on whichever `<audio>` is drawn. */
|
|
166
203
|
const listeners = {
|
|
167
204
|
onplay: (e: Event) => hear(e),
|
|
@@ -218,7 +255,8 @@
|
|
|
218
255
|
{...playAttr}
|
|
219
256
|
preload="auto"
|
|
220
257
|
{src}
|
|
221
|
-
|
|
258
|
+
{...playlistAttr}
|
|
259
|
+
onerror={failFile}
|
|
222
260
|
{...listeners}
|
|
223
261
|
></audio>
|
|
224
262
|
{:else}
|
|
@@ -229,12 +267,14 @@
|
|
|
229
267
|
{...playAttr}
|
|
230
268
|
preload="metadata"
|
|
231
269
|
{src}
|
|
232
|
-
|
|
270
|
+
{...playlistAttr}
|
|
271
|
+
onerror={failFile}
|
|
233
272
|
{...listeners}
|
|
234
273
|
></audio>
|
|
235
274
|
{/if}
|
|
236
275
|
{/key}
|
|
237
276
|
{#if clock}<span data-widget-part="messages.spoken-time">{clock}</span>{/if}
|
|
277
|
+
{#if count}<span data-widget-part="messages.spoken-count"><span aria-hidden="true">{count}</span><span data-widget-part="messages.spoken-sr">{countSr}</span></span>{/if}
|
|
238
278
|
<span data-widget-part="messages.spoken-voice" title={asLine}>
|
|
239
279
|
{#if ownFace}
|
|
240
280
|
<img data-widget-part="messages.spoken-face" src={ownFace} alt="" />
|
|
@@ -268,6 +308,7 @@
|
|
|
268
308
|
</sp-menu-item>
|
|
269
309
|
</sp-menu>
|
|
270
310
|
{/if}
|
|
311
|
+
{#if someFailed}<p data-widget-part="messages.spoken-skipped">A part of this line could not be played.</p>{/if}
|
|
271
312
|
{#if caption}<p data-widget-part="messages.spoken-caption" aria-hidden="true">{caption}</p>{/if}
|
|
272
313
|
{/if}
|
|
273
314
|
</div>
|
|
@@ -29,8 +29,18 @@
|
|
|
29
29
|
proposals: ConversationProposalV1[]
|
|
30
30
|
/** Shown in the Review panel, where a row is not under its message. */
|
|
31
31
|
showAnchor?: boolean
|
|
32
|
+
/**
|
|
33
|
+
* The widget that draws this copy, when it is not Messages (the Turn
|
|
34
|
+
* line): every part also carries `<alias>.<name>`, beside its
|
|
35
|
+
* `messages.<name>`. Unset: the log's copy, unchanged.
|
|
36
|
+
*/
|
|
37
|
+
alias?: string
|
|
32
38
|
}
|
|
33
|
-
let { proposals, showAnchor = false }: Props = $props()
|
|
39
|
+
let { proposals, showAnchor = false, alias }: Props = $props()
|
|
40
|
+
|
|
41
|
+
/** `messages.<name>` for each name, and `<alias>.<name>` beside it when an alias is set. */
|
|
42
|
+
const parts = (...names: string[]): string =>
|
|
43
|
+
names.map((n) => (alias ? `messages.${n} ${alias}.${n}` : `messages.${n}`)).join(" ")
|
|
34
44
|
|
|
35
45
|
const conv = useConversation()
|
|
36
46
|
const t = useT()
|
|
@@ -43,14 +53,14 @@
|
|
|
43
53
|
{#each proposals as row (row.id)}
|
|
44
54
|
{#if row.status === "superseded"}
|
|
45
55
|
<div
|
|
46
|
-
data-widget-part="
|
|
56
|
+
data-widget-part={parts("proposal")}
|
|
47
57
|
data-proposal-id={row.id}
|
|
48
58
|
data-superseded="true"
|
|
49
59
|
>
|
|
50
60
|
<sp-icon name="history" size="11"></sp-icon>
|
|
51
|
-
<span data-widget-part="
|
|
61
|
+
<span data-widget-part={parts("proposal-text")}>
|
|
52
62
|
{describe(row)}
|
|
53
|
-
<span data-widget-part="
|
|
63
|
+
<span data-widget-part={parts("proposal-note")}>
|
|
54
64
|
· {t("Superseded — {slot} changed since this was proposed").replace(
|
|
55
65
|
"{slot}",
|
|
56
66
|
movedName(row)
|
|
@@ -59,64 +69,64 @@
|
|
|
59
69
|
</span>
|
|
60
70
|
</div>
|
|
61
71
|
{:else if row.offer?.yours}
|
|
62
|
-
<div data-widget-part="
|
|
72
|
+
<div data-widget-part={parts("proposal")} data-proposal-id={row.id} data-offer="yours">
|
|
63
73
|
<sp-icon name="hourglass" size="11"></sp-icon>
|
|
64
|
-
<span data-widget-part="
|
|
74
|
+
<span data-widget-part={parts("proposal-text")}>
|
|
65
75
|
{t("Offered to {to} — waiting for their answer").replace("{to}", row.offer.to)}
|
|
66
|
-
<span data-widget-part="
|
|
76
|
+
<span data-widget-part={parts("proposal-note")}>· {describe(row)}</span>
|
|
67
77
|
</span>
|
|
68
78
|
<button
|
|
69
|
-
data-widget-part="
|
|
79
|
+
data-widget-part={parts("proposal-decide", "proposal-reject")}
|
|
70
80
|
onclick={() => decide(row.id, false)}
|
|
71
81
|
>
|
|
72
82
|
{t("Withdraw")}
|
|
73
83
|
</button>
|
|
74
84
|
</div>
|
|
75
85
|
{:else if row.offer}
|
|
76
|
-
<div data-widget-part="
|
|
86
|
+
<div data-widget-part={parts("proposal")} data-proposal-id={row.id} data-offer="to-you">
|
|
77
87
|
<sp-icon name="hand-helping" size="11"></sp-icon>
|
|
78
|
-
<span data-widget-part="
|
|
88
|
+
<span data-widget-part={parts("proposal-text")}>
|
|
79
89
|
{describe(row)}
|
|
80
90
|
{#if showAnchor && row.messageId != null}
|
|
81
|
-
<span data-widget-part="
|
|
91
|
+
<span data-widget-part={parts("proposal-anchor")}>on message {row.messageId}</span>
|
|
82
92
|
{/if}
|
|
83
93
|
</span>
|
|
84
|
-
<span data-widget-part="
|
|
94
|
+
<span data-widget-part={parts("proposal-note")} title={t("Offered by {from}").replace("{from}", row.offer.from)}>
|
|
85
95
|
{t("offered")}
|
|
86
96
|
</span>
|
|
87
97
|
<button
|
|
88
|
-
data-widget-part="
|
|
98
|
+
data-widget-part={parts("proposal-decide", "proposal-accept")}
|
|
89
99
|
onclick={() => decide(row.id, true)}
|
|
90
100
|
>
|
|
91
101
|
{t("Accept")}
|
|
92
102
|
</button>
|
|
93
103
|
<button
|
|
94
|
-
data-widget-part="
|
|
104
|
+
data-widget-part={parts("proposal-decide", "proposal-reject")}
|
|
95
105
|
onclick={() => decide(row.id, false)}
|
|
96
106
|
>
|
|
97
107
|
{t("Decline")}
|
|
98
108
|
</button>
|
|
99
109
|
</div>
|
|
100
110
|
{:else}
|
|
101
|
-
<div data-widget-part="
|
|
111
|
+
<div data-widget-part={parts("proposal")} data-proposal-id={row.id}>
|
|
102
112
|
<sp-icon name="sparkles" size="11"></sp-icon>
|
|
103
|
-
<span data-widget-part="
|
|
113
|
+
<span data-widget-part={parts("proposal-text")}>
|
|
104
114
|
{describe(row)}
|
|
105
115
|
{#if showAnchor && row.messageId != null}
|
|
106
|
-
<span data-widget-part="
|
|
116
|
+
<span data-widget-part={parts("proposal-anchor")}>on message {row.messageId}</span>
|
|
107
117
|
{/if}
|
|
108
118
|
</span>
|
|
109
|
-
<span data-widget-part="
|
|
119
|
+
<span data-widget-part={parts("proposal-note")} title="Proposed by {row.proposedBy || 'a run'}">
|
|
110
120
|
proposed
|
|
111
121
|
</span>
|
|
112
122
|
<button
|
|
113
|
-
data-widget-part="
|
|
123
|
+
data-widget-part={parts("proposal-decide", "proposal-accept")}
|
|
114
124
|
onclick={() => decide(row.id, true)}
|
|
115
125
|
>
|
|
116
126
|
Accept
|
|
117
127
|
</button>
|
|
118
128
|
<button
|
|
119
|
-
data-widget-part="
|
|
129
|
+
data-widget-part={parts("proposal-decide", "proposal-reject")}
|
|
120
130
|
onclick={() => decide(row.id, false)}
|
|
121
131
|
>
|
|
122
132
|
Reject
|