@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
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
*/
|
|
37
37
|
import { untrack } from "svelte"
|
|
38
38
|
import {
|
|
39
|
-
BACKDROP_EMPTY,
|
|
40
39
|
BACKDROP_ILLUSTRATE_PAYLOAD,
|
|
41
40
|
backdropOf,
|
|
42
41
|
illustrateActionOf,
|
|
@@ -87,11 +86,11 @@
|
|
|
87
86
|
}
|
|
88
87
|
|
|
89
88
|
let choosing = $state(false)
|
|
90
|
-
/** Whose gallery the chooser shows, by
|
|
91
|
-
let memberId = $state<
|
|
92
|
-
let galleries = $state<Record<
|
|
89
|
+
/** Whose gallery the chooser shows, by the member's `ref`. */
|
|
90
|
+
let memberId = $state<string | null>(null)
|
|
91
|
+
let galleries = $state<Record<string, GalleryPages>>({})
|
|
93
92
|
/** Members whose next page is on its way — not state: nothing draws it. */
|
|
94
|
-
const asking = new Set<
|
|
93
|
+
const asking = new Set<string>()
|
|
95
94
|
|
|
96
95
|
const isImage = (v: unknown): v is GalleryImage =>
|
|
97
96
|
!!v &&
|
|
@@ -99,15 +98,27 @@
|
|
|
99
98
|
typeof (v as GalleryImage).ref === "string" &&
|
|
100
99
|
typeof (v as GalleryImage).src === "string"
|
|
101
100
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
/** Who `character-images` is asked about: the card when the member has one, else its cast member. */
|
|
102
|
+
const nameOf = (m: {
|
|
103
|
+
cardId?: number | null
|
|
104
|
+
castMemberId?: number | null
|
|
105
|
+
characterId: number
|
|
106
|
+
}): { characterId: number } | { castMemberId: number } =>
|
|
107
|
+
m.cardId === null && m.castMemberId != null
|
|
108
|
+
? { castMemberId: m.castMemberId }
|
|
109
|
+
: { characterId: m.cardId ?? m.characterId }
|
|
110
|
+
|
|
111
|
+
async function nextPage(key: string): Promise<void> {
|
|
112
|
+
const m = untrack(() => members.find((x) => x.ref === key))
|
|
113
|
+
if (!m) return
|
|
114
|
+
const held = untrack(() => galleries[key])
|
|
115
|
+
if (asking.has(key) || held?.done) return
|
|
116
|
+
asking.add(key)
|
|
106
117
|
const keep = held?.images ?? []
|
|
107
118
|
let pages: GalleryPages
|
|
108
119
|
try {
|
|
109
120
|
const res = (await w?.current.request("character-images", {
|
|
110
|
-
|
|
121
|
+
...nameOf(m),
|
|
111
122
|
...(held?.next ? { cursor: held.next } : {})
|
|
112
123
|
})) as { images?: unknown[]; nextCursor?: string } | undefined
|
|
113
124
|
const images = (Array.isArray(res?.images) ? res.images : []).filter(isImage)
|
|
@@ -116,9 +127,9 @@
|
|
|
116
127
|
} catch (e) {
|
|
117
128
|
pages = { images: keep, next: null, done: true, error: messageOf(e) }
|
|
118
129
|
} finally {
|
|
119
|
-
asking.delete(
|
|
130
|
+
asking.delete(key)
|
|
120
131
|
}
|
|
121
|
-
galleries = { ...untrack(() => galleries), [
|
|
132
|
+
galleries = { ...untrack(() => galleries), [key]: pages }
|
|
122
133
|
}
|
|
123
134
|
|
|
124
135
|
/* ── From this session: its generated pictures, by `session-images` ── */
|
|
@@ -148,7 +159,7 @@
|
|
|
148
159
|
sessionPages = pages
|
|
149
160
|
}
|
|
150
161
|
|
|
151
|
-
function pickMember(id:
|
|
162
|
+
function pickMember(id: string) {
|
|
152
163
|
memberId = id
|
|
153
164
|
if (!untrack(() => galleries[id])) void nextPage(id)
|
|
154
165
|
}
|
|
@@ -156,14 +167,14 @@
|
|
|
156
167
|
function openChooser() {
|
|
157
168
|
choosing = true
|
|
158
169
|
error = null
|
|
159
|
-
const first = untrack(() => memberId ?? members[0]
|
|
170
|
+
const first = untrack(() => memberId ?? (members[0] ? members[0].ref : null))
|
|
160
171
|
if (first !== null) pickMember(first)
|
|
161
172
|
// Asked afresh each time: a Scene may have drawn one since.
|
|
162
173
|
sessionPages = null
|
|
163
174
|
void nextSessionPage()
|
|
164
175
|
}
|
|
165
176
|
|
|
166
|
-
const member = $derived(members.find((m) => m.
|
|
177
|
+
const member = $derived(members.find((m) => m.ref === memberId) ?? null)
|
|
167
178
|
const pages = $derived(memberId !== null ? galleries[memberId] : undefined)
|
|
168
179
|
|
|
169
180
|
/** Draw the scene as the backdrop: the Scene action, placement `backdrop`. */
|
|
@@ -242,9 +253,9 @@
|
|
|
242
253
|
{#each members as m (m.ref)}
|
|
243
254
|
<button
|
|
244
255
|
type="button"
|
|
245
|
-
aria-pressed={m.
|
|
256
|
+
aria-pressed={m.ref === memberId}
|
|
246
257
|
data-widget-part="backdrop.member"
|
|
247
|
-
onclick={() => pickMember(m.
|
|
258
|
+
onclick={() => pickMember(m.ref)}
|
|
248
259
|
>
|
|
249
260
|
{m.name}
|
|
250
261
|
</button>
|
|
@@ -312,11 +323,6 @@
|
|
|
312
323
|
{/if}
|
|
313
324
|
</section>
|
|
314
325
|
</section>
|
|
315
|
-
{:else if !backdrop}
|
|
316
|
-
<div data-widget-part="backdrop.empty empty" role="status">
|
|
317
|
-
<sp-icon name="mountain-snow" size="20"></sp-icon>
|
|
318
|
-
<span>{t(BACKDROP_EMPTY)}</span>
|
|
319
|
-
</div>
|
|
320
326
|
{/if}
|
|
321
327
|
|
|
322
328
|
{#if mayChange && !choosing}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import type { ComponentContext } from "@serene-pub/sdk/component"
|
|
13
13
|
import { WIDGET_CONTEXT_KEY } from "@serene-pub/core-catalog/widgets"
|
|
14
14
|
import ChronicleWidget from "./ChronicleWidget.svelte"
|
|
15
|
+
import WidgetBoundary from "../WidgetBoundary.svelte"
|
|
15
16
|
import { widgetRefFromComponent } from "../widgetRef.svelte"
|
|
16
17
|
|
|
17
18
|
let { ctx }: { ctx: ComponentContext } = $props()
|
|
@@ -33,4 +34,4 @@
|
|
|
33
34
|
)
|
|
34
35
|
</script>
|
|
35
36
|
|
|
36
|
-
<ChronicleWidget ready={settled}
|
|
37
|
+
<WidgetBoundary {ctx}><ChronicleWidget ready={settled} /></WidgetBoundary>
|
|
@@ -32,6 +32,15 @@
|
|
|
32
32
|
* scene with no summary yet. While a scene is open it asks again when a
|
|
33
33
|
* line arrives, so its line count keeps up.
|
|
34
34
|
*
|
|
35
|
+
* 🚧 ★S2-1b: under Now, **Not yet compiled** — the session's scenes no
|
|
36
|
+
* history entry holds yet, by day (*Undated* last), each row the same as a
|
|
37
|
+
* Scenes row; 🚧 ★S6-1 each day's **Compile** (`compile-history-entry`).
|
|
38
|
+
*
|
|
39
|
+
* 🚧 A lorebook with no timeline (owner 2026-11-15, ★T-C6; `timeline`
|
|
40
|
+
* false): no clock, no Now, no Earlier and no days — the session's scenes
|
|
41
|
+
* (all of them, in played order) and its open scene stay, and a note says
|
|
42
|
+
* why in the clock's place.
|
|
43
|
+
*
|
|
35
44
|
* The markup carries no look (STYLE-GUIDE §6.16): its elements carry
|
|
36
45
|
* `chronicle.*` widget parts; a scene's colour rides on its swatch's
|
|
37
46
|
* `data-swatch`, an entry that says nothing yet on `data-blank`. Earlier
|
|
@@ -39,13 +48,14 @@
|
|
|
39
48
|
* note's Advanced does.
|
|
40
49
|
*/
|
|
41
50
|
import { untrack } from "svelte"
|
|
42
|
-
import type { HistoryEntriesV1, WidgetRequests } from "@serene-pub/sdk/component"
|
|
51
|
+
import type { HistoryEntriesV1, StoryTime, WidgetRequests } from "@serene-pub/sdk/component"
|
|
43
52
|
import {
|
|
44
53
|
chronicleClockDraft,
|
|
45
54
|
chronicleClockFromDraft,
|
|
46
55
|
chronicleView,
|
|
47
56
|
readChronicleSettings,
|
|
48
|
-
type ChronicleClockDraft
|
|
57
|
+
type ChronicleClockDraft,
|
|
58
|
+
type ChronicleSceneView
|
|
49
59
|
} from "@serene-pub/core-catalog/chronicle"
|
|
50
60
|
import { useWidgetContext } from "../context"
|
|
51
61
|
|
|
@@ -69,6 +79,7 @@
|
|
|
69
79
|
/** A press in flight: its controls wait. */
|
|
70
80
|
let busy = $state<string | null>(null)
|
|
71
81
|
|
|
82
|
+
const timeless = $derived(answer?.timeline === false)
|
|
72
83
|
const view = $derived(chronicleView(answer, settings, widget?.current?.viewer?.v1, t))
|
|
73
84
|
|
|
74
85
|
const reason = (e: unknown) => (e instanceof Error ? e.message : String(e))
|
|
@@ -172,6 +183,11 @@
|
|
|
172
183
|
if (done) ask()
|
|
173
184
|
}
|
|
174
185
|
|
|
186
|
+
/** 🚧 ★S6-1: compile one day's scenes not yet compiled (null = Undated); the run shows in the activity list. */
|
|
187
|
+
async function compileDay(date: StoryTime | null) {
|
|
188
|
+
await press("compile", "compile-history-entry", { date })
|
|
189
|
+
}
|
|
190
|
+
|
|
175
191
|
// ── the clock ────────────────────────────────────────────────────────────
|
|
176
192
|
let moving = $state(false)
|
|
177
193
|
let draft = $state<ChronicleClockDraft>(chronicleClockDraft(null))
|
|
@@ -193,7 +209,12 @@
|
|
|
193
209
|
|
|
194
210
|
/** Set the clock to the form's date (Set the clock, or Enter in a field). */
|
|
195
211
|
async function submitMove() {
|
|
196
|
-
|
|
212
|
+
// A part not drawn stays in the draft but is not read.
|
|
213
|
+
const read = chronicleClockFromDraft({
|
|
214
|
+
...draft,
|
|
215
|
+
day: draft.month.trim() === "" ? "" : draft.day,
|
|
216
|
+
minute: draft.hour.trim() === "" ? "" : draft.minute
|
|
217
|
+
})
|
|
197
218
|
if (read.problem !== undefined) {
|
|
198
219
|
formProblem = t(read.problem)
|
|
199
220
|
return
|
|
@@ -211,6 +232,9 @@
|
|
|
211
232
|
]
|
|
212
233
|
|
|
213
234
|
// ── the entries and scenes ───────────────────────────────────────────────
|
|
235
|
+
/** The session's notes are the owner's: a guest reads the Chronicle and opens none of it. */
|
|
236
|
+
const canOpen = $derived(widget?.current?.viewer?.v1?.isGuest !== true)
|
|
237
|
+
|
|
214
238
|
function openEntry(entryId?: number) {
|
|
215
239
|
const lorebookId = answer?.lorebookId ?? undefined
|
|
216
240
|
void press("open", "open-lore", {
|
|
@@ -229,6 +253,14 @@
|
|
|
229
253
|
})
|
|
230
254
|
}
|
|
231
255
|
|
|
256
|
+
function openScenes() {
|
|
257
|
+
const lorebookId = answer?.lorebookId ?? undefined
|
|
258
|
+
void press("open", "open-lore", {
|
|
259
|
+
...(lorebookId != null ? { lorebookId } : {}),
|
|
260
|
+
scope: "scenes"
|
|
261
|
+
})
|
|
262
|
+
}
|
|
263
|
+
|
|
232
264
|
async function startEntry() {
|
|
233
265
|
const made = await press("start", "start-history-entry", {})
|
|
234
266
|
if (!made) return
|
|
@@ -239,15 +271,86 @@
|
|
|
239
271
|
}
|
|
240
272
|
</script>
|
|
241
273
|
|
|
274
|
+
{#snippet sceneOpenBody(s: ChronicleSceneView)}
|
|
275
|
+
<span data-widget-part="chronicle.scene-swatch" data-swatch={s.swatch}></span>
|
|
276
|
+
<span data-widget-part="chronicle.scene-name">{s.name}</span>
|
|
277
|
+
<span data-widget-part="chronicle.scene-span">{s.span}</span>
|
|
278
|
+
<span
|
|
279
|
+
data-widget-part="chronicle.scene-status"
|
|
280
|
+
data-status={s.status}
|
|
281
|
+
role="img"
|
|
282
|
+
aria-label={s.statusLabel}
|
|
283
|
+
title={s.statusLabel}
|
|
284
|
+
></span>
|
|
285
|
+
{/snippet}
|
|
286
|
+
|
|
287
|
+
{#snippet earlierBody(e: (typeof view.earlier)[number])}
|
|
288
|
+
<span data-widget-part="chronicle.entry-date">{e.date}</span>
|
|
289
|
+
<span data-widget-part="chronicle.entry-line" data-blank={e.blank ? "" : undefined}>
|
|
290
|
+
{e.firstLine}
|
|
291
|
+
</span>
|
|
292
|
+
<span data-widget-part="chronicle.entry-scenes">{e.scenes}</span>
|
|
293
|
+
{/snippet}
|
|
294
|
+
|
|
295
|
+
{#snippet sceneRow(s: ChronicleSceneView)}
|
|
296
|
+
<li
|
|
297
|
+
data-widget-part="chronicle.scene row"
|
|
298
|
+
data-scene-id={s.id}
|
|
299
|
+
data-open={s.open ? "" : undefined}
|
|
300
|
+
>
|
|
301
|
+
{#if canOpen}
|
|
302
|
+
<button
|
|
303
|
+
type="button"
|
|
304
|
+
data-widget-part="chronicle.scene-open"
|
|
305
|
+
title={t("Open in lorebook")}
|
|
306
|
+
onclick={() => openScene(s.id)}
|
|
307
|
+
>
|
|
308
|
+
{@render sceneOpenBody(s)}
|
|
309
|
+
</button>
|
|
310
|
+
{:else}
|
|
311
|
+
<span data-widget-part="chronicle.scene-open">{@render sceneOpenBody(s)}</span>
|
|
312
|
+
{/if}
|
|
313
|
+
{#if s.canSummarize}
|
|
314
|
+
<button
|
|
315
|
+
type="button"
|
|
316
|
+
data-widget-part="chronicle.scene-summarize"
|
|
317
|
+
title={t("Summarize this scene in the background")}
|
|
318
|
+
disabled={!!busy}
|
|
319
|
+
onclick={() => summarizeScenes([s.id])}
|
|
320
|
+
>
|
|
321
|
+
{t("Summarize")}
|
|
322
|
+
</button>
|
|
323
|
+
{:else if s.canReview}
|
|
324
|
+
<!-- 🚧 §15 G8: the run finished; its review opens in the host. -->
|
|
325
|
+
<button
|
|
326
|
+
type="button"
|
|
327
|
+
data-widget-part="chronicle.scene-summarize chronicle.scene-review"
|
|
328
|
+
title={t("Its summary is ready: open the review to apply or discard it")}
|
|
329
|
+
disabled={!!busy}
|
|
330
|
+
onclick={() => press("review", "summarize", { kind: "scene", sceneId: s.id })}
|
|
331
|
+
>
|
|
332
|
+
{t("Ready to review")}
|
|
333
|
+
</button>
|
|
334
|
+
{:else if s.status === "running"}
|
|
335
|
+
<!-- The run in words where its Summarize was, as the conversation's
|
|
336
|
+
divider says it: the dot alone is too small to notice. -->
|
|
337
|
+
<span data-widget-part="chronicle.scene-running" role="status">{s.statusLabel}</span>
|
|
338
|
+
{/if}
|
|
339
|
+
{#if s.writtenFrom}
|
|
340
|
+
<p data-widget-part="chronicle.scene-written-from">{s.writtenFrom}</p>
|
|
341
|
+
{/if}
|
|
342
|
+
</li>
|
|
343
|
+
{/snippet}
|
|
344
|
+
|
|
242
345
|
<div data-widget-part="chronicle.root" data-widget="chronicle" data-state={view.state}>
|
|
243
|
-
{#if view.state
|
|
244
|
-
<p data-widget-part="chronicle.empty empty">{view.empty}</p>
|
|
245
|
-
{:else}
|
|
346
|
+
{#if view.state !== "no-book"}
|
|
246
347
|
{#if alert}
|
|
247
348
|
<p data-widget-part="chronicle.alert" role="alert">{alert}</p>
|
|
248
349
|
{/if}
|
|
249
350
|
|
|
250
|
-
{#if
|
|
351
|
+
{#if timeless}
|
|
352
|
+
<p data-widget-part="chronicle.note">{t("This lorebook keeps no timeline, so there are no story dates here.")}</p>
|
|
353
|
+
{:else if view.clock}
|
|
251
354
|
<section data-widget-part="chronicle.clock" aria-label={t("Story clock")}>
|
|
252
355
|
<div data-widget-part="chronicle.clock-head">
|
|
253
356
|
<span data-widget-part="chronicle.clock-date">{view.clock.date}</span>
|
|
@@ -302,22 +405,42 @@
|
|
|
302
405
|
>
|
|
303
406
|
<div data-widget-part="chronicle.fields">
|
|
304
407
|
{#each FIELDS as f (f.key)}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
408
|
+
{#if (f.key !== "day" || draft.month.trim() !== "") && (f.key !== "minute" || draft.hour.trim() !== "")}
|
|
409
|
+
{#if f.key === "month" && answer?.clock.months?.length}
|
|
410
|
+
<!-- The combobox draws its own label. -->
|
|
411
|
+
<div data-widget-part="chronicle.field">
|
|
412
|
+
<sp-combobox
|
|
413
|
+
data-widget-part="chronicle.field-input"
|
|
414
|
+
label={t(f.label)}
|
|
415
|
+
trigger-label={t("Choose a month")}
|
|
416
|
+
value={draft.month}
|
|
417
|
+
onchange={(e: CustomEvent<{ value: string }>) => (draft = { ...draft, month: e.detail.value })}
|
|
418
|
+
>
|
|
419
|
+
<sp-option value="">{t("No month")}</sp-option>
|
|
420
|
+
{#each answer.clock.months as monthName, i (i)}
|
|
421
|
+
<sp-option value={String(i + 1)}>{monthName}</sp-option>
|
|
422
|
+
{/each}
|
|
423
|
+
</sp-combobox>
|
|
424
|
+
</div>
|
|
425
|
+
{:else}
|
|
426
|
+
<label data-widget-part="chronicle.field">
|
|
427
|
+
<span data-widget-part="chronicle.field-label label">{t(f.label)}</span>
|
|
428
|
+
<input
|
|
429
|
+
type="number"
|
|
430
|
+
data-widget-part="chronicle.field-input"
|
|
431
|
+
name={f.key}
|
|
432
|
+
value={draft[f.key]}
|
|
433
|
+
oninput={(e) => (draft = { ...draft, [f.key]: e.currentTarget.value })}
|
|
434
|
+
onkeydown={(e) => {
|
|
435
|
+
if (e.key === "Enter") {
|
|
436
|
+
e.preventDefault()
|
|
437
|
+
void submitMove()
|
|
438
|
+
}
|
|
439
|
+
}}
|
|
440
|
+
/>
|
|
441
|
+
</label>
|
|
442
|
+
{/if}
|
|
443
|
+
{/if}
|
|
321
444
|
{/each}
|
|
322
445
|
</div>
|
|
323
446
|
{#if formProblem}
|
|
@@ -364,9 +487,10 @@
|
|
|
364
487
|
{#if open.cast.length}
|
|
365
488
|
<ul data-widget-part="chronicle.cast list" aria-label={t("Proposed cast")}>
|
|
366
489
|
{#each open.cast as member, i (i)}
|
|
367
|
-
|
|
490
|
+
<!-- Why they're proposed is the name's tooltip, in words (2026-11-06);
|
|
491
|
+
never printed beside the name. -->
|
|
492
|
+
<li data-widget-part="chronicle.cast-member chip" title={member.evidence || undefined}>
|
|
368
493
|
{member.name}
|
|
369
|
-
<span data-widget-part="chronicle.cast-evidence">{member.evidence}</span>
|
|
370
494
|
</li>
|
|
371
495
|
{/each}
|
|
372
496
|
</ul>
|
|
@@ -401,6 +525,7 @@
|
|
|
401
525
|
</section>
|
|
402
526
|
{/if}
|
|
403
527
|
|
|
528
|
+
{#if !timeless}
|
|
404
529
|
<section data-widget-part="chronicle.now" aria-labelledby="{uid}-now">
|
|
405
530
|
<h3 id="{uid}-now" data-widget-part="chronicle.heading label">{t("Now")}</h3>
|
|
406
531
|
{#if view.now}
|
|
@@ -411,18 +536,18 @@
|
|
|
411
536
|
</span>
|
|
412
537
|
<span data-widget-part="chronicle.entry-scenes">{view.now.scenes}</span>
|
|
413
538
|
</div>
|
|
414
|
-
{:else}
|
|
415
|
-
<p data-widget-part="chronicle.empty empty">{view.nowEmpty}</p>
|
|
416
539
|
{/if}
|
|
417
540
|
<div data-widget-part="chronicle.toolbar toolbar">
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
541
|
+
{#if canOpen}
|
|
542
|
+
<button
|
|
543
|
+
type="button"
|
|
544
|
+
data-widget-part="chronicle.open"
|
|
545
|
+
onclick={() => openEntry(view.now?.id)}
|
|
546
|
+
>
|
|
547
|
+
<sp-icon name="external-link" size="14"></sp-icon>
|
|
548
|
+
{t("Open in lorebook")}
|
|
549
|
+
</button>
|
|
550
|
+
{/if}
|
|
426
551
|
{#if view.canWrite && view.now}
|
|
427
552
|
<button
|
|
428
553
|
type="button"
|
|
@@ -436,68 +561,26 @@
|
|
|
436
561
|
{/if}
|
|
437
562
|
</div>
|
|
438
563
|
</section>
|
|
564
|
+
{/if}
|
|
439
565
|
|
|
440
|
-
{#if view.now}
|
|
566
|
+
{#if view.now || timeless}
|
|
441
567
|
<section data-widget-part="chronicle.scenes" aria-labelledby="{uid}-scenes">
|
|
442
568
|
<h3 id="{uid}-scenes" data-widget-part="chronicle.heading label">{t("Scenes")}</h3>
|
|
443
569
|
{#if view.scenes.length}
|
|
444
570
|
<ul data-widget-part="chronicle.scene-list list">
|
|
445
571
|
{#each view.scenes as s (s.id)}
|
|
446
|
-
|
|
447
|
-
data-widget-part="chronicle.scene row"
|
|
448
|
-
data-scene-id={s.id}
|
|
449
|
-
data-open={s.open ? "" : undefined}
|
|
450
|
-
>
|
|
451
|
-
<button
|
|
452
|
-
type="button"
|
|
453
|
-
data-widget-part="chronicle.scene-open"
|
|
454
|
-
title={t("Open in lorebook")}
|
|
455
|
-
onclick={() => openScene(s.id)}
|
|
456
|
-
>
|
|
457
|
-
<span data-widget-part="chronicle.scene-swatch" data-swatch={s.swatch}></span>
|
|
458
|
-
<span data-widget-part="chronicle.scene-name">{s.name}</span>
|
|
459
|
-
<span data-widget-part="chronicle.scene-span">{s.span}</span>
|
|
460
|
-
<span
|
|
461
|
-
data-widget-part="chronicle.scene-status"
|
|
462
|
-
data-status={s.status}
|
|
463
|
-
role="img"
|
|
464
|
-
aria-label={s.statusLabel}
|
|
465
|
-
title={s.statusLabel}
|
|
466
|
-
></span>
|
|
467
|
-
</button>
|
|
468
|
-
{#if s.canSummarize}
|
|
469
|
-
<button
|
|
470
|
-
type="button"
|
|
471
|
-
data-widget-part="chronicle.scene-summarize"
|
|
472
|
-
title={t("Summarize this scene in the background")}
|
|
473
|
-
disabled={!!busy}
|
|
474
|
-
onclick={() => summarizeScenes([s.id])}
|
|
475
|
-
>
|
|
476
|
-
{t("Summarize")}
|
|
477
|
-
</button>
|
|
478
|
-
{:else if s.canReview}
|
|
479
|
-
<!-- 🚧 §15 G8: the run finished; its review opens in the host. -->
|
|
480
|
-
<button
|
|
481
|
-
type="button"
|
|
482
|
-
data-widget-part="chronicle.scene-summarize chronicle.scene-review"
|
|
483
|
-
title={t("Its summary is ready: open the review to apply or discard it")}
|
|
484
|
-
disabled={!!busy}
|
|
485
|
-
onclick={() => press("review", "summarize", { kind: "scene", sceneId: s.id })}
|
|
486
|
-
>
|
|
487
|
-
{t("Ready to review")}
|
|
488
|
-
</button>
|
|
489
|
-
{/if}
|
|
490
|
-
{#if s.writtenFrom}
|
|
491
|
-
<p data-widget-part="chronicle.scene-written-from">{s.writtenFrom}</p>
|
|
492
|
-
{/if}
|
|
493
|
-
</li>
|
|
572
|
+
{@render sceneRow(s)}
|
|
494
573
|
{/each}
|
|
495
574
|
</ul>
|
|
496
|
-
{:else}
|
|
497
|
-
<p data-widget-part="chronicle.empty empty">{view.scenesEmpty}</p>
|
|
498
575
|
{/if}
|
|
499
|
-
{#if view.canSummarize || view.extend || view.summarizeAll}
|
|
576
|
+
{#if (timeless && canOpen) || view.canSummarize || view.extend || view.summarizeAll}
|
|
500
577
|
<div data-widget-part="chronicle.scene-actions toolbar">
|
|
578
|
+
{#if timeless && canOpen}
|
|
579
|
+
<button type="button" data-widget-part="chronicle.open" onclick={openScenes}>
|
|
580
|
+
<sp-icon name="external-link" size="14"></sp-icon>
|
|
581
|
+
{t("Open in lorebook")}
|
|
582
|
+
</button>
|
|
583
|
+
{/if}
|
|
501
584
|
{#if view.canSummarize}
|
|
502
585
|
<button
|
|
503
586
|
type="button"
|
|
@@ -539,6 +622,35 @@
|
|
|
539
622
|
</section>
|
|
540
623
|
{/if}
|
|
541
624
|
|
|
625
|
+
{#if view.unfiled.length}
|
|
626
|
+
<section data-widget-part="chronicle.unfiled" aria-labelledby="{uid}-unfiled">
|
|
627
|
+
<h3 id="{uid}-unfiled" data-widget-part="chronicle.heading label">{t("Not yet compiled")}</h3>
|
|
628
|
+
{#each view.unfiled as day (day.key)}
|
|
629
|
+
<div data-widget-part="chronicle.unfiled-day" role="group" aria-label={day.date}>
|
|
630
|
+
<div data-widget-part="chronicle.unfiled-day-head">
|
|
631
|
+
<span data-widget-part="chronicle.unfiled-date">{day.date}</span>
|
|
632
|
+
<span data-widget-part="chronicle.unfiled-count">{day.count}</span>
|
|
633
|
+
{#if day.compile}
|
|
634
|
+
<button
|
|
635
|
+
type="button"
|
|
636
|
+
data-widget-part="chronicle.unfiled-compile"
|
|
637
|
+
title={day.compile.title}
|
|
638
|
+
disabled={!!busy}
|
|
639
|
+
onclick={() => compileDay(day.compile!.date)}
|
|
640
|
+
>
|
|
641
|
+
<sp-icon name="wand" size="14"></sp-icon>
|
|
642
|
+
{day.compile.label}
|
|
643
|
+
</button>
|
|
644
|
+
{/if}
|
|
645
|
+
</div>
|
|
646
|
+
<ul data-widget-part="chronicle.scene-list list">
|
|
647
|
+
{#each day.scenes as s (s.id)}{@render sceneRow(s)}{/each}
|
|
648
|
+
</ul>
|
|
649
|
+
</div>
|
|
650
|
+
{/each}
|
|
651
|
+
</section>
|
|
652
|
+
{/if}
|
|
653
|
+
|
|
542
654
|
{#if view.earlierHead}
|
|
543
655
|
<!-- Folded: the host's accordion, its trigger the head (*Earlier (N)*). -->
|
|
544
656
|
<sp-accordion data-widget-part="chronicle.earlier" value="">
|
|
@@ -546,18 +658,18 @@
|
|
|
546
658
|
<ul data-widget-part="chronicle.earlier-list list">
|
|
547
659
|
{#each view.earlier as e (e.id)}
|
|
548
660
|
<li data-widget-part="chronicle.earlier-row row" data-entry-id={e.id}>
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
<span data-widget-part="chronicle.entry
|
|
560
|
-
|
|
661
|
+
{#if canOpen}
|
|
662
|
+
<button
|
|
663
|
+
type="button"
|
|
664
|
+
data-widget-part="chronicle.earlier-entry"
|
|
665
|
+
title={t("Open in lorebook")}
|
|
666
|
+
onclick={() => openEntry(e.id)}
|
|
667
|
+
>
|
|
668
|
+
{@render earlierBody(e)}
|
|
669
|
+
</button>
|
|
670
|
+
{:else}
|
|
671
|
+
<span data-widget-part="chronicle.earlier-entry">{@render earlierBody(e)}</span>
|
|
672
|
+
{/if}
|
|
561
673
|
</li>
|
|
562
674
|
{/each}
|
|
563
675
|
</ul>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Core's composer widget as a remote component: the component context, as
|
|
4
|
+
* the native widget context, around `ComposerWidget`.
|
|
5
|
+
*/
|
|
6
|
+
import { setContext, untrack } from "svelte"
|
|
7
|
+
import type { ComponentContext } from "@serene-pub/sdk/component"
|
|
8
|
+
import { WIDGET_CONTEXT_KEY } from "@serene-pub/core-catalog/conversation"
|
|
9
|
+
import ComposerWidget from "./ComposerWidget.svelte"
|
|
10
|
+
import WidgetBoundary from "../WidgetBoundary.svelte"
|
|
11
|
+
import { widgetRefFromComponent } from "../widgetRef.svelte"
|
|
12
|
+
|
|
13
|
+
let { ctx }: { ctx: ComponentContext } = $props()
|
|
14
|
+
|
|
15
|
+
// The context is the mount's, handed once: its sections move, it does not.
|
|
16
|
+
setContext(
|
|
17
|
+
WIDGET_CONTEXT_KEY,
|
|
18
|
+
widgetRefFromComponent(
|
|
19
|
+
untrack(() => ctx),
|
|
20
|
+
{ id: "composer", instanceId: "composer", title: "Composer" }
|
|
21
|
+
)
|
|
22
|
+
)
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<WidgetBoundary {ctx}><ComposerWidget /></WidgetBoundary>
|