@redis-ui/components 51.26.0 → 51.28.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/dist/Button/CopyToClipboardButton/CopyToClipboardButton.cjs +17 -8
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.js +17 -8
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.types.d.ts +5 -1
- package/dist/CodeBlock/CodeBlock.cjs +29 -14
- package/dist/CodeBlock/CodeBlock.js +29 -14
- package/dist/CodeBlock/CodeBlock.style.d.ts +4 -3
- package/dist/CodeBlock/CodeBlock.types.cjs +7 -0
- package/dist/CodeBlock/CodeBlock.types.d.ts +4 -0
- package/dist/CodeBlock/CodeBlock.types.js +7 -1
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.cjs +29 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.cjs +34 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.d.ts +25 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.js +32 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.d.ts +6 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.js +29 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.types.d.ts +10 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.types.js +1 -0
- package/dist/Inputs/Input/Input.cjs +9 -2
- package/dist/Inputs/Input/Input.d.ts +4 -1
- package/dist/Inputs/Input/Input.js +9 -2
- package/dist/Inputs/Input/Input.types.d.ts +5 -1
- package/dist/Inputs/PasswordInput/components/Compose/Compose.types.d.ts +1 -1
- package/dist/Inputs/TextArea/TextArea.cjs +16 -6
- package/dist/Inputs/TextArea/TextArea.d.ts +3 -1
- package/dist/Inputs/TextArea/TextArea.js +16 -6
- package/dist/Inputs/TextArea/TextArea.types.d.ts +4 -1
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.cjs +7 -0
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.d.ts +2 -0
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.js +7 -0
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.style.cjs +17 -0
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.style.d.ts +1 -0
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.style.js +15 -0
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.cjs +3 -1
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.js +4 -2
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.style.cjs +8 -1
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.style.js +8 -1
- package/dist/Inputs/components/Compose/CommonCompose.cjs +23 -18
- package/dist/Inputs/components/Compose/CommonCompose.d.ts +1 -1
- package/dist/Inputs/components/Compose/CommonCompose.js +24 -19
- package/dist/Inputs/components/Compose/CommonCompose.types.d.ts +2 -0
- package/dist/Inputs/components/Compose/Compose.style.cjs +7 -0
- package/dist/Inputs/components/Compose/Compose.style.js +7 -0
- package/dist/Inputs/components/Compose/NumericCompose.types.d.ts +1 -1
- package/dist/Inputs/components/CopyButton/CopyButton.cjs +15 -0
- package/dist/Inputs/components/CopyButton/CopyButton.d.ts +2 -0
- package/dist/Inputs/components/CopyButton/CopyButton.js +15 -0
- package/dist/Inputs/components/CopyButton/CopyButton.style.cjs +17 -0
- package/dist/Inputs/components/CopyButton/CopyButton.style.d.ts +1 -0
- package/dist/Inputs/components/CopyButton/CopyButton.style.js +15 -0
- package/dist/Inputs/components/CopyButton/CopyButton.types.d.ts +6 -0
- package/dist/Inputs/components/CopyButton/CopyButton.types.js +1 -0
- package/dist/Inputs/components/InputTag/InputTag.cjs +3 -1
- package/dist/Inputs/components/InputTag/InputTag.js +4 -2
- package/dist/Inputs/components/InputTag/InputTag.style.cjs +1 -1
- package/dist/Inputs/components/InputTag/InputTag.style.js +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.js +2 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.cjs +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.cjs +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.cjs +17 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.cjs +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.cjs +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.cjs +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.cjs +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.cjs +10 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +10 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.cjs +14 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.cjs +9 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/typeof.cjs +16 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.cjs +11 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +11 -0
- package/dist/node_modules/character-entities-legacy/index.cjs +116 -0
- package/dist/node_modules/character-entities-legacy/index.js +116 -0
- package/dist/node_modules/character-reference-invalid/index.cjs +38 -0
- package/dist/node_modules/character-reference-invalid/index.js +38 -0
- package/dist/node_modules/comma-separated-tokens/index.cjs +43 -0
- package/dist/node_modules/comma-separated-tokens/index.js +43 -0
- package/dist/node_modules/decode-named-character-reference/index.dom.cjs +15 -0
- package/dist/node_modules/decode-named-character-reference/index.dom.js +15 -0
- package/dist/node_modules/hast-util-parse-selector/lib/index.cjs +76 -0
- package/dist/node_modules/hast-util-parse-selector/lib/index.js +76 -0
- package/dist/node_modules/hastscript/lib/create-h.cjs +262 -0
- package/dist/node_modules/hastscript/lib/create-h.js +262 -0
- package/dist/node_modules/hastscript/lib/index.cjs +21 -0
- package/dist/node_modules/hastscript/lib/index.js +21 -0
- package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs +49 -0
- package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +49 -0
- package/dist/node_modules/is-alphabetical/index.cjs +14 -0
- package/dist/node_modules/is-alphabetical/index.js +14 -0
- package/dist/node_modules/is-alphanumerical/index.cjs +15 -0
- package/dist/node_modules/is-alphanumerical/index.js +15 -0
- package/dist/node_modules/is-decimal/index.cjs +14 -0
- package/dist/node_modules/is-decimal/index.js +14 -0
- package/dist/node_modules/is-hexadecimal/index.cjs +14 -0
- package/dist/node_modules/is-hexadecimal/index.js +14 -0
- package/dist/node_modules/parse-entities/lib/index.cjs +232 -0
- package/dist/node_modules/parse-entities/lib/index.js +232 -0
- package/dist/node_modules/property-information/index.cjs +27 -0
- package/dist/node_modules/property-information/index.js +26 -0
- package/dist/node_modules/property-information/lib/aria.cjs +60 -0
- package/dist/node_modules/property-information/lib/aria.js +61 -0
- package/dist/node_modules/property-information/lib/find.cjs +81 -0
- package/dist/node_modules/property-information/lib/find.js +81 -0
- package/dist/node_modules/property-information/lib/html.cjs +326 -0
- package/dist/node_modules/property-information/lib/html.js +326 -0
- package/dist/node_modules/property-information/lib/normalize.cjs +15 -0
- package/dist/node_modules/property-information/lib/normalize.js +15 -0
- package/dist/node_modules/property-information/lib/svg.cjs +564 -0
- package/dist/node_modules/property-information/lib/svg.js +564 -0
- package/dist/node_modules/property-information/lib/util/case-insensitive-transform.cjs +15 -0
- package/dist/node_modules/property-information/lib/util/case-insensitive-transform.js +15 -0
- package/dist/node_modules/property-information/lib/util/case-sensitive-transform.cjs +14 -0
- package/dist/node_modules/property-information/lib/util/case-sensitive-transform.js +14 -0
- package/dist/node_modules/property-information/lib/util/create.cjs +53 -0
- package/dist/node_modules/property-information/lib/util/create.js +53 -0
- package/dist/node_modules/property-information/lib/util/defined-info.cjs +49 -0
- package/dist/node_modules/property-information/lib/util/defined-info.js +49 -0
- package/dist/node_modules/property-information/lib/util/info.cjs +33 -0
- package/dist/node_modules/property-information/lib/util/info.js +33 -0
- package/dist/node_modules/property-information/lib/util/merge.cjs +26 -0
- package/dist/node_modules/property-information/lib/util/merge.js +26 -0
- package/dist/node_modules/property-information/lib/util/schema.cjs +27 -0
- package/dist/node_modules/property-information/lib/util/schema.js +27 -0
- package/dist/node_modules/property-information/lib/util/types.cjs +35 -0
- package/dist/node_modules/property-information/lib/util/types.js +24 -0
- package/dist/node_modules/property-information/lib/xlink.cjs +18 -0
- package/dist/node_modules/property-information/lib/xlink.js +19 -0
- package/dist/node_modules/property-information/lib/xml.cjs +14 -0
- package/dist/node_modules/property-information/lib/xml.js +15 -0
- package/dist/node_modules/property-information/lib/xmlns.cjs +14 -0
- package/dist/node_modules/property-information/lib/xmlns.js +14 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.cjs +6 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.js +6 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.cjs +183 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.js +181 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.cjs +308 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.js +306 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.cjs +4 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.js +5 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.cjs +4 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.js +5 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.cjs +4 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.js +5 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.cjs +4 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.js +5 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/prism-light.cjs +12 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/prism-light.js +12 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.cjs +121 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.js +121 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.cjs +147 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.js +147 -0
- package/dist/node_modules/refractor/lang/bash.cjs +190 -0
- package/dist/node_modules/refractor/lang/bash.js +190 -0
- package/dist/node_modules/refractor/lang/clike.cjs +37 -0
- package/dist/node_modules/refractor/lang/clike.js +37 -0
- package/dist/node_modules/refractor/lang/javascript.cjs +122 -0
- package/dist/node_modules/refractor/lang/javascript.js +122 -0
- package/dist/node_modules/refractor/lang/json.cjs +36 -0
- package/dist/node_modules/refractor/lang/json.js +36 -0
- package/dist/node_modules/refractor/lang/python.cjs +71 -0
- package/dist/node_modules/refractor/lang/python.js +71 -0
- package/dist/node_modules/refractor/lang/typescript.cjs +55 -0
- package/dist/node_modules/refractor/lang/typescript.js +55 -0
- package/dist/node_modules/refractor/lib/core.cjs +214 -0
- package/dist/node_modules/refractor/lib/core.js +214 -0
- package/dist/node_modules/refractor/lib/prism-core.cjs +595 -0
- package/dist/node_modules/refractor/lib/prism-core.js +595 -0
- package/dist/node_modules/space-separated-tokens/index.cjs +15 -0
- package/dist/node_modules/space-separated-tokens/index.js +15 -0
- package/package.json +4 -2
- package/skills/redis-ui-components/references/CodeBlock.md +23 -5
- package/skills/redis-ui-components/references/CopyToClipboardButton.md +23 -1
- package/skills/redis-ui-components/references/Input.md +39 -2
- package/skills/redis-ui-components/references/SearchInput.md +1 -1
- package/skills/redis-ui-components/references/TextArea.md +19 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region ../../node_modules/refractor/lang/clike.js
|
|
2
|
+
/**
|
|
3
|
+
* @import {Refractor} from '../lib/core.js'
|
|
4
|
+
*/
|
|
5
|
+
clike.displayName = "clike";
|
|
6
|
+
clike.aliases = [];
|
|
7
|
+
/** @param {Refractor} Prism */
|
|
8
|
+
function clike(Prism) {
|
|
9
|
+
Prism.languages.clike = {
|
|
10
|
+
comment: [{
|
|
11
|
+
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
12
|
+
lookbehind: true,
|
|
13
|
+
greedy: true
|
|
14
|
+
}, {
|
|
15
|
+
pattern: /(^|[^\\:])\/\/.*/,
|
|
16
|
+
lookbehind: true,
|
|
17
|
+
greedy: true
|
|
18
|
+
}],
|
|
19
|
+
string: {
|
|
20
|
+
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
21
|
+
greedy: true
|
|
22
|
+
},
|
|
23
|
+
"class-name": {
|
|
24
|
+
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
25
|
+
lookbehind: true,
|
|
26
|
+
inside: { punctuation: /[.\\]/ }
|
|
27
|
+
},
|
|
28
|
+
keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
29
|
+
boolean: /\b(?:false|true)\b/,
|
|
30
|
+
function: /\b\w+(?=\()/,
|
|
31
|
+
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
32
|
+
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
33
|
+
punctuation: /[{}[\];(),.:]/
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
exports.default = clike;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region ../../node_modules/refractor/lang/clike.js
|
|
2
|
+
/**
|
|
3
|
+
* @import {Refractor} from '../lib/core.js'
|
|
4
|
+
*/
|
|
5
|
+
clike.displayName = "clike";
|
|
6
|
+
clike.aliases = [];
|
|
7
|
+
/** @param {Refractor} Prism */
|
|
8
|
+
function clike(Prism) {
|
|
9
|
+
Prism.languages.clike = {
|
|
10
|
+
comment: [{
|
|
11
|
+
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
12
|
+
lookbehind: true,
|
|
13
|
+
greedy: true
|
|
14
|
+
}, {
|
|
15
|
+
pattern: /(^|[^\\:])\/\/.*/,
|
|
16
|
+
lookbehind: true,
|
|
17
|
+
greedy: true
|
|
18
|
+
}],
|
|
19
|
+
string: {
|
|
20
|
+
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
21
|
+
greedy: true
|
|
22
|
+
},
|
|
23
|
+
"class-name": {
|
|
24
|
+
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
25
|
+
lookbehind: true,
|
|
26
|
+
inside: { punctuation: /[.\\]/ }
|
|
27
|
+
},
|
|
28
|
+
keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
29
|
+
boolean: /\b(?:false|true)\b/,
|
|
30
|
+
function: /\b\w+(?=\()/,
|
|
31
|
+
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
32
|
+
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
33
|
+
punctuation: /[{}[\];(),.:]/
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { clike as default };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
const require_clike = require("./clike.cjs");
|
|
2
|
+
//#region ../../node_modules/refractor/lang/javascript.js
|
|
3
|
+
/**
|
|
4
|
+
* @import {Refractor} from '../lib/core.js'
|
|
5
|
+
*/
|
|
6
|
+
javascript.displayName = "javascript";
|
|
7
|
+
javascript.aliases = ["js"];
|
|
8
|
+
/** @param {Refractor} Prism */
|
|
9
|
+
function javascript(Prism) {
|
|
10
|
+
Prism.register(require_clike.default);
|
|
11
|
+
Prism.languages.javascript = Prism.languages.extend("clike", {
|
|
12
|
+
"class-name": [Prism.languages.clike["class-name"], {
|
|
13
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
14
|
+
lookbehind: true
|
|
15
|
+
}],
|
|
16
|
+
keyword: [{
|
|
17
|
+
pattern: /((?:^|\})\s*)catch\b/,
|
|
18
|
+
lookbehind: true
|
|
19
|
+
}, {
|
|
20
|
+
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/,
|
|
21
|
+
lookbehind: true
|
|
22
|
+
}],
|
|
23
|
+
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
24
|
+
number: {
|
|
25
|
+
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),
|
|
26
|
+
lookbehind: true
|
|
27
|
+
},
|
|
28
|
+
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
29
|
+
});
|
|
30
|
+
Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
|
|
31
|
+
Prism.languages.insertBefore("javascript", "keyword", {
|
|
32
|
+
regex: {
|
|
33
|
+
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),
|
|
34
|
+
lookbehind: true,
|
|
35
|
+
greedy: true,
|
|
36
|
+
inside: {
|
|
37
|
+
"regex-source": {
|
|
38
|
+
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
39
|
+
lookbehind: true,
|
|
40
|
+
alias: "language-regex",
|
|
41
|
+
inside: Prism.languages.regex
|
|
42
|
+
},
|
|
43
|
+
"regex-delimiter": /^\/|\/$/,
|
|
44
|
+
"regex-flags": /^[a-z]+$/
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"function-variable": {
|
|
48
|
+
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*=>))/,
|
|
49
|
+
alias: "function"
|
|
50
|
+
},
|
|
51
|
+
parameter: [
|
|
52
|
+
{
|
|
53
|
+
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
54
|
+
lookbehind: true,
|
|
55
|
+
inside: Prism.languages.javascript
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
59
|
+
lookbehind: true,
|
|
60
|
+
inside: Prism.languages.javascript
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
64
|
+
lookbehind: true,
|
|
65
|
+
inside: Prism.languages.javascript
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
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*\{)/,
|
|
69
|
+
lookbehind: true,
|
|
70
|
+
inside: Prism.languages.javascript
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
74
|
+
});
|
|
75
|
+
Prism.languages.insertBefore("javascript", "string", {
|
|
76
|
+
hashbang: {
|
|
77
|
+
pattern: /^#!.*/,
|
|
78
|
+
greedy: true,
|
|
79
|
+
alias: "comment"
|
|
80
|
+
},
|
|
81
|
+
"template-string": {
|
|
82
|
+
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
83
|
+
greedy: true,
|
|
84
|
+
inside: {
|
|
85
|
+
"template-punctuation": {
|
|
86
|
+
pattern: /^`|`$/,
|
|
87
|
+
alias: "string"
|
|
88
|
+
},
|
|
89
|
+
interpolation: {
|
|
90
|
+
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
91
|
+
lookbehind: true,
|
|
92
|
+
inside: {
|
|
93
|
+
"interpolation-punctuation": {
|
|
94
|
+
pattern: /^\$\{|\}$/,
|
|
95
|
+
alias: "punctuation"
|
|
96
|
+
},
|
|
97
|
+
rest: Prism.languages.javascript
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
string: /[\s\S]+/
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"string-property": {
|
|
104
|
+
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
105
|
+
lookbehind: true,
|
|
106
|
+
greedy: true,
|
|
107
|
+
alias: "property"
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
Prism.languages.insertBefore("javascript", "operator", { "literal-property": {
|
|
111
|
+
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
112
|
+
lookbehind: true,
|
|
113
|
+
alias: "property"
|
|
114
|
+
} });
|
|
115
|
+
if (Prism.languages.markup) {
|
|
116
|
+
Prism.languages.markup.tag.addInlined("script", "javascript");
|
|
117
|
+
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");
|
|
118
|
+
}
|
|
119
|
+
Prism.languages.js = Prism.languages.javascript;
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
exports.default = javascript;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import clike from "./clike.js";
|
|
2
|
+
//#region ../../node_modules/refractor/lang/javascript.js
|
|
3
|
+
/**
|
|
4
|
+
* @import {Refractor} from '../lib/core.js'
|
|
5
|
+
*/
|
|
6
|
+
javascript.displayName = "javascript";
|
|
7
|
+
javascript.aliases = ["js"];
|
|
8
|
+
/** @param {Refractor} Prism */
|
|
9
|
+
function javascript(Prism) {
|
|
10
|
+
Prism.register(clike);
|
|
11
|
+
Prism.languages.javascript = Prism.languages.extend("clike", {
|
|
12
|
+
"class-name": [Prism.languages.clike["class-name"], {
|
|
13
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
14
|
+
lookbehind: true
|
|
15
|
+
}],
|
|
16
|
+
keyword: [{
|
|
17
|
+
pattern: /((?:^|\})\s*)catch\b/,
|
|
18
|
+
lookbehind: true
|
|
19
|
+
}, {
|
|
20
|
+
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/,
|
|
21
|
+
lookbehind: true
|
|
22
|
+
}],
|
|
23
|
+
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
24
|
+
number: {
|
|
25
|
+
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),
|
|
26
|
+
lookbehind: true
|
|
27
|
+
},
|
|
28
|
+
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
29
|
+
});
|
|
30
|
+
Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
|
|
31
|
+
Prism.languages.insertBefore("javascript", "keyword", {
|
|
32
|
+
regex: {
|
|
33
|
+
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),
|
|
34
|
+
lookbehind: true,
|
|
35
|
+
greedy: true,
|
|
36
|
+
inside: {
|
|
37
|
+
"regex-source": {
|
|
38
|
+
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
39
|
+
lookbehind: true,
|
|
40
|
+
alias: "language-regex",
|
|
41
|
+
inside: Prism.languages.regex
|
|
42
|
+
},
|
|
43
|
+
"regex-delimiter": /^\/|\/$/,
|
|
44
|
+
"regex-flags": /^[a-z]+$/
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"function-variable": {
|
|
48
|
+
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*=>))/,
|
|
49
|
+
alias: "function"
|
|
50
|
+
},
|
|
51
|
+
parameter: [
|
|
52
|
+
{
|
|
53
|
+
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
54
|
+
lookbehind: true,
|
|
55
|
+
inside: Prism.languages.javascript
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
59
|
+
lookbehind: true,
|
|
60
|
+
inside: Prism.languages.javascript
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
64
|
+
lookbehind: true,
|
|
65
|
+
inside: Prism.languages.javascript
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
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*\{)/,
|
|
69
|
+
lookbehind: true,
|
|
70
|
+
inside: Prism.languages.javascript
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
74
|
+
});
|
|
75
|
+
Prism.languages.insertBefore("javascript", "string", {
|
|
76
|
+
hashbang: {
|
|
77
|
+
pattern: /^#!.*/,
|
|
78
|
+
greedy: true,
|
|
79
|
+
alias: "comment"
|
|
80
|
+
},
|
|
81
|
+
"template-string": {
|
|
82
|
+
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
83
|
+
greedy: true,
|
|
84
|
+
inside: {
|
|
85
|
+
"template-punctuation": {
|
|
86
|
+
pattern: /^`|`$/,
|
|
87
|
+
alias: "string"
|
|
88
|
+
},
|
|
89
|
+
interpolation: {
|
|
90
|
+
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
91
|
+
lookbehind: true,
|
|
92
|
+
inside: {
|
|
93
|
+
"interpolation-punctuation": {
|
|
94
|
+
pattern: /^\$\{|\}$/,
|
|
95
|
+
alias: "punctuation"
|
|
96
|
+
},
|
|
97
|
+
rest: Prism.languages.javascript
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
string: /[\s\S]+/
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"string-property": {
|
|
104
|
+
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
105
|
+
lookbehind: true,
|
|
106
|
+
greedy: true,
|
|
107
|
+
alias: "property"
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
Prism.languages.insertBefore("javascript", "operator", { "literal-property": {
|
|
111
|
+
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
112
|
+
lookbehind: true,
|
|
113
|
+
alias: "property"
|
|
114
|
+
} });
|
|
115
|
+
if (Prism.languages.markup) {
|
|
116
|
+
Prism.languages.markup.tag.addInlined("script", "javascript");
|
|
117
|
+
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");
|
|
118
|
+
}
|
|
119
|
+
Prism.languages.js = Prism.languages.javascript;
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
export { javascript as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region ../../node_modules/refractor/lang/json.js
|
|
2
|
+
/**
|
|
3
|
+
* @import {Refractor} from '../lib/core.js'
|
|
4
|
+
*/
|
|
5
|
+
json.displayName = "json";
|
|
6
|
+
json.aliases = ["webmanifest"];
|
|
7
|
+
/** @param {Refractor} Prism */
|
|
8
|
+
function json(Prism) {
|
|
9
|
+
Prism.languages.json = {
|
|
10
|
+
property: {
|
|
11
|
+
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
12
|
+
lookbehind: true,
|
|
13
|
+
greedy: true
|
|
14
|
+
},
|
|
15
|
+
string: {
|
|
16
|
+
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
|
|
17
|
+
lookbehind: true,
|
|
18
|
+
greedy: true
|
|
19
|
+
},
|
|
20
|
+
comment: {
|
|
21
|
+
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
22
|
+
greedy: true
|
|
23
|
+
},
|
|
24
|
+
number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
|
25
|
+
punctuation: /[{}[\],]/,
|
|
26
|
+
operator: /:/,
|
|
27
|
+
boolean: /\b(?:false|true)\b/,
|
|
28
|
+
null: {
|
|
29
|
+
pattern: /\bnull\b/,
|
|
30
|
+
alias: "keyword"
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
Prism.languages.webmanifest = Prism.languages.json;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
exports.default = json;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region ../../node_modules/refractor/lang/json.js
|
|
2
|
+
/**
|
|
3
|
+
* @import {Refractor} from '../lib/core.js'
|
|
4
|
+
*/
|
|
5
|
+
json.displayName = "json";
|
|
6
|
+
json.aliases = ["webmanifest"];
|
|
7
|
+
/** @param {Refractor} Prism */
|
|
8
|
+
function json(Prism) {
|
|
9
|
+
Prism.languages.json = {
|
|
10
|
+
property: {
|
|
11
|
+
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
12
|
+
lookbehind: true,
|
|
13
|
+
greedy: true
|
|
14
|
+
},
|
|
15
|
+
string: {
|
|
16
|
+
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
|
|
17
|
+
lookbehind: true,
|
|
18
|
+
greedy: true
|
|
19
|
+
},
|
|
20
|
+
comment: {
|
|
21
|
+
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
22
|
+
greedy: true
|
|
23
|
+
},
|
|
24
|
+
number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
|
25
|
+
punctuation: /[{}[\],]/,
|
|
26
|
+
operator: /:/,
|
|
27
|
+
boolean: /\b(?:false|true)\b/,
|
|
28
|
+
null: {
|
|
29
|
+
pattern: /\bnull\b/,
|
|
30
|
+
alias: "keyword"
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
Prism.languages.webmanifest = Prism.languages.json;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { json as default };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//#region ../../node_modules/refractor/lang/python.js
|
|
2
|
+
/**
|
|
3
|
+
* @import {Refractor} from '../lib/core.js'
|
|
4
|
+
*/
|
|
5
|
+
python.displayName = "python";
|
|
6
|
+
python.aliases = ["py"];
|
|
7
|
+
/** @param {Refractor} Prism */
|
|
8
|
+
function python(Prism) {
|
|
9
|
+
Prism.languages.python = {
|
|
10
|
+
comment: {
|
|
11
|
+
pattern: /(^|[^\\])#.*/,
|
|
12
|
+
lookbehind: true,
|
|
13
|
+
greedy: true
|
|
14
|
+
},
|
|
15
|
+
"string-interpolation": {
|
|
16
|
+
pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
|
|
17
|
+
greedy: true,
|
|
18
|
+
inside: {
|
|
19
|
+
interpolation: {
|
|
20
|
+
pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
|
|
21
|
+
lookbehind: true,
|
|
22
|
+
inside: {
|
|
23
|
+
"format-spec": {
|
|
24
|
+
pattern: /(:)[^:(){}]+(?=\}$)/,
|
|
25
|
+
lookbehind: true
|
|
26
|
+
},
|
|
27
|
+
"conversion-option": {
|
|
28
|
+
pattern: //,
|
|
29
|
+
alias: "punctuation"
|
|
30
|
+
},
|
|
31
|
+
rest: null
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
string: /[\s\S]+/
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"triple-quoted-string": {
|
|
38
|
+
pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
|
|
39
|
+
greedy: true,
|
|
40
|
+
alias: "string"
|
|
41
|
+
},
|
|
42
|
+
string: {
|
|
43
|
+
pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
|
|
44
|
+
greedy: true
|
|
45
|
+
},
|
|
46
|
+
function: {
|
|
47
|
+
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
|
|
48
|
+
lookbehind: true
|
|
49
|
+
},
|
|
50
|
+
"class-name": {
|
|
51
|
+
pattern: /(\bclass\s+)\w+/i,
|
|
52
|
+
lookbehind: true
|
|
53
|
+
},
|
|
54
|
+
decorator: {
|
|
55
|
+
pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
|
|
56
|
+
lookbehind: true,
|
|
57
|
+
alias: ["annotation", "punctuation"],
|
|
58
|
+
inside: { punctuation: /\./ }
|
|
59
|
+
},
|
|
60
|
+
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/,
|
|
61
|
+
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/,
|
|
62
|
+
boolean: /\b(?:False|None|True)\b/,
|
|
63
|
+
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,
|
|
64
|
+
operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
|
|
65
|
+
punctuation: /[{}[\];(),.:]/
|
|
66
|
+
};
|
|
67
|
+
Prism.languages.python["string-interpolation"].inside["interpolation"].inside.rest = Prism.languages.python;
|
|
68
|
+
Prism.languages.py = Prism.languages.python;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
exports.default = python;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//#region ../../node_modules/refractor/lang/python.js
|
|
2
|
+
/**
|
|
3
|
+
* @import {Refractor} from '../lib/core.js'
|
|
4
|
+
*/
|
|
5
|
+
python.displayName = "python";
|
|
6
|
+
python.aliases = ["py"];
|
|
7
|
+
/** @param {Refractor} Prism */
|
|
8
|
+
function python(Prism) {
|
|
9
|
+
Prism.languages.python = {
|
|
10
|
+
comment: {
|
|
11
|
+
pattern: /(^|[^\\])#.*/,
|
|
12
|
+
lookbehind: true,
|
|
13
|
+
greedy: true
|
|
14
|
+
},
|
|
15
|
+
"string-interpolation": {
|
|
16
|
+
pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
|
|
17
|
+
greedy: true,
|
|
18
|
+
inside: {
|
|
19
|
+
interpolation: {
|
|
20
|
+
pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
|
|
21
|
+
lookbehind: true,
|
|
22
|
+
inside: {
|
|
23
|
+
"format-spec": {
|
|
24
|
+
pattern: /(:)[^:(){}]+(?=\}$)/,
|
|
25
|
+
lookbehind: true
|
|
26
|
+
},
|
|
27
|
+
"conversion-option": {
|
|
28
|
+
pattern: //,
|
|
29
|
+
alias: "punctuation"
|
|
30
|
+
},
|
|
31
|
+
rest: null
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
string: /[\s\S]+/
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"triple-quoted-string": {
|
|
38
|
+
pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
|
|
39
|
+
greedy: true,
|
|
40
|
+
alias: "string"
|
|
41
|
+
},
|
|
42
|
+
string: {
|
|
43
|
+
pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
|
|
44
|
+
greedy: true
|
|
45
|
+
},
|
|
46
|
+
function: {
|
|
47
|
+
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
|
|
48
|
+
lookbehind: true
|
|
49
|
+
},
|
|
50
|
+
"class-name": {
|
|
51
|
+
pattern: /(\bclass\s+)\w+/i,
|
|
52
|
+
lookbehind: true
|
|
53
|
+
},
|
|
54
|
+
decorator: {
|
|
55
|
+
pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
|
|
56
|
+
lookbehind: true,
|
|
57
|
+
alias: ["annotation", "punctuation"],
|
|
58
|
+
inside: { punctuation: /\./ }
|
|
59
|
+
},
|
|
60
|
+
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/,
|
|
61
|
+
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/,
|
|
62
|
+
boolean: /\b(?:False|None|True)\b/,
|
|
63
|
+
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,
|
|
64
|
+
operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
|
|
65
|
+
punctuation: /[{}[\];(),.:]/
|
|
66
|
+
};
|
|
67
|
+
Prism.languages.python["string-interpolation"].inside["interpolation"].inside.rest = Prism.languages.python;
|
|
68
|
+
Prism.languages.py = Prism.languages.python;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { python as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const require_javascript = require("./javascript.cjs");
|
|
2
|
+
//#region ../../node_modules/refractor/lang/typescript.js
|
|
3
|
+
/**
|
|
4
|
+
* @import {Refractor} from '../lib/core.js'
|
|
5
|
+
*/
|
|
6
|
+
typescript.displayName = "typescript";
|
|
7
|
+
typescript.aliases = ["ts"];
|
|
8
|
+
/** @param {Refractor} Prism */
|
|
9
|
+
function typescript(Prism) {
|
|
10
|
+
Prism.register(require_javascript.default);
|
|
11
|
+
(function(Prism) {
|
|
12
|
+
Prism.languages.typescript = Prism.languages.extend("javascript", {
|
|
13
|
+
"class-name": {
|
|
14
|
+
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
|
|
15
|
+
lookbehind: true,
|
|
16
|
+
greedy: true,
|
|
17
|
+
inside: null
|
|
18
|
+
},
|
|
19
|
+
builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/
|
|
20
|
+
});
|
|
21
|
+
Prism.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*(?:[\{*]|$))/);
|
|
22
|
+
delete Prism.languages.typescript["parameter"];
|
|
23
|
+
delete Prism.languages.typescript["literal-property"];
|
|
24
|
+
var typeInside = Prism.languages.extend("typescript", {});
|
|
25
|
+
delete typeInside["class-name"];
|
|
26
|
+
Prism.languages.typescript["class-name"].inside = typeInside;
|
|
27
|
+
Prism.languages.insertBefore("typescript", "function", {
|
|
28
|
+
decorator: {
|
|
29
|
+
pattern: /@[$\w\xA0-\uFFFF]+/,
|
|
30
|
+
inside: {
|
|
31
|
+
at: {
|
|
32
|
+
pattern: /^@/,
|
|
33
|
+
alias: "operator"
|
|
34
|
+
},
|
|
35
|
+
function: /^[\s\S]+/
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"generic-function": {
|
|
39
|
+
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
|
|
40
|
+
greedy: true,
|
|
41
|
+
inside: {
|
|
42
|
+
function: /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
|
|
43
|
+
generic: {
|
|
44
|
+
pattern: /<[\s\S]+/,
|
|
45
|
+
alias: "class-name",
|
|
46
|
+
inside: typeInside
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
Prism.languages.ts = Prism.languages.typescript;
|
|
52
|
+
})(Prism);
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
exports.default = typescript;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import javascript from "./javascript.js";
|
|
2
|
+
//#region ../../node_modules/refractor/lang/typescript.js
|
|
3
|
+
/**
|
|
4
|
+
* @import {Refractor} from '../lib/core.js'
|
|
5
|
+
*/
|
|
6
|
+
typescript.displayName = "typescript";
|
|
7
|
+
typescript.aliases = ["ts"];
|
|
8
|
+
/** @param {Refractor} Prism */
|
|
9
|
+
function typescript(Prism) {
|
|
10
|
+
Prism.register(javascript);
|
|
11
|
+
(function(Prism) {
|
|
12
|
+
Prism.languages.typescript = Prism.languages.extend("javascript", {
|
|
13
|
+
"class-name": {
|
|
14
|
+
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
|
|
15
|
+
lookbehind: true,
|
|
16
|
+
greedy: true,
|
|
17
|
+
inside: null
|
|
18
|
+
},
|
|
19
|
+
builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/
|
|
20
|
+
});
|
|
21
|
+
Prism.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*(?:[\{*]|$))/);
|
|
22
|
+
delete Prism.languages.typescript["parameter"];
|
|
23
|
+
delete Prism.languages.typescript["literal-property"];
|
|
24
|
+
var typeInside = Prism.languages.extend("typescript", {});
|
|
25
|
+
delete typeInside["class-name"];
|
|
26
|
+
Prism.languages.typescript["class-name"].inside = typeInside;
|
|
27
|
+
Prism.languages.insertBefore("typescript", "function", {
|
|
28
|
+
decorator: {
|
|
29
|
+
pattern: /@[$\w\xA0-\uFFFF]+/,
|
|
30
|
+
inside: {
|
|
31
|
+
at: {
|
|
32
|
+
pattern: /^@/,
|
|
33
|
+
alias: "operator"
|
|
34
|
+
},
|
|
35
|
+
function: /^[\s\S]+/
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"generic-function": {
|
|
39
|
+
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
|
|
40
|
+
greedy: true,
|
|
41
|
+
inside: {
|
|
42
|
+
function: /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
|
|
43
|
+
generic: {
|
|
44
|
+
pattern: /<[\s\S]+/,
|
|
45
|
+
alias: "class-name",
|
|
46
|
+
inside: typeInside
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
Prism.languages.ts = Prism.languages.typescript;
|
|
52
|
+
})(Prism);
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { typescript as default };
|