unvendor: Replace droll
| @@ -50,7 +50,6 @@ module.exports = { | ||
| 50 | 50 | }, |
| 51 | 51 | // These scripts are loaded in HTML; tell ESLint not to complain about them being undefined |
| 52 | 52 | globals: { |
| 53 | - droll: 'readonly', | |
| 54 | 53 | showdownKatex: 'readonly', |
| 55 | 54 | toastr: 'readonly', |
| 56 | 55 | SillyTavern: 'readonly', |
| @@ -29,6 +29,7 @@ | ||
| 29 | 29 | "csrf-csrf": "^2.2.3", |
| 30 | 30 | "diff-match-patch": "^1.0.5", |
| 31 | 31 | "dompurify": "^3.1.7", |
| 32 | + "droll": "^0.2.1", | |
| 32 | 33 | "epubjs": "^0.3.93", |
| 33 | 34 | "express": "^4.21.0", |
| 34 | 35 | "form-data": "^4.0.0", |
| @@ -3531,6 +3532,17 @@ | ||
| 3531 | 3532 | "node": ">=10" |
| 3532 | 3533 | } |
| 3533 | 3534 | }, |
| 3535 | + "node_modules/droll": { | |
| 3536 | + "version": "0.2.1", | |
| 3537 | + "resolved": "https://registry.npmjs.org/droll/-/droll-0.2.1.tgz", | |
| 3538 | + "integrity": "sha512-fXxtxZSwGK6afeG18Vk6q/8LQDAnIylsvk/2tQhHwDOJmdB/x+YL9GLoSZUZXJkQ8LrBcyU/1EoIL1eSlpDMsg==", | |
| 3539 | + "bin": { | |
| 3540 | + "droll": "bin/droll-cli.js" | |
| 3541 | + }, | |
| 3542 | + "engines": { | |
| 3543 | + "node": ">=0.8.0" | |
| 3544 | + } | |
| 3545 | + }, | |
| 3534 | 3546 | "node_modules/eastasianwidth": { |
| 3535 | 3547 | "version": "0.2.0", |
| 3536 | 3548 | "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", |
| @@ -19,6 +19,7 @@ | ||
| 19 | 19 | "csrf-csrf": "^2.2.3", |
| 20 | 20 | "diff-match-patch": "^1.0.5", |
| 21 | 21 | "dompurify": "^3.1.7", |
| 22 | + "droll": "^0.2.1", | |
| 22 | 23 | "epubjs": "^0.3.93", |
| 23 | 24 | "express": "^4.21.0", |
| 24 | 25 | "form-data": "^4.0.0", |
| @@ -1,5 +1,4 @@ | ||
| 1 | 1 | // Global namespace modules |
| 2 | -declare var droll; | |
| 3 | 2 | declare var showdownKatex; |
| 4 | 3 | declare var ai; |
| 5 | 4 | |
| @@ -6751,7 +6751,6 @@ | ||
| 6751 | 6751 | <script src="lib/toastr.min.js"></script> |
| 6752 | 6752 | <script src="lib/select2.min.js"></script> |
| 6753 | 6753 | <script src="lib/select2-search-placeholder.js"></script> |
| 6754 | - <script src="lib/droll.js"></script> | |
| 6755 | 6754 | <script src="lib/pagination.js"></script> |
| 6756 | 6755 | <script src="lib/toolcool-color-picker.js"></script> |
| 6757 | 6756 | <script src="lib/jquery.izoomify.js"></script> |
| @@ -17,9 +17,7 @@ | ||
| 17 | 17 | ], |
| 18 | 18 | "typeAcquisition": { |
| 19 | 19 | "include": [ |
| 20 | - "@popperjs/core", | |
| 20 | + "showdown-katex" | |
| 21 | - "showdown-katex", | |
| 22 | - "droll" | |
| 23 | 21 | ] |
| 24 | 22 | } |
| 25 | 23 | } |
| @@ -19,6 +19,7 @@ import showdown from 'showdown'; | ||
| 19 | 19 | import moment from 'moment'; |
| 20 | 20 | import seedrandom from 'seedrandom'; |
| 21 | 21 | import * as Popper from '@popperjs/core'; |
| 22 | +import droll from 'droll'; | |
| 22 | 23 | |
| 23 | 24 | /** |
| 24 | 25 | * Expose the libraries to the 'window' object. |
| @@ -69,6 +70,10 @@ export function initLibraryShims() { | ||
| 69 | 70 | // @ts-ignore |
| 70 | 71 | window.Popper = Popper; |
| 71 | 72 | } |
| 73 | + if (!('droll' in window)) { | |
| 74 | + // @ts-ignore | |
| 75 | + window.droll = droll; | |
| 76 | + } | |
| 72 | 77 | } |
| 73 | 78 | |
| 74 | 79 | export default { |
| @@ -90,6 +95,7 @@ export default { | ||
| 90 | 95 | moment, |
| 91 | 96 | seedrandom, |
| 92 | 97 | Popper, |
| 98 | + droll, | |
| 93 | 99 | }; |
| 94 | 100 | |
| 95 | 101 | export { |
| @@ -111,4 +117,5 @@ export { | ||
| 111 | 117 | moment, |
| 112 | 118 | seedrandom, |
| 113 | 119 | Popper, |
| 120 | + droll, | |
| 114 | 121 | }; |
| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | import { Handlebars, moment, seedrandom, droll } from '../lib.js'; |
| 2 | 2 | import { chat, chat_metadata, main_api, getMaxContextSize, getCurrentChatId, substituteParams } from '../script.js'; |
| 3 | 3 | import { timestampToMoment, isDigitsOnly, getStringHash, escapeRegex, uuidv4 } from './utils.js'; |
| 4 | 4 | import { textgenerationwebui_banned_in_macros } from './textgen-settings.js'; |