unvendor: Replace droll

e9a002bc2b78ed700f3f4069febf20d0c064a6fe

Cohee <18619528+Cohee1207@users.noreply.github.com>

8 files changed, +22 -7Showing whitespace changes
.eslintrc.cjs+0 -1
@@ -50,7 +50,6 @@ module.exports = {
5050 },
5151 // These scripts are loaded in HTML; tell ESLint not to complain about them being undefined
5252 globals: {
53- droll: 'readonly',
5453 showdownKatex: 'readonly',
5554 toastr: 'readonly',
5655 SillyTavern: 'readonly',
package-lock.json+12 -0
@@ -29,6 +29,7 @@
2929 "csrf-csrf": "^2.2.3",
3030 "diff-match-patch": "^1.0.5",
3131 "dompurify": "^3.1.7",
32+ "droll": "^0.2.1",
3233 "epubjs": "^0.3.93",
3334 "express": "^4.21.0",
3435 "form-data": "^4.0.0",
@@ -3531,6 +3532,17 @@
35313532 "node": ">=10"
35323533 }
35333534 },
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+ },
35343546 "node_modules/eastasianwidth": {
35353547 "version": "0.2.0",
35363548 "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
package.json+1 -0
@@ -19,6 +19,7 @@
1919 "csrf-csrf": "^2.2.3",
2020 "diff-match-patch": "^1.0.5",
2121 "dompurify": "^3.1.7",
22+ "droll": "^0.2.1",
2223 "epubjs": "^0.3.93",
2324 "express": "^4.21.0",
2425 "form-data": "^4.0.0",
public/global.d.ts+0 -1
@@ -1,5 +1,4 @@
11// Global namespace modules
2-declare var droll;
32declare var showdownKatex;
43declare var ai;
54
public/index.html+0 -1
@@ -6751,7 +6751,6 @@
67516751 <script src="lib/toastr.min.js"></script>
67526752 <script src="lib/select2.min.js"></script>
67536753 <script src="lib/select2-search-placeholder.js"></script>
6754- <script src="lib/droll.js"></script>
67556754 <script src="lib/pagination.js"></script>
67566755 <script src="lib/toolcool-color-picker.js"></script>
67576756 <script src="lib/jquery.izoomify.js"></script>
public/jsconfig.json+1 -3
@@ -17,9 +17,7 @@
1717 ],
1818 "typeAcquisition": {
1919 "include": [
20- "@popperjs/core",
20+ "showdown-katex"
21- "showdown-katex",
22- "droll"
2321 ]
2422 }
2523}
public/lib.js+7 -0
@@ -19,6 +19,7 @@ import showdown from 'showdown';
1919import moment from 'moment';
2020import seedrandom from 'seedrandom';
2121import * as Popper from '@popperjs/core';
22+import droll from 'droll';
2223
2324/**
2425 * Expose the libraries to the 'window' object.
@@ -69,6 +70,10 @@ export function initLibraryShims() {
6970 // @ts-ignore
7071 window.Popper = Popper;
7172 }
73+ if (!('droll' in window)) {
74+ // @ts-ignore
75+ window.droll = droll;
76+ }
7277}
7378
7479export default {
@@ -90,6 +95,7 @@ export default {
9095 moment,
9196 seedrandom,
9297 Popper,
98+ droll,
9399};
94100
95101export {
@@ -111,4 +117,5 @@ export {
111117 moment,
112118 seedrandom,
113119 Popper,
120+ droll,
114121};
public/scripts/macros.js+1 -1
@@ -1,4 +1,4 @@
11import { Handlebars, moment, seedrandom, droll } from '../lib.js';
22import { chat, chat_metadata, main_api, getMaxContextSize, getCurrentChatId, substituteParams } from '../script.js';
33import { timestampToMoment, isDigitsOnly, getStringHash, escapeRegex, uuidv4 } from './utils.js';
44import { textgenerationwebui_banned_in_macros } from './textgen-settings.js';