16 Commits

Author SHA1 Message Date
Enerccio 277285d30c implemented emit events for itemized-prompts.js (#5461)
* implemented emit events for itemized-prompts.js

* removed redundant ITEMIZED_PROMPTS_DELETED_ALL event and updated emit logic accordingly

---------

Co-authored-by: Peter Vanusanik <pvan@bach.cz>
2026-04-16 21:10:19 +03:00
Wolfsblvt 7d3d1231a9 Chore: Add persona lifecycle events (PERSONA_CREATED, PERSONA_UPDATED, PERSONA_RENAMED, PERSONA_DELETED) (#5443)
* Add persona lifecycle events (created, updated, renamed, deleted) and emit them throughout persona management functions

* fix: await event emissions

* fix: await event in convertCharacterToPersona

* fix: await PERSONA_UPDATED in callbacks

* fix: delete multiple personas without reloading the chat

* fix: add CHAT_RENAMED event and adjust welcome screen pin update logic

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-13 19:24:38 +03:00
Xiangzhe e4ad489448 feat(tts): emit events and track messageId for third-party integrations (#5309)
* feat(tts): add event signals and messageId tracking for third-party integrations

* feat(tts): move events to core, centralize clone and id tracking

* Apply review suggestions

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-20 00:24:34 +02:00
Copilot ccf8ce7a06 Add PERSONA_CHANGED event (#5218)
* Initial plan

* Add PERSONA_CHANGED event emission when active user avatar changes

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-24 20:52:04 +02:00
Cohee 042dd44408 Add APP_INITIALIZED to event auto-fire list 2026-01-23 00:32:43 +02:00
Wolfsblvt f3c886fd12 Add APP_INITIALIZED event before hideLoader in initialization sequence, before APP_READY fires (#5051)
* Add APP_INIT event before hideLoader in initialization sequence

* refactor(events): rename APP_INIT to APP_INITIALIZED

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-22 23:40:48 +02:00
Cohee 8a32b72dfe Replace $.ajax with fetch (#4978) 2026-01-09 02:28:22 +02:00
Wolfsblvt a11abc4273 Add new WORLDINFO_SCAN_DONE event with mutable state for extensions (#4797)
* chore: Add WORLDINFO_SCAN_DONE event with mutable state for extensions

* Fix incorrect scan state reference in world info recursion logic

* Fix typo in world info scan state property name: 'sucessful' → 'successful'

(am i stupid)
2025-11-23 15:59:49 +02:00
Cohee 2577e35c0b Audio media attachments (#4741)
* Add audio-player component

* Enhance audio player functionality and styles

- Adjust audio player layout and styles in CSS for better spacing and alignment.
- Add audio element to message template in HTML.
- Implement audio attachment handling in JavaScript, including a new AudioPlayer class.
- Update media attachment structure to include titles for audio files.
- Extend supported media file types in constants.

* Add audio inlining control

* Fix file formats list

* Simplify hints

* Add to prompt

* Add progress title hint

* Add to scrollOnMediaLoad

* Add audio size hint

* Add gallery controls

* Delete removed media attachments from server

* Adjust min width

* No-op when swiping a singular media

* Fix clean-up

* Fix silent deletion logic

* More accurate media prompt estimations

* Round durations with ceiling function

* Adjust rounding logic

* you don't have to say it twice

* Export deleteFileFromServer

* Don't reference module from HTML

* Clean-up styles

* Move formatTime to utils

* Add fa-fw to delete
2025-11-05 00:53:23 +02:00
Cohee df7f046912 Preset Regex: add preset type for script regexes (#4642)
* feat: preset regex

* refactor: unify `saveScriptsByType`

* fix: default branch for `saveScriptsByType`

* refactor: resolve some reviews

* fix: lint

* refactor: getPresetName -> getCurrentPresetName

* refactor: unify regex allow operation

* feat: notify whether to reload current chat when preset is changed

* refacotr: set timeout for reload current chat notification

* fix: _ -> lodash

* i18n

* Refactor API ID access

* refactor: replace UNKNOWN type with a separate constant

* refactor: consolidate CSS rules for scoped and preset script blocks

* Extend toast timeout

* Fix bug with moving, refactor

* Refactor bulk toggle operations

* Use for..of for preset application

* refactor: enhance parameter documentation for scriptType in regex functions

* fix: await loadRegexScripts in event handlers

* fix: correct script type in saveScriptsByType for preset handling

* fix: add null checks for preset manager and API ID in regex functions

* feat: implement expandable regex script options in UI

* Always show edit/delete buttons

* Add title attribute to regex script name

* fix: correct class name for regex script display

* Remove extra paddings from script blocks

* fix: ensure preset scripts are only disallowed if currently allowed during rename

* fix: reload on bulk script toggle

* feat: add PRESET_RENAMED_BEFORE event type and emit it during preset renaming

* fix: always preserve preset extensions on rename

* Handle horde in getPresetManager

---------

Co-authored-by: ZoinkCN <zoinkcn@outlook.com>
Co-authored-by: StageDog <aksanajw845@gmail.com>
2025-10-11 22:10:06 +03:00
StageDog 72f91bcf83 Preset Regex: event change (#4616)
* feat: PRESET_RENAMED event

* fix: emit PRESET_DELETED only when the deletion successes

---------

Co-authored-by: ZoinkCN <zoinkcn@outlook.com>
2025-10-07 15:27:10 +03:00
Cohee 326d1c34c8 Emit event on message swipe deletion (#4590)
Closes #4567
2025-10-03 21:20:29 +03:00
Wolfsblvt 3e3dfbe05e Small change, (visually) disable "Link to Source" on characters that weren't downloaded from a source (#4588)
* feat: enable character source dropdown based on availability and style disabled options

* feat: emit event when character is in right character panel

* refactor: rename CHARACTER_SELECT_SELECTED event to CHARACTER_EDITOR_OPENED for clarity

* Always disable source option when peeking in groups

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-03 19:48:13 +03:00
zonde306 53d96deaff WORLDINFO_SORTING changed to WORLDINFO_ENTRIES_LOADED 2025-07-25 04:09:33 +08:00
zonde306 ac759e5b7e Allows control of Lore books entries by extensions 2025-07-25 03:36:01 +08:00
Cohee 19a8a8625c Move event types + new events (#4257)
* Move app events to separate module

* Add event emission for preset changes and deletions

* Remove unnecessary blank line at the beginning of events.js

* Add await to selectPreset call in initTextGenSettings

* Emit events for preset deletion and change in initPresetManager

* Move event emit out of PRESET_CHANGED
2025-07-11 22:00:04 +03:00