mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-06 04:38:21 +01:00
unvendor: Replace handlebars
This commit is contained in:
parent
1c4e87b25b
commit
d5fdf307c8
@ -51,7 +51,6 @@ module.exports = {
|
||||
// These scripts are loaded in HTML; tell ESLint not to complain about them being undefined
|
||||
globals: {
|
||||
droll: 'readonly',
|
||||
Handlebars: 'readonly',
|
||||
moment: 'readonly',
|
||||
pdfjsLib: 'readonly',
|
||||
Popper: 'readonly',
|
||||
|
41
package-lock.json
generated
41
package-lock.json
generated
@ -27,6 +27,7 @@
|
||||
"form-data": "^4.0.0",
|
||||
"fuse.js": "^7.0.0",
|
||||
"google-translate-api-x": "^10.7.1",
|
||||
"handlebars": "^4.7.8",
|
||||
"helmet": "^7.1.0",
|
||||
"highlight.js": "^11.10.0",
|
||||
"html-entities": "^2.5.2",
|
||||
@ -4214,6 +4215,27 @@
|
||||
"integrity": "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/handlebars": {
|
||||
"version": "4.7.8",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
|
||||
"integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.5",
|
||||
"neo-async": "^2.6.2",
|
||||
"source-map": "^0.6.1",
|
||||
"wordwrap": "^1.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"handlebars": "bin/handlebars"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.7"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"uglify-js": "^3.1.4"
|
||||
}
|
||||
},
|
||||
"node_modules/has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
@ -7042,6 +7064,19 @@
|
||||
"integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/uglify-js": {
|
||||
"version": "3.19.3",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
|
||||
"integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==",
|
||||
"license": "BSD-2-Clause",
|
||||
"optional": true,
|
||||
"bin": {
|
||||
"uglifyjs": "bin/uglifyjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "5.26.5",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
||||
@ -7376,6 +7411,12 @@
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/wordwrap": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/wrap-ansi": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||
|
@ -17,6 +17,7 @@
|
||||
"form-data": "^4.0.0",
|
||||
"fuse.js": "^7.0.0",
|
||||
"google-translate-api-x": "^10.7.1",
|
||||
"handlebars": "^4.7.8",
|
||||
"helmet": "^7.1.0",
|
||||
"highlight.js": "^11.10.0",
|
||||
"html-entities": "^2.5.2",
|
||||
|
1
public/global.d.ts
vendored
1
public/global.d.ts
vendored
@ -1,6 +1,5 @@
|
||||
// Global namespace modules
|
||||
declare var droll;
|
||||
declare var Handlebars;
|
||||
declare var pdfjsLib;
|
||||
declare var Popper;
|
||||
declare var showdown;
|
||||
|
@ -6758,7 +6758,6 @@
|
||||
<script src="lib/select2-search-placeholder.js"></script>
|
||||
<script src="lib/seedrandom.min.js"></script>
|
||||
<script src="lib/droll.js"></script>
|
||||
<script src="lib/handlebars.js"></script>
|
||||
<script src="lib/pagination.js"></script>
|
||||
<script src="lib/toolcool-color-picker.js"></script>
|
||||
<script src="lib/svg-inject.js"></script>
|
||||
|
@ -22,8 +22,6 @@
|
||||
"seedrandom",
|
||||
"showdown-katex",
|
||||
"droll",
|
||||
"handlebars",
|
||||
"highlight.js",
|
||||
"pdfjs-dist",
|
||||
"@mozilla/readability"
|
||||
]
|
||||
|
@ -6,6 +6,7 @@ import Fuse from 'fuse.js';
|
||||
import DOMPurify from 'dompurify';
|
||||
import hljs from 'highlight.js';
|
||||
import localforage from 'localforage';
|
||||
import Handlebars from 'handlebars';
|
||||
|
||||
/**
|
||||
* Expose the libraries to the 'window' object.
|
||||
@ -32,6 +33,10 @@ export function initLibraryShims() {
|
||||
// @ts-ignore
|
||||
window.localforage = localforage;
|
||||
}
|
||||
if (!('Handlebars' in window)) {
|
||||
// @ts-ignore
|
||||
window.Handlebars = Handlebars;
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
@ -39,6 +44,7 @@ export default {
|
||||
DOMPurify,
|
||||
hljs,
|
||||
localforage,
|
||||
Handlebars,
|
||||
};
|
||||
|
||||
export {
|
||||
@ -46,4 +52,5 @@ export {
|
||||
DOMPurify,
|
||||
hljs,
|
||||
localforage,
|
||||
Handlebars,
|
||||
};
|
||||
|
File diff suppressed because one or more lines are too long
@ -3,6 +3,7 @@ import {
|
||||
DOMPurify,
|
||||
hljs,
|
||||
localforage,
|
||||
Handlebars,
|
||||
initLibraryShims,
|
||||
default as libs,
|
||||
} from './lib.js';
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { Handlebars } from '../lib.js';
|
||||
import { chat, chat_metadata, main_api, getMaxContextSize, getCurrentChatId, substituteParams } from '../script.js';
|
||||
import { timestampToMoment, isDigitsOnly, getStringHash, escapeRegex, uuidv4 } from './utils.js';
|
||||
import { textgenerationwebui_banned_in_macros } from './textgen-settings.js';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Fuse } from '../lib.js';
|
||||
import { Fuse, Handlebars } from '../lib.js';
|
||||
|
||||
import {
|
||||
saveSettingsDebounced,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { DOMPurify } from '../lib.js';
|
||||
import { DOMPurify, Handlebars } from '../lib.js';
|
||||
import { applyLocale } from './i18n.js';
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user