@serene-pub/core-catalog 0.6.0-pr-2 → 0.6.0-pr-5

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.
Files changed (360) hide show
  1. package/README.md +21 -1
  2. package/components/{sessions → genres/chat}/authors-note/AuthorsNote.svelte +1 -1
  3. package/components/{sessions → genres/chat}/authors-note/AuthorsNoteWidget.svelte +1 -1
  4. package/components/{sessions/world-state/WorldState.svelte → shared/actions/Actions.svelte} +5 -5
  5. package/components/shared/actions/ActionsWidget.svelte +118 -0
  6. package/components/shared/actions/actions.ts +11 -0
  7. package/components/shared/album/Album.svelte +24 -0
  8. package/components/shared/album/AlbumWidget.svelte +163 -0
  9. package/components/shared/album/album.ts +10 -0
  10. package/components/shared/annex/Annex.svelte +24 -0
  11. package/components/shared/annex/AnnexWidget.svelte +151 -0
  12. package/components/shared/annex/annex.ts +10 -0
  13. package/components/shared/attendance/Attendance.svelte +24 -0
  14. package/components/shared/attendance/AttendanceWidget.svelte +136 -0
  15. package/components/shared/attendance/attendance.ts +12 -0
  16. package/components/shared/backdrop/Backdrop.svelte +24 -0
  17. package/components/shared/backdrop/BackdropWidget.svelte +345 -0
  18. package/components/shared/backdrop/backdrop.ts +10 -0
  19. package/components/shared/chronicle/Chronicle.svelte +36 -0
  20. package/components/shared/chronicle/ChronicleWidget.svelte +569 -0
  21. package/components/shared/chronicle/chronicle.ts +11 -0
  22. package/components/{sessions → shared}/lore-entries/LoreEntries.svelte +1 -1
  23. package/components/{sessions → shared}/lore-entries/LoreEntriesWidget.svelte +3 -3
  24. package/components/shared/map-canvas/MapCanvas.svelte +171 -0
  25. package/components/shared/map-canvas/index.ts +390 -0
  26. package/components/{sessions → shared}/messages/MessageComposer.svelte +1 -1
  27. package/components/{sessions → shared}/messages/MessageControls.svelte +42 -0
  28. package/components/{sessions → shared}/messages/MessageStateLedger.svelte +19 -8
  29. package/components/{sessions → shared}/messages/Messages.svelte +1 -1
  30. package/components/{sessions → shared}/messages/MessagesWidget.svelte +126 -40
  31. package/components/{sessions → shared}/messages/NextCharacterBlock.svelte +17 -14
  32. package/components/shared/messages/SceneCueChip.svelte +82 -0
  33. package/components/shared/messages/SceneDivider.svelte +399 -0
  34. package/components/{sessions → shared}/messages/SessionComposer.svelte +33 -9
  35. package/components/shared/messages/SessionContainer.svelte +651 -0
  36. package/components/{sessions → shared}/messages/SessionMessage.svelte +52 -7
  37. package/components/shared/messages/TurnLine.svelte +254 -0
  38. package/components/{sessions → shared}/messages/conversation.svelte.ts +191 -2
  39. package/components/shared/messages/sceneMarks.ts +397 -0
  40. package/components/shared/places/Places.svelte +24 -0
  41. package/components/shared/places/PlacesWidget.svelte +290 -0
  42. package/components/shared/places/places.ts +11 -0
  43. package/components/{sessions → shared}/scene-portraits/ScenePortraits.svelte +1 -1
  44. package/components/shared/scene-portraits/ScenePortraitsWidget.svelte +404 -0
  45. package/components/{sessions → shared}/state/SlotControl.svelte +9 -1
  46. package/components/{sessions → shared}/stats/Stats.svelte +1 -1
  47. package/components/shared/stats/StatsWidget.svelte +350 -0
  48. package/components/{sessions → shared}/stats/stats.ts +3 -2
  49. package/components/shared/turn-order/TurnOrder.svelte +24 -0
  50. package/components/shared/turn-order/TurnOrderWidget.svelte +167 -0
  51. package/components/shared/turn-order/turn-order.ts +11 -0
  52. package/components/{sessions/shared → shared}/widgetRef.svelte.ts +9 -2
  53. package/components/shared/world-state/WorldState.svelte +33 -0
  54. package/components/shared/world-state/world-state.ts +10 -0
  55. package/components/tsconfig.json +2 -2
  56. package/dist/components/actions.js +294 -0
  57. package/dist/components/actions.source.json +1 -0
  58. package/dist/components/album.js +386 -0
  59. package/dist/components/album.source.json +1 -0
  60. package/dist/components/annex.js +457 -0
  61. package/dist/components/annex.source.json +1 -0
  62. package/dist/components/attendance.js +353 -0
  63. package/dist/components/attendance.source.json +1 -0
  64. package/dist/components/authors-note.js +5 -5
  65. package/dist/components/authors-note.source.json +1 -1
  66. package/dist/components/backdrop.js +561 -0
  67. package/dist/components/backdrop.source.json +1 -0
  68. package/dist/components/chronicle.js +1141 -0
  69. package/dist/components/chronicle.source.json +1 -0
  70. package/dist/components/core-ui.json +1 -1
  71. package/dist/components/lore-entries.js +5 -5
  72. package/dist/components/lore-entries.source.json +1 -1
  73. package/dist/components/messages.js +3014 -2489
  74. package/dist/components/messages.source.json +1 -1
  75. package/dist/components/places.js +1133 -0
  76. package/dist/components/places.source.json +1 -0
  77. package/dist/components/scene-portraits.js +514 -345
  78. package/dist/components/scene-portraits.source.json +1 -1
  79. package/dist/components/shared-3K7SOGH7.js +16 -0
  80. package/dist/components/shared-452PIS46.js +156 -0
  81. package/dist/components/shared-GEDAMORM.js +45 -0
  82. package/dist/components/{shared-TCQZXBE3.js → shared-GXTL5G2H.js} +4 -3
  83. package/dist/components/shared-ITSLBJB5.js +478 -0
  84. package/dist/components/shared-NK7QSVMU.js +400 -0
  85. package/dist/components/shared-TDWKI2QV.js +58 -0
  86. package/dist/components/{shared-UAQVMZZK.js → shared-XBPH6USH.js} +586 -18
  87. package/dist/components/{shared-AINANAIA.js → shared-XISPHAKY.js} +502 -98
  88. package/dist/components/stats.js +8 -208
  89. package/dist/components/stats.source.json +1 -1
  90. package/dist/components/turn-order.js +461 -0
  91. package/dist/components/turn-order.source.json +1 -0
  92. package/dist/components/world-state.js +14 -202
  93. package/dist/components/world-state.source.json +1 -1
  94. package/dist/{answerForm.d.ts → factories/answerForm.d.ts} +4 -30
  95. package/dist/{answerForm.js → factories/answerForm.js} +10 -39
  96. package/dist/factories/once.d.ts +7 -0
  97. package/dist/factories/once.js +9 -0
  98. package/dist/{turnOrder.d.ts → factories/turnOrder.d.ts} +0 -22
  99. package/dist/{turnOrder.js → factories/turnOrder.js} +4 -104
  100. package/dist/genres/adventure/advanceTime.d.ts +18 -0
  101. package/dist/genres/adventure/advanceTime.js +24 -0
  102. package/dist/genres/adventure/answer.d.ts +23 -0
  103. package/dist/genres/adventure/answer.js +59 -0
  104. package/dist/genres/adventure/answerForm.d.ts +9 -0
  105. package/dist/genres/adventure/answerForm.js +11 -0
  106. package/dist/genres/adventure/ask.d.ts +73 -0
  107. package/dist/genres/adventure/ask.js +157 -0
  108. package/dist/genres/adventure/create.d.ts +36 -0
  109. package/dist/genres/adventure/create.js +62 -0
  110. package/dist/genres/adventure/illustrateScene.d.ts +7 -0
  111. package/dist/genres/adventure/illustrateScene.js +19 -0
  112. package/dist/genres/adventure/index.d.ts +45 -0
  113. package/dist/genres/adventure/index.js +45 -0
  114. package/dist/genres/adventure/keeperAction.d.ts +43 -0
  115. package/dist/genres/adventure/keeperAction.js +217 -0
  116. package/dist/genres/adventure/look.d.ts +45 -0
  117. package/dist/genres/adventure/look.js +209 -0
  118. package/dist/{adventure.d.ts → genres/adventure/respond.d.ts} +74 -65
  119. package/dist/{adventure.js → genres/adventure/respond.js} +125 -65
  120. package/dist/genres/adventure/rest.d.ts +10 -0
  121. package/dist/genres/adventure/rest.js +16 -0
  122. package/dist/genres/adventure/summarizeScene.d.ts +7 -0
  123. package/dist/genres/adventure/summarizeScene.js +14 -0
  124. package/dist/genres/adventure/turnOrder.d.ts +10 -0
  125. package/dist/genres/adventure/turnOrder.js +27 -0
  126. package/dist/genres/chat/advanceTime.d.ts +7 -0
  127. package/dist/genres/chat/advanceTime.js +17 -0
  128. package/dist/genres/chat/answerForm.d.ts +9 -0
  129. package/dist/genres/chat/answerForm.js +11 -0
  130. package/dist/genres/chat/create.d.ts +7 -0
  131. package/dist/{createChat.js → genres/chat/create.js} +6 -6
  132. package/dist/genres/chat/generateImage.d.ts +7 -0
  133. package/dist/{generateImage.js → genres/chat/generateImage.js} +26 -22
  134. package/dist/genres/chat/illustrateScene.d.ts +8 -0
  135. package/dist/genres/chat/illustrateScene.js +19 -0
  136. package/dist/genres/chat/index.d.ts +18 -0
  137. package/dist/genres/chat/index.js +19 -0
  138. package/dist/{narrate.d.ts → genres/chat/narrate.d.ts} +3 -3
  139. package/dist/{narrate.js → genres/chat/narrate.js} +37 -12
  140. package/dist/{narrateCharacter.d.ts → genres/chat/narrateCharacter.d.ts} +2 -2
  141. package/dist/{narrateCharacter.js → genres/chat/narrateCharacter.js} +39 -17
  142. package/dist/genres/chat/respond.d.ts +25 -0
  143. package/dist/{respond.js → genres/chat/respond.js} +91 -23
  144. package/dist/genres/chat/summarizeScene.d.ts +7 -0
  145. package/dist/genres/chat/summarizeScene.js +14 -0
  146. package/dist/genres/chat/turnOrder.d.ts +9 -0
  147. package/dist/genres/chat/turnOrder.js +28 -0
  148. package/dist/{ui/sessions → genres/chat/ui}/authors-note/index.d.ts +1 -1
  149. package/dist/genres/guide/answerForm.d.ts +9 -0
  150. package/dist/genres/guide/answerForm.js +11 -0
  151. package/dist/genres/guide/create.d.ts +24 -0
  152. package/dist/genres/guide/create.js +58 -0
  153. package/dist/genres/guide/index.d.ts +10 -0
  154. package/dist/genres/guide/index.js +10 -0
  155. package/dist/{guide.d.ts → genres/guide/respond.d.ts} +1 -20
  156. package/dist/{guide.js → genres/guide/respond.js} +32 -61
  157. package/dist/genres/guide/summarizeScene.d.ts +7 -0
  158. package/dist/genres/guide/summarizeScene.js +14 -0
  159. package/dist/genres/guide/turnOrder.d.ts +10 -0
  160. package/dist/genres/guide/turnOrder.js +27 -0
  161. package/dist/genres/index.d.ts +14 -0
  162. package/dist/genres/index.js +41 -0
  163. package/dist/genres/lair/advanceTime.d.ts +7 -0
  164. package/dist/genres/lair/advanceTime.js +17 -0
  165. package/dist/genres/lair/answerForm.d.ts +17 -0
  166. package/dist/genres/lair/answerForm.js +19 -0
  167. package/dist/genres/lair/buildRoom.d.ts +64 -0
  168. package/dist/genres/lair/buildRoom.js +244 -0
  169. package/dist/genres/lair/castellanAction.d.ts +27 -0
  170. package/dist/genres/lair/castellanAction.js +177 -0
  171. package/dist/genres/lair/create.d.ts +28 -0
  172. package/dist/genres/lair/create.js +69 -0
  173. package/dist/genres/lair/fileRoom.d.ts +53 -0
  174. package/dist/genres/lair/fileRoom.js +288 -0
  175. package/dist/genres/lair/index.d.ts +62 -0
  176. package/dist/genres/lair/index.js +63 -0
  177. package/dist/genres/lair/nudge.d.ts +25 -0
  178. package/dist/genres/lair/nudge.js +78 -0
  179. package/dist/{lair.d.ts → genres/lair/respond.d.ts} +46 -59
  180. package/dist/{lair.js → genres/lair/respond.js} +55 -76
  181. package/dist/genres/lair/reveal.d.ts +10 -0
  182. package/dist/genres/lair/reveal.js +18 -0
  183. package/dist/genres/lair/roomAnswer.d.ts +86 -0
  184. package/dist/genres/lair/roomAnswer.js +378 -0
  185. package/dist/genres/lair/summarizeScene.d.ts +39 -0
  186. package/dist/genres/lair/summarizeScene.js +51 -0
  187. package/dist/genres/lair/trap.d.ts +11 -0
  188. package/dist/genres/lair/trap.js +24 -0
  189. package/dist/genres/lair/turnOrder.d.ts +9 -0
  190. package/dist/genres/lair/turnOrder.js +36 -0
  191. package/dist/genres/lair/whisper.d.ts +35 -0
  192. package/dist/genres/lair/whisper.js +90 -0
  193. package/dist/index.d.ts +52 -29
  194. package/dist/index.js +192 -86
  195. package/dist/loadouts.d.ts +37 -0
  196. package/dist/loadouts.js +105 -0
  197. package/dist/{entries.d.ts → registry/entries.d.ts} +1 -1
  198. package/dist/{genres.js → registry/genres.js} +40 -6
  199. package/dist/{ui/sessions → registry}/layouts.d.ts +41 -27
  200. package/dist/{ui/sessions → registry}/layouts.js +90 -49
  201. package/dist/{ui/sessions → registry}/widgets.d.ts +22 -0
  202. package/dist/registry/widgets.js +1294 -0
  203. package/dist/{presets.js → seed/presets.js} +28 -13
  204. package/dist/{prompts.d.ts → seed/prompts.d.ts} +10 -5
  205. package/dist/{prompts.js → seed/prompts.js} +225 -176
  206. package/dist/{annexField.d.ts → shared/annexField.d.ts} +12 -8
  207. package/dist/{annexField.js → shared/annexField.js} +16 -15
  208. package/dist/shared/builtins/branch.d.ts +8 -0
  209. package/dist/shared/builtins/branch.js +13 -0
  210. package/dist/{builtins.d.ts → shared/builtins/builtIn.d.ts} +16 -21
  211. package/dist/{builtins.js → shared/builtins/builtIn.js} +3 -37
  212. package/dist/shared/builtins/delete.d.ts +8 -0
  213. package/dist/shared/builtins/delete.js +13 -0
  214. package/dist/shared/builtins/edit.d.ts +8 -0
  215. package/dist/shared/builtins/edit.js +13 -0
  216. package/dist/shared/builtins/hide.d.ts +8 -0
  217. package/dist/shared/builtins/hide.js +13 -0
  218. package/dist/shared/builtins/index.d.ts +11 -0
  219. package/dist/shared/builtins/index.js +11 -0
  220. package/dist/shared/builtins/swipe.d.ts +8 -0
  221. package/dist/shared/builtins/swipe.js +17 -0
  222. package/dist/shared/describeLikeness.d.ts +14 -0
  223. package/dist/shared/describeLikeness.js +65 -0
  224. package/dist/shared/illustrateScene.d.ts +28 -0
  225. package/dist/shared/illustrateScene.js +181 -0
  226. package/dist/shared/portrait.d.ts +21 -0
  227. package/dist/shared/portrait.js +101 -0
  228. package/dist/shared/spriteFill.d.ts +14 -0
  229. package/dist/shared/spriteFill.js +107 -0
  230. package/dist/shared/sprites.d.ts +34 -0
  231. package/dist/shared/sprites.js +98 -0
  232. package/dist/shared/summarize/character.d.ts +9 -0
  233. package/dist/shared/summarize/character.js +10 -0
  234. package/dist/shared/summarize/history.d.ts +9 -0
  235. package/dist/shared/summarize/history.js +10 -0
  236. package/dist/shared/summarize/index.d.ts +12 -0
  237. package/dist/shared/summarize/index.js +12 -0
  238. package/dist/shared/summarize/scene.d.ts +38 -0
  239. package/dist/shared/summarize/scene.js +42 -0
  240. package/dist/shared/summarize/sceneIds.d.ts +17 -0
  241. package/dist/shared/summarize/sceneIds.js +17 -0
  242. package/dist/shared/summarize/summarizeScene.d.ts +113 -0
  243. package/dist/shared/summarize/summarizeScene.js +234 -0
  244. package/dist/shared/summarize/summarizeSpec.d.ts +54 -0
  245. package/dist/{summarize.js → shared/summarize/summarizeSpec.js} +23 -53
  246. package/dist/shared/summarize/world.d.ts +8 -0
  247. package/dist/shared/summarize/world.js +9 -0
  248. package/dist/shared/timePasses.d.ts +56 -0
  249. package/dist/shared/timePasses.js +86 -0
  250. package/dist/{toolLoop.d.ts → shared/toolLoop.d.ts} +25 -3
  251. package/dist/{toolLoop.js → shared/toolLoop.js} +70 -14
  252. package/dist/shared/ui/actions/index.d.ts +117 -0
  253. package/dist/shared/ui/actions/index.js +154 -0
  254. package/dist/shared/ui/album/index.d.ts +115 -0
  255. package/dist/shared/ui/album/index.js +178 -0
  256. package/dist/shared/ui/annex/index.d.ts +163 -0
  257. package/dist/shared/ui/annex/index.js +273 -0
  258. package/dist/shared/ui/attendance/index.d.ts +97 -0
  259. package/dist/shared/ui/attendance/index.js +89 -0
  260. package/dist/shared/ui/backdrop/index.d.ts +78 -0
  261. package/dist/shared/ui/backdrop/index.js +98 -0
  262. package/dist/shared/ui/chronicle/index.d.ts +230 -0
  263. package/dist/shared/ui/chronicle/index.js +249 -0
  264. package/dist/shared/ui/conversation/dossier.d.ts +33 -0
  265. package/dist/shared/ui/conversation/dossier.js +31 -0
  266. package/dist/{ui/sessions → shared/ui}/conversation/index.d.ts +2 -1
  267. package/dist/{ui/sessions → shared/ui}/conversation/index.js +3 -1
  268. package/dist/{ui/sessions → shared/ui}/conversation/messageVerbState.d.ts +1 -1
  269. package/dist/shared/ui/conversation/storyDays.d.ts +21 -0
  270. package/dist/shared/ui/conversation/storyDays.js +23 -0
  271. package/dist/{ui/sessions → shared/ui}/coreWidgetsEntry.d.ts +1 -1
  272. package/dist/{ui/sessions → shared/ui}/coreWidgetsEntry.js +1 -1
  273. package/dist/{ui/sessions → shared/ui}/lore-entries/index.d.ts +2 -2
  274. package/dist/shared/ui/places/index.d.ts +148 -0
  275. package/dist/shared/ui/places/index.js +249 -0
  276. package/dist/{ui/sessions → shared/ui}/scene-portraits/index.d.ts +1 -1
  277. package/dist/{ui/sessions → shared/ui}/scene-portraits/index.js +1 -1
  278. package/dist/shared/ui/scene-portraits/portraits.d.ts +191 -0
  279. package/dist/shared/ui/scene-portraits/portraits.js +223 -0
  280. package/dist/shared/ui/session-state/index.d.ts +16 -0
  281. package/dist/shared/ui/session-state/index.js +16 -0
  282. package/dist/{ui/sessions → shared/ui}/session-state/shapes.d.ts +2 -2
  283. package/dist/shared/ui/session-state/stateView.d.ts +249 -0
  284. package/dist/shared/ui/session-state/stateView.js +247 -0
  285. package/dist/shared/ui/turn-order/index.d.ts +146 -0
  286. package/dist/shared/ui/turn-order/index.js +257 -0
  287. package/dist/{ui/sessions → shared/ui}/widgetContext.d.ts +19 -10
  288. package/package.json +69 -30
  289. package/components/sessions/messages/SessionContainer.svelte +0 -459
  290. package/components/sessions/scene-portraits/ScenePortraitsWidget.svelte +0 -249
  291. package/components/sessions/stats/StatsWidget.svelte +0 -112
  292. package/components/sessions/world-state/WorldStateWidget.svelte +0 -112
  293. package/components/sessions/world-state/world-state.ts +0 -10
  294. package/dist/adventureActions.d.ts +0 -169
  295. package/dist/adventureActions.js +0 -599
  296. package/dist/createChat.d.ts +0 -7
  297. package/dist/generateImage.d.ts +0 -7
  298. package/dist/lairActions.d.ts +0 -296
  299. package/dist/lairActions.js +0 -1287
  300. package/dist/respond.d.ts +0 -24
  301. package/dist/sprites.d.ts +0 -24
  302. package/dist/sprites.js +0 -102
  303. package/dist/summarize.d.ts +0 -76
  304. package/dist/ui/sessions/conversation/dossier.d.ts +0 -328
  305. package/dist/ui/sessions/conversation/dossier.js +0 -31
  306. package/dist/ui/sessions/scene-portraits/portraits.d.ts +0 -95
  307. package/dist/ui/sessions/scene-portraits/portraits.js +0 -115
  308. package/dist/ui/sessions/session-state/index.d.ts +0 -15
  309. package/dist/ui/sessions/session-state/index.js +0 -15
  310. package/dist/ui/sessions/session-state/stateView.d.ts +0 -155
  311. package/dist/ui/sessions/session-state/stateView.js +0 -141
  312. package/dist/ui/sessions/widgets.js +0 -567
  313. package/components/{sessions → genres/chat}/authors-note/authors-note.ts +0 -0
  314. package/components/{sessions/shared → shared}/context.ts +0 -0
  315. package/components/{sessions → shared}/lore-entries/lore-entries.ts +0 -0
  316. package/components/{sessions → shared}/messages/MessageBlocksView.svelte +0 -0
  317. package/components/{sessions → shared}/messages/MessageMediaStrip.svelte +0 -0
  318. package/components/{sessions → shared}/messages/MessagePartsView.svelte +0 -0
  319. package/components/{sessions → shared}/messages/StateProposalList.svelte +0 -0
  320. package/components/{sessions → shared}/messages/mediaStrip.ts +0 -0
  321. package/components/{sessions → shared}/messages/messages.ts +0 -0
  322. package/components/{sessions → shared}/scene-portraits/StatBars.svelte +0 -0
  323. package/components/{sessions → shared}/scene-portraits/scene-portraits.ts +0 -0
  324. package/components/{sessions → shared}/state/entryFinder.ts +0 -0
  325. package/components/{sessions → shared}/state/slotWriter.svelte.ts +0 -0
  326. package/dist/components/{shared-RJDGOAVC.js → shared-FTRGUE7G.js} +78 -78
  327. /package/dist/{ui/sessions → genres/chat/ui}/authors-note/index.js +0 -0
  328. /package/dist/{entries.js → registry/entries.js} +0 -0
  329. /package/dist/{genres.d.ts → registry/genres.d.ts} +0 -0
  330. /package/dist/{slots.d.ts → registry/slots.d.ts} +0 -0
  331. /package/dist/{slots.js → registry/slots.js} +0 -0
  332. /package/dist/{statShapes.d.ts → registry/statShapes.d.ts} +0 -0
  333. /package/dist/{statShapes.js → registry/statShapes.js} +0 -0
  334. /package/dist/{guideMascotImage.d.ts → seed/guideMascotImage.d.ts} +0 -0
  335. /package/dist/{guideMascotImage.js → seed/guideMascotImage.js} +0 -0
  336. /package/dist/{presets.d.ts → seed/presets.d.ts} +0 -0
  337. /package/dist/{graphBuild.d.ts → shared/graphBuild.d.ts} +0 -0
  338. /package/dist/{graphBuild.js → shared/graphBuild.js} +0 -0
  339. /package/dist/{ui/sessions → shared/ui}/conversation/actionsDisclosure.d.ts +0 -0
  340. /package/dist/{ui/sessions → shared/ui}/conversation/actionsDisclosure.js +0 -0
  341. /package/dist/{ui/sessions → shared/ui}/conversation/composerTray.d.ts +0 -0
  342. /package/dist/{ui/sessions → shared/ui}/conversation/composerTray.js +0 -0
  343. /package/dist/{ui/sessions → shared/ui}/conversation/formAnswer.d.ts +0 -0
  344. /package/dist/{ui/sessions → shared/ui}/conversation/formAnswer.js +0 -0
  345. /package/dist/{ui/sessions → shared/ui}/conversation/itemValues.d.ts +0 -0
  346. /package/dist/{ui/sessions → shared/ui}/conversation/itemValues.js +0 -0
  347. /package/dist/{ui/sessions → shared/ui}/conversation/messageOrder.d.ts +0 -0
  348. /package/dist/{ui/sessions → shared/ui}/conversation/messageOrder.js +0 -0
  349. /package/dist/{ui/sessions → shared/ui}/conversation/messageSpeaker.d.ts +0 -0
  350. /package/dist/{ui/sessions → shared/ui}/conversation/messageSpeaker.js +0 -0
  351. /package/dist/{ui/sessions → shared/ui}/conversation/messageVerbState.js +0 -0
  352. /package/dist/{ui/sessions → shared/ui}/conversation/slashPalette.d.ts +0 -0
  353. /package/dist/{ui/sessions → shared/ui}/conversation/slashPalette.js +0 -0
  354. /package/dist/{ui/sessions → shared/ui}/conversation/text.d.ts +0 -0
  355. /package/dist/{ui/sessions → shared/ui}/conversation/text.js +0 -0
  356. /package/dist/{ui/sessions → shared/ui}/lore-entries/index.js +0 -0
  357. /package/dist/{ui/sessions → shared/ui}/session-state/barMath.d.ts +0 -0
  358. /package/dist/{ui/sessions → shared/ui}/session-state/barMath.js +0 -0
  359. /package/dist/{ui/sessions → shared/ui}/session-state/shapes.js +0 -0
  360. /package/dist/{ui/sessions → shared/ui}/widgetContext.js +0 -0
package/README.md CHANGED
@@ -6,7 +6,7 @@ components Serene Pub ships, as a package. Serene Pub seeds from it at boot,
6
6
  references:
7
7
 
8
8
  ```ts
9
- import { respond, chatGenre } from '@serene-pub/core-catalog'
9
+ import { chatGenre, chatTurnOrder } from '@serene-pub/core-catalog'
10
10
  ```
11
11
 
12
12
  Core is the first consumer of the announce path rather than a special case — one
@@ -24,3 +24,23 @@ stylesheet build can scan it for class names; it is not imported at runtime.
24
24
 
25
25
  Importing the package registers its declarations, so it lists those modules in
26
26
  `sideEffects` — a bundler must not drop them.
27
+
28
+ ## Where things live
29
+
30
+ `src/` is laid out by genre (ruled 2026-10-05):
31
+
32
+ | folder | holds |
33
+ | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
34
+ | `src/genres/<genre>/` | one genre's pipelines, one spec per file (create, reply, actions, answer form, turn order), and its own widgets (`genres/chat/ui/authors-note/`) |
35
+ | `src/shared/` | what more than one genre uses: the built-in message verbs, summarize, the annex field, sprites, the story graph build, the tool-loop example, and the shared widgets (`shared/ui/`) |
36
+ | `src/factories/` | `answerFormSpec()` and `turnOrderSpec()`, which a plugin genre calls too |
37
+ | `src/registry/` | genres, slots, stat shapes, entry types, widget declarations and layouts |
38
+ | `src/seed/` | the shipped prompts, presets and the guide mascot |
39
+ | `components/` | the Svelte sources, mirrored the same way (`components/shared/*`, `components/genres/chat/authors-note`) |
40
+
41
+ `CORE_SPECS` (`src/index.ts`) lists every pipeline core seeds, with its display name. A genre's
42
+ pipeline id is `core:spec/<genre>-<what>` (`core:spec/chat-respond`); one every genre uses is
43
+ `core:spec/<what>` (`core:spec/summarize-scene`). A name says what the pipeline does and never
44
+ which genre it serves (_Reply_, _Turn order_): wherever several genres' pipelines are listed, the
45
+ genre is shown beside it. `core:spec/tool-loop` is exported as an example and is not in
46
+ `CORE_SPECS`.
@@ -9,7 +9,7 @@
9
9
  import type { ComponentContext } from "@serene-pub/sdk/component"
10
10
  import { WIDGET_CONTEXT_KEY } from "@serene-pub/core-catalog/widgets"
11
11
  import AuthorsNoteWidget from "./AuthorsNoteWidget.svelte"
12
- import { widgetRefFromComponent } from "../shared/widgetRef.svelte"
12
+ import { widgetRefFromComponent } from "../../../shared/widgetRef.svelte"
13
13
 
14
14
  let { ctx }: { ctx: ComponentContext } = $props()
15
15
 
@@ -31,7 +31,7 @@
31
31
  authorsNoteLastReplyLine,
32
32
  readAuthorsNote
33
33
  } from "@serene-pub/core-catalog/authors-note"
34
- import { useWidgetContext } from "../shared/context"
34
+ import { useWidgetContext } from "../../../shared/context"
35
35
 
36
36
  const widget = useWidgetContext()
37
37
  const t = (source: string): string => widget?.current?.t(source) ?? source
@@ -1,13 +1,13 @@
1
1
  <script lang="ts">
2
2
  /**
3
- * Core's World State widget as a remote component (R21): the component
3
+ * Core's Actions widget as a remote component (W8): the component
4
4
  * context, as the widget context, around the widget.
5
5
  */
6
6
  import { setContext, untrack } from "svelte"
7
7
  import type { ComponentContext } from "@serene-pub/sdk/component"
8
8
  import { WIDGET_CONTEXT_KEY } from "@serene-pub/core-catalog/widgets"
9
- import WorldStateWidget from "./WorldStateWidget.svelte"
10
- import { widgetRefFromComponent } from "../shared/widgetRef.svelte"
9
+ import ActionsWidget from "./ActionsWidget.svelte"
10
+ import { widgetRefFromComponent } from "../widgetRef.svelte"
11
11
 
12
12
  let { ctx }: { ctx: ComponentContext } = $props()
13
13
 
@@ -16,9 +16,9 @@
16
16
  WIDGET_CONTEXT_KEY,
17
17
  widgetRefFromComponent(
18
18
  untrack(() => ctx),
19
- { id: "world-state", instanceId: "world-state", title: "World State" }
19
+ { id: "actions", instanceId: "actions", title: "Actions" }
20
20
  )
21
21
  )
22
22
  </script>
23
23
 
24
- <WorldStateWidget />
24
+ <ActionsWidget />
@@ -0,0 +1,118 @@
1
+ <script lang="ts">
2
+ /**
3
+ * Actions (PLAN-core-widgets W8): what can I do right now — the session's
4
+ * listed actions (`actions.v1`) as real buttons, each with its icon and
5
+ * name, grouped from fields the listing carries: the turn controls, then
6
+ * the genre's own, then the ones added to it (`actionsView`, the plain
7
+ * half; this only draws it).
8
+ *
9
+ * A press is `invoke(identity)` — the same door the composer's chips
10
+ * take, so a core verb reaches the page's own handler and an action that
11
+ * collects text or recipients opens the page's collect modal before it
12
+ * fires. A greyed action is greyed, not disabled: `aria-disabled` keeps it
13
+ * in the tab order, its reason is its `title` and its description
14
+ * (`actions.reason`), and the click is guarded — as the chips do.
15
+ *
16
+ * Drawing a newcomer is meeting it: the widget shows every action at
17
+ * once, as opening **More** does in the composer, so the identities it
18
+ * draws wearing the *new* mark are told to the page (`actions-seen`),
19
+ * once each.
20
+ *
21
+ * ⚠ `showWaiting` (the questions waiting on the viewer) is declared and
22
+ * not drawn: no section this widget reads carries a session's open forms.
23
+ *
24
+ * The markup carries no look: each element names what it is in
25
+ * `data-widget-part`, the size rides on the root's `data-size`, a
26
+ * newcomer on its button's `data-new`, and the default widget stylesheet
27
+ * draws them (STYLE-GUIDE §6.16).
28
+ */
29
+ import { actionsView, readActionsSettings, type ActionsButtonView } from "@serene-pub/core-catalog/actions"
30
+ import { useWidgetContext } from "../context"
31
+
32
+ const widget = useWidgetContext()
33
+ const t = (source: string): string => widget?.current.t(source) ?? source
34
+ const uid = $props.id()
35
+
36
+ const settings = $derived(
37
+ readActionsSettings(widget?.current.settings?.v1)
38
+ )
39
+ const view = $derived(
40
+ actionsView({
41
+ actions: widget?.current.actions?.v1,
42
+ settings,
43
+ locale: widget?.current.locale?.v1,
44
+ t
45
+ })
46
+ )
47
+
48
+ /** An element id from an action's identity (`core#advance` → `core-advance`). */
49
+ const idOf = (identity: string): string => identity.replace(/[^a-zA-Z0-9-]/g, "-")
50
+
51
+ /** The newcomers already told to the page — each once. */
52
+ const met = new Set<string>()
53
+ $effect(() => {
54
+ const fresh = view.fresh.filter((k) => !met.has(k))
55
+ if (!fresh.length) return
56
+ for (const k of fresh) met.add(k)
57
+ void widget?.current.request("actions-seen", { keys: fresh })?.catch(() => {})
58
+ })
59
+
60
+ /** Why the last press did not go through, this widget's own. */
61
+ let refusal = $state<string | null>(null)
62
+
63
+ function press(button: ActionsButtonView): void {
64
+ if (button.disabled) return
65
+ refusal = null
66
+ try {
67
+ widget?.current.invoke(button.identity)
68
+ } catch (e) {
69
+ refusal = e instanceof Error && e.message ? e.message : t("That did not go through. Try again.")
70
+ }
71
+ }
72
+ </script>
73
+
74
+ <div data-widget-part="actions.root" data-size={settings.size}>
75
+ {#if refusal}
76
+ <p data-widget-part="actions.alert" role="alert">{refusal}</p>
77
+ {/if}
78
+
79
+ {#if view.empty}
80
+ <div data-widget-part="actions.empty empty" role="status">
81
+ <sp-icon name="mouse-pointer-click" size="20"></sp-icon>
82
+ <span>{view.empty}</span>
83
+ </div>
84
+ {:else}
85
+ {#each view.groups as group (group.key)}
86
+ <div
87
+ data-widget-part="actions.group"
88
+ data-group={group.key}
89
+ role="group"
90
+ aria-labelledby={`actions-${uid}-${group.key}`}
91
+ >
92
+ <p data-widget-part="actions.group-head" id={`actions-${uid}-${group.key}`}>{group.title}</p>
93
+ {#each group.buttons as button (button.identity)}
94
+ <button
95
+ type="button"
96
+ data-widget-part="actions.button"
97
+ data-identity={button.identity}
98
+ data-new={button.isNew ? "" : undefined}
99
+ aria-disabled={button.disabled ? "true" : undefined}
100
+ aria-describedby={button.reason ? `actions-${uid}-reason-${idOf(button.identity)}` : undefined}
101
+ title={button.title}
102
+ onclick={() => press(button)}
103
+ >
104
+ <sp-icon name={button.icon} size="16"></sp-icon>
105
+ <span>{button.name}</span>
106
+ {#if button.reason}
107
+ <span
108
+ data-widget-part="actions.reason"
109
+ id={`actions-${uid}-reason-${idOf(button.identity)}`}
110
+ aria-hidden="true">{button.reason}</span
111
+ >
112
+ {/if}
113
+ </button>
114
+ {/each}
115
+ </div>
116
+ {/each}
117
+ {/if}
118
+ </div>
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Core's `actions` component (PLAN-core-widgets W8): the session's actions as
3
+ * buttons — the turn controls, the genre's own, the added ones — as the
4
+ * page's UI worker runs it. `npm run build` compiles it with the CLI's
5
+ * component bundler to `dist/components/actions.js`, the module the app
6
+ * serves at `/core-ui/actions`.
7
+ */
8
+ import { svelteComponent } from '@serene-pub/component-client/svelte'
9
+ import Actions from './Actions.svelte'
10
+
11
+ export default svelteComponent(Actions)
@@ -0,0 +1,24 @@
1
+ <script lang="ts">
2
+ /**
3
+ * Core's Album widget as a remote component (W2): the component context,
4
+ * as the widget context, around the widget.
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/widgets"
9
+ import AlbumWidget from "./AlbumWidget.svelte"
10
+ import { widgetRefFromComponent } from "../widgetRef.svelte"
11
+
12
+ let { ctx }: { ctx: ComponentContext } = $props()
13
+
14
+ // The context is the mount's, handed once: its sections move, it does not.
15
+ setContext(
16
+ WIDGET_CONTEXT_KEY,
17
+ widgetRefFromComponent(
18
+ untrack(() => ctx),
19
+ { id: "album", instanceId: "album", title: "Album" }
20
+ )
21
+ )
22
+ </script>
23
+
24
+ <AlbumWidget />
@@ -0,0 +1,163 @@
1
+ <script lang="ts">
2
+ /**
3
+ * Album (PLAN-core-widgets W2): what has this session shown me — every
4
+ * picture on its lines (`messages.v1` parts), newest line first, as
5
+ * square tiles. Each tile wears a corner glyph for where it came from —
6
+ * a paperclip for what a person attached, sparkles for what a run
7
+ * generated — and names who showed it and when on hover or focus. A
8
+ * press opens the page's lightbox (`view-image`) on that picture, with
9
+ * the whole album as its pages in the order drawn. Everything it shows is
10
+ * worked out in the plain half (`albumItems`); this only draws it.
11
+ *
12
+ * `arrangement: latest` draws the newest picture large (the `fitted`
13
+ * representation) and the rest as a thumbnail strip, so an illustrated
14
+ * scene can sit beside the log as it is generated.
15
+ *
16
+ * A picture whose file is gone (deleted from the Media panel) raises
17
+ * `error` and is drawn as *File no longer available*, never a broken
18
+ * image, and leaves the lightbox's pages — the media strip's rule.
19
+ *
20
+ * The markup carries no look: each element names what it is in
21
+ * `data-widget-part` (`album.tile`, …), the settings ride on the root's
22
+ * `data-tile` and `data-arrangement`, a tile's origin on `data-origin`,
23
+ * and the default widget stylesheet draws them (STYLE-GUIDE §6.16).
24
+ */
25
+ import { SvelteSet } from "svelte/reactivity"
26
+ import {
27
+ ALBUM_EMPTY,
28
+ ALBUM_ORIGIN_NAMES,
29
+ albumItems,
30
+ albumOpenLabel,
31
+ albumSrc,
32
+ albumViewImageParams,
33
+ readAlbumSettings,
34
+ type AlbumItem
35
+ } from "@serene-pub/core-catalog/album"
36
+ import { useWidgetContext } from "../context"
37
+
38
+ const widget = useWidgetContext()
39
+ const t = (source: string): string => widget?.current.t(source) ?? source
40
+
41
+ const settings = $derived(
42
+ readAlbumSettings(widget?.current.settings?.v1)
43
+ )
44
+ const items = $derived(
45
+ albumItems(widget?.current.messages?.v1, settings, {
46
+ locale: widget?.current.locale?.v1,
47
+ t
48
+ })
49
+ )
50
+
51
+ /** Pictures whose file failed to load, by part id. */
52
+ const missing = new SvelteSet<number>()
53
+ /** What the lightbox pages through: every picture still there, in the order drawn. */
54
+ const openable = $derived(items.filter((i) => !missing.has(i.partId)))
55
+
56
+ const latest = $derived(settings.arrangement === "latest")
57
+ const lead = $derived(items[0])
58
+ const rest = $derived(items.slice(1))
59
+
60
+ /** Why the page declined the last press, this widget's own. */
61
+ let refusal = $state<string | null>(null)
62
+
63
+ async function open(item: AlbumItem): Promise<void> {
64
+ const index = openable.findIndex((i) => i.partId === item.partId)
65
+ if (index < 0) return
66
+ refusal = null
67
+ try {
68
+ await widget?.current.request("view-image", albumViewImageParams(openable, index))
69
+ } catch (e) {
70
+ refusal = e instanceof Error && e.message ? e.message : t("That did not go through. Try again.")
71
+ }
72
+ }
73
+
74
+ function label(item: AlbumItem): string {
75
+ const at = openable.findIndex((i) => i.partId === item.partId)
76
+ return albumOpenLabel(item, at, openable.length, t)
77
+ }
78
+
79
+ const count = $derived(
80
+ items.length === 1 ? t("1 picture") : `${items.length} ${t("pictures")}`
81
+ )
82
+ </script>
83
+
84
+ {#snippet tile(item: AlbumItem, big: boolean)}
85
+ {#if missing.has(item.partId)}
86
+ <div
87
+ data-widget-part="album.tile"
88
+ data-origin={item.origin}
89
+ data-missing=""
90
+ role="img"
91
+ aria-label={`${item.label}: ${t("File no longer available")}`}
92
+ >
93
+ <sp-icon name="image-off" size="20"></sp-icon>
94
+ <span>{t("File no longer available")}</span>
95
+ </div>
96
+ {:else}
97
+ <button
98
+ type="button"
99
+ data-widget-part="album.tile"
100
+ data-origin={item.origin}
101
+ data-part-id={item.partId}
102
+ data-message-id={item.messageId}
103
+ aria-label={label(item)}
104
+ onclick={() => open(item)}
105
+ >
106
+ <img
107
+ src={albumSrc(item.assetId, big ? "fitted" : "thumb")}
108
+ alt=""
109
+ loading="lazy"
110
+ decoding="async"
111
+ onerror={() => missing.add(item.partId)}
112
+ />
113
+ <span data-widget-part="album.origin" title={t(ALBUM_ORIGIN_NAMES[item.origin])} aria-hidden="true">
114
+ <sp-icon name={item.origin === "attached" ? "paperclip" : "sparkles"} size="12"></sp-icon>
115
+ </span>
116
+ {#if item.caption}
117
+ <span data-widget-part="album.caption" aria-hidden="true">{item.caption}</span>
118
+ {/if}
119
+ </button>
120
+ {/if}
121
+ {/snippet}
122
+
123
+ <div
124
+ data-widget-part="album.root"
125
+ data-tile={settings.tile}
126
+ data-arrangement={settings.arrangement}
127
+ data-source={settings.source}
128
+ role="group"
129
+ aria-label={t("Album")}
130
+ >
131
+ {#if refusal}
132
+ <p data-widget-part="album.alert" role="alert">{refusal}</p>
133
+ {/if}
134
+
135
+ {#if !items.length}
136
+ <div data-widget-part="album.empty empty" role="status">
137
+ <sp-icon name="book-image" size="20"></sp-icon>
138
+ <span>{t(ALBUM_EMPTY[settings.source])}</span>
139
+ </div>
140
+ {:else}
141
+ <p data-widget-part="album.toolbar toolbar">{count}</p>
142
+ {#if latest}
143
+ {#if lead}
144
+ <div data-widget-part="album.latest">
145
+ {@render tile(lead, true)}
146
+ </div>
147
+ {/if}
148
+ {#if rest.length}
149
+ <ul data-widget-part="album.strip list">
150
+ {#each rest as item (item.partId)}
151
+ <li>{@render tile(item, false)}</li>
152
+ {/each}
153
+ </ul>
154
+ {/if}
155
+ {:else}
156
+ <ul data-widget-part="album.grid list">
157
+ {#each items as item (item.partId)}
158
+ <li>{@render tile(item, false)}</li>
159
+ {/each}
160
+ </ul>
161
+ {/if}
162
+ {/if}
163
+ </div>
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Core's `album` component (PLAN-core-widgets W2): every picture on the
3
+ * session's lines, newest first, as the page's UI worker runs it. `npm run
4
+ * build` compiles it with the CLI's component bundler to
5
+ * `dist/components/album.js`, the module the app serves at `/core-ui/album`.
6
+ */
7
+ import { svelteComponent } from '@serene-pub/component-client/svelte'
8
+ import Album from './Album.svelte'
9
+
10
+ export default svelteComponent(Album)
@@ -0,0 +1,24 @@
1
+ <script lang="ts">
2
+ /**
3
+ * Core's Annex widget as a remote component (W9): the component context,
4
+ * as the widget context, around the widget.
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/widgets"
9
+ import AnnexWidget from "./AnnexWidget.svelte"
10
+ import { widgetRefFromComponent } from "../widgetRef.svelte"
11
+
12
+ let { ctx }: { ctx: ComponentContext } = $props()
13
+
14
+ // The context is the mount's, handed once: its sections move, it does not.
15
+ setContext(
16
+ WIDGET_CONTEXT_KEY,
17
+ widgetRefFromComponent(
18
+ untrack(() => ctx),
19
+ { id: "annex", instanceId: "annex", title: "Annex" }
20
+ )
21
+ )
22
+ </script>
23
+
24
+ <AnnexWidget />
@@ -0,0 +1,151 @@
1
+ <script lang="ts">
2
+ /**
3
+ * Annex (PLAN-core-widgets W9): what the pipeline knows that I may see —
4
+ * one declared annex key, by its label, from the viewer's own view of the
5
+ * annex (`annex.v1`). Text is prose, a number or a choice one row, a list
6
+ * chips, an object a row per member. Everything it shows is worked out in
7
+ * the plain half (`annexWidgetView`); this only draws it.
8
+ *
9
+ * Never silent: with no key picked, nothing written, or nothing the
10
+ * viewer may see, it says which, in one line.
11
+ *
12
+ * **Edit** is the Session data list's: a text field the host lists as the
13
+ * viewer's to set gets an Edit button, which opens the text in place;
14
+ * Save presses the field's ready-made action (`<owner>:annex#<key>`) with
15
+ * `{ value }` — the same door and the same write. The new value comes
16
+ * back through `annex.v1`; a refusal is the page's to say.
17
+ *
18
+ * The markup carries no look: each element names what it is in
19
+ * `data-widget-part` (`annex.prose`, `annex.row row`, …), the state and
20
+ * the drawn shape ride on the root's `data-state` and `data-shape`, and
21
+ * the default widget stylesheet draws them (STYLE-GUIDE §6.16).
22
+ */
23
+ import {
24
+ annexWidgetFieldsFrom,
25
+ annexWidgetView,
26
+ readAnnexWidgetSettings
27
+ } from "@serene-pub/core-catalog/annex"
28
+ import { useWidgetContext } from "../context"
29
+
30
+ const widget = useWidgetContext()
31
+ const t = (source: string): string => widget?.current.t(source) ?? source
32
+ const uid = $props.id()
33
+
34
+ const settings = $derived(
35
+ readAnnexWidgetSettings(widget?.current.settings?.v1)
36
+ )
37
+ const view = $derived(
38
+ annexWidgetView({
39
+ annex: widget?.current.annex?.v1,
40
+ fields: annexWidgetFieldsFrom(widget?.current.actions?.v1),
41
+ key: settings.key,
42
+ viewer: widget?.current.viewer?.v1,
43
+ locale: widget?.current.locale?.v1,
44
+ t
45
+ })
46
+ )
47
+
48
+ /** The editor, open, and its text. */
49
+ let editing = $state(false)
50
+ let draft = $state("")
51
+ /** Why the last Save did not go through, this widget's own. */
52
+ let refusal = $state<string | null>(null)
53
+
54
+ // Another key picked: an open editor was for the old one. Keyed on the
55
+ // identity alone, so a value pushed while someone types leaves it open.
56
+ const identity = $derived(view.identity)
57
+ $effect(() => {
58
+ void identity
59
+ editing = false
60
+ })
61
+
62
+ function startEdit(): void {
63
+ draft = view.draft
64
+ refusal = null
65
+ editing = true
66
+ }
67
+
68
+ function save(): void {
69
+ if (!identity) return
70
+ refusal = null
71
+ try {
72
+ widget?.current.invoke(identity, { payload: { value: draft } })
73
+ editing = false
74
+ } catch (e) {
75
+ refusal = e instanceof Error && e.message ? e.message : t("That did not go through. Try again.")
76
+ }
77
+ }
78
+ </script>
79
+
80
+ <div
81
+ data-widget-part="annex.root"
82
+ data-state={view.state}
83
+ data-shape={view.state === "value" ? view.shape : undefined}
84
+ role="group"
85
+ aria-label={view.title}
86
+ >
87
+ {#if refusal}
88
+ <p data-widget-part="annex.alert" role="alert">{refusal}</p>
89
+ {/if}
90
+
91
+ {#if settings.showLabel && view.state !== "pick"}
92
+ <p data-widget-part="annex.label label">{view.title}</p>
93
+ {/if}
94
+
95
+ {#if editing && identity}
96
+ <div data-widget-part="annex.editor">
97
+ <textarea
98
+ id={`annex-${uid}-text`}
99
+ data-widget-part="annex.text"
100
+ aria-label={view.title}
101
+ bind:value={draft}
102
+ ></textarea>
103
+ <div data-widget-part="annex.editor-actions toolbar">
104
+ <button type="button" data-widget-part="annex.cancel" onclick={() => (editing = false)}>
105
+ {t("Cancel")}
106
+ </button>
107
+ <button type="button" data-widget-part="annex.save" onclick={save}>
108
+ {t("Save")}
109
+ </button>
110
+ </div>
111
+ </div>
112
+ {:else if view.state === "value"}
113
+ <div data-widget-part="annex.value value">
114
+ {#if view.drawn.as === "prose"}
115
+ <p data-widget-part="annex.prose">{view.drawn.text}</p>
116
+ {:else if view.drawn.as === "chips"}
117
+ <ul data-widget-part="annex.chips list" aria-label={view.title}>
118
+ {#each view.drawn.chips as chip, i (i)}
119
+ <li data-widget-part="annex.chip chip">{chip}</li>
120
+ {/each}
121
+ </ul>
122
+ {:else}
123
+ <dl data-widget-part="annex.rows list">
124
+ {#each view.drawn.rows as row (row.key)}
125
+ <div data-widget-part="annex.row row" data-key={row.key}>
126
+ <dt data-widget-part="annex.row-label label">{row.label}</dt>
127
+ <dd data-widget-part="annex.row-value value">{row.text}</dd>
128
+ </div>
129
+ {/each}
130
+ </dl>
131
+ {/if}
132
+ </div>
133
+ {:else}
134
+ <div data-widget-part="annex.empty empty" role="status">
135
+ <sp-icon name="clipboard-list" size="20"></sp-icon>
136
+ <span>{view.empty}</span>
137
+ </div>
138
+ {/if}
139
+
140
+ {#if view.canEdit && !editing}
141
+ <button
142
+ type="button"
143
+ data-widget-part="annex.edit"
144
+ aria-label={`${t("Edit")} ${view.title}`}
145
+ onclick={startEdit}
146
+ >
147
+ <sp-icon name="pencil" size="14"></sp-icon>
148
+ <span>{t("Edit")}</span>
149
+ </button>
150
+ {/if}
151
+ </div>
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Core's `annex` component (PLAN-core-widgets W9): one declared annex key, by
3
+ * its label, in the shape it was declared in, as the page's UI worker runs
4
+ * it. `npm run build` compiles it with the CLI's component bundler to
5
+ * `dist/components/annex.js`, the module the app serves at `/core-ui/annex`.
6
+ */
7
+ import { svelteComponent } from '@serene-pub/component-client/svelte'
8
+ import Annex from './Annex.svelte'
9
+
10
+ export default svelteComponent(Annex)
@@ -0,0 +1,24 @@
1
+ <script lang="ts">
2
+ /**
3
+ * Core's Who's here widget as a remote component (W10): the component
4
+ * context, as the widget context, around the widget.
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/widgets"
9
+ import AttendanceWidget from "./AttendanceWidget.svelte"
10
+ import { widgetRefFromComponent } from "../widgetRef.svelte"
11
+
12
+ let { ctx }: { ctx: ComponentContext } = $props()
13
+
14
+ // The context is the mount's, handed once: its sections move, it does not.
15
+ setContext(
16
+ WIDGET_CONTEXT_KEY,
17
+ widgetRefFromComponent(
18
+ untrack(() => ctx),
19
+ { id: "attendance", instanceId: "attendance", title: "Who's here" }
20
+ )
21
+ )
22
+ </script>
23
+
24
+ <AttendanceWidget />