react-source-spotlight 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +375 -0
- package/bin/cli.js +28 -0
- package/dist/Spotlight.d.ts +8 -0
- package/dist/Spotlight.d.ts.map +1 -0
- package/dist/SpotlightProvider.d.ts +12 -0
- package/dist/SpotlightProvider.d.ts.map +1 -0
- package/dist/__tests__/setup.d.ts +2 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/cli/Spotlight.d.ts +8 -0
- package/dist/cli/Spotlight.d.ts.map +1 -0
- package/dist/cli/SpotlightProvider.d.ts +12 -0
- package/dist/cli/SpotlightProvider.d.ts.map +1 -0
- package/dist/cli/__tests__/setup.d.ts +2 -0
- package/dist/cli/__tests__/setup.d.ts.map +1 -0
- package/dist/cli/cli/config.d.ts +3 -0
- package/dist/cli/cli/config.d.ts.map +1 -0
- package/dist/cli/cli/generator.d.ts +8 -0
- package/dist/cli/cli/generator.d.ts.map +1 -0
- package/dist/cli/components/CodeModal.d.ts +10 -0
- package/dist/cli/components/CodeModal.d.ts.map +1 -0
- package/dist/cli/components/DevModeToggle.d.ts +7 -0
- package/dist/cli/components/DevModeToggle.d.ts.map +1 -0
- package/dist/cli/config.d.ts +3 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/generator.d.ts +8 -0
- package/dist/cli/generator.d.ts.map +1 -0
- package/dist/cli/generator.js +128 -0
- package/dist/cli/generator.js.map +1 -0
- package/dist/cli/hooks/useSourceSpotlight.d.ts +11 -0
- package/dist/cli/hooks/useSourceSpotlight.d.ts.map +1 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/types.d.ts +45 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/components/CodeModal.d.ts +10 -0
- package/dist/components/CodeModal.d.ts.map +1 -0
- package/dist/components/DevModeToggle.d.ts +7 -0
- package/dist/components/DevModeToggle.d.ts.map +1 -0
- package/dist/hooks/useSourceSpotlight.d.ts +11 -0
- package/dist/hooks/useSourceSpotlight.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +3295 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +3300 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +45 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +73 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3300 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
const SpotlightContext = React.createContext(null);
|
|
6
|
+
function SpotlightProvider({ children, mapUrl = '/spotlight-map.json', repoUrl, theme = 'dark', }) {
|
|
7
|
+
const [isDevMode, setIsDevMode] = React.useState(false);
|
|
8
|
+
const [sourceMap, setSourceMap] = React.useState({});
|
|
9
|
+
// Load source map on mount
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
fetch(mapUrl)
|
|
12
|
+
.then(res => {
|
|
13
|
+
if (!res.ok) {
|
|
14
|
+
throw new Error(`Failed to load source map: ${res.statusText}`);
|
|
15
|
+
}
|
|
16
|
+
return res.json();
|
|
17
|
+
})
|
|
18
|
+
.then(data => {
|
|
19
|
+
setSourceMap(data);
|
|
20
|
+
console.log(`[Spotlight] Loaded ${Object.keys(data).length} component sources`);
|
|
21
|
+
})
|
|
22
|
+
.catch(err => {
|
|
23
|
+
console.warn('[Spotlight] Source map not found:', err.message);
|
|
24
|
+
console.warn('[Spotlight] Make sure to run "spotlight generate" before building');
|
|
25
|
+
});
|
|
26
|
+
}, [mapUrl]);
|
|
27
|
+
// Keyboard shortcut (Ctrl+Shift+D)
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
const handler = (e) => {
|
|
30
|
+
if (e.ctrlKey && e.shiftKey && e.key === 'D') {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
setIsDevMode(prev => {
|
|
33
|
+
console.log(`[Spotlight] Dev mode ${!prev ? 'ON' : 'OFF'}`);
|
|
34
|
+
return !prev;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
window.addEventListener('keydown', handler);
|
|
39
|
+
return () => window.removeEventListener('keydown', handler);
|
|
40
|
+
}, []);
|
|
41
|
+
const contextValue = {
|
|
42
|
+
isDevMode,
|
|
43
|
+
setIsDevMode,
|
|
44
|
+
sourceMap,
|
|
45
|
+
repoUrl,
|
|
46
|
+
theme,
|
|
47
|
+
};
|
|
48
|
+
return (React.createElement(SpotlightContext.Provider, { value: contextValue }, children));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
52
|
+
|
|
53
|
+
var __create = Object.create;
|
|
54
|
+
var __defProp = Object.defineProperty;
|
|
55
|
+
var __defProps = Object.defineProperties;
|
|
56
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
57
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
58
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
59
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
60
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
61
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
62
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
63
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
64
|
+
var __spreadValues = (a, b) => {
|
|
65
|
+
for (var prop in b || (b = {}))
|
|
66
|
+
if (__hasOwnProp.call(b, prop))
|
|
67
|
+
__defNormalProp(a, prop, b[prop]);
|
|
68
|
+
if (__getOwnPropSymbols)
|
|
69
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
70
|
+
if (__propIsEnum.call(b, prop))
|
|
71
|
+
__defNormalProp(a, prop, b[prop]);
|
|
72
|
+
}
|
|
73
|
+
return a;
|
|
74
|
+
};
|
|
75
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
76
|
+
var __objRest = (source, exclude) => {
|
|
77
|
+
var target = {};
|
|
78
|
+
for (var prop in source)
|
|
79
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
80
|
+
target[prop] = source[prop];
|
|
81
|
+
if (source != null && __getOwnPropSymbols)
|
|
82
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
83
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
84
|
+
target[prop] = source[prop];
|
|
85
|
+
}
|
|
86
|
+
return target;
|
|
87
|
+
};
|
|
88
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
89
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
90
|
+
};
|
|
91
|
+
var __export = (target, all) => {
|
|
92
|
+
for (var name in all)
|
|
93
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
94
|
+
};
|
|
95
|
+
var __copyProps = (to, from, except, desc) => {
|
|
96
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
97
|
+
for (let key of __getOwnPropNames(from))
|
|
98
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
99
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
100
|
+
}
|
|
101
|
+
return to;
|
|
102
|
+
};
|
|
103
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
104
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
105
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
106
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
107
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
108
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
109
|
+
mod
|
|
110
|
+
));
|
|
111
|
+
|
|
112
|
+
// ../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js
|
|
113
|
+
var require_prism = __commonJS({
|
|
114
|
+
"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(exports$1, module) {
|
|
115
|
+
var Prism2 = function() {
|
|
116
|
+
var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
|
|
117
|
+
var uniqueId = 0;
|
|
118
|
+
var plainTextGrammar = {};
|
|
119
|
+
var _ = {
|
|
120
|
+
/**
|
|
121
|
+
* A namespace for utility methods.
|
|
122
|
+
*
|
|
123
|
+
* All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
|
|
124
|
+
* change or disappear at any time.
|
|
125
|
+
*
|
|
126
|
+
* @namespace
|
|
127
|
+
* @memberof Prism
|
|
128
|
+
*/
|
|
129
|
+
util: {
|
|
130
|
+
encode: function encode(tokens) {
|
|
131
|
+
if (tokens instanceof Token) {
|
|
132
|
+
return new Token(tokens.type, encode(tokens.content), tokens.alias);
|
|
133
|
+
} else if (Array.isArray(tokens)) {
|
|
134
|
+
return tokens.map(encode);
|
|
135
|
+
} else {
|
|
136
|
+
return tokens.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
/**
|
|
140
|
+
* Returns the name of the type of the given value.
|
|
141
|
+
*
|
|
142
|
+
* @param {any} o
|
|
143
|
+
* @returns {string}
|
|
144
|
+
* @example
|
|
145
|
+
* type(null) === 'Null'
|
|
146
|
+
* type(undefined) === 'Undefined'
|
|
147
|
+
* type(123) === 'Number'
|
|
148
|
+
* type('foo') === 'String'
|
|
149
|
+
* type(true) === 'Boolean'
|
|
150
|
+
* type([1, 2]) === 'Array'
|
|
151
|
+
* type({}) === 'Object'
|
|
152
|
+
* type(String) === 'Function'
|
|
153
|
+
* type(/abc+/) === 'RegExp'
|
|
154
|
+
*/
|
|
155
|
+
type: function(o) {
|
|
156
|
+
return Object.prototype.toString.call(o).slice(8, -1);
|
|
157
|
+
},
|
|
158
|
+
/**
|
|
159
|
+
* Returns a unique number for the given object. Later calls will still return the same number.
|
|
160
|
+
*
|
|
161
|
+
* @param {Object} obj
|
|
162
|
+
* @returns {number}
|
|
163
|
+
*/
|
|
164
|
+
objId: function(obj) {
|
|
165
|
+
if (!obj["__id"]) {
|
|
166
|
+
Object.defineProperty(obj, "__id", { value: ++uniqueId });
|
|
167
|
+
}
|
|
168
|
+
return obj["__id"];
|
|
169
|
+
},
|
|
170
|
+
/**
|
|
171
|
+
* Creates a deep clone of the given object.
|
|
172
|
+
*
|
|
173
|
+
* The main intended use of this function is to clone language definitions.
|
|
174
|
+
*
|
|
175
|
+
* @param {T} o
|
|
176
|
+
* @param {Record<number, any>} [visited]
|
|
177
|
+
* @returns {T}
|
|
178
|
+
* @template T
|
|
179
|
+
*/
|
|
180
|
+
clone: function deepClone(o, visited) {
|
|
181
|
+
visited = visited || {};
|
|
182
|
+
var clone;
|
|
183
|
+
var id;
|
|
184
|
+
switch (_.util.type(o)) {
|
|
185
|
+
case "Object":
|
|
186
|
+
id = _.util.objId(o);
|
|
187
|
+
if (visited[id]) {
|
|
188
|
+
return visited[id];
|
|
189
|
+
}
|
|
190
|
+
clone = /** @type {Record<string, any>} */
|
|
191
|
+
{};
|
|
192
|
+
visited[id] = clone;
|
|
193
|
+
for (var key in o) {
|
|
194
|
+
if (o.hasOwnProperty(key)) {
|
|
195
|
+
clone[key] = deepClone(o[key], visited);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return (
|
|
199
|
+
/** @type {any} */
|
|
200
|
+
clone
|
|
201
|
+
);
|
|
202
|
+
case "Array":
|
|
203
|
+
id = _.util.objId(o);
|
|
204
|
+
if (visited[id]) {
|
|
205
|
+
return visited[id];
|
|
206
|
+
}
|
|
207
|
+
clone = [];
|
|
208
|
+
visited[id] = clone;
|
|
209
|
+
/** @type {Array} */
|
|
210
|
+
/** @type {any} */
|
|
211
|
+
o.forEach(function(v, i) {
|
|
212
|
+
clone[i] = deepClone(v, visited);
|
|
213
|
+
});
|
|
214
|
+
return (
|
|
215
|
+
/** @type {any} */
|
|
216
|
+
clone
|
|
217
|
+
);
|
|
218
|
+
default:
|
|
219
|
+
return o;
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
/**
|
|
223
|
+
* Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
|
|
224
|
+
*
|
|
225
|
+
* If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
|
|
226
|
+
*
|
|
227
|
+
* @param {Element} element
|
|
228
|
+
* @returns {string}
|
|
229
|
+
*/
|
|
230
|
+
getLanguage: function(element) {
|
|
231
|
+
while (element) {
|
|
232
|
+
var m = lang.exec(element.className);
|
|
233
|
+
if (m) {
|
|
234
|
+
return m[1].toLowerCase();
|
|
235
|
+
}
|
|
236
|
+
element = element.parentElement;
|
|
237
|
+
}
|
|
238
|
+
return "none";
|
|
239
|
+
},
|
|
240
|
+
/**
|
|
241
|
+
* Sets the Prism `language-xxxx` class of the given element.
|
|
242
|
+
*
|
|
243
|
+
* @param {Element} element
|
|
244
|
+
* @param {string} language
|
|
245
|
+
* @returns {void}
|
|
246
|
+
*/
|
|
247
|
+
setLanguage: function(element, language) {
|
|
248
|
+
element.className = element.className.replace(RegExp(lang, "gi"), "");
|
|
249
|
+
element.classList.add("language-" + language);
|
|
250
|
+
},
|
|
251
|
+
/**
|
|
252
|
+
* Returns whether a given class is active for `element`.
|
|
253
|
+
*
|
|
254
|
+
* The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
|
|
255
|
+
* if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
|
|
256
|
+
* given class is just the given class with a `no-` prefix.
|
|
257
|
+
*
|
|
258
|
+
* Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
|
|
259
|
+
* closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
|
|
260
|
+
* ancestors have the given class or the negated version of it, then the default activation will be returned.
|
|
261
|
+
*
|
|
262
|
+
* In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
|
|
263
|
+
* version of it, the class is considered active.
|
|
264
|
+
*
|
|
265
|
+
* @param {Element} element
|
|
266
|
+
* @param {string} className
|
|
267
|
+
* @param {boolean} [defaultActivation=false]
|
|
268
|
+
* @returns {boolean}
|
|
269
|
+
*/
|
|
270
|
+
isActive: function(element, className, defaultActivation) {
|
|
271
|
+
var no = "no-" + className;
|
|
272
|
+
while (element) {
|
|
273
|
+
var classList = element.classList;
|
|
274
|
+
if (classList.contains(className)) {
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
if (classList.contains(no)) {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
element = element.parentElement;
|
|
281
|
+
}
|
|
282
|
+
return !!defaultActivation;
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
/**
|
|
286
|
+
* This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
|
|
287
|
+
*
|
|
288
|
+
* @namespace
|
|
289
|
+
* @memberof Prism
|
|
290
|
+
* @public
|
|
291
|
+
*/
|
|
292
|
+
languages: {
|
|
293
|
+
/**
|
|
294
|
+
* The grammar for plain, unformatted text.
|
|
295
|
+
*/
|
|
296
|
+
plain: plainTextGrammar,
|
|
297
|
+
plaintext: plainTextGrammar,
|
|
298
|
+
text: plainTextGrammar,
|
|
299
|
+
txt: plainTextGrammar,
|
|
300
|
+
/**
|
|
301
|
+
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
302
|
+
*
|
|
303
|
+
* If a token in `redef` also appears in the copied language, then the existing token in the copied language
|
|
304
|
+
* will be overwritten at its original position.
|
|
305
|
+
*
|
|
306
|
+
* ## Best practices
|
|
307
|
+
*
|
|
308
|
+
* Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
|
|
309
|
+
* doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
|
|
310
|
+
* understand the language definition because, normally, the order of tokens matters in Prism grammars.
|
|
311
|
+
*
|
|
312
|
+
* Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
|
|
313
|
+
* Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
|
|
314
|
+
*
|
|
315
|
+
* @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
|
|
316
|
+
* @param {Grammar} redef The new tokens to append.
|
|
317
|
+
* @returns {Grammar} The new language created.
|
|
318
|
+
* @public
|
|
319
|
+
* @example
|
|
320
|
+
* Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
|
|
321
|
+
* // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
|
|
322
|
+
* // at its original position
|
|
323
|
+
* 'comment': { ... },
|
|
324
|
+
* // CSS doesn't have a 'color' token, so this token will be appended
|
|
325
|
+
* 'color': /\b(?:red|green|blue)\b/
|
|
326
|
+
* });
|
|
327
|
+
*/
|
|
328
|
+
extend: function(id, redef) {
|
|
329
|
+
var lang2 = _.util.clone(_.languages[id]);
|
|
330
|
+
for (var key in redef) {
|
|
331
|
+
lang2[key] = redef[key];
|
|
332
|
+
}
|
|
333
|
+
return lang2;
|
|
334
|
+
},
|
|
335
|
+
/**
|
|
336
|
+
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
|
337
|
+
*
|
|
338
|
+
* ## Usage
|
|
339
|
+
*
|
|
340
|
+
* This helper method makes it easy to modify existing languages. For example, the CSS language definition
|
|
341
|
+
* not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
|
|
342
|
+
* in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
|
|
343
|
+
* appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
|
|
344
|
+
* this:
|
|
345
|
+
*
|
|
346
|
+
* ```js
|
|
347
|
+
* Prism.languages.markup.style = {
|
|
348
|
+
* // token
|
|
349
|
+
* };
|
|
350
|
+
* ```
|
|
351
|
+
*
|
|
352
|
+
* then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
|
|
353
|
+
* before existing tokens. For the CSS example above, you would use it like this:
|
|
354
|
+
*
|
|
355
|
+
* ```js
|
|
356
|
+
* Prism.languages.insertBefore('markup', 'cdata', {
|
|
357
|
+
* 'style': {
|
|
358
|
+
* // token
|
|
359
|
+
* }
|
|
360
|
+
* });
|
|
361
|
+
* ```
|
|
362
|
+
*
|
|
363
|
+
* ## Special cases
|
|
364
|
+
*
|
|
365
|
+
* If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
|
|
366
|
+
* will be ignored.
|
|
367
|
+
*
|
|
368
|
+
* This behavior can be used to insert tokens after `before`:
|
|
369
|
+
*
|
|
370
|
+
* ```js
|
|
371
|
+
* Prism.languages.insertBefore('markup', 'comment', {
|
|
372
|
+
* 'comment': Prism.languages.markup.comment,
|
|
373
|
+
* // tokens after 'comment'
|
|
374
|
+
* });
|
|
375
|
+
* ```
|
|
376
|
+
*
|
|
377
|
+
* ## Limitations
|
|
378
|
+
*
|
|
379
|
+
* The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
|
|
380
|
+
* properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
|
|
381
|
+
* differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
|
|
382
|
+
* deleting properties which is necessary to insert at arbitrary positions.
|
|
383
|
+
*
|
|
384
|
+
* To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
|
|
385
|
+
* Instead, it will create a new object and replace all references to the target object with the new one. This
|
|
386
|
+
* can be done without temporarily deleting properties, so the iteration order is well-defined.
|
|
387
|
+
*
|
|
388
|
+
* However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
|
|
389
|
+
* you hold the target object in a variable, then the value of the variable will not change.
|
|
390
|
+
*
|
|
391
|
+
* ```js
|
|
392
|
+
* var oldMarkup = Prism.languages.markup;
|
|
393
|
+
* var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
|
|
394
|
+
*
|
|
395
|
+
* assert(oldMarkup !== Prism.languages.markup);
|
|
396
|
+
* assert(newMarkup === Prism.languages.markup);
|
|
397
|
+
* ```
|
|
398
|
+
*
|
|
399
|
+
* @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
|
|
400
|
+
* object to be modified.
|
|
401
|
+
* @param {string} before The key to insert before.
|
|
402
|
+
* @param {Grammar} insert An object containing the key-value pairs to be inserted.
|
|
403
|
+
* @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
|
|
404
|
+
* object to be modified.
|
|
405
|
+
*
|
|
406
|
+
* Defaults to `Prism.languages`.
|
|
407
|
+
* @returns {Grammar} The new grammar object.
|
|
408
|
+
* @public
|
|
409
|
+
*/
|
|
410
|
+
insertBefore: function(inside, before, insert, root) {
|
|
411
|
+
root = root || /** @type {any} */
|
|
412
|
+
_.languages;
|
|
413
|
+
var grammar = root[inside];
|
|
414
|
+
var ret = {};
|
|
415
|
+
for (var token in grammar) {
|
|
416
|
+
if (grammar.hasOwnProperty(token)) {
|
|
417
|
+
if (token == before) {
|
|
418
|
+
for (var newToken in insert) {
|
|
419
|
+
if (insert.hasOwnProperty(newToken)) {
|
|
420
|
+
ret[newToken] = insert[newToken];
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
if (!insert.hasOwnProperty(token)) {
|
|
425
|
+
ret[token] = grammar[token];
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
var old = root[inside];
|
|
430
|
+
root[inside] = ret;
|
|
431
|
+
_.languages.DFS(_.languages, function(key, value) {
|
|
432
|
+
if (value === old && key != inside) {
|
|
433
|
+
this[key] = ret;
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
return ret;
|
|
437
|
+
},
|
|
438
|
+
// Traverse a language definition with Depth First Search
|
|
439
|
+
DFS: function DFS(o, callback, type, visited) {
|
|
440
|
+
visited = visited || {};
|
|
441
|
+
var objId = _.util.objId;
|
|
442
|
+
for (var i in o) {
|
|
443
|
+
if (o.hasOwnProperty(i)) {
|
|
444
|
+
callback.call(o, i, o[i], type || i);
|
|
445
|
+
var property = o[i];
|
|
446
|
+
var propertyType = _.util.type(property);
|
|
447
|
+
if (propertyType === "Object" && !visited[objId(property)]) {
|
|
448
|
+
visited[objId(property)] = true;
|
|
449
|
+
DFS(property, callback, null, visited);
|
|
450
|
+
} else if (propertyType === "Array" && !visited[objId(property)]) {
|
|
451
|
+
visited[objId(property)] = true;
|
|
452
|
+
DFS(property, callback, i, visited);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
plugins: {},
|
|
459
|
+
/**
|
|
460
|
+
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
461
|
+
* and the language definitions to use, and returns a string with the HTML produced.
|
|
462
|
+
*
|
|
463
|
+
* The following hooks will be run:
|
|
464
|
+
* 1. `before-tokenize`
|
|
465
|
+
* 2. `after-tokenize`
|
|
466
|
+
* 3. `wrap`: On each {@link Token}.
|
|
467
|
+
*
|
|
468
|
+
* @param {string} text A string with the code to be highlighted.
|
|
469
|
+
* @param {Grammar} grammar An object containing the tokens to use.
|
|
470
|
+
*
|
|
471
|
+
* Usually a language definition like `Prism.languages.markup`.
|
|
472
|
+
* @param {string} language The name of the language definition passed to `grammar`.
|
|
473
|
+
* @returns {string} The highlighted HTML.
|
|
474
|
+
* @memberof Prism
|
|
475
|
+
* @public
|
|
476
|
+
* @example
|
|
477
|
+
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
478
|
+
*/
|
|
479
|
+
highlight: function(text, grammar, language) {
|
|
480
|
+
var env = {
|
|
481
|
+
code: text,
|
|
482
|
+
grammar,
|
|
483
|
+
language
|
|
484
|
+
};
|
|
485
|
+
_.hooks.run("before-tokenize", env);
|
|
486
|
+
if (!env.grammar) {
|
|
487
|
+
throw new Error('The language "' + env.language + '" has no grammar.');
|
|
488
|
+
}
|
|
489
|
+
env.tokens = _.tokenize(env.code, env.grammar);
|
|
490
|
+
_.hooks.run("after-tokenize", env);
|
|
491
|
+
return Token.stringify(_.util.encode(env.tokens), env.language);
|
|
492
|
+
},
|
|
493
|
+
/**
|
|
494
|
+
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
495
|
+
* and the language definitions to use, and returns an array with the tokenized code.
|
|
496
|
+
*
|
|
497
|
+
* When the language definition includes nested tokens, the function is called recursively on each of these tokens.
|
|
498
|
+
*
|
|
499
|
+
* This method could be useful in other contexts as well, as a very crude parser.
|
|
500
|
+
*
|
|
501
|
+
* @param {string} text A string with the code to be highlighted.
|
|
502
|
+
* @param {Grammar} grammar An object containing the tokens to use.
|
|
503
|
+
*
|
|
504
|
+
* Usually a language definition like `Prism.languages.markup`.
|
|
505
|
+
* @returns {TokenStream} An array of strings and tokens, a token stream.
|
|
506
|
+
* @memberof Prism
|
|
507
|
+
* @public
|
|
508
|
+
* @example
|
|
509
|
+
* let code = `var foo = 0;`;
|
|
510
|
+
* let tokens = Prism.tokenize(code, Prism.languages.javascript);
|
|
511
|
+
* tokens.forEach(token => {
|
|
512
|
+
* if (token instanceof Prism.Token && token.type === 'number') {
|
|
513
|
+
* console.log(`Found numeric literal: ${token.content}`);
|
|
514
|
+
* }
|
|
515
|
+
* });
|
|
516
|
+
*/
|
|
517
|
+
tokenize: function(text, grammar) {
|
|
518
|
+
var rest = grammar.rest;
|
|
519
|
+
if (rest) {
|
|
520
|
+
for (var token in rest) {
|
|
521
|
+
grammar[token] = rest[token];
|
|
522
|
+
}
|
|
523
|
+
delete grammar.rest;
|
|
524
|
+
}
|
|
525
|
+
var tokenList = new LinkedList();
|
|
526
|
+
addAfter(tokenList, tokenList.head, text);
|
|
527
|
+
matchGrammar(text, tokenList, grammar, tokenList.head, 0);
|
|
528
|
+
return toArray(tokenList);
|
|
529
|
+
},
|
|
530
|
+
/**
|
|
531
|
+
* @namespace
|
|
532
|
+
* @memberof Prism
|
|
533
|
+
* @public
|
|
534
|
+
*/
|
|
535
|
+
hooks: {
|
|
536
|
+
all: {},
|
|
537
|
+
/**
|
|
538
|
+
* Adds the given callback to the list of callbacks for the given hook.
|
|
539
|
+
*
|
|
540
|
+
* The callback will be invoked when the hook it is registered for is run.
|
|
541
|
+
* Hooks are usually directly run by a highlight function but you can also run hooks yourself.
|
|
542
|
+
*
|
|
543
|
+
* One callback function can be registered to multiple hooks and the same hook multiple times.
|
|
544
|
+
*
|
|
545
|
+
* @param {string} name The name of the hook.
|
|
546
|
+
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
547
|
+
* @public
|
|
548
|
+
*/
|
|
549
|
+
add: function(name, callback) {
|
|
550
|
+
var hooks2 = _.hooks.all;
|
|
551
|
+
hooks2[name] = hooks2[name] || [];
|
|
552
|
+
hooks2[name].push(callback);
|
|
553
|
+
},
|
|
554
|
+
/**
|
|
555
|
+
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
556
|
+
*
|
|
557
|
+
* Callbacks will be invoked synchronously and in the order in which they were registered.
|
|
558
|
+
*
|
|
559
|
+
* @param {string} name The name of the hook.
|
|
560
|
+
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
561
|
+
* @public
|
|
562
|
+
*/
|
|
563
|
+
run: function(name, env) {
|
|
564
|
+
var callbacks = _.hooks.all[name];
|
|
565
|
+
if (!callbacks || !callbacks.length) {
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
for (var i = 0, callback; callback = callbacks[i++]; ) {
|
|
569
|
+
callback(env);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
Token
|
|
574
|
+
};
|
|
575
|
+
function Token(type, content, alias, matchedStr) {
|
|
576
|
+
this.type = type;
|
|
577
|
+
this.content = content;
|
|
578
|
+
this.alias = alias;
|
|
579
|
+
this.length = (matchedStr || "").length | 0;
|
|
580
|
+
}
|
|
581
|
+
Token.stringify = function stringify(o, language) {
|
|
582
|
+
if (typeof o == "string") {
|
|
583
|
+
return o;
|
|
584
|
+
}
|
|
585
|
+
if (Array.isArray(o)) {
|
|
586
|
+
var s = "";
|
|
587
|
+
o.forEach(function(e) {
|
|
588
|
+
s += stringify(e, language);
|
|
589
|
+
});
|
|
590
|
+
return s;
|
|
591
|
+
}
|
|
592
|
+
var env = {
|
|
593
|
+
type: o.type,
|
|
594
|
+
content: stringify(o.content, language),
|
|
595
|
+
tag: "span",
|
|
596
|
+
classes: ["token", o.type],
|
|
597
|
+
attributes: {},
|
|
598
|
+
language
|
|
599
|
+
};
|
|
600
|
+
var aliases = o.alias;
|
|
601
|
+
if (aliases) {
|
|
602
|
+
if (Array.isArray(aliases)) {
|
|
603
|
+
Array.prototype.push.apply(env.classes, aliases);
|
|
604
|
+
} else {
|
|
605
|
+
env.classes.push(aliases);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
_.hooks.run("wrap", env);
|
|
609
|
+
var attributes = "";
|
|
610
|
+
for (var name in env.attributes) {
|
|
611
|
+
attributes += " " + name + '="' + (env.attributes[name] || "").replace(/"/g, """) + '"';
|
|
612
|
+
}
|
|
613
|
+
return "<" + env.tag + ' class="' + env.classes.join(" ") + '"' + attributes + ">" + env.content + "</" + env.tag + ">";
|
|
614
|
+
};
|
|
615
|
+
function matchPattern(pattern, pos, text, lookbehind) {
|
|
616
|
+
pattern.lastIndex = pos;
|
|
617
|
+
var match = pattern.exec(text);
|
|
618
|
+
if (match && lookbehind && match[1]) {
|
|
619
|
+
var lookbehindLength = match[1].length;
|
|
620
|
+
match.index += lookbehindLength;
|
|
621
|
+
match[0] = match[0].slice(lookbehindLength);
|
|
622
|
+
}
|
|
623
|
+
return match;
|
|
624
|
+
}
|
|
625
|
+
function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
|
|
626
|
+
for (var token in grammar) {
|
|
627
|
+
if (!grammar.hasOwnProperty(token) || !grammar[token]) {
|
|
628
|
+
continue;
|
|
629
|
+
}
|
|
630
|
+
var patterns = grammar[token];
|
|
631
|
+
patterns = Array.isArray(patterns) ? patterns : [patterns];
|
|
632
|
+
for (var j = 0; j < patterns.length; ++j) {
|
|
633
|
+
if (rematch && rematch.cause == token + "," + j) {
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
var patternObj = patterns[j];
|
|
637
|
+
var inside = patternObj.inside;
|
|
638
|
+
var lookbehind = !!patternObj.lookbehind;
|
|
639
|
+
var greedy = !!patternObj.greedy;
|
|
640
|
+
var alias = patternObj.alias;
|
|
641
|
+
if (greedy && !patternObj.pattern.global) {
|
|
642
|
+
var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
|
|
643
|
+
patternObj.pattern = RegExp(patternObj.pattern.source, flags + "g");
|
|
644
|
+
}
|
|
645
|
+
var pattern = patternObj.pattern || patternObj;
|
|
646
|
+
for (var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) {
|
|
647
|
+
if (rematch && pos >= rematch.reach) {
|
|
648
|
+
break;
|
|
649
|
+
}
|
|
650
|
+
var str = currentNode.value;
|
|
651
|
+
if (tokenList.length > text.length) {
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
if (str instanceof Token) {
|
|
655
|
+
continue;
|
|
656
|
+
}
|
|
657
|
+
var removeCount = 1;
|
|
658
|
+
var match;
|
|
659
|
+
if (greedy) {
|
|
660
|
+
match = matchPattern(pattern, pos, text, lookbehind);
|
|
661
|
+
if (!match || match.index >= text.length) {
|
|
662
|
+
break;
|
|
663
|
+
}
|
|
664
|
+
var from = match.index;
|
|
665
|
+
var to = match.index + match[0].length;
|
|
666
|
+
var p = pos;
|
|
667
|
+
p += currentNode.value.length;
|
|
668
|
+
while (from >= p) {
|
|
669
|
+
currentNode = currentNode.next;
|
|
670
|
+
p += currentNode.value.length;
|
|
671
|
+
}
|
|
672
|
+
p -= currentNode.value.length;
|
|
673
|
+
pos = p;
|
|
674
|
+
if (currentNode.value instanceof Token) {
|
|
675
|
+
continue;
|
|
676
|
+
}
|
|
677
|
+
for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === "string"); k = k.next) {
|
|
678
|
+
removeCount++;
|
|
679
|
+
p += k.value.length;
|
|
680
|
+
}
|
|
681
|
+
removeCount--;
|
|
682
|
+
str = text.slice(pos, p);
|
|
683
|
+
match.index -= pos;
|
|
684
|
+
} else {
|
|
685
|
+
match = matchPattern(pattern, 0, str, lookbehind);
|
|
686
|
+
if (!match) {
|
|
687
|
+
continue;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
var from = match.index;
|
|
691
|
+
var matchStr = match[0];
|
|
692
|
+
var before = str.slice(0, from);
|
|
693
|
+
var after = str.slice(from + matchStr.length);
|
|
694
|
+
var reach = pos + str.length;
|
|
695
|
+
if (rematch && reach > rematch.reach) {
|
|
696
|
+
rematch.reach = reach;
|
|
697
|
+
}
|
|
698
|
+
var removeFrom = currentNode.prev;
|
|
699
|
+
if (before) {
|
|
700
|
+
removeFrom = addAfter(tokenList, removeFrom, before);
|
|
701
|
+
pos += before.length;
|
|
702
|
+
}
|
|
703
|
+
removeRange(tokenList, removeFrom, removeCount);
|
|
704
|
+
var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
|
|
705
|
+
currentNode = addAfter(tokenList, removeFrom, wrapped);
|
|
706
|
+
if (after) {
|
|
707
|
+
addAfter(tokenList, currentNode, after);
|
|
708
|
+
}
|
|
709
|
+
if (removeCount > 1) {
|
|
710
|
+
var nestedRematch = {
|
|
711
|
+
cause: token + "," + j,
|
|
712
|
+
reach
|
|
713
|
+
};
|
|
714
|
+
matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
|
|
715
|
+
if (rematch && nestedRematch.reach > rematch.reach) {
|
|
716
|
+
rematch.reach = nestedRematch.reach;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
function LinkedList() {
|
|
724
|
+
var head = { value: null, prev: null, next: null };
|
|
725
|
+
var tail = { value: null, prev: head, next: null };
|
|
726
|
+
head.next = tail;
|
|
727
|
+
this.head = head;
|
|
728
|
+
this.tail = tail;
|
|
729
|
+
this.length = 0;
|
|
730
|
+
}
|
|
731
|
+
function addAfter(list, node, value) {
|
|
732
|
+
var next = node.next;
|
|
733
|
+
var newNode = { value, prev: node, next };
|
|
734
|
+
node.next = newNode;
|
|
735
|
+
next.prev = newNode;
|
|
736
|
+
list.length++;
|
|
737
|
+
return newNode;
|
|
738
|
+
}
|
|
739
|
+
function removeRange(list, node, count) {
|
|
740
|
+
var next = node.next;
|
|
741
|
+
for (var i = 0; i < count && next !== list.tail; i++) {
|
|
742
|
+
next = next.next;
|
|
743
|
+
}
|
|
744
|
+
node.next = next;
|
|
745
|
+
next.prev = node;
|
|
746
|
+
list.length -= i;
|
|
747
|
+
}
|
|
748
|
+
function toArray(list) {
|
|
749
|
+
var array = [];
|
|
750
|
+
var node = list.head.next;
|
|
751
|
+
while (node !== list.tail) {
|
|
752
|
+
array.push(node.value);
|
|
753
|
+
node = node.next;
|
|
754
|
+
}
|
|
755
|
+
return array;
|
|
756
|
+
}
|
|
757
|
+
return _;
|
|
758
|
+
}();
|
|
759
|
+
module.exports = Prism2;
|
|
760
|
+
Prism2.default = Prism2;
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
// src/prism-langs.ts
|
|
765
|
+
var Prism = __toESM(require_prism());
|
|
766
|
+
Prism.languages.markup = { comment: { pattern: /<!--(?:(?!<!--)[\s\S])*?-->/, greedy: true }, prolog: { pattern: /<\?[\s\S]+?\?>/, greedy: true }, doctype: { pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i, greedy: true, inside: { "internal-subset": { pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/, lookbehind: true, greedy: true, inside: null }, string: { pattern: /"[^"]*"|'[^']*'/, greedy: true }, punctuation: /^<!|>$|[[\]]/, "doctype-tag": /^DOCTYPE/i, name: /[^\s<>'"]+/ } }, cdata: { pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i, greedy: true }, tag: { pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, greedy: true, inside: { tag: { pattern: /^<\/?[^\s>\/]+/, inside: { punctuation: /^<\/?/, namespace: /^[^\s>\/:]+:/ } }, "special-attr": [], "attr-value": { pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, inside: { punctuation: [{ pattern: /^=/, alias: "attr-equals" }, { pattern: /^(\s*)["']|["']$/, lookbehind: true }] } }, punctuation: /\/?>/, "attr-name": { pattern: /[^\s>\/]+/, inside: { namespace: /^[^\s>\/:]+:/ } } } }, entity: [{ pattern: /&[\da-z]{1,8};/i, alias: "named-entity" }, /&#x?[\da-f]{1,8};/i] }, Prism.languages.markup.tag.inside["attr-value"].inside.entity = Prism.languages.markup.entity, Prism.languages.markup.doctype.inside["internal-subset"].inside = Prism.languages.markup, Prism.hooks.add("wrap", function(e) {
|
|
767
|
+
"entity" === e.type && (e.attributes.title = e.content.replace(/&/, "&"));
|
|
768
|
+
}), Object.defineProperty(Prism.languages.markup.tag, "addInlined", { value: function(e, n) {
|
|
769
|
+
var t = {}, t = (t["language-" + n] = { pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i, lookbehind: true, inside: Prism.languages[n] }, t.cdata = /^<!\[CDATA\[|\]\]>$/i, { "included-cdata": { pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i, inside: t } }), n = (t["language-" + n] = { pattern: /[\s\S]+/, inside: Prism.languages[n] }, {});
|
|
770
|
+
n[e] = { pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
771
|
+
return e;
|
|
772
|
+
}), "i"), lookbehind: true, greedy: true, inside: t }, Prism.languages.insertBefore("markup", "cdata", n);
|
|
773
|
+
} }), Object.defineProperty(Prism.languages.markup.tag, "addAttribute", { value: function(e, n) {
|
|
774
|
+
Prism.languages.markup.tag.inside["special-attr"].push({ pattern: RegExp(/(^|["'\s])/.source + "(?:" + e + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, "i"), lookbehind: true, inside: { "attr-name": /^[^\s=]+/, "attr-value": { pattern: /=[\s\S]+/, inside: { value: { pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/, lookbehind: true, alias: [n, "language-" + n], inside: Prism.languages[n] }, punctuation: [{ pattern: /^=/, alias: "attr-equals" }, /"|'/] } } } });
|
|
775
|
+
} }), Prism.languages.html = Prism.languages.markup, Prism.languages.mathml = Prism.languages.markup, Prism.languages.svg = Prism.languages.markup, Prism.languages.xml = Prism.languages.extend("markup", {}), Prism.languages.ssml = Prism.languages.xml, Prism.languages.atom = Prism.languages.xml, Prism.languages.rss = Prism.languages.xml, function(e) {
|
|
776
|
+
var n = { pattern: /\\[\\(){}[\]^$+*?|.]/, alias: "escape" }, t = /\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/, a = "(?:[^\\\\-]|" + t.source + ")", a = RegExp(a + "-" + a), r = { pattern: /(<|')[^<>']+(?=[>']$)/, lookbehind: true, alias: "variable" };
|
|
777
|
+
e.languages.regex = { "char-class": { pattern: /((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/, lookbehind: true, inside: { "char-class-negation": { pattern: /(^\[)\^/, lookbehind: true, alias: "operator" }, "char-class-punctuation": { pattern: /^\[|\]$/, alias: "punctuation" }, range: { pattern: a, inside: { escape: t, "range-punctuation": { pattern: /-/, alias: "operator" } } }, "special-escape": n, "char-set": { pattern: /\\[wsd]|\\p\{[^{}]+\}/i, alias: "class-name" }, escape: t } }, "special-escape": n, "char-set": { pattern: /\.|\\[wsd]|\\p\{[^{}]+\}/i, alias: "class-name" }, backreference: [{ pattern: /\\(?![123][0-7]{2})[1-9]/, alias: "keyword" }, { pattern: /\\k<[^<>']+>/, alias: "keyword", inside: { "group-name": r } }], anchor: { pattern: /[$^]|\\[ABbGZz]/, alias: "function" }, escape: t, group: [{ pattern: /\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/, alias: "punctuation", inside: { "group-name": r } }, { pattern: /\)/, alias: "punctuation" }], quantifier: { pattern: /(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/, alias: "number" }, alternation: { pattern: /\|/, alias: "keyword" } };
|
|
778
|
+
}(Prism), Prism.languages.clike = { comment: [{ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: true, greedy: true }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: true, greedy: true }], string: { pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: true }, "class-name": { pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i, lookbehind: true, inside: { punctuation: /[.\\]/ } }, keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/, boolean: /\b(?:false|true)\b/, function: /\b\w+(?=\()/, number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, punctuation: /[{}[\];(),.:]/ }, Prism.languages.javascript = Prism.languages.extend("clike", { "class-name": [Prism.languages.clike["class-name"], { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/, lookbehind: true }], keyword: [{ pattern: /((?:^|\})\s*)catch\b/, lookbehind: true }, { pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, lookbehind: true }], function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, number: { pattern: RegExp(/(^|[^\w$])/.source + "(?:" + /NaN|Infinity/.source + "|" + /0[bB][01]+(?:_[01]+)*n?/.source + "|" + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + /\d+(?:_\d+)*n/.source + "|" + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source + ")" + /(?![\w$])/.source), lookbehind: true }, operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ }), Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, Prism.languages.insertBefore("javascript", "keyword", { regex: { pattern: RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source), lookbehind: true, greedy: true, inside: { "regex-source": { pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, lookbehind: true, alias: "language-regex", inside: Prism.languages.regex }, "regex-delimiter": /^\/|\/$/, "regex-flags": /^[a-z]+$/ } }, "function-variable": { pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, alias: "function" }, parameter: [{ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, lookbehind: true, inside: Prism.languages.javascript }, { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, lookbehind: true, inside: Prism.languages.javascript }, { pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, lookbehind: true, inside: Prism.languages.javascript }, { pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/, lookbehind: true, inside: Prism.languages.javascript }], constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/ }), Prism.languages.insertBefore("javascript", "string", { hashbang: { pattern: /^#!.*/, greedy: true, alias: "comment" }, "template-string": { pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, greedy: true, inside: { "template-punctuation": { pattern: /^`|`$/, alias: "string" }, interpolation: { pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, lookbehind: true, inside: { "interpolation-punctuation": { pattern: /^\$\{|\}$/, alias: "punctuation" }, rest: Prism.languages.javascript } }, string: /[\s\S]+/ } }, "string-property": { pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m, lookbehind: true, greedy: true, alias: "property" } }), Prism.languages.insertBefore("javascript", "operator", { "literal-property": { pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, lookbehind: true, alias: "property" } }), Prism.languages.markup && (Prism.languages.markup.tag.addInlined("script", "javascript"), Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, "javascript")), Prism.languages.js = Prism.languages.javascript, Prism.languages.actionscript = Prism.languages.extend("javascript", { keyword: /\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/, operator: /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/ }), Prism.languages.actionscript["class-name"].alias = "function", delete Prism.languages.actionscript.parameter, delete Prism.languages.actionscript["literal-property"], Prism.languages.markup && Prism.languages.insertBefore("actionscript", "string", { xml: { pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/, lookbehind: true, inside: Prism.languages.markup } }), function(e) {
|
|
779
|
+
var n = /#(?!\{).+/, t = { pattern: /#\{[^}]+\}/, alias: "variable" };
|
|
780
|
+
e.languages.coffeescript = e.languages.extend("javascript", { comment: n, string: [{ pattern: /'(?:\\[\s\S]|[^\\'])*'/, greedy: true }, { pattern: /"(?:\\[\s\S]|[^\\"])*"/, greedy: true, inside: { interpolation: t } }], keyword: /\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/, "class-member": { pattern: /@(?!\d)\w+/, alias: "variable" } }), e.languages.insertBefore("coffeescript", "comment", { "multiline-comment": { pattern: /###[\s\S]+?###/, alias: "comment" }, "block-regex": { pattern: /\/{3}[\s\S]*?\/{3}/, alias: "regex", inside: { comment: n, interpolation: t } } }), e.languages.insertBefore("coffeescript", "string", { "inline-javascript": { pattern: /`(?:\\[\s\S]|[^\\`])*`/, inside: { delimiter: { pattern: /^`|`$/, alias: "punctuation" }, script: { pattern: /[\s\S]+/, alias: "language-javascript", inside: e.languages.javascript } } }, "multiline-string": [{ pattern: /'''[\s\S]*?'''/, greedy: true, alias: "string" }, { pattern: /"""[\s\S]*?"""/, greedy: true, alias: "string", inside: { interpolation: t } }] }), e.languages.insertBefore("coffeescript", "keyword", { property: /(?!\d)\w+(?=\s*:(?!:))/ }), delete e.languages.coffeescript["template-string"], e.languages.coffee = e.languages.coffeescript;
|
|
781
|
+
}(Prism), function(l) {
|
|
782
|
+
var e = l.languages.javadoclike = { parameter: { pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m, lookbehind: true }, keyword: { pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m, lookbehind: true }, punctuation: /[{}]/ };
|
|
783
|
+
Object.defineProperty(e, "addSupport", { value: function(e2, o) {
|
|
784
|
+
(e2 = "string" == typeof e2 ? [e2] : e2).forEach(function(e3) {
|
|
785
|
+
var n = function(e4) {
|
|
786
|
+
e4.inside || (e4.inside = {}), e4.inside.rest = o;
|
|
787
|
+
}, t = "doc-comment";
|
|
788
|
+
if (a = l.languages[e3]) {
|
|
789
|
+
var a, r = a[t];
|
|
790
|
+
if ((r = r ? r : (a = l.languages.insertBefore(e3, "comment", { "doc-comment": { pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/, lookbehind: true, alias: "comment" } }))[t]) instanceof RegExp && (r = a[t] = { pattern: r }), Array.isArray(r))
|
|
791
|
+
for (var s = 0, i = r.length; s < i; s++)
|
|
792
|
+
r[s] instanceof RegExp && (r[s] = { pattern: r[s] }), n(r[s]);
|
|
793
|
+
else
|
|
794
|
+
n(r);
|
|
795
|
+
}
|
|
796
|
+
});
|
|
797
|
+
} }), e.addSupport(["java", "javascript", "php"], e);
|
|
798
|
+
}(Prism), function(e) {
|
|
799
|
+
var n = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/, n = (e.languages.css = { comment: /\/\*[\s\S]*?\*\//, atrule: { pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + n.source + ")*?" + /(?:;|(?=\s*\{))/.source), inside: { rule: /^@[\w-]+/, "selector-function-argument": { pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/, lookbehind: true, alias: "selector" }, keyword: { pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/, lookbehind: true } } }, url: { pattern: RegExp("\\burl\\((?:" + n.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"), greedy: true, inside: { function: /^url/i, punctuation: /^\(|\)$/, string: { pattern: RegExp("^" + n.source + "$"), alias: "url" } } }, selector: { pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + n.source + ")*(?=\\s*\\{)"), lookbehind: true }, string: { pattern: n, greedy: true }, property: { pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i, lookbehind: true }, important: /!important\b/i, function: { pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i, lookbehind: true }, punctuation: /[(){};:,]/ }, e.languages.css.atrule.inside.rest = e.languages.css, e.languages.markup);
|
|
800
|
+
n && (n.tag.addInlined("style", "css"), n.tag.addAttribute("style", "css"));
|
|
801
|
+
}(Prism), function(e) {
|
|
802
|
+
var n = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, n = (e.languages.css.selector = { pattern: e.languages.css.selector.pattern, lookbehind: true, inside: n = { "pseudo-element": /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/, "pseudo-class": /:[-\w]+/, class: /\.[-\w]+/, id: /#[-\w]+/, attribute: { pattern: RegExp(`\\[(?:[^[\\]"']|` + n.source + ")*\\]"), greedy: true, inside: { punctuation: /^\[|\]$/, "case-sensitivity": { pattern: /(\s)[si]$/i, lookbehind: true, alias: "keyword" }, namespace: { pattern: /^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/, lookbehind: true, inside: { punctuation: /\|$/ } }, "attr-name": { pattern: /^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/, lookbehind: true }, "attr-value": [n, { pattern: /(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/, lookbehind: true }], operator: /[|~*^$]?=/ } }, "n-th": [{ pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/, lookbehind: true, inside: { number: /[\dn]+/, operator: /[+-]/ } }, { pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i, lookbehind: true }], combinator: />|\+|~|\|\|/, punctuation: /[(),]/ } }, e.languages.css.atrule.inside["selector-function-argument"].inside = n, e.languages.insertBefore("css", "property", { variable: { pattern: /(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i, lookbehind: true } }), { pattern: /(\b\d+)(?:%|[a-z]+(?![\w-]))/, lookbehind: true }), t = { pattern: /(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/, lookbehind: true };
|
|
803
|
+
e.languages.insertBefore("css", "function", { operator: { pattern: /(\s)[+\-*\/](?=\s)/, lookbehind: true }, hexcode: { pattern: /\B#[\da-f]{3,8}\b/i, alias: "color" }, color: [{ pattern: /(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i, lookbehind: true }, { pattern: /\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i, inside: { unit: n, number: t, function: /[\w-]+(?=\()/, punctuation: /[(),]/ } }], entity: /\\[\da-f]{1,8}/i, unit: n, number: t });
|
|
804
|
+
}(Prism), function(e) {
|
|
805
|
+
var n = /[*&][^\s[\]{},]+/, t = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/, a = "(?:" + t.source + "(?:[ ]+" + n.source + ")?|" + n.source + "(?:[ ]+" + t.source + ")?)", r = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g, function() {
|
|
806
|
+
return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source;
|
|
807
|
+
}), s = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
|
|
808
|
+
function i(e2, n2) {
|
|
809
|
+
n2 = (n2 || "").replace(/m/g, "") + "m";
|
|
810
|
+
var t2 = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, function() {
|
|
811
|
+
return a;
|
|
812
|
+
}).replace(/<<value>>/g, function() {
|
|
813
|
+
return e2;
|
|
814
|
+
});
|
|
815
|
+
return RegExp(t2, n2);
|
|
816
|
+
}
|
|
817
|
+
e.languages.yaml = { scalar: { pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g, function() {
|
|
818
|
+
return a;
|
|
819
|
+
})), lookbehind: true, alias: "string" }, comment: /#.*/, key: { pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g, function() {
|
|
820
|
+
return a;
|
|
821
|
+
}).replace(/<<key>>/g, function() {
|
|
822
|
+
return "(?:" + r + "|" + s + ")";
|
|
823
|
+
})), lookbehind: true, greedy: true, alias: "atrule" }, directive: { pattern: /(^[ \t]*)%.+/m, lookbehind: true, alias: "important" }, datetime: { pattern: i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source), lookbehind: true, alias: "number" }, boolean: { pattern: i(/false|true/.source, "i"), lookbehind: true, alias: "important" }, null: { pattern: i(/null|~/.source, "i"), lookbehind: true, alias: "important" }, string: { pattern: i(s), lookbehind: true, greedy: true }, number: { pattern: i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, "i"), lookbehind: true }, tag: t, important: n, punctuation: /---|[:[\]{}\-,|>?]|\.\.\./ }, e.languages.yml = e.languages.yaml;
|
|
824
|
+
}(Prism), function(o) {
|
|
825
|
+
var n = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
|
|
826
|
+
function e(e2) {
|
|
827
|
+
return e2 = e2.replace(/<inner>/g, function() {
|
|
828
|
+
return n;
|
|
829
|
+
}), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + e2 + ")");
|
|
830
|
+
}
|
|
831
|
+
var t = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, a = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function() {
|
|
832
|
+
return t;
|
|
833
|
+
}), r = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source, l = (o.languages.markdown = o.languages.extend("markup", {}), o.languages.insertBefore("markdown", "prolog", { "front-matter-block": { pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/, lookbehind: true, greedy: true, inside: { punctuation: /^---|---$/, "front-matter": { pattern: /\S+(?:\s+\S+)*/, alias: ["yaml", "language-yaml"], inside: o.languages.yaml } } }, blockquote: { pattern: /^>(?:[\t ]*>)*/m, alias: "punctuation" }, table: { pattern: RegExp("^" + a + r + "(?:" + a + ")*", "m"), inside: { "table-data-rows": { pattern: RegExp("^(" + a + r + ")(?:" + a + ")*$"), lookbehind: true, inside: { "table-data": { pattern: RegExp(t), inside: o.languages.markdown }, punctuation: /\|/ } }, "table-line": { pattern: RegExp("^(" + a + ")" + r + "$"), lookbehind: true, inside: { punctuation: /\||:?-{3,}:?/ } }, "table-header-row": { pattern: RegExp("^" + a + "$"), inside: { "table-header": { pattern: RegExp(t), alias: "important", inside: o.languages.markdown }, punctuation: /\|/ } } } }, code: [{ pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/, lookbehind: true, alias: "keyword" }, { pattern: /^```[\s\S]*?^```$/m, greedy: true, inside: { "code-block": { pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m, lookbehind: true }, "code-language": { pattern: /^(```).+/, lookbehind: true }, punctuation: /```/ } }], title: [{ pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m, alias: "important", inside: { punctuation: /==+$|--+$/ } }, { pattern: /(^\s*)#.+/m, lookbehind: true, alias: "important", inside: { punctuation: /^#+|#+$/ } }], hr: { pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m, lookbehind: true, alias: "punctuation" }, list: { pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m, lookbehind: true, alias: "punctuation" }, "url-reference": { pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/, inside: { variable: { pattern: /^(!?\[)[^\]]+/, lookbehind: true }, string: /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/, punctuation: /^[\[\]!:]|[<>]/ }, alias: "url" }, bold: { pattern: e(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source), lookbehind: true, greedy: true, inside: { content: { pattern: /(^..)[\s\S]+(?=..$)/, lookbehind: true, inside: {} }, punctuation: /\*\*|__/ } }, italic: { pattern: e(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source), lookbehind: true, greedy: true, inside: { content: { pattern: /(^.)[\s\S]+(?=.$)/, lookbehind: true, inside: {} }, punctuation: /[*_]/ } }, strike: { pattern: e(/(~~?)(?:(?!~)<inner>)+\2/.source), lookbehind: true, greedy: true, inside: { content: { pattern: /(^~~?)[\s\S]+(?=\1$)/, lookbehind: true, inside: {} }, punctuation: /~~?/ } }, "code-snippet": { pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/, lookbehind: true, greedy: true, alias: ["code", "keyword"] }, url: { pattern: e(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source), lookbehind: true, greedy: true, inside: { operator: /^!/, content: { pattern: /(^\[)[^\]]+(?=\])/, lookbehind: true, inside: {} }, variable: { pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/, lookbehind: true }, url: { pattern: /(^\]\()[^\s)]+/, lookbehind: true }, string: { pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/, lookbehind: true } } } }), ["url", "bold", "italic", "strike"].forEach(function(n2) {
|
|
834
|
+
["url", "bold", "italic", "strike", "code-snippet"].forEach(function(e2) {
|
|
835
|
+
n2 !== e2 && (o.languages.markdown[n2].inside.content.inside[e2] = o.languages.markdown[e2]);
|
|
836
|
+
});
|
|
837
|
+
}), o.hooks.add("after-tokenize", function(e2) {
|
|
838
|
+
"markdown" !== e2.language && "md" !== e2.language || !function e3(n2) {
|
|
839
|
+
if (n2 && "string" != typeof n2)
|
|
840
|
+
for (var t2 = 0, a2 = n2.length; t2 < a2; t2++) {
|
|
841
|
+
var r2, s = n2[t2];
|
|
842
|
+
"code" !== s.type ? e3(s.content) : (r2 = s.content[1], s = s.content[3], r2 && s && "code-language" === r2.type && "code-block" === s.type && "string" == typeof r2.content && (r2 = r2.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp"), r2 = "language-" + (r2 = (/[a-z][\w-]*/i.exec(r2) || [""])[0].toLowerCase()), s.alias ? "string" == typeof s.alias ? s.alias = [s.alias, r2] : s.alias.push(r2) : s.alias = [r2]));
|
|
843
|
+
}
|
|
844
|
+
}(e2.tokens);
|
|
845
|
+
}), o.hooks.add("wrap", function(e2) {
|
|
846
|
+
if ("code-block" === e2.type) {
|
|
847
|
+
for (var n2 = "", t2 = 0, a2 = e2.classes.length; t2 < a2; t2++) {
|
|
848
|
+
var r2 = e2.classes[t2], r2 = /language-(.+)/.exec(r2);
|
|
849
|
+
if (r2) {
|
|
850
|
+
n2 = r2[1];
|
|
851
|
+
break;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
var s, i = o.languages[n2];
|
|
855
|
+
i ? e2.content = o.highlight(function(e3) {
|
|
856
|
+
e3 = e3.replace(l, "");
|
|
857
|
+
return e3 = e3.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function(e4, n3) {
|
|
858
|
+
var t3;
|
|
859
|
+
return "#" === (n3 = n3.toLowerCase())[0] ? (t3 = "x" === n3[1] ? parseInt(n3.slice(2), 16) : Number(n3.slice(1)), c(t3)) : u[n3] || e4;
|
|
860
|
+
});
|
|
861
|
+
}(e2.content), i, n2) : n2 && "none" !== n2 && o.plugins.autoloader && (s = "md-" + (/* @__PURE__ */ new Date()).valueOf() + "-" + Math.floor(1e16 * Math.random()), e2.attributes.id = s, o.plugins.autoloader.loadLanguages(n2, function() {
|
|
862
|
+
var e3 = document.getElementById(s);
|
|
863
|
+
e3 && (e3.innerHTML = o.highlight(e3.textContent, o.languages[n2], n2));
|
|
864
|
+
}));
|
|
865
|
+
}
|
|
866
|
+
}), RegExp(o.languages.markup.tag.pattern.source, "gi")), u = { amp: "&", lt: "<", gt: ">", quot: '"' }, c = String.fromCodePoint || String.fromCharCode;
|
|
867
|
+
o.languages.md = o.languages.markdown;
|
|
868
|
+
}(Prism), Prism.languages.graphql = { comment: /#.*/, description: { pattern: /(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i, greedy: true, alias: "string", inside: { "language-markdown": { pattern: /(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/, lookbehind: true, inside: Prism.languages.markdown } } }, string: { pattern: /"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/, greedy: true }, number: /(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, boolean: /\b(?:false|true)\b/, variable: /\$[a-z_]\w*/i, directive: { pattern: /@[a-z_]\w*/i, alias: "function" }, "attr-name": { pattern: /\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i, greedy: true }, "atom-input": { pattern: /\b[A-Z]\w*Input\b/, alias: "class-name" }, scalar: /\b(?:Boolean|Float|ID|Int|String)\b/, constant: /\b[A-Z][A-Z_\d]*\b/, "class-name": { pattern: /(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/, lookbehind: true }, fragment: { pattern: /(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/, lookbehind: true, alias: "function" }, "definition-mutation": { pattern: /(\bmutation\s+)[a-zA-Z_]\w*/, lookbehind: true, alias: "function" }, "definition-query": { pattern: /(\bquery\s+)[a-zA-Z_]\w*/, lookbehind: true, alias: "function" }, keyword: /\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/, operator: /[!=|&]|\.{3}/, "property-query": /\w+(?=\s*\()/, object: /\w+(?=\s*\{)/, punctuation: /[!(){}\[\]:=,]/, property: /\w+/ }, Prism.hooks.add("after-tokenize", function(e) {
|
|
869
|
+
if ("graphql" === e.language)
|
|
870
|
+
for (var i = e.tokens.filter(function(e2) {
|
|
871
|
+
return "string" != typeof e2 && "comment" !== e2.type && "scalar" !== e2.type;
|
|
872
|
+
}), o = 0; o < i.length; ) {
|
|
873
|
+
var n = i[o++];
|
|
874
|
+
if ("keyword" === n.type && "mutation" === n.content) {
|
|
875
|
+
var t = [];
|
|
876
|
+
if (p(["definition-mutation", "punctuation"]) && "(" === c(1).content) {
|
|
877
|
+
o += 2;
|
|
878
|
+
var a = d(/^\($/, /^\)$/);
|
|
879
|
+
if (-1 === a)
|
|
880
|
+
continue;
|
|
881
|
+
for (; o < a; o++) {
|
|
882
|
+
var r = c(0);
|
|
883
|
+
"variable" === r.type && (g(r, "variable-input"), t.push(r.content));
|
|
884
|
+
}
|
|
885
|
+
o = a + 1;
|
|
886
|
+
}
|
|
887
|
+
if (p(["punctuation", "property-query"]) && "{" === c(0).content && (o++, g(c(0), "property-mutation"), 0 < t.length)) {
|
|
888
|
+
var s = d(/^\{$/, /^\}$/);
|
|
889
|
+
if (-1 !== s)
|
|
890
|
+
for (var l = o; l < s; l++) {
|
|
891
|
+
var u = i[l];
|
|
892
|
+
"variable" === u.type && 0 <= t.indexOf(u.content) && g(u, "variable-input");
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
function c(e2) {
|
|
898
|
+
return i[o + e2];
|
|
899
|
+
}
|
|
900
|
+
function p(e2, n2) {
|
|
901
|
+
n2 = n2 || 0;
|
|
902
|
+
for (var t2 = 0; t2 < e2.length; t2++) {
|
|
903
|
+
var a2 = c(t2 + n2);
|
|
904
|
+
if (!a2 || a2.type !== e2[t2])
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
return 1;
|
|
908
|
+
}
|
|
909
|
+
function d(e2, n2) {
|
|
910
|
+
for (var t2 = 1, a2 = o; a2 < i.length; a2++) {
|
|
911
|
+
var r2 = i[a2], s2 = r2.content;
|
|
912
|
+
if ("punctuation" === r2.type && "string" == typeof s2) {
|
|
913
|
+
if (e2.test(s2))
|
|
914
|
+
t2++;
|
|
915
|
+
else if (n2.test(s2) && 0 === --t2)
|
|
916
|
+
return a2;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
return -1;
|
|
920
|
+
}
|
|
921
|
+
function g(e2, n2) {
|
|
922
|
+
var t2 = e2.alias;
|
|
923
|
+
t2 ? Array.isArray(t2) || (e2.alias = t2 = [t2]) : e2.alias = t2 = [], t2.push(n2);
|
|
924
|
+
}
|
|
925
|
+
}), Prism.languages.sql = { comment: { pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/, lookbehind: true }, variable: [{ pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/, greedy: true }, /@[\w.$]+/], string: { pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/, greedy: true, lookbehind: true }, identifier: { pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/, greedy: true, lookbehind: true, inside: { punctuation: /^`|`$/ } }, function: /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i, keyword: /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i, boolean: /\b(?:FALSE|NULL|TRUE)\b/i, number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i, operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i, punctuation: /[;[\]()`,.]/ }, function(b) {
|
|
926
|
+
var e = b.languages.javascript["template-string"], t = e.pattern.source, m = e.inside.interpolation, f = m.inside["interpolation-punctuation"], s = m.pattern.source;
|
|
927
|
+
function n(e2, n2) {
|
|
928
|
+
if (b.languages[e2])
|
|
929
|
+
return { pattern: RegExp("((?:" + n2 + ")\\s*)" + t), lookbehind: true, greedy: true, inside: { "template-punctuation": { pattern: /^`|`$/, alias: "string" }, "embedded-code": { pattern: /[\s\S]+/, alias: e2 } } };
|
|
930
|
+
}
|
|
931
|
+
function h(e2, n2, t2) {
|
|
932
|
+
e2 = { code: e2, grammar: n2, language: t2 };
|
|
933
|
+
return b.hooks.run("before-tokenize", e2), e2.tokens = b.tokenize(e2.code, e2.grammar), b.hooks.run("after-tokenize", e2), e2.tokens;
|
|
934
|
+
}
|
|
935
|
+
function l(a2, e2, r) {
|
|
936
|
+
var n2 = b.tokenize(a2, { interpolation: { pattern: RegExp(s), lookbehind: true } }), p = 0, d = {}, n2 = h(n2.map(function(e3) {
|
|
937
|
+
if ("string" == typeof e3)
|
|
938
|
+
return e3;
|
|
939
|
+
for (var n3, t2, e3 = e3.content; -1 !== a2.indexOf((t2 = p++, n3 = "___" + r.toUpperCase() + "_" + t2 + "___")); )
|
|
940
|
+
;
|
|
941
|
+
return d[n3] = e3, n3;
|
|
942
|
+
}).join(""), e2, r), g = Object.keys(d);
|
|
943
|
+
return p = 0, function e3(n3) {
|
|
944
|
+
for (var t2 = 0; t2 < n3.length; t2++) {
|
|
945
|
+
if (p >= g.length)
|
|
946
|
+
return;
|
|
947
|
+
var a3, r2, s2, i, o, l2, u2, c = n3[t2];
|
|
948
|
+
"string" == typeof c || "string" == typeof c.content ? (a3 = g[p], -1 !== (u2 = (l2 = "string" == typeof c ? c : c.content).indexOf(a3)) && (++p, r2 = l2.substring(0, u2), o = d[a3], s2 = void 0, (i = {})["interpolation-punctuation"] = f, 3 === (i = b.tokenize(o, i)).length && ((s2 = [1, 1]).push.apply(s2, h(i[1], b.languages.javascript, "javascript")), i.splice.apply(i, s2)), s2 = new b.Token("interpolation", i, m.alias, o), i = l2.substring(u2 + a3.length), o = [], r2 && o.push(r2), o.push(s2), i && (e3(l2 = [i]), o.push.apply(o, l2)), "string" == typeof c ? (n3.splice.apply(n3, [t2, 1].concat(o)), t2 += o.length - 1) : c.content = o)) : (u2 = c.content, Array.isArray(u2) ? e3(u2) : e3([u2]));
|
|
949
|
+
}
|
|
950
|
+
}(n2), new b.Token(r, n2, "language-" + r, a2);
|
|
951
|
+
}
|
|
952
|
+
b.languages.javascript["template-string"] = [n("css", /\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source), n("html", /\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source), n("svg", /\bsvg/.source), n("markdown", /\b(?:markdown|md)/.source), n("graphql", /\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source), n("sql", /\bsql/.source), e].filter(Boolean);
|
|
953
|
+
var a = { javascript: true, js: true, typescript: true, ts: true, jsx: true, tsx: true };
|
|
954
|
+
function u(e2) {
|
|
955
|
+
return "string" == typeof e2 ? e2 : Array.isArray(e2) ? e2.map(u).join("") : u(e2.content);
|
|
956
|
+
}
|
|
957
|
+
b.hooks.add("after-tokenize", function(e2) {
|
|
958
|
+
e2.language in a && !function e3(n2) {
|
|
959
|
+
for (var t2 = 0, a2 = n2.length; t2 < a2; t2++) {
|
|
960
|
+
var r, s2, i, o = n2[t2];
|
|
961
|
+
"string" != typeof o && (r = o.content, Array.isArray(r) ? "template-string" === o.type ? (o = r[1], 3 === r.length && "string" != typeof o && "embedded-code" === o.type && (s2 = u(o), o = o.alias, o = Array.isArray(o) ? o[0] : o, i = b.languages[o]) && (r[1] = l(s2, i, o))) : e3(r) : "string" != typeof r && e3([r]));
|
|
962
|
+
}
|
|
963
|
+
}(e2.tokens);
|
|
964
|
+
});
|
|
965
|
+
}(Prism), function(e) {
|
|
966
|
+
e.languages.typescript = e.languages.extend("javascript", { "class-name": { pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/, lookbehind: true, greedy: true, inside: null }, builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/ }), e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/, /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/, /\btype\b(?=\s*(?:[\{*]|$))/), delete e.languages.typescript.parameter, delete e.languages.typescript["literal-property"];
|
|
967
|
+
var n = e.languages.extend("typescript", {});
|
|
968
|
+
delete n["class-name"], e.languages.typescript["class-name"].inside = n, e.languages.insertBefore("typescript", "function", { decorator: { pattern: /@[$\w\xA0-\uFFFF]+/, inside: { at: { pattern: /^@/, alias: "operator" }, function: /^[\s\S]+/ } }, "generic-function": { pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/, greedy: true, inside: { function: /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/, generic: { pattern: /<[\s\S]+/, alias: "class-name", inside: n } } } }), e.languages.ts = e.languages.typescript;
|
|
969
|
+
}(Prism), function(e) {
|
|
970
|
+
var n = e.languages.javascript, t = /\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source, a = "(@(?:arg|argument|param|property)\\s+(?:" + t + "\\s+)?)";
|
|
971
|
+
e.languages.jsdoc = e.languages.extend("javadoclike", { parameter: { pattern: RegExp(a + /(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source), lookbehind: true, inside: { punctuation: /\./ } } }), e.languages.insertBefore("jsdoc", "keyword", { "optional-parameter": { pattern: RegExp(a + /\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source), lookbehind: true, inside: { parameter: { pattern: /(^\[)[$\w\xA0-\uFFFF\.]+/, lookbehind: true, inside: { punctuation: /\./ } }, code: { pattern: /(=)[\s\S]*(?=\]$)/, lookbehind: true, inside: n, alias: "language-javascript" }, punctuation: /[=[\]]/ } }, "class-name": [{ pattern: RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g, function() {
|
|
972
|
+
return t;
|
|
973
|
+
})), lookbehind: true, inside: { punctuation: /\./ } }, { pattern: RegExp("(@[a-z]+\\s+)" + t), lookbehind: true, inside: { string: n.string, number: n.number, boolean: n.boolean, keyword: e.languages.typescript.keyword, operator: /=>|\.\.\.|[&|?:*]/, punctuation: /[.,;=<>{}()[\]]/ } }], example: { pattern: /(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/, lookbehind: true, inside: { code: { pattern: /^([\t ]*(?:\*\s*)?)\S.*$/m, lookbehind: true, inside: n, alias: "language-javascript" } } } }), e.languages.javadoclike.addSupport("javascript", e.languages.jsdoc);
|
|
974
|
+
}(Prism), function(e) {
|
|
975
|
+
e.languages.flow = e.languages.extend("javascript", {}), e.languages.insertBefore("flow", "keyword", { type: [{ pattern: /\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/, alias: "class-name" }] }), e.languages.flow["function-variable"].pattern = /(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i, delete e.languages.flow.parameter, e.languages.insertBefore("flow", "operator", { "flow-punctuation": { pattern: /\{\||\|\}/, alias: "punctuation" } }), Array.isArray(e.languages.flow.keyword) || (e.languages.flow.keyword = [e.languages.flow.keyword]), e.languages.flow.keyword.unshift({ pattern: /(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/, lookbehind: true }, { pattern: /(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/, lookbehind: true });
|
|
976
|
+
}(Prism), Prism.languages.n4js = Prism.languages.extend("javascript", { keyword: /\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/ }), Prism.languages.insertBefore("n4js", "constant", { annotation: { pattern: /@+\w+/, alias: "operator" } }), Prism.languages.n4jsd = Prism.languages.n4js, function(e) {
|
|
977
|
+
function n(e2, n2) {
|
|
978
|
+
return RegExp(e2.replace(/<ID>/g, function() {
|
|
979
|
+
return /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source;
|
|
980
|
+
}), n2);
|
|
981
|
+
}
|
|
982
|
+
e.languages.insertBefore("javascript", "function-variable", { "method-variable": { pattern: RegExp("(\\.\\s*)" + e.languages.javascript["function-variable"].pattern.source), lookbehind: true, alias: ["function-variable", "method", "function", "property-access"] } }), e.languages.insertBefore("javascript", "function", { method: { pattern: RegExp("(\\.\\s*)" + e.languages.javascript.function.source), lookbehind: true, alias: ["function", "property-access"] } }), e.languages.insertBefore("javascript", "constant", { "known-class-name": [{ pattern: /\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/, alias: "class-name" }, { pattern: /\b(?:[A-Z]\w*)Error\b/, alias: "class-name" }] }), e.languages.insertBefore("javascript", "keyword", { imports: { pattern: n(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source), lookbehind: true, inside: e.languages.javascript }, exports: { pattern: n(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source), lookbehind: true, inside: e.languages.javascript } }), e.languages.javascript.keyword.unshift({ pattern: /\b(?:as|default|export|from|import)\b/, alias: "module" }, { pattern: /\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/, alias: "control-flow" }, { pattern: /\bnull\b/, alias: ["null", "nil"] }, { pattern: /\bundefined\b/, alias: "nil" }), e.languages.insertBefore("javascript", "operator", { spread: { pattern: /\.{3}/, alias: "operator" }, arrow: { pattern: /=>/, alias: "operator" } }), e.languages.insertBefore("javascript", "punctuation", { "property-access": { pattern: n(/(\.\s*)#?<ID>/.source), lookbehind: true }, "maybe-class-name": { pattern: /(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/, lookbehind: true }, dom: { pattern: /\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/, alias: "variable" }, console: { pattern: /\bconsole(?=\s*\.)/, alias: "class-name" } });
|
|
983
|
+
for (var t = ["function", "function-variable", "method", "method-variable", "property-access"], a = 0; a < t.length; a++) {
|
|
984
|
+
var r = t[a], s = e.languages.javascript[r], r = (s = "RegExp" === e.util.type(s) ? e.languages.javascript[r] = { pattern: s } : s).inside || {};
|
|
985
|
+
(s.inside = r)["maybe-class-name"] = /^[A-Z][\s\S]*/;
|
|
986
|
+
}
|
|
987
|
+
}(Prism), function(s) {
|
|
988
|
+
var e = s.util.clone(s.languages.javascript), t = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source, a = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source, r = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
|
|
989
|
+
function n(e2, n2) {
|
|
990
|
+
return e2 = e2.replace(/<S>/g, function() {
|
|
991
|
+
return t;
|
|
992
|
+
}).replace(/<BRACES>/g, function() {
|
|
993
|
+
return a;
|
|
994
|
+
}).replace(/<SPREAD>/g, function() {
|
|
995
|
+
return r;
|
|
996
|
+
}), RegExp(e2, n2);
|
|
997
|
+
}
|
|
998
|
+
r = n(r).source, s.languages.jsx = s.languages.extend("markup", e), s.languages.jsx.tag.pattern = n(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source), s.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/, s.languages.jsx.tag.inside["attr-value"].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/, s.languages.jsx.tag.inside.tag.inside["class-name"] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/, s.languages.jsx.tag.inside.comment = e.comment, s.languages.insertBefore("inside", "attr-name", { spread: { pattern: n(/<SPREAD>/.source), inside: s.languages.jsx } }, s.languages.jsx.tag), s.languages.insertBefore("inside", "special-attr", { script: { pattern: n(/=<BRACES>/.source), alias: "language-javascript", inside: { "script-punctuation": { pattern: /^=(?=\{)/, alias: "punctuation" }, rest: s.languages.jsx } } }, s.languages.jsx.tag);
|
|
999
|
+
function i(e2) {
|
|
1000
|
+
for (var n2 = [], t2 = 0; t2 < e2.length; t2++) {
|
|
1001
|
+
var a2 = e2[t2], r2 = false;
|
|
1002
|
+
"string" != typeof a2 && ("tag" === a2.type && a2.content[0] && "tag" === a2.content[0].type ? "</" === a2.content[0].content[0].content ? 0 < n2.length && n2[n2.length - 1].tagName === o(a2.content[0].content[1]) && n2.pop() : "/>" !== a2.content[a2.content.length - 1].content && n2.push({ tagName: o(a2.content[0].content[1]), openedBraces: 0 }) : 0 < n2.length && "punctuation" === a2.type && "{" === a2.content ? n2[n2.length - 1].openedBraces++ : 0 < n2.length && 0 < n2[n2.length - 1].openedBraces && "punctuation" === a2.type && "}" === a2.content ? n2[n2.length - 1].openedBraces-- : r2 = true), (r2 || "string" == typeof a2) && 0 < n2.length && 0 === n2[n2.length - 1].openedBraces && (r2 = o(a2), t2 < e2.length - 1 && ("string" == typeof e2[t2 + 1] || "plain-text" === e2[t2 + 1].type) && (r2 += o(e2[t2 + 1]), e2.splice(t2 + 1, 1)), 0 < t2 && ("string" == typeof e2[t2 - 1] || "plain-text" === e2[t2 - 1].type) && (r2 = o(e2[t2 - 1]) + r2, e2.splice(t2 - 1, 1), t2--), e2[t2] = new s.Token("plain-text", r2, null, r2)), a2.content && "string" != typeof a2.content && i(a2.content);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
var o = function(e2) {
|
|
1006
|
+
return e2 ? "string" == typeof e2 ? e2 : "string" == typeof e2.content ? e2.content : e2.content.map(o).join("") : "";
|
|
1007
|
+
};
|
|
1008
|
+
s.hooks.add("after-tokenize", function(e2) {
|
|
1009
|
+
"jsx" !== e2.language && "tsx" !== e2.language || i(e2.tokens);
|
|
1010
|
+
});
|
|
1011
|
+
}(Prism), function(e) {
|
|
1012
|
+
var n = e.util.clone(e.languages.typescript), n = (e.languages.tsx = e.languages.extend("jsx", n), delete e.languages.tsx.parameter, delete e.languages.tsx["literal-property"], e.languages.tsx.tag);
|
|
1013
|
+
n.pattern = RegExp(/(^|[^\w$]|(?=<\/))/.source + "(?:" + n.pattern.source + ")", n.pattern.flags), n.lookbehind = true;
|
|
1014
|
+
}(Prism), Prism.languages.swift = { comment: { pattern: /(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/, lookbehind: true, greedy: true }, "string-literal": [{ pattern: RegExp(/(^|[^"#])/.source + "(?:" + /"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source + "|" + /"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source + ")" + /(?!["#])/.source), lookbehind: true, greedy: true, inside: { interpolation: { pattern: /(\\\()(?:[^()]|\([^()]*\))*(?=\))/, lookbehind: true, inside: null }, "interpolation-punctuation": { pattern: /^\)|\\\($/, alias: "punctuation" }, punctuation: /\\(?=[\r\n])/, string: /[\s\S]+/ } }, { pattern: RegExp(/(^|[^"#])(#+)/.source + "(?:" + /"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source + "|" + /"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source + ")\\2"), lookbehind: true, greedy: true, inside: { interpolation: { pattern: /(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/, lookbehind: true, inside: null }, "interpolation-punctuation": { pattern: /^\)|\\#+\($/, alias: "punctuation" }, string: /[\s\S]+/ } }], directive: { pattern: RegExp(/#/.source + "(?:" + /(?:elseif|if)\b/.source + "(?:[ ]*" + /(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source + ")+|" + /(?:else|endif)\b/.source + ")"), alias: "property", inside: { "directive-name": /^#\w+/, boolean: /\b(?:false|true)\b/, number: /\b\d+(?:\.\d+)*\b/, operator: /!|&&|\|\||[<>]=?/, punctuation: /[(),]/ } }, literal: { pattern: /#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/, alias: "constant" }, "other-directive": { pattern: /#\w+\b/, alias: "property" }, attribute: { pattern: /@\w+/, alias: "atrule" }, "function-definition": { pattern: /(\bfunc\s+)\w+/, lookbehind: true, alias: "function" }, label: { pattern: /\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/, lookbehind: true, alias: "important" }, keyword: /\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/, boolean: /\b(?:false|true)\b/, nil: { pattern: /\bnil\b/, alias: "constant" }, "short-argument": /\$\d+\b/, omit: { pattern: /\b_\b/, alias: "keyword" }, number: /\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i, "class-name": /\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/, function: /\b[a-z_]\w*(?=\s*\()/i, constant: /\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/, operator: /[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/, punctuation: /[{}[\]();,.:\\]/ }, Prism.languages.swift["string-literal"].forEach(function(e) {
|
|
1015
|
+
e.inside.interpolation.inside = Prism.languages.swift;
|
|
1016
|
+
}), function(e) {
|
|
1017
|
+
e.languages.kotlin = e.languages.extend("clike", { keyword: { pattern: /(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/, lookbehind: true }, function: [{ pattern: /(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/, greedy: true }, { pattern: /(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/, lookbehind: true, greedy: true }], number: /\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/, operator: /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/ }), delete e.languages.kotlin["class-name"];
|
|
1018
|
+
var n = { "interpolation-punctuation": { pattern: /^\$\{?|\}$/, alias: "punctuation" }, expression: { pattern: /[\s\S]+/, inside: e.languages.kotlin } };
|
|
1019
|
+
e.languages.insertBefore("kotlin", "string", { "string-literal": [{ pattern: /"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/, alias: "multiline", inside: { interpolation: { pattern: /\$(?:[a-z_]\w*|\{[^{}]*\})/i, inside: n }, string: /[\s\S]+/ } }, { pattern: /"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/, alias: "singleline", inside: { interpolation: { pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i, lookbehind: true, inside: n }, string: /[\s\S]+/ } }], char: { pattern: /'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/, greedy: true } }), delete e.languages.kotlin.string, e.languages.insertBefore("kotlin", "keyword", { annotation: { pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/, alias: "builtin" } }), e.languages.insertBefore("kotlin", "function", { label: { pattern: /\b\w+@|@\w+\b/, alias: "symbol" } }), e.languages.kt = e.languages.kotlin, e.languages.kts = e.languages.kotlin;
|
|
1020
|
+
}(Prism), Prism.languages.c = Prism.languages.extend("clike", { comment: { pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: true }, string: { pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, greedy: true }, "class-name": { pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/, lookbehind: true }, keyword: /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/, function: /\b[a-z_]\w*(?=\s*\()/i, number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i, operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/ }), Prism.languages.insertBefore("c", "string", { char: { pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/, greedy: true } }), Prism.languages.insertBefore("c", "string", { macro: { pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im, lookbehind: true, greedy: true, alias: "property", inside: { string: [{ pattern: /^(#\s*include\s*)<[^>]+>/, lookbehind: true }, Prism.languages.c.string], char: Prism.languages.c.char, comment: Prism.languages.c.comment, "macro-name": [{ pattern: /(^#\s*define\s+)\w+\b(?!\()/i, lookbehind: true }, { pattern: /(^#\s*define\s+)\w+\b(?=\()/i, lookbehind: true, alias: "function" }], directive: { pattern: /^(#\s*)[a-z]+/, lookbehind: true, alias: "keyword" }, "directive-hash": /^#/, punctuation: /##|\\(?=[\r\n])/, expression: { pattern: /\S[\s\S]*/, inside: Prism.languages.c } } } }), Prism.languages.insertBefore("c", "function", { constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/ }), delete Prism.languages.c.boolean, Prism.languages.objectivec = Prism.languages.extend("c", { string: { pattern: /@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, greedy: true }, keyword: /\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/, operator: /-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/ }), delete Prism.languages.objectivec["class-name"], Prism.languages.objc = Prism.languages.objectivec, Prism.languages.reason = Prism.languages.extend("clike", { string: { pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/, greedy: true }, "class-name": /\b[A-Z]\w*/, keyword: /\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/, operator: /\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/ }), Prism.languages.insertBefore("reason", "class-name", { char: { pattern: /'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/, greedy: true }, constructor: /\b[A-Z]\w*\b(?!\s*\.)/, label: { pattern: /\b[a-z]\w*(?=::)/, alias: "symbol" } }), delete Prism.languages.reason.function, function(e) {
|
|
1021
|
+
for (var n = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, t = 0; t < 2; t++)
|
|
1022
|
+
n = n.replace(/<self>/g, function() {
|
|
1023
|
+
return n;
|
|
1024
|
+
});
|
|
1025
|
+
n = n.replace(/<self>/g, function() {
|
|
1026
|
+
return /[^\s\S]/.source;
|
|
1027
|
+
}), e.languages.rust = { comment: [{ pattern: RegExp(/(^|[^\\])/.source + n), lookbehind: true, greedy: true }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: true, greedy: true }], string: { pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/, greedy: true }, char: { pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/, greedy: true }, attribute: { pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/, greedy: true, alias: "attr-name", inside: { string: null } }, "closure-params": { pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/, lookbehind: true, greedy: true, inside: { "closure-punctuation": { pattern: /^\||\|$/, alias: "punctuation" }, rest: null } }, "lifetime-annotation": { pattern: /'\w+/, alias: "symbol" }, "fragment-specifier": { pattern: /(\$\w+:)[a-z]+/, lookbehind: true, alias: "punctuation" }, variable: /\$\w+/, "function-definition": { pattern: /(\bfn\s+)\w+/, lookbehind: true, alias: "function" }, "type-definition": { pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/, lookbehind: true, alias: "class-name" }, "module-declaration": [{ pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/, lookbehind: true, alias: "namespace" }, { pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/, lookbehind: true, alias: "namespace", inside: { punctuation: /::/ } }], keyword: [/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/, /\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/], function: /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/, macro: { pattern: /\b\w+!/, alias: "property" }, constant: /\b[A-Z_][A-Z_\d]+\b/, "class-name": /\b[A-Z]\w*\b/, namespace: { pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/, inside: { punctuation: /::/ } }, number: /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/, boolean: /\b(?:false|true)\b/, punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/, operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/ }, e.languages.rust["closure-params"].inside.rest = e.languages.rust, e.languages.rust.attribute.inside.string = e.languages.rust.string;
|
|
1028
|
+
}(Prism), Prism.languages.go = Prism.languages.extend("clike", { string: { pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/, lookbehind: true, greedy: true }, keyword: /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/, boolean: /\b(?:_|false|iota|nil|true)\b/, number: [/\b0(?:b[01_]+|o[0-7_]+)i?\b/i, /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i, /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i], operator: /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./, builtin: /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/ }), Prism.languages.insertBefore("go", "string", { char: { pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/, greedy: true } }), delete Prism.languages.go["class-name"], function(e) {
|
|
1029
|
+
var n = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, t = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, function() {
|
|
1030
|
+
return n.source;
|
|
1031
|
+
});
|
|
1032
|
+
e.languages.cpp = e.languages.extend("c", { "class-name": [{ pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g, function() {
|
|
1033
|
+
return n.source;
|
|
1034
|
+
})), lookbehind: true }, /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/, /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i, /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/], keyword: n, number: { pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i, greedy: true }, operator: />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, boolean: /\b(?:false|true)\b/ }), e.languages.insertBefore("cpp", "string", { module: { pattern: RegExp(/(\b(?:import|module)\s+)/.source + "(?:" + /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + "|" + /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g, function() {
|
|
1035
|
+
return t;
|
|
1036
|
+
}) + ")"), lookbehind: true, greedy: true, inside: { string: /^[<"][\s\S]+/, operator: /:/, punctuation: /\./ } }, "raw-string": { pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, alias: "string", greedy: true } }), e.languages.insertBefore("cpp", "keyword", { "generic-function": { pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i, inside: { function: /^\w+/, generic: { pattern: /<[\s\S]+/, alias: "class-name", inside: e.languages.cpp } } } }), e.languages.insertBefore("cpp", "operator", { "double-colon": { pattern: /::/, alias: "punctuation" } }), e.languages.insertBefore("cpp", "class-name", { "base-clause": { pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/, lookbehind: true, greedy: true, inside: e.languages.extend("cpp", {}) } }), e.languages.insertBefore("inside", "double-colon", { "class-name": /\b[a-z_]\w*\b(?!\s*::)/i }, e.languages.cpp["base-clause"]);
|
|
1037
|
+
}(Prism), Prism.languages.python = { comment: { pattern: /(^|[^\\])#.*/, lookbehind: true, greedy: true }, "string-interpolation": { pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, greedy: true, inside: { interpolation: { pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/, lookbehind: true, inside: { "format-spec": { pattern: /(:)[^:(){}]+(?=\}$)/, lookbehind: true }, "conversion-option": { pattern: //, alias: "punctuation" }, rest: null } }, string: /[\s\S]+/ } }, "triple-quoted-string": { pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i, greedy: true, alias: "string" }, string: { pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i, greedy: true }, function: { pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g, lookbehind: true }, "class-name": { pattern: /(\bclass\s+)\w+/i, lookbehind: true }, decorator: { pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m, lookbehind: true, alias: ["annotation", "punctuation"], inside: { punctuation: /\./ } }, keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/, builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, boolean: /\b(?:False|None|True)\b/, number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i, operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, punctuation: /[{}[\];(),.:]/ }, Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python, Prism.languages.py = Prism.languages.python, Prism.languages.json = { property: { pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/, lookbehind: true, greedy: true }, string: { pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, lookbehind: true, greedy: true }, comment: { pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: true }, number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, punctuation: /[{}[\],]/, operator: /:/, boolean: /\b(?:false|true)\b/, null: { pattern: /\bnull\b/, alias: "keyword" } }, Prism.languages.webmanifest = Prism.languages.json;
|
|
1038
|
+
|
|
1039
|
+
// src/themes/index.ts
|
|
1040
|
+
var themes_exports = {};
|
|
1041
|
+
__export(themes_exports, {
|
|
1042
|
+
dracula: () => dracula_default,
|
|
1043
|
+
duotoneDark: () => duotoneDark_default,
|
|
1044
|
+
duotoneLight: () => duotoneLight_default,
|
|
1045
|
+
github: () => github_default,
|
|
1046
|
+
gruvboxMaterialDark: () => gruvboxMaterialDark_default,
|
|
1047
|
+
gruvboxMaterialLight: () => gruvboxMaterialLight_default,
|
|
1048
|
+
jettwaveDark: () => jettwaveDark_default,
|
|
1049
|
+
jettwaveLight: () => jettwaveLight_default,
|
|
1050
|
+
nightOwl: () => nightOwl_default,
|
|
1051
|
+
nightOwlLight: () => nightOwlLight_default,
|
|
1052
|
+
oceanicNext: () => oceanicNext_default,
|
|
1053
|
+
okaidia: () => okaidia_default,
|
|
1054
|
+
oneDark: () => oneDark_default,
|
|
1055
|
+
oneLight: () => oneLight_default,
|
|
1056
|
+
palenight: () => palenight_default,
|
|
1057
|
+
shadesOfPurple: () => shadesOfPurple_default,
|
|
1058
|
+
synthwave84: () => synthwave84_default,
|
|
1059
|
+
ultramin: () => ultramin_default,
|
|
1060
|
+
vsDark: () => vsDark_default,
|
|
1061
|
+
vsLight: () => vsLight_default
|
|
1062
|
+
});
|
|
1063
|
+
|
|
1064
|
+
// src/themes/dracula.ts
|
|
1065
|
+
var theme = {
|
|
1066
|
+
plain: {
|
|
1067
|
+
color: "#F8F8F2",
|
|
1068
|
+
backgroundColor: "#282A36"
|
|
1069
|
+
},
|
|
1070
|
+
styles: [
|
|
1071
|
+
{
|
|
1072
|
+
types: ["prolog", "constant", "builtin"],
|
|
1073
|
+
style: {
|
|
1074
|
+
color: "rgb(189, 147, 249)"
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
types: ["inserted", "function"],
|
|
1079
|
+
style: {
|
|
1080
|
+
color: "rgb(80, 250, 123)"
|
|
1081
|
+
}
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
types: ["deleted"],
|
|
1085
|
+
style: {
|
|
1086
|
+
color: "rgb(255, 85, 85)"
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
types: ["changed"],
|
|
1091
|
+
style: {
|
|
1092
|
+
color: "rgb(255, 184, 108)"
|
|
1093
|
+
}
|
|
1094
|
+
},
|
|
1095
|
+
{
|
|
1096
|
+
types: ["punctuation", "symbol"],
|
|
1097
|
+
style: {
|
|
1098
|
+
color: "rgb(248, 248, 242)"
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
types: ["string", "char", "tag", "selector"],
|
|
1103
|
+
style: {
|
|
1104
|
+
color: "rgb(255, 121, 198)"
|
|
1105
|
+
}
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
types: ["keyword", "variable"],
|
|
1109
|
+
style: {
|
|
1110
|
+
color: "rgb(189, 147, 249)",
|
|
1111
|
+
fontStyle: "italic"
|
|
1112
|
+
}
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
types: ["comment"],
|
|
1116
|
+
style: {
|
|
1117
|
+
color: "rgb(98, 114, 164)"
|
|
1118
|
+
}
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
types: ["attr-name"],
|
|
1122
|
+
style: {
|
|
1123
|
+
color: "rgb(241, 250, 140)"
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
]
|
|
1127
|
+
};
|
|
1128
|
+
var dracula_default = theme;
|
|
1129
|
+
|
|
1130
|
+
// src/themes/duotoneDark.ts
|
|
1131
|
+
var theme2 = {
|
|
1132
|
+
plain: {
|
|
1133
|
+
backgroundColor: "#2a2734",
|
|
1134
|
+
color: "#9a86fd"
|
|
1135
|
+
},
|
|
1136
|
+
styles: [
|
|
1137
|
+
{
|
|
1138
|
+
types: ["comment", "prolog", "doctype", "cdata", "punctuation"],
|
|
1139
|
+
style: {
|
|
1140
|
+
color: "#6c6783"
|
|
1141
|
+
}
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
types: ["namespace"],
|
|
1145
|
+
style: {
|
|
1146
|
+
opacity: 0.7
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
types: ["tag", "operator", "number"],
|
|
1151
|
+
style: {
|
|
1152
|
+
color: "#e09142"
|
|
1153
|
+
}
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
types: ["property", "function"],
|
|
1157
|
+
style: {
|
|
1158
|
+
color: "#9a86fd"
|
|
1159
|
+
}
|
|
1160
|
+
},
|
|
1161
|
+
{
|
|
1162
|
+
types: ["tag-id", "selector", "atrule-id"],
|
|
1163
|
+
style: {
|
|
1164
|
+
color: "#eeebff"
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
types: ["attr-name"],
|
|
1169
|
+
style: {
|
|
1170
|
+
color: "#c4b9fe"
|
|
1171
|
+
}
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
types: [
|
|
1175
|
+
"boolean",
|
|
1176
|
+
"string",
|
|
1177
|
+
"entity",
|
|
1178
|
+
"url",
|
|
1179
|
+
"attr-value",
|
|
1180
|
+
"keyword",
|
|
1181
|
+
"control",
|
|
1182
|
+
"directive",
|
|
1183
|
+
"unit",
|
|
1184
|
+
"statement",
|
|
1185
|
+
"regex",
|
|
1186
|
+
"atrule",
|
|
1187
|
+
"placeholder",
|
|
1188
|
+
"variable"
|
|
1189
|
+
],
|
|
1190
|
+
style: {
|
|
1191
|
+
color: "#ffcc99"
|
|
1192
|
+
}
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
types: ["deleted"],
|
|
1196
|
+
style: {
|
|
1197
|
+
textDecorationLine: "line-through"
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
types: ["inserted"],
|
|
1202
|
+
style: {
|
|
1203
|
+
textDecorationLine: "underline"
|
|
1204
|
+
}
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
types: ["italic"],
|
|
1208
|
+
style: {
|
|
1209
|
+
fontStyle: "italic"
|
|
1210
|
+
}
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
types: ["important", "bold"],
|
|
1214
|
+
style: {
|
|
1215
|
+
fontWeight: "bold"
|
|
1216
|
+
}
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
types: ["important"],
|
|
1220
|
+
style: {
|
|
1221
|
+
color: "#c4b9fe"
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
]
|
|
1225
|
+
};
|
|
1226
|
+
var duotoneDark_default = theme2;
|
|
1227
|
+
|
|
1228
|
+
// src/themes/duotoneLight.ts
|
|
1229
|
+
var theme3 = {
|
|
1230
|
+
plain: {
|
|
1231
|
+
backgroundColor: "#faf8f5",
|
|
1232
|
+
color: "#728fcb"
|
|
1233
|
+
},
|
|
1234
|
+
styles: [
|
|
1235
|
+
{
|
|
1236
|
+
types: ["comment", "prolog", "doctype", "cdata", "punctuation"],
|
|
1237
|
+
style: {
|
|
1238
|
+
color: "#b6ad9a"
|
|
1239
|
+
}
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
types: ["namespace"],
|
|
1243
|
+
style: {
|
|
1244
|
+
opacity: 0.7
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
types: ["tag", "operator", "number"],
|
|
1249
|
+
style: {
|
|
1250
|
+
color: "#063289"
|
|
1251
|
+
}
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
types: ["property", "function"],
|
|
1255
|
+
style: {
|
|
1256
|
+
color: "#b29762"
|
|
1257
|
+
}
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
types: ["tag-id", "selector", "atrule-id"],
|
|
1261
|
+
style: {
|
|
1262
|
+
color: "#2d2006"
|
|
1263
|
+
}
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
types: ["attr-name"],
|
|
1267
|
+
style: {
|
|
1268
|
+
color: "#896724"
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
types: [
|
|
1273
|
+
"boolean",
|
|
1274
|
+
"string",
|
|
1275
|
+
"entity",
|
|
1276
|
+
"url",
|
|
1277
|
+
"attr-value",
|
|
1278
|
+
"keyword",
|
|
1279
|
+
"control",
|
|
1280
|
+
"directive",
|
|
1281
|
+
"unit",
|
|
1282
|
+
"statement",
|
|
1283
|
+
"regex",
|
|
1284
|
+
"atrule"
|
|
1285
|
+
],
|
|
1286
|
+
style: {
|
|
1287
|
+
color: "#728fcb"
|
|
1288
|
+
}
|
|
1289
|
+
},
|
|
1290
|
+
{
|
|
1291
|
+
types: ["placeholder", "variable"],
|
|
1292
|
+
style: {
|
|
1293
|
+
color: "#93abdc"
|
|
1294
|
+
}
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
types: ["deleted"],
|
|
1298
|
+
style: {
|
|
1299
|
+
textDecorationLine: "line-through"
|
|
1300
|
+
}
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
types: ["inserted"],
|
|
1304
|
+
style: {
|
|
1305
|
+
textDecorationLine: "underline"
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
{
|
|
1309
|
+
types: ["italic"],
|
|
1310
|
+
style: {
|
|
1311
|
+
fontStyle: "italic"
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
types: ["important", "bold"],
|
|
1316
|
+
style: {
|
|
1317
|
+
fontWeight: "bold"
|
|
1318
|
+
}
|
|
1319
|
+
},
|
|
1320
|
+
{
|
|
1321
|
+
types: ["important"],
|
|
1322
|
+
style: {
|
|
1323
|
+
color: "#896724"
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
]
|
|
1327
|
+
};
|
|
1328
|
+
var duotoneLight_default = theme3;
|
|
1329
|
+
|
|
1330
|
+
// src/themes/github.ts
|
|
1331
|
+
var theme4 = {
|
|
1332
|
+
plain: {
|
|
1333
|
+
color: "#393A34",
|
|
1334
|
+
backgroundColor: "#f6f8fa"
|
|
1335
|
+
},
|
|
1336
|
+
styles: [
|
|
1337
|
+
{
|
|
1338
|
+
types: ["comment", "prolog", "doctype", "cdata"],
|
|
1339
|
+
style: {
|
|
1340
|
+
color: "#999988",
|
|
1341
|
+
fontStyle: "italic"
|
|
1342
|
+
}
|
|
1343
|
+
},
|
|
1344
|
+
{
|
|
1345
|
+
types: ["namespace"],
|
|
1346
|
+
style: {
|
|
1347
|
+
opacity: 0.7
|
|
1348
|
+
}
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
types: ["string", "attr-value"],
|
|
1352
|
+
style: {
|
|
1353
|
+
color: "#e3116c"
|
|
1354
|
+
}
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
types: ["punctuation", "operator"],
|
|
1358
|
+
style: {
|
|
1359
|
+
color: "#393A34"
|
|
1360
|
+
}
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
types: [
|
|
1364
|
+
"entity",
|
|
1365
|
+
"url",
|
|
1366
|
+
"symbol",
|
|
1367
|
+
"number",
|
|
1368
|
+
"boolean",
|
|
1369
|
+
"variable",
|
|
1370
|
+
"constant",
|
|
1371
|
+
"property",
|
|
1372
|
+
"regex",
|
|
1373
|
+
"inserted"
|
|
1374
|
+
],
|
|
1375
|
+
style: {
|
|
1376
|
+
color: "#36acaa"
|
|
1377
|
+
}
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
types: ["atrule", "keyword", "attr-name", "selector"],
|
|
1381
|
+
style: {
|
|
1382
|
+
color: "#00a4db"
|
|
1383
|
+
}
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
types: ["function", "deleted", "tag"],
|
|
1387
|
+
style: {
|
|
1388
|
+
color: "#d73a49"
|
|
1389
|
+
}
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
types: ["function-variable"],
|
|
1393
|
+
style: {
|
|
1394
|
+
color: "#6f42c1"
|
|
1395
|
+
}
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
types: ["tag", "selector", "keyword"],
|
|
1399
|
+
style: {
|
|
1400
|
+
color: "#00009f"
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
]
|
|
1404
|
+
};
|
|
1405
|
+
var github_default = theme4;
|
|
1406
|
+
|
|
1407
|
+
// src/themes/nightOwl.ts
|
|
1408
|
+
var theme5 = {
|
|
1409
|
+
plain: {
|
|
1410
|
+
color: "#d6deeb",
|
|
1411
|
+
backgroundColor: "#011627"
|
|
1412
|
+
},
|
|
1413
|
+
styles: [
|
|
1414
|
+
{
|
|
1415
|
+
types: ["changed"],
|
|
1416
|
+
style: {
|
|
1417
|
+
color: "rgb(162, 191, 252)",
|
|
1418
|
+
fontStyle: "italic"
|
|
1419
|
+
}
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
types: ["deleted"],
|
|
1423
|
+
style: {
|
|
1424
|
+
color: "rgba(239, 83, 80, 0.56)",
|
|
1425
|
+
fontStyle: "italic"
|
|
1426
|
+
}
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
types: ["inserted", "attr-name"],
|
|
1430
|
+
style: {
|
|
1431
|
+
color: "rgb(173, 219, 103)",
|
|
1432
|
+
fontStyle: "italic"
|
|
1433
|
+
}
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
types: ["comment"],
|
|
1437
|
+
style: {
|
|
1438
|
+
color: "rgb(99, 119, 119)",
|
|
1439
|
+
fontStyle: "italic"
|
|
1440
|
+
}
|
|
1441
|
+
},
|
|
1442
|
+
{
|
|
1443
|
+
types: ["string", "url"],
|
|
1444
|
+
style: {
|
|
1445
|
+
color: "rgb(173, 219, 103)"
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
types: ["variable"],
|
|
1450
|
+
style: {
|
|
1451
|
+
color: "rgb(214, 222, 235)"
|
|
1452
|
+
}
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
types: ["number"],
|
|
1456
|
+
style: {
|
|
1457
|
+
color: "rgb(247, 140, 108)"
|
|
1458
|
+
}
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
types: ["builtin", "char", "constant", "function"],
|
|
1462
|
+
style: {
|
|
1463
|
+
color: "rgb(130, 170, 255)"
|
|
1464
|
+
}
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
// This was manually added after the auto-generation
|
|
1468
|
+
// so that punctuations are not italicised
|
|
1469
|
+
types: ["punctuation"],
|
|
1470
|
+
style: {
|
|
1471
|
+
color: "rgb(199, 146, 234)"
|
|
1472
|
+
}
|
|
1473
|
+
},
|
|
1474
|
+
{
|
|
1475
|
+
types: ["selector", "doctype"],
|
|
1476
|
+
style: {
|
|
1477
|
+
color: "rgb(199, 146, 234)",
|
|
1478
|
+
fontStyle: "italic"
|
|
1479
|
+
}
|
|
1480
|
+
},
|
|
1481
|
+
{
|
|
1482
|
+
types: ["class-name"],
|
|
1483
|
+
style: {
|
|
1484
|
+
color: "rgb(255, 203, 139)"
|
|
1485
|
+
}
|
|
1486
|
+
},
|
|
1487
|
+
{
|
|
1488
|
+
types: ["tag", "operator", "keyword"],
|
|
1489
|
+
style: {
|
|
1490
|
+
color: "rgb(127, 219, 202)"
|
|
1491
|
+
}
|
|
1492
|
+
},
|
|
1493
|
+
{
|
|
1494
|
+
types: ["boolean"],
|
|
1495
|
+
style: {
|
|
1496
|
+
color: "rgb(255, 88, 116)"
|
|
1497
|
+
}
|
|
1498
|
+
},
|
|
1499
|
+
{
|
|
1500
|
+
types: ["property"],
|
|
1501
|
+
style: {
|
|
1502
|
+
color: "rgb(128, 203, 196)"
|
|
1503
|
+
}
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
types: ["namespace"],
|
|
1507
|
+
style: {
|
|
1508
|
+
color: "rgb(178, 204, 214)"
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
]
|
|
1512
|
+
};
|
|
1513
|
+
var nightOwl_default = theme5;
|
|
1514
|
+
|
|
1515
|
+
// src/themes/nightOwlLight.ts
|
|
1516
|
+
var theme6 = {
|
|
1517
|
+
plain: {
|
|
1518
|
+
color: "#403f53",
|
|
1519
|
+
backgroundColor: "#FBFBFB"
|
|
1520
|
+
},
|
|
1521
|
+
styles: [
|
|
1522
|
+
{
|
|
1523
|
+
types: ["changed"],
|
|
1524
|
+
style: {
|
|
1525
|
+
color: "rgb(162, 191, 252)",
|
|
1526
|
+
fontStyle: "italic"
|
|
1527
|
+
}
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
types: ["deleted"],
|
|
1531
|
+
style: {
|
|
1532
|
+
color: "rgba(239, 83, 80, 0.56)",
|
|
1533
|
+
fontStyle: "italic"
|
|
1534
|
+
}
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
types: ["inserted", "attr-name"],
|
|
1538
|
+
style: {
|
|
1539
|
+
color: "rgb(72, 118, 214)",
|
|
1540
|
+
fontStyle: "italic"
|
|
1541
|
+
}
|
|
1542
|
+
},
|
|
1543
|
+
{
|
|
1544
|
+
types: ["comment"],
|
|
1545
|
+
style: {
|
|
1546
|
+
color: "rgb(152, 159, 177)",
|
|
1547
|
+
fontStyle: "italic"
|
|
1548
|
+
}
|
|
1549
|
+
},
|
|
1550
|
+
{
|
|
1551
|
+
types: ["string", "builtin", "char", "constant", "url"],
|
|
1552
|
+
style: {
|
|
1553
|
+
color: "rgb(72, 118, 214)"
|
|
1554
|
+
}
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
types: ["variable"],
|
|
1558
|
+
style: {
|
|
1559
|
+
color: "rgb(201, 103, 101)"
|
|
1560
|
+
}
|
|
1561
|
+
},
|
|
1562
|
+
{
|
|
1563
|
+
types: ["number"],
|
|
1564
|
+
style: {
|
|
1565
|
+
color: "rgb(170, 9, 130)"
|
|
1566
|
+
}
|
|
1567
|
+
},
|
|
1568
|
+
{
|
|
1569
|
+
// This was manually added after the auto-generation
|
|
1570
|
+
// so that punctuations are not italicised
|
|
1571
|
+
types: ["punctuation"],
|
|
1572
|
+
style: {
|
|
1573
|
+
color: "rgb(153, 76, 195)"
|
|
1574
|
+
}
|
|
1575
|
+
},
|
|
1576
|
+
{
|
|
1577
|
+
types: ["function", "selector", "doctype"],
|
|
1578
|
+
style: {
|
|
1579
|
+
color: "rgb(153, 76, 195)",
|
|
1580
|
+
fontStyle: "italic"
|
|
1581
|
+
}
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
types: ["class-name"],
|
|
1585
|
+
style: {
|
|
1586
|
+
color: "rgb(17, 17, 17)"
|
|
1587
|
+
}
|
|
1588
|
+
},
|
|
1589
|
+
{
|
|
1590
|
+
types: ["tag"],
|
|
1591
|
+
style: {
|
|
1592
|
+
color: "rgb(153, 76, 195)"
|
|
1593
|
+
}
|
|
1594
|
+
},
|
|
1595
|
+
{
|
|
1596
|
+
types: ["operator", "property", "keyword", "namespace"],
|
|
1597
|
+
style: {
|
|
1598
|
+
color: "rgb(12, 150, 155)"
|
|
1599
|
+
}
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
types: ["boolean"],
|
|
1603
|
+
style: {
|
|
1604
|
+
color: "rgb(188, 84, 84)"
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
]
|
|
1608
|
+
};
|
|
1609
|
+
var nightOwlLight_default = theme6;
|
|
1610
|
+
|
|
1611
|
+
// src/themes/oceanicNext.ts
|
|
1612
|
+
var colors = {
|
|
1613
|
+
char: "#D8DEE9",
|
|
1614
|
+
comment: "#999999",
|
|
1615
|
+
keyword: "#c5a5c5",
|
|
1616
|
+
primitive: "#5a9bcf",
|
|
1617
|
+
string: "#8dc891",
|
|
1618
|
+
variable: "#d7deea",
|
|
1619
|
+
boolean: "#ff8b50",
|
|
1620
|
+
tag: "#fc929e",
|
|
1621
|
+
function: "#79b6f2",
|
|
1622
|
+
className: "#FAC863"};
|
|
1623
|
+
var theme7 = {
|
|
1624
|
+
plain: {
|
|
1625
|
+
backgroundColor: "#282c34",
|
|
1626
|
+
color: "#ffffff"
|
|
1627
|
+
},
|
|
1628
|
+
styles: [
|
|
1629
|
+
{
|
|
1630
|
+
types: ["attr-name"],
|
|
1631
|
+
style: {
|
|
1632
|
+
color: colors.keyword
|
|
1633
|
+
}
|
|
1634
|
+
},
|
|
1635
|
+
{
|
|
1636
|
+
types: ["attr-value"],
|
|
1637
|
+
style: {
|
|
1638
|
+
color: colors.string
|
|
1639
|
+
}
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
types: [
|
|
1643
|
+
"comment",
|
|
1644
|
+
"block-comment",
|
|
1645
|
+
"prolog",
|
|
1646
|
+
"doctype",
|
|
1647
|
+
"cdata",
|
|
1648
|
+
"shebang"
|
|
1649
|
+
],
|
|
1650
|
+
style: {
|
|
1651
|
+
color: colors.comment
|
|
1652
|
+
}
|
|
1653
|
+
},
|
|
1654
|
+
{
|
|
1655
|
+
types: [
|
|
1656
|
+
"property",
|
|
1657
|
+
"number",
|
|
1658
|
+
"function-name",
|
|
1659
|
+
"constant",
|
|
1660
|
+
"symbol",
|
|
1661
|
+
"deleted"
|
|
1662
|
+
],
|
|
1663
|
+
style: {
|
|
1664
|
+
color: colors.primitive
|
|
1665
|
+
}
|
|
1666
|
+
},
|
|
1667
|
+
{
|
|
1668
|
+
types: ["boolean"],
|
|
1669
|
+
style: {
|
|
1670
|
+
color: colors.boolean
|
|
1671
|
+
}
|
|
1672
|
+
},
|
|
1673
|
+
{
|
|
1674
|
+
types: ["tag"],
|
|
1675
|
+
style: {
|
|
1676
|
+
color: colors.tag
|
|
1677
|
+
}
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
types: ["string"],
|
|
1681
|
+
style: {
|
|
1682
|
+
color: colors.string
|
|
1683
|
+
}
|
|
1684
|
+
},
|
|
1685
|
+
{
|
|
1686
|
+
types: ["punctuation"],
|
|
1687
|
+
style: {
|
|
1688
|
+
color: colors.string
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
types: ["selector", "char", "builtin", "inserted"],
|
|
1693
|
+
style: {
|
|
1694
|
+
color: colors.char
|
|
1695
|
+
}
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
types: ["function"],
|
|
1699
|
+
style: {
|
|
1700
|
+
color: colors.function
|
|
1701
|
+
}
|
|
1702
|
+
},
|
|
1703
|
+
{
|
|
1704
|
+
types: ["operator", "entity", "url", "variable"],
|
|
1705
|
+
style: {
|
|
1706
|
+
color: colors.variable
|
|
1707
|
+
}
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
types: ["keyword"],
|
|
1711
|
+
style: {
|
|
1712
|
+
color: colors.keyword
|
|
1713
|
+
}
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
types: ["atrule", "class-name"],
|
|
1717
|
+
style: {
|
|
1718
|
+
color: colors.className
|
|
1719
|
+
}
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
types: ["important"],
|
|
1723
|
+
style: {
|
|
1724
|
+
fontWeight: "400"
|
|
1725
|
+
}
|
|
1726
|
+
},
|
|
1727
|
+
{
|
|
1728
|
+
types: ["bold"],
|
|
1729
|
+
style: {
|
|
1730
|
+
fontWeight: "bold"
|
|
1731
|
+
}
|
|
1732
|
+
},
|
|
1733
|
+
{
|
|
1734
|
+
types: ["italic"],
|
|
1735
|
+
style: {
|
|
1736
|
+
fontStyle: "italic"
|
|
1737
|
+
}
|
|
1738
|
+
},
|
|
1739
|
+
{
|
|
1740
|
+
types: ["namespace"],
|
|
1741
|
+
style: {
|
|
1742
|
+
opacity: 0.7
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
]
|
|
1746
|
+
};
|
|
1747
|
+
var oceanicNext_default = theme7;
|
|
1748
|
+
|
|
1749
|
+
// src/themes/okaidia.ts
|
|
1750
|
+
var theme8 = {
|
|
1751
|
+
plain: {
|
|
1752
|
+
color: "#f8f8f2",
|
|
1753
|
+
backgroundColor: "#272822"
|
|
1754
|
+
},
|
|
1755
|
+
styles: [
|
|
1756
|
+
{
|
|
1757
|
+
types: ["changed"],
|
|
1758
|
+
style: {
|
|
1759
|
+
color: "rgb(162, 191, 252)",
|
|
1760
|
+
fontStyle: "italic"
|
|
1761
|
+
}
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
types: ["deleted"],
|
|
1765
|
+
style: {
|
|
1766
|
+
color: "#f92672",
|
|
1767
|
+
fontStyle: "italic"
|
|
1768
|
+
}
|
|
1769
|
+
},
|
|
1770
|
+
{
|
|
1771
|
+
types: ["inserted"],
|
|
1772
|
+
style: {
|
|
1773
|
+
color: "rgb(173, 219, 103)",
|
|
1774
|
+
fontStyle: "italic"
|
|
1775
|
+
}
|
|
1776
|
+
},
|
|
1777
|
+
{
|
|
1778
|
+
types: ["comment"],
|
|
1779
|
+
style: {
|
|
1780
|
+
color: "#8292a2",
|
|
1781
|
+
fontStyle: "italic"
|
|
1782
|
+
}
|
|
1783
|
+
},
|
|
1784
|
+
{
|
|
1785
|
+
types: ["string", "url"],
|
|
1786
|
+
style: {
|
|
1787
|
+
color: "#a6e22e"
|
|
1788
|
+
}
|
|
1789
|
+
},
|
|
1790
|
+
{
|
|
1791
|
+
types: ["variable"],
|
|
1792
|
+
style: {
|
|
1793
|
+
color: "#f8f8f2"
|
|
1794
|
+
}
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
types: ["number"],
|
|
1798
|
+
style: {
|
|
1799
|
+
color: "#ae81ff"
|
|
1800
|
+
}
|
|
1801
|
+
},
|
|
1802
|
+
{
|
|
1803
|
+
types: ["builtin", "char", "constant", "function", "class-name"],
|
|
1804
|
+
style: {
|
|
1805
|
+
color: "#e6db74"
|
|
1806
|
+
}
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
types: ["punctuation"],
|
|
1810
|
+
style: {
|
|
1811
|
+
color: "#f8f8f2"
|
|
1812
|
+
}
|
|
1813
|
+
},
|
|
1814
|
+
{
|
|
1815
|
+
types: ["selector", "doctype"],
|
|
1816
|
+
style: {
|
|
1817
|
+
color: "#a6e22e",
|
|
1818
|
+
fontStyle: "italic"
|
|
1819
|
+
}
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
types: ["tag", "operator", "keyword"],
|
|
1823
|
+
style: {
|
|
1824
|
+
color: "#66d9ef"
|
|
1825
|
+
}
|
|
1826
|
+
},
|
|
1827
|
+
{
|
|
1828
|
+
types: ["boolean"],
|
|
1829
|
+
style: {
|
|
1830
|
+
color: "#ae81ff"
|
|
1831
|
+
}
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
types: ["namespace"],
|
|
1835
|
+
style: {
|
|
1836
|
+
color: "rgb(178, 204, 214)",
|
|
1837
|
+
opacity: 0.7
|
|
1838
|
+
}
|
|
1839
|
+
},
|
|
1840
|
+
{
|
|
1841
|
+
types: ["tag", "property"],
|
|
1842
|
+
style: {
|
|
1843
|
+
color: "#f92672"
|
|
1844
|
+
}
|
|
1845
|
+
},
|
|
1846
|
+
{
|
|
1847
|
+
types: ["attr-name"],
|
|
1848
|
+
style: {
|
|
1849
|
+
color: "#a6e22e !important"
|
|
1850
|
+
}
|
|
1851
|
+
},
|
|
1852
|
+
{
|
|
1853
|
+
types: ["doctype"],
|
|
1854
|
+
style: {
|
|
1855
|
+
color: "#8292a2"
|
|
1856
|
+
}
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
types: ["rule"],
|
|
1860
|
+
style: {
|
|
1861
|
+
color: "#e6db74"
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
]
|
|
1865
|
+
};
|
|
1866
|
+
var okaidia_default = theme8;
|
|
1867
|
+
|
|
1868
|
+
// src/themes/palenight.ts
|
|
1869
|
+
var theme9 = {
|
|
1870
|
+
plain: {
|
|
1871
|
+
color: "#bfc7d5",
|
|
1872
|
+
backgroundColor: "#292d3e"
|
|
1873
|
+
},
|
|
1874
|
+
styles: [
|
|
1875
|
+
{
|
|
1876
|
+
types: ["comment"],
|
|
1877
|
+
style: {
|
|
1878
|
+
color: "rgb(105, 112, 152)",
|
|
1879
|
+
fontStyle: "italic"
|
|
1880
|
+
}
|
|
1881
|
+
},
|
|
1882
|
+
{
|
|
1883
|
+
types: ["string", "inserted"],
|
|
1884
|
+
style: {
|
|
1885
|
+
color: "rgb(195, 232, 141)"
|
|
1886
|
+
}
|
|
1887
|
+
},
|
|
1888
|
+
{
|
|
1889
|
+
types: ["number"],
|
|
1890
|
+
style: {
|
|
1891
|
+
color: "rgb(247, 140, 108)"
|
|
1892
|
+
}
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
types: ["builtin", "char", "constant", "function"],
|
|
1896
|
+
style: {
|
|
1897
|
+
color: "rgb(130, 170, 255)"
|
|
1898
|
+
}
|
|
1899
|
+
},
|
|
1900
|
+
{
|
|
1901
|
+
types: ["punctuation", "selector"],
|
|
1902
|
+
style: {
|
|
1903
|
+
color: "rgb(199, 146, 234)"
|
|
1904
|
+
}
|
|
1905
|
+
},
|
|
1906
|
+
{
|
|
1907
|
+
types: ["variable"],
|
|
1908
|
+
style: {
|
|
1909
|
+
color: "rgb(191, 199, 213)"
|
|
1910
|
+
}
|
|
1911
|
+
},
|
|
1912
|
+
{
|
|
1913
|
+
types: ["class-name", "attr-name"],
|
|
1914
|
+
style: {
|
|
1915
|
+
color: "rgb(255, 203, 107)"
|
|
1916
|
+
}
|
|
1917
|
+
},
|
|
1918
|
+
{
|
|
1919
|
+
types: ["tag", "deleted"],
|
|
1920
|
+
style: {
|
|
1921
|
+
color: "rgb(255, 85, 114)"
|
|
1922
|
+
}
|
|
1923
|
+
},
|
|
1924
|
+
{
|
|
1925
|
+
types: ["operator"],
|
|
1926
|
+
style: {
|
|
1927
|
+
color: "rgb(137, 221, 255)"
|
|
1928
|
+
}
|
|
1929
|
+
},
|
|
1930
|
+
{
|
|
1931
|
+
types: ["boolean"],
|
|
1932
|
+
style: {
|
|
1933
|
+
color: "rgb(255, 88, 116)"
|
|
1934
|
+
}
|
|
1935
|
+
},
|
|
1936
|
+
{
|
|
1937
|
+
types: ["keyword"],
|
|
1938
|
+
style: {
|
|
1939
|
+
fontStyle: "italic"
|
|
1940
|
+
}
|
|
1941
|
+
},
|
|
1942
|
+
{
|
|
1943
|
+
types: ["doctype"],
|
|
1944
|
+
style: {
|
|
1945
|
+
color: "rgb(199, 146, 234)",
|
|
1946
|
+
fontStyle: "italic"
|
|
1947
|
+
}
|
|
1948
|
+
},
|
|
1949
|
+
{
|
|
1950
|
+
types: ["namespace"],
|
|
1951
|
+
style: {
|
|
1952
|
+
color: "rgb(178, 204, 214)"
|
|
1953
|
+
}
|
|
1954
|
+
},
|
|
1955
|
+
{
|
|
1956
|
+
types: ["url"],
|
|
1957
|
+
style: {
|
|
1958
|
+
color: "rgb(221, 221, 221)"
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
]
|
|
1962
|
+
};
|
|
1963
|
+
var palenight_default = theme9;
|
|
1964
|
+
|
|
1965
|
+
// src/themes/shadesOfPurple.ts
|
|
1966
|
+
var theme10 = {
|
|
1967
|
+
plain: {
|
|
1968
|
+
color: "#9EFEFF",
|
|
1969
|
+
backgroundColor: "#2D2A55"
|
|
1970
|
+
},
|
|
1971
|
+
styles: [
|
|
1972
|
+
{
|
|
1973
|
+
types: ["changed"],
|
|
1974
|
+
style: {
|
|
1975
|
+
color: "rgb(255, 238, 128)"
|
|
1976
|
+
}
|
|
1977
|
+
},
|
|
1978
|
+
{
|
|
1979
|
+
types: ["deleted"],
|
|
1980
|
+
style: {
|
|
1981
|
+
color: "rgba(239, 83, 80, 0.56)"
|
|
1982
|
+
}
|
|
1983
|
+
},
|
|
1984
|
+
{
|
|
1985
|
+
types: ["inserted"],
|
|
1986
|
+
style: {
|
|
1987
|
+
color: "rgb(173, 219, 103)"
|
|
1988
|
+
}
|
|
1989
|
+
},
|
|
1990
|
+
{
|
|
1991
|
+
types: ["comment"],
|
|
1992
|
+
style: {
|
|
1993
|
+
color: "rgb(179, 98, 255)",
|
|
1994
|
+
fontStyle: "italic"
|
|
1995
|
+
}
|
|
1996
|
+
},
|
|
1997
|
+
{
|
|
1998
|
+
types: ["punctuation"],
|
|
1999
|
+
style: {
|
|
2000
|
+
color: "rgb(255, 255, 255)"
|
|
2001
|
+
}
|
|
2002
|
+
},
|
|
2003
|
+
{
|
|
2004
|
+
types: ["constant"],
|
|
2005
|
+
style: {
|
|
2006
|
+
color: "rgb(255, 98, 140)"
|
|
2007
|
+
}
|
|
2008
|
+
},
|
|
2009
|
+
{
|
|
2010
|
+
types: ["string", "url"],
|
|
2011
|
+
style: {
|
|
2012
|
+
color: "rgb(165, 255, 144)"
|
|
2013
|
+
}
|
|
2014
|
+
},
|
|
2015
|
+
{
|
|
2016
|
+
types: ["variable"],
|
|
2017
|
+
style: {
|
|
2018
|
+
color: "rgb(255, 238, 128)"
|
|
2019
|
+
}
|
|
2020
|
+
},
|
|
2021
|
+
{
|
|
2022
|
+
types: ["number", "boolean"],
|
|
2023
|
+
style: {
|
|
2024
|
+
color: "rgb(255, 98, 140)"
|
|
2025
|
+
}
|
|
2026
|
+
},
|
|
2027
|
+
{
|
|
2028
|
+
types: ["attr-name"],
|
|
2029
|
+
style: {
|
|
2030
|
+
color: "rgb(255, 180, 84)"
|
|
2031
|
+
}
|
|
2032
|
+
},
|
|
2033
|
+
{
|
|
2034
|
+
types: [
|
|
2035
|
+
"keyword",
|
|
2036
|
+
"operator",
|
|
2037
|
+
"property",
|
|
2038
|
+
"namespace",
|
|
2039
|
+
"tag",
|
|
2040
|
+
"selector",
|
|
2041
|
+
"doctype"
|
|
2042
|
+
],
|
|
2043
|
+
style: {
|
|
2044
|
+
color: "rgb(255, 157, 0)"
|
|
2045
|
+
}
|
|
2046
|
+
},
|
|
2047
|
+
{
|
|
2048
|
+
types: ["builtin", "char", "constant", "function", "class-name"],
|
|
2049
|
+
style: {
|
|
2050
|
+
color: "rgb(250, 208, 0)"
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
]
|
|
2054
|
+
};
|
|
2055
|
+
var shadesOfPurple_default = theme10;
|
|
2056
|
+
|
|
2057
|
+
// src/themes/synthwave84.ts
|
|
2058
|
+
var theme11 = {
|
|
2059
|
+
plain: {
|
|
2060
|
+
backgroundColor: "linear-gradient(to bottom, #2a2139 75%, #34294f)",
|
|
2061
|
+
backgroundImage: "#34294f",
|
|
2062
|
+
color: "#f92aad",
|
|
2063
|
+
textShadow: "0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"
|
|
2064
|
+
},
|
|
2065
|
+
styles: [
|
|
2066
|
+
{
|
|
2067
|
+
types: ["comment", "block-comment", "prolog", "doctype", "cdata"],
|
|
2068
|
+
style: {
|
|
2069
|
+
color: "#495495",
|
|
2070
|
+
fontStyle: "italic"
|
|
2071
|
+
}
|
|
2072
|
+
},
|
|
2073
|
+
{
|
|
2074
|
+
types: ["punctuation"],
|
|
2075
|
+
style: {
|
|
2076
|
+
color: "#ccc"
|
|
2077
|
+
}
|
|
2078
|
+
},
|
|
2079
|
+
{
|
|
2080
|
+
types: [
|
|
2081
|
+
"tag",
|
|
2082
|
+
"attr-name",
|
|
2083
|
+
"namespace",
|
|
2084
|
+
"number",
|
|
2085
|
+
"unit",
|
|
2086
|
+
"hexcode",
|
|
2087
|
+
"deleted"
|
|
2088
|
+
],
|
|
2089
|
+
style: {
|
|
2090
|
+
color: "#e2777a"
|
|
2091
|
+
}
|
|
2092
|
+
},
|
|
2093
|
+
{
|
|
2094
|
+
types: ["property", "selector"],
|
|
2095
|
+
style: {
|
|
2096
|
+
color: "#72f1b8",
|
|
2097
|
+
textShadow: "0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"
|
|
2098
|
+
}
|
|
2099
|
+
},
|
|
2100
|
+
{
|
|
2101
|
+
types: ["function-name"],
|
|
2102
|
+
style: {
|
|
2103
|
+
color: "#6196cc"
|
|
2104
|
+
}
|
|
2105
|
+
},
|
|
2106
|
+
{
|
|
2107
|
+
types: ["boolean", "selector-id", "function"],
|
|
2108
|
+
style: {
|
|
2109
|
+
color: "#fdfdfd",
|
|
2110
|
+
textShadow: "0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"
|
|
2111
|
+
}
|
|
2112
|
+
},
|
|
2113
|
+
{
|
|
2114
|
+
types: ["class-name", "maybe-class-name", "builtin"],
|
|
2115
|
+
style: {
|
|
2116
|
+
color: "#fff5f6",
|
|
2117
|
+
textShadow: "0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"
|
|
2118
|
+
}
|
|
2119
|
+
},
|
|
2120
|
+
{
|
|
2121
|
+
types: ["constant", "symbol"],
|
|
2122
|
+
style: {
|
|
2123
|
+
color: "#f92aad",
|
|
2124
|
+
textShadow: "0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"
|
|
2125
|
+
}
|
|
2126
|
+
},
|
|
2127
|
+
{
|
|
2128
|
+
types: ["important", "atrule", "keyword", "selector-class"],
|
|
2129
|
+
style: {
|
|
2130
|
+
color: "#f4eee4",
|
|
2131
|
+
textShadow: "0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"
|
|
2132
|
+
}
|
|
2133
|
+
},
|
|
2134
|
+
{
|
|
2135
|
+
types: ["string", "char", "attr-value", "regex", "variable"],
|
|
2136
|
+
style: {
|
|
2137
|
+
color: "#f87c32"
|
|
2138
|
+
}
|
|
2139
|
+
},
|
|
2140
|
+
{
|
|
2141
|
+
types: ["parameter"],
|
|
2142
|
+
style: {
|
|
2143
|
+
fontStyle: "italic"
|
|
2144
|
+
}
|
|
2145
|
+
},
|
|
2146
|
+
{
|
|
2147
|
+
types: ["entity", "url"],
|
|
2148
|
+
style: {
|
|
2149
|
+
color: "#67cdcc"
|
|
2150
|
+
}
|
|
2151
|
+
},
|
|
2152
|
+
{
|
|
2153
|
+
types: ["operator"],
|
|
2154
|
+
style: {
|
|
2155
|
+
color: "ffffffee"
|
|
2156
|
+
}
|
|
2157
|
+
},
|
|
2158
|
+
{
|
|
2159
|
+
types: ["important", "bold"],
|
|
2160
|
+
style: {
|
|
2161
|
+
fontWeight: "bold"
|
|
2162
|
+
}
|
|
2163
|
+
},
|
|
2164
|
+
{
|
|
2165
|
+
types: ["italic"],
|
|
2166
|
+
style: {
|
|
2167
|
+
fontStyle: "italic"
|
|
2168
|
+
}
|
|
2169
|
+
},
|
|
2170
|
+
{
|
|
2171
|
+
types: ["entity"],
|
|
2172
|
+
style: {
|
|
2173
|
+
cursor: "help"
|
|
2174
|
+
}
|
|
2175
|
+
},
|
|
2176
|
+
{
|
|
2177
|
+
types: ["inserted"],
|
|
2178
|
+
style: {
|
|
2179
|
+
color: "green"
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
]
|
|
2183
|
+
};
|
|
2184
|
+
var synthwave84_default = theme11;
|
|
2185
|
+
|
|
2186
|
+
// src/themes/ultramin.ts
|
|
2187
|
+
var theme12 = {
|
|
2188
|
+
plain: {
|
|
2189
|
+
color: "#282a2e",
|
|
2190
|
+
backgroundColor: "#ffffff"
|
|
2191
|
+
},
|
|
2192
|
+
styles: [
|
|
2193
|
+
{
|
|
2194
|
+
types: ["comment"],
|
|
2195
|
+
style: {
|
|
2196
|
+
color: "rgb(197, 200, 198)"
|
|
2197
|
+
}
|
|
2198
|
+
},
|
|
2199
|
+
{
|
|
2200
|
+
types: ["string", "number", "builtin", "variable"],
|
|
2201
|
+
style: {
|
|
2202
|
+
color: "rgb(150, 152, 150)"
|
|
2203
|
+
}
|
|
2204
|
+
},
|
|
2205
|
+
{
|
|
2206
|
+
types: ["class-name", "function", "tag", "attr-name"],
|
|
2207
|
+
style: {
|
|
2208
|
+
color: "rgb(40, 42, 46)"
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
]
|
|
2212
|
+
};
|
|
2213
|
+
var ultramin_default = theme12;
|
|
2214
|
+
|
|
2215
|
+
// src/themes/vsDark.ts
|
|
2216
|
+
var theme13 = {
|
|
2217
|
+
plain: {
|
|
2218
|
+
color: "#9CDCFE",
|
|
2219
|
+
backgroundColor: "#1E1E1E"
|
|
2220
|
+
},
|
|
2221
|
+
styles: [
|
|
2222
|
+
{
|
|
2223
|
+
types: ["prolog"],
|
|
2224
|
+
style: {
|
|
2225
|
+
color: "rgb(0, 0, 128)"
|
|
2226
|
+
}
|
|
2227
|
+
},
|
|
2228
|
+
{
|
|
2229
|
+
types: ["comment"],
|
|
2230
|
+
style: {
|
|
2231
|
+
color: "rgb(106, 153, 85)"
|
|
2232
|
+
}
|
|
2233
|
+
},
|
|
2234
|
+
{
|
|
2235
|
+
types: ["builtin", "changed", "keyword", "interpolation-punctuation"],
|
|
2236
|
+
style: {
|
|
2237
|
+
color: "rgb(86, 156, 214)"
|
|
2238
|
+
}
|
|
2239
|
+
},
|
|
2240
|
+
{
|
|
2241
|
+
types: ["number", "inserted"],
|
|
2242
|
+
style: {
|
|
2243
|
+
color: "rgb(181, 206, 168)"
|
|
2244
|
+
}
|
|
2245
|
+
},
|
|
2246
|
+
{
|
|
2247
|
+
types: ["constant"],
|
|
2248
|
+
style: {
|
|
2249
|
+
color: "rgb(100, 102, 149)"
|
|
2250
|
+
}
|
|
2251
|
+
},
|
|
2252
|
+
{
|
|
2253
|
+
types: ["attr-name", "variable"],
|
|
2254
|
+
style: {
|
|
2255
|
+
color: "rgb(156, 220, 254)"
|
|
2256
|
+
}
|
|
2257
|
+
},
|
|
2258
|
+
{
|
|
2259
|
+
types: ["deleted", "string", "attr-value", "template-punctuation"],
|
|
2260
|
+
style: {
|
|
2261
|
+
color: "rgb(206, 145, 120)"
|
|
2262
|
+
}
|
|
2263
|
+
},
|
|
2264
|
+
{
|
|
2265
|
+
types: ["selector"],
|
|
2266
|
+
style: {
|
|
2267
|
+
color: "rgb(215, 186, 125)"
|
|
2268
|
+
}
|
|
2269
|
+
},
|
|
2270
|
+
{
|
|
2271
|
+
// Fix tag color
|
|
2272
|
+
types: ["tag"],
|
|
2273
|
+
style: {
|
|
2274
|
+
color: "rgb(78, 201, 176)"
|
|
2275
|
+
}
|
|
2276
|
+
},
|
|
2277
|
+
{
|
|
2278
|
+
// Fix tag color for HTML
|
|
2279
|
+
types: ["tag"],
|
|
2280
|
+
languages: ["markup"],
|
|
2281
|
+
style: {
|
|
2282
|
+
color: "rgb(86, 156, 214)"
|
|
2283
|
+
}
|
|
2284
|
+
},
|
|
2285
|
+
{
|
|
2286
|
+
types: ["punctuation", "operator"],
|
|
2287
|
+
style: {
|
|
2288
|
+
color: "rgb(212, 212, 212)"
|
|
2289
|
+
}
|
|
2290
|
+
},
|
|
2291
|
+
{
|
|
2292
|
+
// Fix punctuation color for HTML
|
|
2293
|
+
types: ["punctuation"],
|
|
2294
|
+
languages: ["markup"],
|
|
2295
|
+
style: {
|
|
2296
|
+
color: "#808080"
|
|
2297
|
+
}
|
|
2298
|
+
},
|
|
2299
|
+
{
|
|
2300
|
+
types: ["function"],
|
|
2301
|
+
style: {
|
|
2302
|
+
color: "rgb(220, 220, 170)"
|
|
2303
|
+
}
|
|
2304
|
+
},
|
|
2305
|
+
{
|
|
2306
|
+
types: ["class-name"],
|
|
2307
|
+
style: {
|
|
2308
|
+
color: "rgb(78, 201, 176)"
|
|
2309
|
+
}
|
|
2310
|
+
},
|
|
2311
|
+
{
|
|
2312
|
+
types: ["char"],
|
|
2313
|
+
style: {
|
|
2314
|
+
color: "rgb(209, 105, 105)"
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
]
|
|
2318
|
+
};
|
|
2319
|
+
var vsDark_default = theme13;
|
|
2320
|
+
|
|
2321
|
+
// src/themes/vsLight.ts
|
|
2322
|
+
var theme14 = {
|
|
2323
|
+
plain: {
|
|
2324
|
+
color: "#000000",
|
|
2325
|
+
backgroundColor: "#ffffff"
|
|
2326
|
+
},
|
|
2327
|
+
styles: [
|
|
2328
|
+
{
|
|
2329
|
+
types: ["comment"],
|
|
2330
|
+
style: {
|
|
2331
|
+
color: "rgb(0, 128, 0)"
|
|
2332
|
+
}
|
|
2333
|
+
},
|
|
2334
|
+
{
|
|
2335
|
+
types: ["builtin"],
|
|
2336
|
+
style: {
|
|
2337
|
+
color: "rgb(0, 112, 193)"
|
|
2338
|
+
}
|
|
2339
|
+
},
|
|
2340
|
+
{
|
|
2341
|
+
types: ["number", "variable", "inserted"],
|
|
2342
|
+
style: {
|
|
2343
|
+
color: "rgb(9, 134, 88)"
|
|
2344
|
+
}
|
|
2345
|
+
},
|
|
2346
|
+
{
|
|
2347
|
+
types: ["operator"],
|
|
2348
|
+
style: {
|
|
2349
|
+
color: "rgb(0, 0, 0)"
|
|
2350
|
+
}
|
|
2351
|
+
},
|
|
2352
|
+
{
|
|
2353
|
+
types: ["constant", "char"],
|
|
2354
|
+
style: {
|
|
2355
|
+
color: "rgb(129, 31, 63)"
|
|
2356
|
+
}
|
|
2357
|
+
},
|
|
2358
|
+
{
|
|
2359
|
+
types: ["tag"],
|
|
2360
|
+
style: {
|
|
2361
|
+
color: "rgb(128, 0, 0)"
|
|
2362
|
+
}
|
|
2363
|
+
},
|
|
2364
|
+
{
|
|
2365
|
+
types: ["attr-name"],
|
|
2366
|
+
style: {
|
|
2367
|
+
color: "rgb(255, 0, 0)"
|
|
2368
|
+
}
|
|
2369
|
+
},
|
|
2370
|
+
{
|
|
2371
|
+
types: ["deleted", "string"],
|
|
2372
|
+
style: {
|
|
2373
|
+
color: "rgb(163, 21, 21)"
|
|
2374
|
+
}
|
|
2375
|
+
},
|
|
2376
|
+
{
|
|
2377
|
+
types: ["changed", "punctuation"],
|
|
2378
|
+
style: {
|
|
2379
|
+
color: "rgb(4, 81, 165)"
|
|
2380
|
+
}
|
|
2381
|
+
},
|
|
2382
|
+
{
|
|
2383
|
+
types: ["function", "keyword"],
|
|
2384
|
+
style: {
|
|
2385
|
+
color: "rgb(0, 0, 255)"
|
|
2386
|
+
}
|
|
2387
|
+
},
|
|
2388
|
+
{
|
|
2389
|
+
types: ["class-name"],
|
|
2390
|
+
style: {
|
|
2391
|
+
color: "rgb(38, 127, 153)"
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
]
|
|
2395
|
+
};
|
|
2396
|
+
var vsLight_default = theme14;
|
|
2397
|
+
|
|
2398
|
+
// src/themes/jettwaveDark.ts
|
|
2399
|
+
var theme15 = {
|
|
2400
|
+
plain: {
|
|
2401
|
+
color: "#f8fafc",
|
|
2402
|
+
backgroundColor: "#011627"
|
|
2403
|
+
},
|
|
2404
|
+
styles: [
|
|
2405
|
+
{
|
|
2406
|
+
types: ["prolog"],
|
|
2407
|
+
style: {
|
|
2408
|
+
color: "#000080"
|
|
2409
|
+
}
|
|
2410
|
+
},
|
|
2411
|
+
{
|
|
2412
|
+
types: ["comment"],
|
|
2413
|
+
style: {
|
|
2414
|
+
color: "#6A9955"
|
|
2415
|
+
}
|
|
2416
|
+
},
|
|
2417
|
+
{
|
|
2418
|
+
types: ["builtin", "changed", "keyword", "interpolation-punctuation"],
|
|
2419
|
+
style: {
|
|
2420
|
+
color: "#569CD6"
|
|
2421
|
+
}
|
|
2422
|
+
},
|
|
2423
|
+
{
|
|
2424
|
+
types: ["number", "inserted"],
|
|
2425
|
+
style: {
|
|
2426
|
+
color: "#B5CEA8"
|
|
2427
|
+
}
|
|
2428
|
+
},
|
|
2429
|
+
{
|
|
2430
|
+
types: ["constant"],
|
|
2431
|
+
style: {
|
|
2432
|
+
color: "#f8fafc"
|
|
2433
|
+
}
|
|
2434
|
+
},
|
|
2435
|
+
{
|
|
2436
|
+
types: ["attr-name", "variable"],
|
|
2437
|
+
style: {
|
|
2438
|
+
color: "#9CDCFE"
|
|
2439
|
+
}
|
|
2440
|
+
},
|
|
2441
|
+
{
|
|
2442
|
+
types: ["deleted", "string", "attr-value", "template-punctuation"],
|
|
2443
|
+
style: {
|
|
2444
|
+
color: "#cbd5e1"
|
|
2445
|
+
}
|
|
2446
|
+
},
|
|
2447
|
+
{
|
|
2448
|
+
types: ["selector"],
|
|
2449
|
+
style: {
|
|
2450
|
+
color: "#D7BA7D"
|
|
2451
|
+
}
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
types: ["tag"],
|
|
2455
|
+
style: {
|
|
2456
|
+
color: "#0ea5e9"
|
|
2457
|
+
}
|
|
2458
|
+
},
|
|
2459
|
+
{
|
|
2460
|
+
types: ["tag"],
|
|
2461
|
+
languages: ["markup"],
|
|
2462
|
+
style: {
|
|
2463
|
+
color: "#0ea5e9"
|
|
2464
|
+
}
|
|
2465
|
+
},
|
|
2466
|
+
{
|
|
2467
|
+
types: ["punctuation", "operator"],
|
|
2468
|
+
style: {
|
|
2469
|
+
color: "#D4D4D4"
|
|
2470
|
+
}
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
types: ["punctuation"],
|
|
2474
|
+
languages: ["markup"],
|
|
2475
|
+
style: {
|
|
2476
|
+
color: "#808080"
|
|
2477
|
+
}
|
|
2478
|
+
},
|
|
2479
|
+
{
|
|
2480
|
+
types: ["function"],
|
|
2481
|
+
style: {
|
|
2482
|
+
color: "#7dd3fc"
|
|
2483
|
+
}
|
|
2484
|
+
},
|
|
2485
|
+
{
|
|
2486
|
+
types: ["class-name"],
|
|
2487
|
+
style: {
|
|
2488
|
+
color: "#0ea5e9"
|
|
2489
|
+
}
|
|
2490
|
+
},
|
|
2491
|
+
{
|
|
2492
|
+
types: ["char"],
|
|
2493
|
+
style: {
|
|
2494
|
+
color: "#D16969"
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
]
|
|
2498
|
+
};
|
|
2499
|
+
var jettwaveDark_default = theme15;
|
|
2500
|
+
|
|
2501
|
+
// src/themes/jettwaveLight.ts
|
|
2502
|
+
var theme16 = {
|
|
2503
|
+
plain: {
|
|
2504
|
+
color: "#0f172a",
|
|
2505
|
+
backgroundColor: "#f1f5f9"
|
|
2506
|
+
},
|
|
2507
|
+
styles: [
|
|
2508
|
+
{
|
|
2509
|
+
types: ["prolog"],
|
|
2510
|
+
style: {
|
|
2511
|
+
color: "#000080"
|
|
2512
|
+
}
|
|
2513
|
+
},
|
|
2514
|
+
{
|
|
2515
|
+
types: ["comment"],
|
|
2516
|
+
style: {
|
|
2517
|
+
color: "#6A9955"
|
|
2518
|
+
}
|
|
2519
|
+
},
|
|
2520
|
+
{
|
|
2521
|
+
types: ["builtin", "changed", "keyword", "interpolation-punctuation"],
|
|
2522
|
+
style: {
|
|
2523
|
+
color: "#0c4a6e"
|
|
2524
|
+
}
|
|
2525
|
+
},
|
|
2526
|
+
{
|
|
2527
|
+
types: ["number", "inserted"],
|
|
2528
|
+
style: {
|
|
2529
|
+
color: "#B5CEA8"
|
|
2530
|
+
}
|
|
2531
|
+
},
|
|
2532
|
+
{
|
|
2533
|
+
types: ["constant"],
|
|
2534
|
+
style: {
|
|
2535
|
+
color: "#0f172a"
|
|
2536
|
+
}
|
|
2537
|
+
},
|
|
2538
|
+
{
|
|
2539
|
+
types: ["attr-name", "variable"],
|
|
2540
|
+
style: {
|
|
2541
|
+
color: "#0c4a6e"
|
|
2542
|
+
}
|
|
2543
|
+
},
|
|
2544
|
+
{
|
|
2545
|
+
types: ["deleted", "string", "attr-value", "template-punctuation"],
|
|
2546
|
+
style: {
|
|
2547
|
+
color: "#64748b"
|
|
2548
|
+
}
|
|
2549
|
+
},
|
|
2550
|
+
{
|
|
2551
|
+
types: ["selector"],
|
|
2552
|
+
style: {
|
|
2553
|
+
color: "#D7BA7D"
|
|
2554
|
+
}
|
|
2555
|
+
},
|
|
2556
|
+
{
|
|
2557
|
+
types: ["tag"],
|
|
2558
|
+
style: {
|
|
2559
|
+
color: "#0ea5e9"
|
|
2560
|
+
}
|
|
2561
|
+
},
|
|
2562
|
+
{
|
|
2563
|
+
types: ["tag"],
|
|
2564
|
+
languages: ["markup"],
|
|
2565
|
+
style: {
|
|
2566
|
+
color: "#0ea5e9"
|
|
2567
|
+
}
|
|
2568
|
+
},
|
|
2569
|
+
{
|
|
2570
|
+
types: ["punctuation", "operator"],
|
|
2571
|
+
style: {
|
|
2572
|
+
color: "#475569"
|
|
2573
|
+
}
|
|
2574
|
+
},
|
|
2575
|
+
{
|
|
2576
|
+
types: ["punctuation"],
|
|
2577
|
+
languages: ["markup"],
|
|
2578
|
+
style: {
|
|
2579
|
+
color: "#808080"
|
|
2580
|
+
}
|
|
2581
|
+
},
|
|
2582
|
+
{
|
|
2583
|
+
types: ["function"],
|
|
2584
|
+
style: {
|
|
2585
|
+
color: "#0e7490"
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2588
|
+
{
|
|
2589
|
+
types: ["class-name"],
|
|
2590
|
+
style: {
|
|
2591
|
+
color: "#0ea5e9"
|
|
2592
|
+
}
|
|
2593
|
+
},
|
|
2594
|
+
{
|
|
2595
|
+
types: ["char"],
|
|
2596
|
+
style: {
|
|
2597
|
+
color: "#D16969"
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
]
|
|
2601
|
+
};
|
|
2602
|
+
var jettwaveLight_default = theme16;
|
|
2603
|
+
|
|
2604
|
+
// src/themes/oneDark.ts
|
|
2605
|
+
var theme17 = {
|
|
2606
|
+
plain: {
|
|
2607
|
+
backgroundColor: "hsl(220, 13%, 18%)",
|
|
2608
|
+
color: "hsl(220, 14%, 71%)",
|
|
2609
|
+
textShadow: "0 1px rgba(0, 0, 0, 0.3)"
|
|
2610
|
+
},
|
|
2611
|
+
styles: [
|
|
2612
|
+
{
|
|
2613
|
+
types: ["comment", "prolog", "cdata"],
|
|
2614
|
+
style: {
|
|
2615
|
+
color: "hsl(220, 10%, 40%)"
|
|
2616
|
+
}
|
|
2617
|
+
},
|
|
2618
|
+
{
|
|
2619
|
+
types: ["doctype", "punctuation", "entity"],
|
|
2620
|
+
style: {
|
|
2621
|
+
color: "hsl(220, 14%, 71%)"
|
|
2622
|
+
}
|
|
2623
|
+
},
|
|
2624
|
+
{
|
|
2625
|
+
types: [
|
|
2626
|
+
"attr-name",
|
|
2627
|
+
"class-name",
|
|
2628
|
+
"maybe-class-name",
|
|
2629
|
+
"boolean",
|
|
2630
|
+
"constant",
|
|
2631
|
+
"number",
|
|
2632
|
+
"atrule"
|
|
2633
|
+
],
|
|
2634
|
+
style: { color: "hsl(29, 54%, 61%)" }
|
|
2635
|
+
},
|
|
2636
|
+
{
|
|
2637
|
+
types: ["keyword"],
|
|
2638
|
+
style: { color: "hsl(286, 60%, 67%)" }
|
|
2639
|
+
},
|
|
2640
|
+
{
|
|
2641
|
+
types: ["property", "tag", "symbol", "deleted", "important"],
|
|
2642
|
+
style: {
|
|
2643
|
+
color: "hsl(355, 65%, 65%)"
|
|
2644
|
+
}
|
|
2645
|
+
},
|
|
2646
|
+
{
|
|
2647
|
+
types: [
|
|
2648
|
+
"selector",
|
|
2649
|
+
"string",
|
|
2650
|
+
"char",
|
|
2651
|
+
"builtin",
|
|
2652
|
+
"inserted",
|
|
2653
|
+
"regex",
|
|
2654
|
+
"attr-value"
|
|
2655
|
+
],
|
|
2656
|
+
style: {
|
|
2657
|
+
color: "hsl(95, 38%, 62%)"
|
|
2658
|
+
}
|
|
2659
|
+
},
|
|
2660
|
+
{
|
|
2661
|
+
types: ["variable", "operator", "function"],
|
|
2662
|
+
style: {
|
|
2663
|
+
color: "hsl(207, 82%, 66%)"
|
|
2664
|
+
}
|
|
2665
|
+
},
|
|
2666
|
+
{
|
|
2667
|
+
types: ["url"],
|
|
2668
|
+
style: {
|
|
2669
|
+
color: "hsl(187, 47%, 55%)"
|
|
2670
|
+
}
|
|
2671
|
+
},
|
|
2672
|
+
{
|
|
2673
|
+
types: ["deleted"],
|
|
2674
|
+
style: {
|
|
2675
|
+
textDecorationLine: "line-through"
|
|
2676
|
+
}
|
|
2677
|
+
},
|
|
2678
|
+
{
|
|
2679
|
+
types: ["inserted"],
|
|
2680
|
+
style: {
|
|
2681
|
+
textDecorationLine: "underline"
|
|
2682
|
+
}
|
|
2683
|
+
},
|
|
2684
|
+
{
|
|
2685
|
+
types: ["italic"],
|
|
2686
|
+
style: {
|
|
2687
|
+
fontStyle: "italic"
|
|
2688
|
+
}
|
|
2689
|
+
},
|
|
2690
|
+
{
|
|
2691
|
+
types: ["important", "bold"],
|
|
2692
|
+
style: {
|
|
2693
|
+
fontWeight: "bold"
|
|
2694
|
+
}
|
|
2695
|
+
},
|
|
2696
|
+
{
|
|
2697
|
+
types: ["important"],
|
|
2698
|
+
style: {
|
|
2699
|
+
color: "hsl(220, 14%, 71%)"
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
]
|
|
2703
|
+
};
|
|
2704
|
+
var oneDark_default = theme17;
|
|
2705
|
+
|
|
2706
|
+
// src/themes/oneLight.ts
|
|
2707
|
+
var theme18 = {
|
|
2708
|
+
plain: {
|
|
2709
|
+
backgroundColor: "hsl(230, 1%, 98%)",
|
|
2710
|
+
color: "hsl(230, 8%, 24%)"
|
|
2711
|
+
},
|
|
2712
|
+
styles: [
|
|
2713
|
+
{
|
|
2714
|
+
types: ["comment", "prolog", "cdata"],
|
|
2715
|
+
style: {
|
|
2716
|
+
color: "hsl(230, 4%, 64%)"
|
|
2717
|
+
}
|
|
2718
|
+
},
|
|
2719
|
+
{
|
|
2720
|
+
types: ["doctype", "punctuation", "entity"],
|
|
2721
|
+
style: {
|
|
2722
|
+
color: "hsl(230, 8%, 24%)"
|
|
2723
|
+
}
|
|
2724
|
+
},
|
|
2725
|
+
{
|
|
2726
|
+
types: [
|
|
2727
|
+
"attr-name",
|
|
2728
|
+
"class-name",
|
|
2729
|
+
"boolean",
|
|
2730
|
+
"constant",
|
|
2731
|
+
"number",
|
|
2732
|
+
"atrule"
|
|
2733
|
+
],
|
|
2734
|
+
style: {
|
|
2735
|
+
color: "hsl(35, 99%, 36%)"
|
|
2736
|
+
}
|
|
2737
|
+
},
|
|
2738
|
+
{
|
|
2739
|
+
types: ["keyword"],
|
|
2740
|
+
style: {
|
|
2741
|
+
color: "hsl(301, 63%, 40%)"
|
|
2742
|
+
}
|
|
2743
|
+
},
|
|
2744
|
+
{
|
|
2745
|
+
types: ["property", "tag", "symbol", "deleted", "important"],
|
|
2746
|
+
style: {
|
|
2747
|
+
color: "hsl(5, 74%, 59%)"
|
|
2748
|
+
}
|
|
2749
|
+
},
|
|
2750
|
+
{
|
|
2751
|
+
types: [
|
|
2752
|
+
"selector",
|
|
2753
|
+
"string",
|
|
2754
|
+
"char",
|
|
2755
|
+
"builtin",
|
|
2756
|
+
"inserted",
|
|
2757
|
+
"regex",
|
|
2758
|
+
"attr-value",
|
|
2759
|
+
"punctuation"
|
|
2760
|
+
],
|
|
2761
|
+
style: {
|
|
2762
|
+
color: "hsl(119, 34%, 47%)"
|
|
2763
|
+
}
|
|
2764
|
+
},
|
|
2765
|
+
{
|
|
2766
|
+
types: ["variable", "operator", "function"],
|
|
2767
|
+
style: {
|
|
2768
|
+
color: "hsl(221, 87%, 60%)"
|
|
2769
|
+
}
|
|
2770
|
+
},
|
|
2771
|
+
{
|
|
2772
|
+
types: ["url"],
|
|
2773
|
+
style: {
|
|
2774
|
+
color: "hsl(198, 99%, 37%)"
|
|
2775
|
+
}
|
|
2776
|
+
},
|
|
2777
|
+
{
|
|
2778
|
+
types: ["deleted"],
|
|
2779
|
+
style: {
|
|
2780
|
+
textDecorationLine: "line-through"
|
|
2781
|
+
}
|
|
2782
|
+
},
|
|
2783
|
+
{
|
|
2784
|
+
types: ["inserted"],
|
|
2785
|
+
style: {
|
|
2786
|
+
textDecorationLine: "underline"
|
|
2787
|
+
}
|
|
2788
|
+
},
|
|
2789
|
+
{
|
|
2790
|
+
types: ["italic"],
|
|
2791
|
+
style: {
|
|
2792
|
+
fontStyle: "italic"
|
|
2793
|
+
}
|
|
2794
|
+
},
|
|
2795
|
+
{
|
|
2796
|
+
types: ["important", "bold"],
|
|
2797
|
+
style: {
|
|
2798
|
+
fontWeight: "bold"
|
|
2799
|
+
}
|
|
2800
|
+
},
|
|
2801
|
+
{
|
|
2802
|
+
types: ["important"],
|
|
2803
|
+
style: {
|
|
2804
|
+
color: "hsl(230, 8%, 24%)"
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2807
|
+
]
|
|
2808
|
+
};
|
|
2809
|
+
var oneLight_default = theme18;
|
|
2810
|
+
|
|
2811
|
+
// src/themes/gruvboxMaterialDark.ts
|
|
2812
|
+
var theme19 = {
|
|
2813
|
+
plain: {
|
|
2814
|
+
color: "#ebdbb2",
|
|
2815
|
+
backgroundColor: "#292828"
|
|
2816
|
+
},
|
|
2817
|
+
styles: [
|
|
2818
|
+
{
|
|
2819
|
+
types: [
|
|
2820
|
+
"imports",
|
|
2821
|
+
"class-name",
|
|
2822
|
+
"maybe-class-name",
|
|
2823
|
+
"constant",
|
|
2824
|
+
"doctype",
|
|
2825
|
+
"builtin",
|
|
2826
|
+
"function"
|
|
2827
|
+
],
|
|
2828
|
+
style: {
|
|
2829
|
+
color: "#d8a657"
|
|
2830
|
+
}
|
|
2831
|
+
},
|
|
2832
|
+
{
|
|
2833
|
+
types: ["property-access"],
|
|
2834
|
+
style: {
|
|
2835
|
+
color: "#7daea3"
|
|
2836
|
+
}
|
|
2837
|
+
},
|
|
2838
|
+
{
|
|
2839
|
+
types: ["tag"],
|
|
2840
|
+
style: {
|
|
2841
|
+
color: "#e78a4e"
|
|
2842
|
+
}
|
|
2843
|
+
},
|
|
2844
|
+
{
|
|
2845
|
+
types: ["attr-name", "char", "url", "regex"],
|
|
2846
|
+
style: {
|
|
2847
|
+
color: "#a9b665"
|
|
2848
|
+
}
|
|
2849
|
+
},
|
|
2850
|
+
{
|
|
2851
|
+
types: ["attr-value", "string"],
|
|
2852
|
+
style: {
|
|
2853
|
+
color: "#89b482"
|
|
2854
|
+
}
|
|
2855
|
+
},
|
|
2856
|
+
{
|
|
2857
|
+
types: ["comment", "prolog", "cdata", "operator", "inserted"],
|
|
2858
|
+
style: {
|
|
2859
|
+
color: "#a89984"
|
|
2860
|
+
}
|
|
2861
|
+
},
|
|
2862
|
+
{
|
|
2863
|
+
types: [
|
|
2864
|
+
"delimiter",
|
|
2865
|
+
"boolean",
|
|
2866
|
+
"keyword",
|
|
2867
|
+
"selector",
|
|
2868
|
+
"important",
|
|
2869
|
+
"atrule",
|
|
2870
|
+
"property",
|
|
2871
|
+
"variable",
|
|
2872
|
+
"deleted"
|
|
2873
|
+
],
|
|
2874
|
+
style: {
|
|
2875
|
+
color: "#ea6962"
|
|
2876
|
+
}
|
|
2877
|
+
},
|
|
2878
|
+
{
|
|
2879
|
+
types: ["entity", "number", "symbol"],
|
|
2880
|
+
style: {
|
|
2881
|
+
color: "#d3869b"
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
]
|
|
2885
|
+
};
|
|
2886
|
+
var gruvboxMaterialDark_default = theme19;
|
|
2887
|
+
|
|
2888
|
+
// src/themes/gruvboxMaterialLight.ts
|
|
2889
|
+
var theme20 = {
|
|
2890
|
+
plain: {
|
|
2891
|
+
color: "#654735",
|
|
2892
|
+
backgroundColor: "#f9f5d7"
|
|
2893
|
+
},
|
|
2894
|
+
styles: [
|
|
2895
|
+
{
|
|
2896
|
+
types: [
|
|
2897
|
+
"delimiter",
|
|
2898
|
+
"boolean",
|
|
2899
|
+
"keyword",
|
|
2900
|
+
"selector",
|
|
2901
|
+
"important",
|
|
2902
|
+
"atrule",
|
|
2903
|
+
"property",
|
|
2904
|
+
"variable",
|
|
2905
|
+
"deleted"
|
|
2906
|
+
],
|
|
2907
|
+
style: {
|
|
2908
|
+
color: "#af2528"
|
|
2909
|
+
}
|
|
2910
|
+
},
|
|
2911
|
+
{
|
|
2912
|
+
types: [
|
|
2913
|
+
"imports",
|
|
2914
|
+
"class-name",
|
|
2915
|
+
"maybe-class-name",
|
|
2916
|
+
"constant",
|
|
2917
|
+
"doctype",
|
|
2918
|
+
"builtin"
|
|
2919
|
+
],
|
|
2920
|
+
style: {
|
|
2921
|
+
color: "#b4730e"
|
|
2922
|
+
}
|
|
2923
|
+
},
|
|
2924
|
+
{
|
|
2925
|
+
types: ["string", "attr-value"],
|
|
2926
|
+
style: {
|
|
2927
|
+
color: "#477a5b"
|
|
2928
|
+
}
|
|
2929
|
+
},
|
|
2930
|
+
{
|
|
2931
|
+
types: ["property-access"],
|
|
2932
|
+
style: {
|
|
2933
|
+
color: "#266b79"
|
|
2934
|
+
}
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
types: ["function", "attr-name", "char", "url"],
|
|
2938
|
+
style: {
|
|
2939
|
+
color: "#72761e"
|
|
2940
|
+
}
|
|
2941
|
+
},
|
|
2942
|
+
{
|
|
2943
|
+
types: ["tag"],
|
|
2944
|
+
style: {
|
|
2945
|
+
color: "#b94c07"
|
|
2946
|
+
}
|
|
2947
|
+
},
|
|
2948
|
+
{
|
|
2949
|
+
types: ["comment", "prolog", "cdata", "operator", "inserted"],
|
|
2950
|
+
style: {
|
|
2951
|
+
color: "#a89984"
|
|
2952
|
+
}
|
|
2953
|
+
},
|
|
2954
|
+
{
|
|
2955
|
+
types: ["entity", "number", "symbol"],
|
|
2956
|
+
style: {
|
|
2957
|
+
color: "#924f79"
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
]
|
|
2961
|
+
};
|
|
2962
|
+
var gruvboxMaterialLight_default = theme20;
|
|
2963
|
+
var useGetLineProps = (themeDictionary) => React.useCallback(
|
|
2964
|
+
(_a) => {
|
|
2965
|
+
var _b = _a, { className, style, line } = _b, rest = __objRest(_b, ["className", "style", "line"]);
|
|
2966
|
+
const output = __spreadProps(__spreadValues({}, rest), {
|
|
2967
|
+
className: clsx("token-line", className)
|
|
2968
|
+
});
|
|
2969
|
+
if (typeof themeDictionary === "object" && "plain" in themeDictionary)
|
|
2970
|
+
output.style = themeDictionary.plain;
|
|
2971
|
+
if (typeof style === "object")
|
|
2972
|
+
output.style = __spreadValues(__spreadValues({}, output.style || {}), style);
|
|
2973
|
+
return output;
|
|
2974
|
+
},
|
|
2975
|
+
[themeDictionary]
|
|
2976
|
+
);
|
|
2977
|
+
var useGetTokenProps = (themeDictionary) => {
|
|
2978
|
+
const styleForToken = React.useCallback(
|
|
2979
|
+
({ types, empty }) => {
|
|
2980
|
+
if (themeDictionary == null)
|
|
2981
|
+
return void 0;
|
|
2982
|
+
else if (types.length === 1 && types[0] === "plain") {
|
|
2983
|
+
return empty != null ? { display: "inline-block" } : void 0;
|
|
2984
|
+
} else if (types.length === 1 && empty != null) {
|
|
2985
|
+
return themeDictionary[types[0]];
|
|
2986
|
+
}
|
|
2987
|
+
return Object.assign(
|
|
2988
|
+
empty != null ? { display: "inline-block" } : {},
|
|
2989
|
+
...types.map((type) => themeDictionary[type])
|
|
2990
|
+
);
|
|
2991
|
+
},
|
|
2992
|
+
[themeDictionary]
|
|
2993
|
+
);
|
|
2994
|
+
return React.useCallback(
|
|
2995
|
+
(_a) => {
|
|
2996
|
+
var _b = _a, { token, className, style } = _b, rest = __objRest(_b, ["token", "className", "style"]);
|
|
2997
|
+
const output = __spreadProps(__spreadValues({}, rest), {
|
|
2998
|
+
className: clsx("token", ...token.types, className),
|
|
2999
|
+
children: token.content,
|
|
3000
|
+
style: styleForToken(token)
|
|
3001
|
+
});
|
|
3002
|
+
if (style != null) {
|
|
3003
|
+
output.style = __spreadValues(__spreadValues({}, output.style || {}), style);
|
|
3004
|
+
}
|
|
3005
|
+
return output;
|
|
3006
|
+
},
|
|
3007
|
+
[styleForToken]
|
|
3008
|
+
);
|
|
3009
|
+
};
|
|
3010
|
+
|
|
3011
|
+
// src/utils/normalizeTokens.ts
|
|
3012
|
+
var newlineRe = /\r\n|\r|\n/;
|
|
3013
|
+
var normalizeEmptyLines = (line) => {
|
|
3014
|
+
if (line.length === 0) {
|
|
3015
|
+
line.push({
|
|
3016
|
+
types: ["plain"],
|
|
3017
|
+
content: "\n",
|
|
3018
|
+
empty: true
|
|
3019
|
+
});
|
|
3020
|
+
} else if (line.length === 1 && line[0].content === "") {
|
|
3021
|
+
line[0].content = "\n";
|
|
3022
|
+
line[0].empty = true;
|
|
3023
|
+
}
|
|
3024
|
+
};
|
|
3025
|
+
var appendTypes = (types, add) => {
|
|
3026
|
+
const typesSize = types.length;
|
|
3027
|
+
if (typesSize > 0 && types[typesSize - 1] === add) {
|
|
3028
|
+
return types;
|
|
3029
|
+
}
|
|
3030
|
+
return types.concat(add);
|
|
3031
|
+
};
|
|
3032
|
+
var normalizeTokens = (tokens) => {
|
|
3033
|
+
const typeArrStack = [[]];
|
|
3034
|
+
const tokenArrStack = [tokens];
|
|
3035
|
+
const tokenArrIndexStack = [0];
|
|
3036
|
+
const tokenArrSizeStack = [tokens.length];
|
|
3037
|
+
let i = 0;
|
|
3038
|
+
let stackIndex = 0;
|
|
3039
|
+
let currentLine = [];
|
|
3040
|
+
const acc = [currentLine];
|
|
3041
|
+
while (stackIndex > -1) {
|
|
3042
|
+
while ((i = tokenArrIndexStack[stackIndex]++) < tokenArrSizeStack[stackIndex]) {
|
|
3043
|
+
let content;
|
|
3044
|
+
let types = typeArrStack[stackIndex];
|
|
3045
|
+
const tokenArr = tokenArrStack[stackIndex];
|
|
3046
|
+
const token = tokenArr[i];
|
|
3047
|
+
if (typeof token === "string") {
|
|
3048
|
+
types = stackIndex > 0 ? types : ["plain"];
|
|
3049
|
+
content = token;
|
|
3050
|
+
} else {
|
|
3051
|
+
types = appendTypes(types, token.type);
|
|
3052
|
+
if (token.alias) {
|
|
3053
|
+
types = appendTypes(types, token.alias);
|
|
3054
|
+
}
|
|
3055
|
+
content = token.content;
|
|
3056
|
+
}
|
|
3057
|
+
if (typeof content !== "string") {
|
|
3058
|
+
stackIndex++;
|
|
3059
|
+
typeArrStack.push(types);
|
|
3060
|
+
tokenArrStack.push(content);
|
|
3061
|
+
tokenArrIndexStack.push(0);
|
|
3062
|
+
tokenArrSizeStack.push(content.length);
|
|
3063
|
+
continue;
|
|
3064
|
+
}
|
|
3065
|
+
const splitByNewlines = content.split(newlineRe);
|
|
3066
|
+
const newlineCount = splitByNewlines.length;
|
|
3067
|
+
currentLine.push({
|
|
3068
|
+
types,
|
|
3069
|
+
content: splitByNewlines[0]
|
|
3070
|
+
});
|
|
3071
|
+
for (let i2 = 1; i2 < newlineCount; i2++) {
|
|
3072
|
+
normalizeEmptyLines(currentLine);
|
|
3073
|
+
acc.push(currentLine = []);
|
|
3074
|
+
currentLine.push({
|
|
3075
|
+
types,
|
|
3076
|
+
content: splitByNewlines[i2]
|
|
3077
|
+
});
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
stackIndex--;
|
|
3081
|
+
typeArrStack.pop();
|
|
3082
|
+
tokenArrStack.pop();
|
|
3083
|
+
tokenArrIndexStack.pop();
|
|
3084
|
+
tokenArrSizeStack.pop();
|
|
3085
|
+
}
|
|
3086
|
+
normalizeEmptyLines(currentLine);
|
|
3087
|
+
return acc;
|
|
3088
|
+
};
|
|
3089
|
+
var normalizeTokens_default = normalizeTokens;
|
|
3090
|
+
var useTokenize = ({ prism, code, grammar, language }) => {
|
|
3091
|
+
return React.useMemo(() => {
|
|
3092
|
+
if (grammar == null)
|
|
3093
|
+
return normalizeTokens_default([code]);
|
|
3094
|
+
const prismConfig = {
|
|
3095
|
+
code,
|
|
3096
|
+
grammar,
|
|
3097
|
+
language,
|
|
3098
|
+
tokens: []
|
|
3099
|
+
};
|
|
3100
|
+
prism.hooks.run("before-tokenize", prismConfig);
|
|
3101
|
+
prismConfig.tokens = prism.tokenize(code, grammar);
|
|
3102
|
+
prism.hooks.run("after-tokenize", prismConfig);
|
|
3103
|
+
return normalizeTokens_default(prismConfig.tokens);
|
|
3104
|
+
}, [
|
|
3105
|
+
code,
|
|
3106
|
+
grammar,
|
|
3107
|
+
language,
|
|
3108
|
+
// prism is a stable import
|
|
3109
|
+
prism
|
|
3110
|
+
]);
|
|
3111
|
+
};
|
|
3112
|
+
|
|
3113
|
+
// src/utils/themeToDict.ts
|
|
3114
|
+
var themeToDict = (theme21, language) => {
|
|
3115
|
+
const { plain } = theme21;
|
|
3116
|
+
const themeDict = theme21.styles.reduce((acc, themeEntry) => {
|
|
3117
|
+
const { languages: languages2, style } = themeEntry;
|
|
3118
|
+
if (languages2 && !languages2.includes(language)) {
|
|
3119
|
+
return acc;
|
|
3120
|
+
}
|
|
3121
|
+
themeEntry.types.forEach((type) => {
|
|
3122
|
+
const accStyle = __spreadValues(__spreadValues({}, acc[type]), style);
|
|
3123
|
+
acc[type] = accStyle;
|
|
3124
|
+
});
|
|
3125
|
+
return acc;
|
|
3126
|
+
}, {});
|
|
3127
|
+
themeDict.root = plain;
|
|
3128
|
+
themeDict.plain = __spreadProps(__spreadValues({}, plain), { backgroundColor: void 0 });
|
|
3129
|
+
return themeDict;
|
|
3130
|
+
};
|
|
3131
|
+
var themeToDict_default = themeToDict;
|
|
3132
|
+
|
|
3133
|
+
// src/components/highlight.ts
|
|
3134
|
+
var Highlight = ({
|
|
3135
|
+
children,
|
|
3136
|
+
language: _language,
|
|
3137
|
+
code,
|
|
3138
|
+
theme: theme21,
|
|
3139
|
+
prism
|
|
3140
|
+
}) => {
|
|
3141
|
+
const language = _language.toLowerCase();
|
|
3142
|
+
const themeDictionary = themeToDict_default(theme21, language);
|
|
3143
|
+
const getLineProps = useGetLineProps(themeDictionary);
|
|
3144
|
+
const getTokenProps = useGetTokenProps(themeDictionary);
|
|
3145
|
+
const grammar = prism.languages[language];
|
|
3146
|
+
const tokens = useTokenize({ prism, language, code, grammar });
|
|
3147
|
+
return children({
|
|
3148
|
+
tokens,
|
|
3149
|
+
className: `prism-code language-${language}`,
|
|
3150
|
+
style: themeDictionary != null ? themeDictionary.root : {},
|
|
3151
|
+
getLineProps,
|
|
3152
|
+
getTokenProps
|
|
3153
|
+
});
|
|
3154
|
+
};
|
|
3155
|
+
|
|
3156
|
+
// src/index.ts
|
|
3157
|
+
var Highlight2 = (props) => React.createElement(Highlight, __spreadProps(__spreadValues({}, props), {
|
|
3158
|
+
prism: props.prism || Prism,
|
|
3159
|
+
theme: props.theme || vsDark_default,
|
|
3160
|
+
code: props.code,
|
|
3161
|
+
language: props.language
|
|
3162
|
+
}));
|
|
3163
|
+
/*! Bundled license information:
|
|
3164
|
+
|
|
3165
|
+
prismjs/prism.js:
|
|
3166
|
+
(**
|
|
3167
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
3168
|
+
*
|
|
3169
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
3170
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
3171
|
+
* @namespace
|
|
3172
|
+
* @public
|
|
3173
|
+
*)
|
|
3174
|
+
*/
|
|
3175
|
+
|
|
3176
|
+
function CodeModal({ filename, sourceData, onClose }) {
|
|
3177
|
+
const context = React.useContext(SpotlightContext);
|
|
3178
|
+
const [copied, setCopied] = React.useState(false);
|
|
3179
|
+
if (!context)
|
|
3180
|
+
return null;
|
|
3181
|
+
const { repoUrl, theme } = context;
|
|
3182
|
+
// Close on ESC key
|
|
3183
|
+
React.useEffect(() => {
|
|
3184
|
+
const handler = (e) => {
|
|
3185
|
+
if (e.key === 'Escape') {
|
|
3186
|
+
onClose();
|
|
3187
|
+
}
|
|
3188
|
+
};
|
|
3189
|
+
window.addEventListener('keydown', handler);
|
|
3190
|
+
return () => window.removeEventListener('keydown', handler);
|
|
3191
|
+
}, [onClose]);
|
|
3192
|
+
const copyToClipboard = async () => {
|
|
3193
|
+
try {
|
|
3194
|
+
await navigator.clipboard.writeText(sourceData.code);
|
|
3195
|
+
setCopied(true);
|
|
3196
|
+
setTimeout(() => setCopied(false), 2000);
|
|
3197
|
+
}
|
|
3198
|
+
catch (error) {
|
|
3199
|
+
console.error('[Spotlight] Failed to copy:', error);
|
|
3200
|
+
}
|
|
3201
|
+
};
|
|
3202
|
+
const isCleanCode = sourceData.lines < 100;
|
|
3203
|
+
// Determine file extension for syntax highlighting
|
|
3204
|
+
const getLanguage = (filename) => {
|
|
3205
|
+
if (filename.endsWith('.tsx'))
|
|
3206
|
+
return 'tsx';
|
|
3207
|
+
if (filename.endsWith('.ts'))
|
|
3208
|
+
return 'typescript';
|
|
3209
|
+
if (filename.endsWith('.jsx'))
|
|
3210
|
+
return 'jsx';
|
|
3211
|
+
return 'javascript';
|
|
3212
|
+
};
|
|
3213
|
+
return (React.createElement("div", { className: "spotlight-modal-backdrop", onClick: onClose },
|
|
3214
|
+
React.createElement("div", { className: "spotlight-modal", onClick: e => e.stopPropagation() },
|
|
3215
|
+
React.createElement("div", { className: "spotlight-modal-header" },
|
|
3216
|
+
React.createElement("div", { className: "spotlight-modal-title" },
|
|
3217
|
+
React.createElement("h3", null, filename),
|
|
3218
|
+
React.createElement("p", { className: "spotlight-modal-meta" },
|
|
3219
|
+
sourceData.lines,
|
|
3220
|
+
" lines \u00B7 ",
|
|
3221
|
+
(sourceData.size / 1024).toFixed(1),
|
|
3222
|
+
' ',
|
|
3223
|
+
"KB")),
|
|
3224
|
+
React.createElement("div", { className: "spotlight-modal-header-actions" },
|
|
3225
|
+
isCleanCode && (React.createElement("span", { className: "clean-code-badge" }, "\u2728 Clean & Modular")),
|
|
3226
|
+
React.createElement("button", { className: "spotlight-modal-close", onClick: onClose, "aria-label": "Close modal" }, "\u2715"))),
|
|
3227
|
+
React.createElement("div", { className: "spotlight-actions" },
|
|
3228
|
+
React.createElement("button", { className: "spotlight-action-btn", onClick: copyToClipboard, disabled: copied }, copied ? '✓ Copied!' : '📋 Copy Code'),
|
|
3229
|
+
repoUrl && (React.createElement("a", { href: `${repoUrl}/blob/main/${filename}`, target: "_blank", rel: "noopener noreferrer", className: "spotlight-action-btn spotlight-action-link" }, "\uD83D\uDD17 View on GitHub"))),
|
|
3230
|
+
React.createElement("div", { className: "spotlight-code-container" },
|
|
3231
|
+
React.createElement(Highlight2, { theme: theme === 'dark' ? themes_exports.nightOwl : themes_exports.github, code: sourceData.code, language: getLanguage(filename) }, ({ style, tokens, getLineProps, getTokenProps }) => (React.createElement("pre", { style: style, className: "spotlight-code-pre" }, tokens.map((line, i) => (React.createElement("div", { key: i, ...getLineProps({ line }) },
|
|
3232
|
+
React.createElement("span", { className: "line-number" }, i + 1),
|
|
3233
|
+
React.createElement("span", { className: "line-content" }, line.map((token, key) => (React.createElement("span", { key: key, ...getTokenProps({ token }) }))))))))))))));
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
function Spotlight({ filename, children }) {
|
|
3237
|
+
const context = React.useContext(SpotlightContext);
|
|
3238
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
3239
|
+
const [showModal, setShowModal] = React.useState(false);
|
|
3240
|
+
// If context is not available or DevMode is OFF, render normally
|
|
3241
|
+
if (!context || !context.isDevMode) {
|
|
3242
|
+
return React.createElement(React.Fragment, null, children);
|
|
3243
|
+
}
|
|
3244
|
+
const { sourceMap } = context;
|
|
3245
|
+
const sourceData = sourceMap[filename];
|
|
3246
|
+
// Warn if source data not found
|
|
3247
|
+
if (!sourceData && isHovered) {
|
|
3248
|
+
console.warn(`[Spotlight] No source data found for: ${filename}`);
|
|
3249
|
+
}
|
|
3250
|
+
return (React.createElement(React.Fragment, null,
|
|
3251
|
+
React.createElement("div", { className: "spotlight-wrapper", onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onClick: () => {
|
|
3252
|
+
if (sourceData) {
|
|
3253
|
+
setShowModal(true);
|
|
3254
|
+
}
|
|
3255
|
+
}, style: {
|
|
3256
|
+
position: 'relative',
|
|
3257
|
+
outline: isHovered ? '2px dashed #00ff88' : 'none',
|
|
3258
|
+
outlineOffset: '4px',
|
|
3259
|
+
cursor: isHovered && sourceData ? 'pointer' : 'default',
|
|
3260
|
+
transition: 'outline 0.2s ease',
|
|
3261
|
+
} },
|
|
3262
|
+
children,
|
|
3263
|
+
isHovered && (React.createElement("div", { className: "spotlight-badge" },
|
|
3264
|
+
"\uD83D\uDCC4 ",
|
|
3265
|
+
filename,
|
|
3266
|
+
!sourceData && ' (not found)'))),
|
|
3267
|
+
showModal && sourceData && (React.createElement(CodeModal, { filename: filename, sourceData: sourceData, onClose: () => setShowModal(false) }))));
|
|
3268
|
+
}
|
|
3269
|
+
|
|
3270
|
+
function DevModeToggle({ position = 'bottom-right', }) {
|
|
3271
|
+
const context = React.useContext(SpotlightContext);
|
|
3272
|
+
if (!context) {
|
|
3273
|
+
console.warn('[Spotlight] DevModeToggle must be used within SpotlightProvider');
|
|
3274
|
+
return null;
|
|
3275
|
+
}
|
|
3276
|
+
const { isDevMode, setIsDevMode } = context;
|
|
3277
|
+
return (React.createElement("button", { className: `spotlight-toggle spotlight-toggle-${position}`, onClick: () => setIsDevMode(!isDevMode), "aria-label": isDevMode ? 'Disable Developer Mode' : 'Enable Developer Mode', title: `${isDevMode ? 'Disable' : 'Enable'} Developer Mode (Ctrl+Shift+D)` }, isDevMode ? '👨💻 Dev Mode ON' : '👁️ View Code'));
|
|
3278
|
+
}
|
|
3279
|
+
|
|
3280
|
+
function useSourceSpotlight() {
|
|
3281
|
+
const context = React.useContext(SpotlightContext);
|
|
3282
|
+
if (!context) {
|
|
3283
|
+
throw new Error('useSourceSpotlight must be used within a SpotlightProvider');
|
|
3284
|
+
}
|
|
3285
|
+
return {
|
|
3286
|
+
isDevMode: context.isDevMode,
|
|
3287
|
+
toggleDevMode: () => context.setIsDevMode(!context.isDevMode),
|
|
3288
|
+
enableDevMode: () => context.setIsDevMode(true),
|
|
3289
|
+
disableDevMode: () => context.setIsDevMode(false),
|
|
3290
|
+
getSourceCode: (filename) => context.sourceMap[filename],
|
|
3291
|
+
sourceMap: context.sourceMap,
|
|
3292
|
+
hasSourceMap: Object.keys(context.sourceMap).length > 0,
|
|
3293
|
+
};
|
|
3294
|
+
}
|
|
3295
|
+
|
|
3296
|
+
exports.DevModeToggle = DevModeToggle;
|
|
3297
|
+
exports.Spotlight = Spotlight;
|
|
3298
|
+
exports.SpotlightProvider = SpotlightProvider;
|
|
3299
|
+
exports.useSourceSpotlight = useSourceSpotlight;
|
|
3300
|
+
//# sourceMappingURL=index.js.map
|