mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-25 16:30:09 +01:00
unvendor: Replace hljs
This commit is contained in:
parent
3c28b754dc
commit
416282ae1f
@ -52,7 +52,6 @@ module.exports = {
|
|||||||
globals: {
|
globals: {
|
||||||
droll: 'readonly',
|
droll: 'readonly',
|
||||||
Handlebars: 'readonly',
|
Handlebars: 'readonly',
|
||||||
hljs: 'readonly',
|
|
||||||
localforage: 'readonly',
|
localforage: 'readonly',
|
||||||
moment: 'readonly',
|
moment: 'readonly',
|
||||||
pdfjsLib: 'readonly',
|
pdfjsLib: 'readonly',
|
||||||
|
10
package-lock.json
generated
10
package-lock.json
generated
@ -28,6 +28,7 @@
|
|||||||
"fuse.js": "^7.0.0",
|
"fuse.js": "^7.0.0",
|
||||||
"google-translate-api-x": "^10.7.1",
|
"google-translate-api-x": "^10.7.1",
|
||||||
"helmet": "^7.1.0",
|
"helmet": "^7.1.0",
|
||||||
|
"highlight.js": "^11.10.0",
|
||||||
"html-entities": "^2.5.2",
|
"html-entities": "^2.5.2",
|
||||||
"iconv-lite": "^0.6.3",
|
"iconv-lite": "^0.6.3",
|
||||||
"ip-matching": "^2.1.2",
|
"ip-matching": "^2.1.2",
|
||||||
@ -4277,6 +4278,15 @@
|
|||||||
"node": ">=16.0.0"
|
"node": ">=16.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/highlight.js": {
|
||||||
|
"version": "11.10.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.10.0.tgz",
|
||||||
|
"integrity": "sha512-SYVnVFswQER+zu1laSya563s+F8VDGt7o35d4utbamowvUNLLMovFqwCLSocpZTz3MgaSRA1IbqRWZv97dtErQ==",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/html-entities": {
|
"node_modules/html-entities": {
|
||||||
"version": "2.5.2",
|
"version": "2.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz",
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
"fuse.js": "^7.0.0",
|
"fuse.js": "^7.0.0",
|
||||||
"google-translate-api-x": "^10.7.1",
|
"google-translate-api-x": "^10.7.1",
|
||||||
"helmet": "^7.1.0",
|
"helmet": "^7.1.0",
|
||||||
|
"highlight.js": "^11.10.0",
|
||||||
"html-entities": "^2.5.2",
|
"html-entities": "^2.5.2",
|
||||||
"iconv-lite": "^0.6.3",
|
"iconv-lite": "^0.6.3",
|
||||||
"ip-matching": "^2.1.2",
|
"ip-matching": "^2.1.2",
|
||||||
|
1
public/global.d.ts
vendored
1
public/global.d.ts
vendored
@ -1,7 +1,6 @@
|
|||||||
// Global namespace modules
|
// Global namespace modules
|
||||||
declare var droll;
|
declare var droll;
|
||||||
declare var Handlebars;
|
declare var Handlebars;
|
||||||
declare var hljs;
|
|
||||||
declare var localforage;
|
declare var localforage;
|
||||||
declare var pdfjsLib;
|
declare var pdfjsLib;
|
||||||
declare var Popper;
|
declare var Popper;
|
||||||
|
@ -6750,7 +6750,6 @@
|
|||||||
<script src="lib/showdown-patch.js"></script>
|
<script src="lib/showdown-patch.js"></script>
|
||||||
<script src="lib/showdown-katex.min.js"></script>
|
<script src="lib/showdown-katex.min.js"></script>
|
||||||
<script src="lib/popper.js"></script>
|
<script src="lib/popper.js"></script>
|
||||||
<script src="lib/highlight.min.js"></script>
|
|
||||||
<script src="lib/moment-with-locales.min.js"></script>
|
<script src="lib/moment-with-locales.min.js"></script>
|
||||||
<script src="lib/cropper.min.js"></script>
|
<script src="lib/cropper.min.js"></script>
|
||||||
<script src="lib/jquery-cropper.min.js"></script>
|
<script src="lib/jquery-cropper.min.js"></script>
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
import Fuse from 'fuse.js';
|
import Fuse from 'fuse.js';
|
||||||
import DOMPurify from 'dompurify';
|
import DOMPurify from 'dompurify';
|
||||||
|
import hljs from 'highlight.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expose the libraries to the 'window' object.
|
* Expose the libraries to the 'window' object.
|
||||||
@ -22,14 +23,20 @@ export function initLibraryShims() {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window.DOMPurify = DOMPurify;
|
window.DOMPurify = DOMPurify;
|
||||||
}
|
}
|
||||||
|
if (!('hljs' in window)) {
|
||||||
|
// @ts-ignore
|
||||||
|
window.hljs = hljs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Fuse,
|
Fuse,
|
||||||
DOMPurify,
|
DOMPurify,
|
||||||
|
hljs,
|
||||||
};
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Fuse,
|
Fuse,
|
||||||
DOMPurify,
|
DOMPurify,
|
||||||
|
hljs,
|
||||||
};
|
};
|
||||||
|
1361
public/lib/highlight.min.js
vendored
1361
public/lib/highlight.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,10 @@
|
|||||||
import { Fuse, DOMPurify, initLibraryShims, default as libs } from './lib.js';
|
import {
|
||||||
|
Fuse,
|
||||||
|
DOMPurify,
|
||||||
|
hljs,
|
||||||
|
initLibraryShims,
|
||||||
|
default as libs,
|
||||||
|
} from './lib.js';
|
||||||
|
|
||||||
import { humanizedDateTime, favsToHotswap, getMessageTimeStamp, dragElement, isMobile, initRossMods, shouldSendOnEnter, addSafariPatch } from './scripts/RossAscends-mods.js';
|
import { humanizedDateTime, favsToHotswap, getMessageTimeStamp, dragElement, isMobile, initRossMods, shouldSendOnEnter, addSafariPatch } from './scripts/RossAscends-mods.js';
|
||||||
import { userStatsHandler, statMesProcess, initStats } from './scripts/stats.js';
|
import { userStatsHandler, statMesProcess, initStats } from './scripts/stats.js';
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { hljs } from '../../../../lib.js';
|
||||||
import { POPUP_RESULT, POPUP_TYPE, Popup } from '../../../popup.js';
|
import { POPUP_RESULT, POPUP_TYPE, Popup } from '../../../popup.js';
|
||||||
import { setSlashCommandAutoComplete } from '../../../slash-commands.js';
|
import { setSlashCommandAutoComplete } from '../../../slash-commands.js';
|
||||||
import { SlashCommandAbortController } from '../../../slash-commands/SlashCommandAbortController.js';
|
import { SlashCommandAbortController } from '../../../slash-commands/SlashCommandAbortController.js';
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { hljs } from '../../lib.js';
|
||||||
import { SlashCommandAbortController } from './SlashCommandAbortController.js';
|
import { SlashCommandAbortController } from './SlashCommandAbortController.js';
|
||||||
import { SlashCommandArgument, SlashCommandNamedArgument } from './SlashCommandArgument.js';
|
import { SlashCommandArgument, SlashCommandNamedArgument } from './SlashCommandArgument.js';
|
||||||
import { SlashCommandClosure } from './SlashCommandClosure.js';
|
import { SlashCommandClosure } from './SlashCommandClosure.js';
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { hljs } from '../../lib.js';
|
||||||
import { power_user } from '../power-user.js';
|
import { power_user } from '../power-user.js';
|
||||||
import { isTrueBoolean, uuidv4 } from '../utils.js';
|
import { isTrueBoolean, uuidv4 } from '../utils.js';
|
||||||
import { SlashCommand } from './SlashCommand.js';
|
import { SlashCommand } from './SlashCommand.js';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user