Commit Graph

3270 Commits

Author SHA1 Message Date
RossAscends
a53cee20d2 Merge branch 'dev' of https://github.com/Cohee1207/SillyTavern into dev 2023-07-06 01:30:41 +09:00
RossAscends
cb741fd954 AND/NOT logic for selective WI 2023-07-06 01:30:37 +09:00
Cohee
f3ebea6ad8 #629 Random list select substitution 2023-07-05 17:59:53 +03:00
Cohee
af6d9d48e0 Merge pull request #630 from bdashore3/dev
Add regex engine and other fixes
2023-07-05 17:30:17 +03:00
Cohee
04b5d73a85 Merge pull request #634 from BlipRanger/feature/spoilers
Add the ability to avoid spoilers
2023-07-05 17:24:43 +03:00
Cohee
9ed05725c6 Hide "branch" button under advanced 2023-07-05 17:23:03 +03:00
Cohee
15a2a61615 Merge pull request #633 from mweldon/dev
Add retroactive bookmarking
2023-07-05 17:21:09 +03:00
Cohee
aed6e3413a Merge pull request #636 from SillyTavern/dev
1.8.2
1.8.2
2023-07-05 16:11:55 +03:00
Cohee
df6b87fa23 Bump package version 2023-07-05 15:18:52 +03:00
RossAscends
f6f4a5199b WI Entry label alignment fix 2023-07-05 21:10:56 +09:00
RossAscends
d59eaa4912 Merge branch 'dev' of https://github.com/Cohee1207/SillyTavern into dev 2023-07-05 20:55:47 +09:00
RossAscends
26b55d47b4 WI Entry restyle; fix colorpicker loc for mobile 2023-07-05 20:55:39 +09:00
Cohee
5c39327450 Display Claude tokenizer in the UI if Claude model is used 2023-07-05 14:49:45 +03:00
Cohee
9c3823a616 #635 Fix sanitation of WI names 2023-07-05 13:40:40 +03:00
Cohee
46330f0558 Skill issue in A/N persona positioning 2023-07-05 13:27:44 +03:00
kingbri
afdab4c5b6 Regex: Add character name override
Sendas uses a different character's name for messages, so allow
the use of a character name override in the regex match function.
This overrides substituteParams to use a different value.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-05 01:35:52 -04:00
kingbri
b8f86d55da Regex: Add substitution to regex and undefined checks
Sometimes a user may want to substitute variables in the regex
itself rather than just matching those variables. This can be
optionally enabled in the editor.

In addition, try preventing crashes by checking for undefined
variables or null coalescing.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-05 01:30:50 -04:00
kingbri
fee801c2a4 Regex: Upgrade engine
If the extension is disabled, don't use any regex formatting. In
addition, wrap all foreach logic into its own function which
reduces the size of all regex injections.

This commit also removes the need for working around static imports
as UI is separate from the engine and is therefore imported at the
same time as other non-static extensions.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-05 01:30:50 -04:00
kingbri
fb02c00402 Extensions: Workaround loading static extensions
Some extensions are statically imported inside script.js, bypassing
the extension load method. The true method to solve this is using
dynamic imports and undefined checks, but implementing this is
extremely time-consuming.

For now, add the extension_first_load event which fires when
first load is about to start. This changes loading priority to
static -> offline -> online/API.

In addition, initialize the event source earlier since it's more
important than most of the other imports.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-05 01:30:50 -04:00
kingbri
7c0222a15b Regex: Migrate CSS styling
Universal styling has been moved to the main styles.css.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-05 01:30:50 -04:00
kingbri
e6eae0aad1 Regex: Fix script duplication on edit
Editing a script can bypass the unique naming system by just renaming
the script to another one. This change ensures that no two script
names can be the same by checking if the existing index and found indices
differ.

If something goes wrong, it would be better to use a filter and a
map and then check the index array length/includes. FindIndex
is used here for efficiency's sake since each array index is unique.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-05 01:30:50 -04:00
kingbri
0f8d07053e Regex: Don't wrap scriptTemplate elements
Fix some UI for flex element wrapping. Text overflow for a script
name is now truncated if it exceeds one line of text. Also fix
how extension settings are laid out to prevent unnecessary
flex resizing.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-05 01:30:50 -04:00
kingbri
b362dba726 Regex: Fix edit message hook
The only way to distinguish between a user and AI is if the is_user
property is changed.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-05 01:30:50 -04:00
kingbri
ee6a6603a3 Regex: Add trimStrings option
Sometimes the matched regex string needs to be pruned before
replacement. Add a method for the user to provide strings which
globally trims a regex match before any replacement is done.

Example without trim:
input - <Manami's thoughts: This is a thought>
regex - /<([^>]*)>/g
output - <Manami's thoughts: Manami's thoughts: This is a thought>

With trim:
input - <Manami's thoughts: This is a thought>
regex - /<([^>]*)>/g
trim - ["{{char}}'s thoughts: "]
output - <Manami's thoughts: This is a thought>

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-05 01:30:50 -04:00
kingbri
ef7aa3941b Extensions: Add regex engine
Regex is a method that is commonly used to find and replace parts
of a string using a single pattern. Add support for using regex in
SillyTavern which allows users to dynamically change various aspects
of the chatting experience.

Users are able to choose where a given regex script should apply
(both invasive and non-invasive options!). Invasive options alter
chat history while non-invasive alters markdown display for the
entire chat.

A new variable called {{match}} is added in regex scripts which
substitutes in the found match from the original find regex script.

There is a lot more that can be added to this extension, but for now,
this is enough.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-05 01:30:49 -04:00
kingbri
6bc9535040 Popups: Allow substitution of primary button
This allows for more flexible popups with options rather than
implementing a brand new popup just to change button text.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-05 01:30:01 -04:00
BlipRanger
4e0cbdfbb3 Add the ability to avoid spoilers 2023-07-05 01:08:09 -04:00
Mike Weldon
7ceb936337 Fix bug with Save bookmark from menu 2023-07-04 18:35:05 -07:00
Mike Weldon
d3c3614147 Add retroactive bookmarking 2023-07-04 18:13:22 -07:00
Cohee
9a8e036ff9 Use floor rounding on chroma auto-calc 2023-07-05 01:25:43 +03:00
Cohee
0d858bdefb #591 Fix Chroma auto-adjust rounding N query to 0 2023-07-05 01:23:11 +03:00
Cohee
27ab509caf Split help command into pages 2023-07-05 01:06:24 +03:00
Cohee
093379dba9 Fix custom group avatar in hotswap bar 2023-07-05 00:35:08 +03:00
Cohee
872bbfad1a Slash command to quickly open a character by name 2023-07-05 00:15:12 +03:00
RossAscends
b8f3a7cbe0 fix code text color & default minimal light theme 2023-07-05 05:16:52 +09:00
RossAscends
deff2d24fb Merge branch 'dev' of https://github.com/Cohee1207/SillyTavern into dev 2023-07-05 04:45:57 +09:00
RossAscends
fde2a91d2a down the rabbit hole 2023-07-05 04:45:54 +09:00
Cohee
4ceb8cedef Merge pull request #626 from Teashrock/main
Added Stable Horde sampler "k_euler_a"
2023-07-04 21:44:35 +03:00
RossAscends
383a9f67a2 Merge branch 'dev' of https://github.com/Cohee1207/SillyTavern into dev 2023-07-05 02:44:06 +09:00
RossAscends
8cee880486 hopeful fix for resize spam on mobile 2023-07-05 02:43:52 +09:00
Cohee
36149fffa1 Merge pull request #631 from BlipRanger/BlipRanger-patch-1
Blip ranger patch 1
2023-07-04 20:34:37 +03:00
BlipRanger
80ac13ef20 Rare race condition patch 2023-07-04 12:26:21 -04:00
RossAscends
b994dbb2d1 dont punish rampant zoomers too much 2023-07-05 00:41:39 +09:00
RossAscends
83d954246f anti-Tav tactics (MovingUI resets on page zoom) 2023-07-05 00:16:36 +09:00
RossAscends
368f3ea968 minor skill issue *obliterated by Dalamud* 2023-07-04 23:10:08 +09:00
RossAscends
19502492c6 Merge branch 'dev' of https://github.com/Cohee1207/SillyTavern into dev 2023-07-04 23:00:13 +09:00
RossAscends
3426f80656 Impervious MovingUI 2023-07-04 23:00:10 +09:00
Cohee
6770ccbe91 Fix Chub embedded lorebooks import 2023-07-04 14:47:48 +03:00
Cohee
44a38f8588 #628 Fix form properties 2023-07-04 14:16:14 +03:00
Cohee
823dd8c47c Merge branch 'main' into dev 2023-07-04 12:06:25 +03:00