@serene-pub/core-catalog 0.6.0-pr-7 → 0.6.0-pr-8
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/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 +101 -59
- package/components/shared/composer/Composer.svelte +25 -0
- package/components/shared/composer/ComposerWidget.svelte +134 -0
- package/components/shared/composer/composer.ts +10 -0
- package/components/shared/composer/settings.ts +55 -0
- package/components/shared/composer/target.ts +60 -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 +5 -6
- package/components/shared/messages/MessageControls.svelte +3 -2
- package/components/shared/messages/Messages.svelte +2 -1
- package/components/shared/messages/MessagesWidget.svelte +58 -183
- package/components/shared/messages/NextCharacterBlock.svelte +17 -17
- package/components/shared/messages/SceneDivider.svelte +18 -2
- package/components/shared/messages/SessionComposer.svelte +115 -105
- package/components/shared/messages/SessionContainer.svelte +2 -6
- package/components/shared/messages/SessionMessage.svelte +90 -26
- package/components/shared/messages/SpokenLine.svelte +12 -3
- package/components/shared/messages/StateProposalList.svelte +30 -20
- package/components/shared/messages/TurnLine.svelte +27 -23
- package/components/shared/messages/conversation.svelte.ts +53 -3
- package/components/shared/messages/readingPace.ts +101 -0
- package/components/shared/messages/sceneMarks.ts +54 -0
- package/components/shared/places/Places.svelte +2 -1
- package/components/shared/places/PlacesWidget.svelte +10 -13
- package/components/shared/routine-log/RoutineLog.svelte +2 -1
- package/components/shared/routine-log/RoutineLogWidget.svelte +0 -4
- 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 +266 -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 +510 -428
- package/dist/components/chronicle.source.json +1 -1
- package/dist/components/composer.js +1604 -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 +64 -61
- package/dist/components/lore-entries.source.json +1 -1
- package/dist/components/messages.js +1418 -8907
- package/dist/components/messages.source.json +1 -1
- package/dist/components/places.js +148 -160
- package/dist/components/places.source.json +1 -1
- package/dist/components/routine-log.js +30 -35
- 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 +581 -0
- package/dist/components/session-runs.source.json +1 -0
- package/dist/components/shared-2FMI3LEE.js +257 -0
- package/dist/components/{shared-W3XS5FEL.js → shared-5E4RQYRX.js} +3 -2
- package/dist/components/{shared-QXF5CJVN.js → shared-6S23SGJB.js} +1 -1
- package/dist/components/{shared-JPG5DQO7.js → shared-7SWDK5MC.js} +88 -17
- package/dist/components/{shared-YDS7HYL6.js → shared-ASZVJYPD.js} +2 -2
- package/dist/components/shared-BR2KXM25.js +1596 -0
- package/dist/components/{shared-BBF64YGL.js → shared-M7AYID43.js} +19 -13
- package/dist/components/{shared-BIWKZFUU.js → shared-N7FFW5TX.js} +3 -3
- package/dist/components/{shared-7VDIXYAL.js → shared-OVDOAXYZ.js} +1 -1
- package/dist/components/{shared-WV3QTKZT.js → shared-RQYMTMHF.js} +13 -9
- package/dist/components/{shared-XBDUENRA.js → shared-TNJZHTMT.js} +1 -1
- package/dist/components/shared-XJD6Y2OU.js +4215 -0
- package/dist/components/stats.js +828 -678
- package/dist/components/stats.source.json +1 -1
- package/dist/components/turn-line.js +584 -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/turnOrder.d.ts +18 -2
- package/dist/factories/turnOrder.js +32 -6
- package/dist/functions/pieces.js +1 -0
- package/dist/functions/time.js +2 -0
- package/dist/genres/defaults.d.ts +20 -4
- package/dist/genres/defaults.js +42 -8
- 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/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 +34 -12
- 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 +26 -16
- package/dist/genres/dungeon-crawler/story.js +169 -43
- package/dist/genres/dungeon-crawler/storyScripts.d.ts +2 -2
- package/dist/genres/dungeon-crawler/storyScripts.js +27 -8
- package/dist/genres/dungeon-crawler/summarizeScene.d.ts +13 -0
- package/dist/genres/dungeon-crawler/summarizeScene.js +21 -0
- package/dist/genres/lair/create.js +2 -0
- package/dist/genres/lair/keeper.js +4 -2
- package/dist/genres/lair/scripts.js +8 -6
- package/dist/genres/story/ask.d.ts +4 -0
- package/dist/genres/story/ask.js +4 -0
- package/dist/genres/story/create.d.ts +0 -1
- package/dist/genres/story/create.js +15 -1
- 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 +13 -33
- 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 +8 -0
- package/dist/genres/story/turnOrder.js +10 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +15 -1
- package/dist/loadouts.d.ts +1 -0
- package/dist/loadouts.js +17 -1
- package/dist/registry/entries.d.ts +2 -0
- package/dist/registry/entries.js +2 -0
- package/dist/registry/genres.d.ts +104 -5
- package/dist/registry/genres.js +276 -21
- 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 +247 -105
- package/dist/rulesets/vis-itineris/ruleset.js +8 -5
- package/dist/rulesets/wherewithal/ruleset.js +2 -1
- package/dist/seed/presets.js +8 -6
- package/dist/seed/prompts.js +24 -5
- 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/portrait.js +13 -4
- package/dist/shared/reckoning.d.ts +1 -1
- package/dist/shared/reckoning.js +23 -13
- 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 +61 -0
- package/dist/shared/sceneSummaries.d.ts +7 -0
- package/dist/shared/sceneSummaries.js +49 -0
- 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 +17 -0
- package/dist/shared/ui/chronicle/index.js +39 -19
- 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 +1 -0
- package/dist/shared/ui/conversation/index.js +2 -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 +12 -2
- package/dist/shared/ui/conversation/messageVerbState.js +2 -1
- 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 +2 -0
- package/dist/shared/ui/conversation/rewindStrip.js +21 -1
- package/dist/shared/ui/conversation/storyDays.d.ts +7 -1
- package/dist/shared/ui/conversation/storyDays.js +8 -0
- package/dist/shared/ui/places/index.d.ts +3 -2
- package/dist/shared/ui/places/index.js +4 -5
- 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 +82 -0
- package/dist/shared/ui/session-runs/index.js +137 -0
- package/dist/shared/ui/session-state/stateView.d.ts +18 -5
- package/dist/shared/ui/session-state/stateView.js +29 -8
- package/package.json +12 -8
- /package/dist/components/{shared-4ME6NFDK.js → shared-LUIF6DW7.js} +0 -0
|
@@ -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,10 @@
|
|
|
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
|
+
*
|
|
35
39
|
* The markup carries no look (STYLE-GUIDE §6.16): its elements carry
|
|
36
40
|
* `chronicle.*` widget parts; a scene's colour rides on its swatch's
|
|
37
41
|
* `data-swatch`, an entry that says nothing yet on `data-blank`. Earlier
|
|
@@ -39,13 +43,14 @@
|
|
|
39
43
|
* note's Advanced does.
|
|
40
44
|
*/
|
|
41
45
|
import { untrack } from "svelte"
|
|
42
|
-
import type { HistoryEntriesV1, WidgetRequests } from "@serene-pub/sdk/component"
|
|
46
|
+
import type { HistoryEntriesV1, StoryTime, WidgetRequests } from "@serene-pub/sdk/component"
|
|
43
47
|
import {
|
|
44
48
|
chronicleClockDraft,
|
|
45
49
|
chronicleClockFromDraft,
|
|
46
50
|
chronicleView,
|
|
47
51
|
readChronicleSettings,
|
|
48
|
-
type ChronicleClockDraft
|
|
52
|
+
type ChronicleClockDraft,
|
|
53
|
+
type ChronicleSceneView
|
|
49
54
|
} from "@serene-pub/core-catalog/chronicle"
|
|
50
55
|
import { useWidgetContext } from "../context"
|
|
51
56
|
|
|
@@ -172,6 +177,11 @@
|
|
|
172
177
|
if (done) ask()
|
|
173
178
|
}
|
|
174
179
|
|
|
180
|
+
/** 🚧 ★S6-1: compile one day's scenes not yet compiled (null = Undated); the run shows in the activity list. */
|
|
181
|
+
async function compileDay(date: StoryTime | null) {
|
|
182
|
+
await press("compile", "compile-history-entry", { date })
|
|
183
|
+
}
|
|
184
|
+
|
|
175
185
|
// ── the clock ────────────────────────────────────────────────────────────
|
|
176
186
|
let moving = $state(false)
|
|
177
187
|
let draft = $state<ChronicleClockDraft>(chronicleClockDraft(null))
|
|
@@ -239,10 +249,63 @@
|
|
|
239
249
|
}
|
|
240
250
|
</script>
|
|
241
251
|
|
|
252
|
+
{#snippet sceneRow(s: ChronicleSceneView)}
|
|
253
|
+
<li
|
|
254
|
+
data-widget-part="chronicle.scene row"
|
|
255
|
+
data-scene-id={s.id}
|
|
256
|
+
data-open={s.open ? "" : undefined}
|
|
257
|
+
>
|
|
258
|
+
<button
|
|
259
|
+
type="button"
|
|
260
|
+
data-widget-part="chronicle.scene-open"
|
|
261
|
+
title={t("Open in lorebook")}
|
|
262
|
+
onclick={() => openScene(s.id)}
|
|
263
|
+
>
|
|
264
|
+
<span data-widget-part="chronicle.scene-swatch" data-swatch={s.swatch}></span>
|
|
265
|
+
<span data-widget-part="chronicle.scene-name">{s.name}</span>
|
|
266
|
+
<span data-widget-part="chronicle.scene-span">{s.span}</span>
|
|
267
|
+
<span
|
|
268
|
+
data-widget-part="chronicle.scene-status"
|
|
269
|
+
data-status={s.status}
|
|
270
|
+
role="img"
|
|
271
|
+
aria-label={s.statusLabel}
|
|
272
|
+
title={s.statusLabel}
|
|
273
|
+
></span>
|
|
274
|
+
</button>
|
|
275
|
+
{#if s.canSummarize}
|
|
276
|
+
<button
|
|
277
|
+
type="button"
|
|
278
|
+
data-widget-part="chronicle.scene-summarize"
|
|
279
|
+
title={t("Summarize this scene in the background")}
|
|
280
|
+
disabled={!!busy}
|
|
281
|
+
onclick={() => summarizeScenes([s.id])}
|
|
282
|
+
>
|
|
283
|
+
{t("Summarize")}
|
|
284
|
+
</button>
|
|
285
|
+
{:else if s.canReview}
|
|
286
|
+
<!-- 🚧 §15 G8: the run finished; its review opens in the host. -->
|
|
287
|
+
<button
|
|
288
|
+
type="button"
|
|
289
|
+
data-widget-part="chronicle.scene-summarize chronicle.scene-review"
|
|
290
|
+
title={t("Its summary is ready: open the review to apply or discard it")}
|
|
291
|
+
disabled={!!busy}
|
|
292
|
+
onclick={() => press("review", "summarize", { kind: "scene", sceneId: s.id })}
|
|
293
|
+
>
|
|
294
|
+
{t("Ready to review")}
|
|
295
|
+
</button>
|
|
296
|
+
{:else if s.status === "running"}
|
|
297
|
+
<!-- The run in words where its Summarize was, as the conversation's
|
|
298
|
+
divider says it: the dot alone is too small to notice. -->
|
|
299
|
+
<span data-widget-part="chronicle.scene-running" role="status">{s.statusLabel}</span>
|
|
300
|
+
{/if}
|
|
301
|
+
{#if s.writtenFrom}
|
|
302
|
+
<p data-widget-part="chronicle.scene-written-from">{s.writtenFrom}</p>
|
|
303
|
+
{/if}
|
|
304
|
+
</li>
|
|
305
|
+
{/snippet}
|
|
306
|
+
|
|
242
307
|
<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}
|
|
308
|
+
{#if view.state !== "no-book"}
|
|
246
309
|
{#if alert}
|
|
247
310
|
<p data-widget-part="chronicle.alert" role="alert">{alert}</p>
|
|
248
311
|
{/if}
|
|
@@ -364,9 +427,10 @@
|
|
|
364
427
|
{#if open.cast.length}
|
|
365
428
|
<ul data-widget-part="chronicle.cast list" aria-label={t("Proposed cast")}>
|
|
366
429
|
{#each open.cast as member, i (i)}
|
|
367
|
-
|
|
430
|
+
<!-- Why they're proposed is the name's tooltip, in words (2026-11-06);
|
|
431
|
+
never printed beside the name. -->
|
|
432
|
+
<li data-widget-part="chronicle.cast-member chip" title={member.evidence || undefined}>
|
|
368
433
|
{member.name}
|
|
369
|
-
<span data-widget-part="chronicle.cast-evidence">{member.evidence}</span>
|
|
370
434
|
</li>
|
|
371
435
|
{/each}
|
|
372
436
|
</ul>
|
|
@@ -411,8 +475,6 @@
|
|
|
411
475
|
</span>
|
|
412
476
|
<span data-widget-part="chronicle.entry-scenes">{view.now.scenes}</span>
|
|
413
477
|
</div>
|
|
414
|
-
{:else}
|
|
415
|
-
<p data-widget-part="chronicle.empty empty">{view.nowEmpty}</p>
|
|
416
478
|
{/if}
|
|
417
479
|
<div data-widget-part="chronicle.toolbar toolbar">
|
|
418
480
|
<button
|
|
@@ -443,58 +505,9 @@
|
|
|
443
505
|
{#if view.scenes.length}
|
|
444
506
|
<ul data-widget-part="chronicle.scene-list list">
|
|
445
507
|
{#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>
|
|
508
|
+
{@render sceneRow(s)}
|
|
494
509
|
{/each}
|
|
495
510
|
</ul>
|
|
496
|
-
{:else}
|
|
497
|
-
<p data-widget-part="chronicle.empty empty">{view.scenesEmpty}</p>
|
|
498
511
|
{/if}
|
|
499
512
|
{#if view.canSummarize || view.extend || view.summarizeAll}
|
|
500
513
|
<div data-widget-part="chronicle.scene-actions toolbar">
|
|
@@ -539,6 +552,35 @@
|
|
|
539
552
|
</section>
|
|
540
553
|
{/if}
|
|
541
554
|
|
|
555
|
+
{#if view.unfiled.length}
|
|
556
|
+
<section data-widget-part="chronicle.unfiled" aria-labelledby="{uid}-unfiled">
|
|
557
|
+
<h3 id="{uid}-unfiled" data-widget-part="chronicle.heading label">{t("Not yet compiled")}</h3>
|
|
558
|
+
{#each view.unfiled as day (day.key)}
|
|
559
|
+
<div data-widget-part="chronicle.unfiled-day" role="group" aria-label={day.date}>
|
|
560
|
+
<div data-widget-part="chronicle.unfiled-day-head">
|
|
561
|
+
<span data-widget-part="chronicle.unfiled-date">{day.date}</span>
|
|
562
|
+
<span data-widget-part="chronicle.unfiled-count">{day.count}</span>
|
|
563
|
+
{#if day.compile}
|
|
564
|
+
<button
|
|
565
|
+
type="button"
|
|
566
|
+
data-widget-part="chronicle.unfiled-compile"
|
|
567
|
+
title={day.compile.title}
|
|
568
|
+
disabled={!!busy}
|
|
569
|
+
onclick={() => compileDay(day.compile!.date)}
|
|
570
|
+
>
|
|
571
|
+
<sp-icon name="wand" size="14"></sp-icon>
|
|
572
|
+
{day.compile.label}
|
|
573
|
+
</button>
|
|
574
|
+
{/if}
|
|
575
|
+
</div>
|
|
576
|
+
<ul data-widget-part="chronicle.scene-list list">
|
|
577
|
+
{#each day.scenes as s (s.id)}{@render sceneRow(s)}{/each}
|
|
578
|
+
</ul>
|
|
579
|
+
</div>
|
|
580
|
+
{/each}
|
|
581
|
+
</section>
|
|
582
|
+
{/if}
|
|
583
|
+
|
|
542
584
|
{#if view.earlierHead}
|
|
543
585
|
<!-- Folded: the host's accordion, its trigger the head (*Earlier (N)*). -->
|
|
544
586
|
<sp-accordion data-widget-part="chronicle.earlier" value="">
|
|
@@ -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>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* The `composer` widget's component (owner R8 2026-11-05, PLAN-session-
|
|
4
|
+
* layout-simplify D7/D8): the field you write into, the persona you write
|
|
5
|
+
* as, the actions, the rewind note and the read-only banner — split from
|
|
6
|
+
* the log. It owns a conversation of its own that follows the Messages
|
|
7
|
+
* copy it writes for (`followTarget`): same dossier, and the lane that
|
|
8
|
+
* copy shows. Its settings come off the widget context; the Line width
|
|
9
|
+
* and presentation it is drawn with are the target's, off the dossier.
|
|
10
|
+
*/
|
|
11
|
+
import { rewindStripState, channelTabsOf } from "@serene-pub/core-catalog/conversation"
|
|
12
|
+
import { useWidgetContext } from "../context"
|
|
13
|
+
import SessionComposer from "../messages/SessionComposer.svelte"
|
|
14
|
+
import { createConversation, setConversation } from "../messages/conversation.svelte"
|
|
15
|
+
import { readComposerSettings } from "./settings"
|
|
16
|
+
import { composerTargetOf } from "./target"
|
|
17
|
+
|
|
18
|
+
const ctx = useWidgetContext()
|
|
19
|
+
const conversation = ctx ? setConversation(createConversation(ctx, { followTarget: true })) : null
|
|
20
|
+
|
|
21
|
+
const fields = $derived(composerTargetOf(conversation?.dossier))
|
|
22
|
+
const target = $derived(fields.target)
|
|
23
|
+
const writingTo = $derived(fields.writingTo)
|
|
24
|
+
/**
|
|
25
|
+
* Folio's rule, the target's: its presentation when the host says it, else
|
|
26
|
+
* what its channel IS (`channelRole`). No target: the primary log's.
|
|
27
|
+
*/
|
|
28
|
+
const folio = $derived(
|
|
29
|
+
!target
|
|
30
|
+
? false
|
|
31
|
+
: target.presentation
|
|
32
|
+
? target.presentation === "folio"
|
|
33
|
+
: !!conversation && conversation.channelRole(target.channel) === "folio"
|
|
34
|
+
)
|
|
35
|
+
const settings = $derived(
|
|
36
|
+
readComposerSettings(ctx?.current.settings.v1 as Record<string, unknown> | undefined, folio)
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The composer this lane is written with: the copy's `composer`, or — on a
|
|
41
|
+
* tab other than the first — its `otherTabsComposer` when it says one (the
|
|
42
|
+
* Lair's Sanctum pill).
|
|
43
|
+
*/
|
|
44
|
+
const composerSkin = $derived.by(() => {
|
|
45
|
+
const tabs = channelTabsOf(conversation?.channels)
|
|
46
|
+
return tabs.length > 1 && conversation?.lane.current !== tabs[0] && settings.otherTabsComposer !== "same"
|
|
47
|
+
? settings.otherTabsComposer
|
|
48
|
+
: settings.composerSkin
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 🚧 **Back · Forward** (RF fix 5, owner ruling 2026-10-23): the note while
|
|
53
|
+
* the session is rewound, where the target shows the story (`main`), with
|
|
54
|
+
* Forward beside it for the owner. The host says how many turns are ahead
|
|
55
|
+
* and why a press would be refused (`dossier.rewind`); nothing presses
|
|
56
|
+
* while a reply is being written. The two presses themselves are the
|
|
57
|
+
* session header's, which reads the same state through `rewindStripState`.
|
|
58
|
+
*/
|
|
59
|
+
const generating = $derived(
|
|
60
|
+
((conversation?.ctx.messages.v1 ?? []) as Array<{ isGenerating?: boolean }>).some((m) => m.isGenerating)
|
|
61
|
+
)
|
|
62
|
+
const rewind = $derived(
|
|
63
|
+
rewindStripState({
|
|
64
|
+
rewind: conversation?.rewind.state,
|
|
65
|
+
isOwner: !!conversation?.dossier?.isOwner,
|
|
66
|
+
generating,
|
|
67
|
+
story: !target || target.channel === "main" || target.channel.startsWith("main:")
|
|
68
|
+
})
|
|
69
|
+
)
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<!-- The widget's parts (`composer.*`, STYLE-GUIDE §6.16): no look here; the
|
|
73
|
+
default widget stylesheet draws them. ⏳ Each also carries its old
|
|
74
|
+
`messages.*` name, so a style pack written for the old widget keeps
|
|
75
|
+
working. The root is the compose block itself and never fills the panel's
|
|
76
|
+
height: the host measures its content. -->
|
|
77
|
+
{#if conversation && !conversation.noLane}
|
|
78
|
+
{@const dossier = conversation.dossier}
|
|
79
|
+
<div
|
|
80
|
+
data-widget-part="composer.root messages.compose composer.compose"
|
|
81
|
+
data-composer-skin={composerSkin}
|
|
82
|
+
data-line-width={target?.lineWidth ?? "full"}
|
|
83
|
+
data-presentation={target?.presentation}
|
|
84
|
+
>
|
|
85
|
+
<div data-widget-part="messages.compose-area composer.compose-area">
|
|
86
|
+
{#if dossier?.readOnly}
|
|
87
|
+
<!-- Read-only (19 §6, ruled): the mode disappeared, the history
|
|
88
|
+
stays, nothing starts a new turn — and the server refuses
|
|
89
|
+
independently at every generation choke, so this banner is
|
|
90
|
+
honesty, not the lock. -->
|
|
91
|
+
<div data-widget-part="messages.read-only composer.read-only" role="status">
|
|
92
|
+
<sp-icon name="lock" size="20" data-widget-part="messages.read-only-icon composer.read-only-icon"></sp-icon>
|
|
93
|
+
<div data-widget-part="messages.read-only-text composer.read-only-text">
|
|
94
|
+
<p data-widget-part="messages.read-only-title composer.read-only-title">This session is read-only.</p>
|
|
95
|
+
<p>
|
|
96
|
+
Its mode ({dossier.readOnly.genreId}) is not installed. Messages are safe to
|
|
97
|
+
read; new turns resume when the mode returns.
|
|
98
|
+
</p>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
{:else}
|
|
102
|
+
{#if writingTo}
|
|
103
|
+
<!-- The target panel shows a tab that is not a Messages tab: say
|
|
104
|
+
where a line goes. -->
|
|
105
|
+
<p data-widget-part="composer.writing-to" role="status">
|
|
106
|
+
{conversation.t("Writing to {label}").replace("{label}", writingTo.label)}
|
|
107
|
+
</p>
|
|
108
|
+
{/if}
|
|
109
|
+
{#if rewind.replaceText}
|
|
110
|
+
<!-- 🚧 While rewound (RF fix 5): a new line replaces the turns
|
|
111
|
+
ahead — said before it is written, with Forward beside it
|
|
112
|
+
for the owner. -->
|
|
113
|
+
<p data-widget-part="messages.rewind-replace composer.rewind-replace" role="status">
|
|
114
|
+
<sp-icon name="undo-2" size="14" data-widget-part="messages.rewind-replace-icon composer.rewind-replace-icon"></sp-icon>
|
|
115
|
+
<span data-widget-part="messages.rewind-replace-text composer.rewind-replace-text">{rewind.replaceText}</span>
|
|
116
|
+
{#if conversation.dossier?.isOwner}
|
|
117
|
+
<button
|
|
118
|
+
type="button"
|
|
119
|
+
data-widget-part="messages.rewind-replace-forward composer.rewind-replace-forward"
|
|
120
|
+
title={rewind.forward.reason ? `Forward — ${rewind.forward.reason}` : "Forward — bring the next turn back"}
|
|
121
|
+
aria-disabled={rewind.forward.disabled}
|
|
122
|
+
onclick={(e) => (rewind.forward.disabled ? e.preventDefault() : conversation.rewind.forward())}
|
|
123
|
+
>
|
|
124
|
+
<span>Forward</span>
|
|
125
|
+
<sp-icon name="redo-2" size="14"></sp-icon>
|
|
126
|
+
</button>
|
|
127
|
+
{/if}
|
|
128
|
+
</p>
|
|
129
|
+
{/if}
|
|
130
|
+
<SessionComposer {composerSkin} showActions={settings.showActions} />
|
|
131
|
+
{/if}
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
{/if}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core's `composer` component (owner R8 2026-11-05): the field you write
|
|
3
|
+
* into, split from the log. `npm run build` compiles it with the CLI's
|
|
4
|
+
* component bundler to `dist/components/composer.js`, the module the app
|
|
5
|
+
* serves at `/core-ui/composer`.
|
|
6
|
+
*/
|
|
7
|
+
import { svelteComponent } from '@serene-pub/component-client/svelte'
|
|
8
|
+
import Composer from './Composer.svelte'
|
|
9
|
+
|
|
10
|
+
export default svelteComponent(Composer)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `composer` widget's settings (owner R8 2026-11-05: they were the
|
|
3
|
+
* `messages` widget's, moved verbatim), read the way the `messages` reader
|
|
4
|
+
* read them: every value present, the declared default wherever the instance
|
|
5
|
+
* has no deviation.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** How the composer's field is drawn. */
|
|
9
|
+
export type ComposerSkin = "classic" | "minimal" | "writer" | "quill"
|
|
10
|
+
|
|
11
|
+
export interface ComposerSettings {
|
|
12
|
+
composerSkin: ComposerSkin
|
|
13
|
+
/**
|
|
14
|
+
* 🚧 The composer while a tab other than the first is shown
|
|
15
|
+
* (`otherTabsComposer`, lair fix 2), or `same` — `composerSkin`.
|
|
16
|
+
*/
|
|
17
|
+
otherTabsComposer: ComposerSkin | "same"
|
|
18
|
+
showActions: boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The declared defaults (`CORE_WIDGETS`, the `composer` entry). */
|
|
22
|
+
export const COMPOSER_DEFAULTS: ComposerSettings = {
|
|
23
|
+
composerSkin: "classic",
|
|
24
|
+
otherTabsComposer: "same",
|
|
25
|
+
showActions: true
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function pickEnum<T extends string>(raw: unknown, of: readonly T[], fallback: T): T {
|
|
29
|
+
return typeof raw === "string" && (of as readonly string[]).includes(raw) ? (raw as T) : fallback
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Read one settings payload. `folio` is whether the target Messages copy
|
|
34
|
+
* reads as Folio: then a copy whose `composer` is the declared default
|
|
35
|
+
* (`classic`) writes with the page line (`quill`). Settings arrive complete,
|
|
36
|
+
* so `classic` cannot say "chosen"; a Folio copy that wants the card back
|
|
37
|
+
* cannot have it, which is the price of a manuscript's page line.
|
|
38
|
+
*/
|
|
39
|
+
export function readComposerSettings(
|
|
40
|
+
raw: Record<string, unknown> | undefined,
|
|
41
|
+
folio: boolean
|
|
42
|
+
): ComposerSettings {
|
|
43
|
+
const v = raw ?? {}
|
|
44
|
+
const d = COMPOSER_DEFAULTS
|
|
45
|
+
const skin = pickEnum<ComposerSkin>(v.composer, ["classic", "minimal", "writer", "quill"], d.composerSkin)
|
|
46
|
+
return {
|
|
47
|
+
composerSkin: folio && skin === d.composerSkin ? "quill" : skin,
|
|
48
|
+
otherTabsComposer: pickEnum(
|
|
49
|
+
v.otherTabsComposer,
|
|
50
|
+
["same", "classic", "minimal", "writer", "quill"],
|
|
51
|
+
d.otherTabsComposer
|
|
52
|
+
),
|
|
53
|
+
showActions: typeof v.showActions === "boolean" ? v.showActions : d.showActions
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Messages copy a Composer or Turn line belongs to (owner R8 2026-11-05:
|
|
3
|
+
* the composer and the turn line are widgets beside the log, not parts of it).
|
|
4
|
+
*
|
|
5
|
+
* The host gives each the same `session:full` dossier as its TARGET Messages
|
|
6
|
+
* copy — its `composer.channels` narrowed the same way — and says which
|
|
7
|
+
* channel that copy last showed (`show-channel`) under `dossier.composer`.
|
|
8
|
+
* Those two fields are not yet in the SDK's `ConversationComposerV1`, so they
|
|
9
|
+
* are read here, structurally, in ONE place; nothing else touches the shape.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export type TargetLineWidth = "column" | "full" | "comfortable"
|
|
13
|
+
export type TargetPresentation = "rows" | "folio"
|
|
14
|
+
|
|
15
|
+
/** The Messages copy this Composer / Turn line writes beside. */
|
|
16
|
+
export interface ComposerTarget {
|
|
17
|
+
/** The target Messages instance id (`messages`, `messages#sanctum`). */
|
|
18
|
+
instance: string
|
|
19
|
+
/** The channel that copy shows, canonical. */
|
|
20
|
+
channel: string
|
|
21
|
+
/** That channel's label in the viewer's language. */
|
|
22
|
+
label: string
|
|
23
|
+
/** The target's Line width, when the host says it. */
|
|
24
|
+
lineWidth?: TargetLineWidth
|
|
25
|
+
/** The target's effective presentation, when the host says it. */
|
|
26
|
+
presentation?: TargetPresentation
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ComposerTargetFields {
|
|
30
|
+
/** Absent: no target resolved — the first writable channel is the lane. */
|
|
31
|
+
target: ComposerTarget | null
|
|
32
|
+
/** Set when the target panel shows a tab that is not a Messages tab. */
|
|
33
|
+
writingTo: { channel: string; label: string } | null
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const str = (v: unknown): v is string => typeof v === "string" && v !== ""
|
|
37
|
+
|
|
38
|
+
/** Read `dossier.composer.target` and `.writingTo`; both null when the host sends none. */
|
|
39
|
+
export function composerTargetOf(dossier: unknown): ComposerTargetFields {
|
|
40
|
+
const composer = (dossier as { composer?: Record<string, unknown> } | null | undefined)?.composer
|
|
41
|
+
const t = composer?.target as Record<string, unknown> | null | undefined
|
|
42
|
+
const w = composer?.writingTo as Record<string, unknown> | null | undefined
|
|
43
|
+
const target: ComposerTarget | null =
|
|
44
|
+
t && str(t.instance) && str(t.channel)
|
|
45
|
+
? {
|
|
46
|
+
instance: t.instance,
|
|
47
|
+
channel: t.channel,
|
|
48
|
+
label: typeof t.label === "string" ? t.label : t.channel,
|
|
49
|
+
...(t.lineWidth === "column" || t.lineWidth === "full" || t.lineWidth === "comfortable"
|
|
50
|
+
? { lineWidth: t.lineWidth }
|
|
51
|
+
: {}),
|
|
52
|
+
...(t.presentation === "rows" || t.presentation === "folio"
|
|
53
|
+
? { presentation: t.presentation }
|
|
54
|
+
: {})
|
|
55
|
+
}
|
|
56
|
+
: null
|
|
57
|
+
const writingTo =
|
|
58
|
+
w && str(w.channel) ? { channel: w.channel, label: typeof w.label === "string" && w.label ? w.label : w.channel } : null
|
|
59
|
+
return { target, writingTo }
|
|
60
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Core's dialogue-box widget as a remote component: the component context,
|
|
4
|
+
* as the native widget context, around `DialogueBoxWidget`.
|
|
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 DialogueBoxWidget from "./DialogueBoxWidget.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: "dialogue-box", instanceId: "dialogue-box", title: "Dialogue box" }
|
|
21
|
+
)
|
|
22
|
+
)
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<WidgetBoundary {ctx}><DialogueBoxWidget /></WidgetBoundary>
|