@webcoder49/code-input 2.6.0 → 2.6.3
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/SECURITY.md +7 -0
- package/code-input.js +154 -91
- package/code-input.min.js +1 -1
- package/docs/_index.md +12 -3
- package/docs/interface/js/_index.md +1 -1
- package/esm/code-input.d.mts +154 -0
- package/esm/code-input.mjs +1058 -0
- package/esm/plugins/auto-close-brackets.d.mts +15 -0
- package/esm/plugins/auto-close-brackets.mjs +84 -0
- package/esm/plugins/autocomplete.d.mts +14 -0
- package/esm/plugins/autocomplete.mjs +93 -0
- package/esm/plugins/autodetect.d.mts +11 -0
- package/esm/plugins/autodetect.mjs +35 -0
- package/esm/plugins/find-and-replace.d.mts +43 -0
- package/esm/plugins/find-and-replace.mjs +777 -0
- package/esm/plugins/go-to-line.d.mts +29 -0
- package/esm/plugins/go-to-line.mjs +217 -0
- package/esm/plugins/indent.d.mts +22 -0
- package/esm/plugins/indent.mjs +359 -0
- package/esm/plugins/select-token-callbacks.d.mts +51 -0
- package/esm/plugins/select-token-callbacks.mjs +296 -0
- package/esm/plugins/special-chars.d.mts +25 -0
- package/esm/plugins/special-chars.mjs +207 -0
- package/esm/plugins/test.d.mts +16 -0
- package/esm/plugins/test.mjs +56 -0
- package/esm/templates/hljs.d.mts +16 -0
- package/esm/templates/hljs.mjs +28 -0
- package/esm/templates/prism.d.mts +16 -0
- package/esm/templates/prism.mjs +25 -0
- package/package.json +1 -1
- package/esm/.code-input.mjs.kate-swp +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
|
+
|
|
3
|
+
import { Template, Plugin } from "../code-input.d.mts";
|
|
4
|
+
/**
|
|
5
|
+
* A template that uses highlight.js syntax highlighting (https://highlightjs.org/).
|
|
6
|
+
*/
|
|
7
|
+
export default class Hljs extends Template {
|
|
8
|
+
/**
|
|
9
|
+
* Constructor to create a template that uses highlight.js syntax highlighting (https://highlightjs.org/)
|
|
10
|
+
* @param {Object} hljs Import highlight.js, then after that import pass the `hljs` object as this parameter.
|
|
11
|
+
* @param {Plugin[]} plugins - An array of plugin objects to add extra features - see `codeInput.plugins`
|
|
12
|
+
* @param {boolean} preElementStyled - Defaults to false, which should be right for most themes. If the styling is broken, change to true. (See `Template` constructor's definition.)
|
|
13
|
+
* @returns template object
|
|
14
|
+
*/
|
|
15
|
+
constructor(hljs: Object, plugins?: Plugin[], preElementStyled?: boolean)
|
|
16
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
|
+
|
|
3
|
+
import { Template } from "../code-input.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* A template that uses highlight.js syntax highlighting (https://highlightjs.org/).
|
|
6
|
+
*/
|
|
7
|
+
class Hljs extends Template { // Dependency: Highlight.js (https://highlightjs.org/)
|
|
8
|
+
/**
|
|
9
|
+
* Constructor to create a template that uses highlight.js syntax highlighting (https://highlightjs.org/)
|
|
10
|
+
* @param {Object} hljs Import highlight.js, then after that import pass the `hljs` object as this parameter.
|
|
11
|
+
* @param {codeInput.Plugin[]} plugins - An array of plugin objects to add extra features - see `codeInput.plugins`
|
|
12
|
+
* @param {boolean} preElementStyled - Defaults to false, which should be right for most themes. If the styling is broken, change to true. (See `Template` constructor's definition.)
|
|
13
|
+
* @returns {Template} template object
|
|
14
|
+
*/
|
|
15
|
+
constructor(hljs, plugins = [], preElementStyled = false) {
|
|
16
|
+
super(
|
|
17
|
+
function(codeElement) {
|
|
18
|
+
codeElement.removeAttribute("data-highlighted");
|
|
19
|
+
hljs.highlightElement(codeElement);
|
|
20
|
+
}, // highlight
|
|
21
|
+
preElementStyled, // preElementStyled
|
|
22
|
+
true, // isCode
|
|
23
|
+
false, // includeCodeInputInHighlightFunc
|
|
24
|
+
plugins
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export default Hljs;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
|
+
|
|
3
|
+
import { Template, Plugin } from "../code-input.d.mts";
|
|
4
|
+
/**
|
|
5
|
+
* A template that uses Prism.js syntax highlighting (https://prismjs.com/).
|
|
6
|
+
*/
|
|
7
|
+
export default class Prism extends Template {
|
|
8
|
+
/**
|
|
9
|
+
* Constructor to create a template that uses Prism.js syntax highlighting (https://prismjs.com/)
|
|
10
|
+
* @param {Object} prism Import Prism.js, then after that import pass the `Prism` object as this parameter.
|
|
11
|
+
* @param {Plugin[]} plugins - An array of plugin objects to add extra features - see `codeInput.plugins`
|
|
12
|
+
* @param {boolean} preElementStyled - Defaults to true, which should be right for most themes. If the styling is broken, change to false. (See `Template` constructor's definition.)
|
|
13
|
+
* @returns template object
|
|
14
|
+
*/
|
|
15
|
+
constructor(prism: Object, plugins?: Plugin[], preElementStyled?: boolean)
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
|
+
|
|
3
|
+
import { Template } from "../code-input.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* A template that uses Prism.js syntax highlighting (https://prismjs.com/).
|
|
6
|
+
*/
|
|
7
|
+
class Prism extends Template { // Dependency: Prism.js (https://prismjs.com/)
|
|
8
|
+
/**
|
|
9
|
+
* Constructor to create a template that uses Prism.js syntax highlighting (https://prismjs.com/)
|
|
10
|
+
* @param {Object} prism Import Prism.js, then after that import pass the `Prism` object as this parameter.
|
|
11
|
+
* @param {codeInput.Plugin[]} plugins - An array of plugin objects to add extra features - see `codeInput.plugins`
|
|
12
|
+
* @param {boolean} preElementStyled - Defaults to true, which should be right for most themes. If the styling is broken, change to false. (See `Template` constructor's definition.)
|
|
13
|
+
* @returns {Template} template object
|
|
14
|
+
*/
|
|
15
|
+
constructor(prism, plugins = [], preElementStyled = true) {
|
|
16
|
+
super(
|
|
17
|
+
prism.highlightElement, // highlight
|
|
18
|
+
preElementStyled, // preElementStyled
|
|
19
|
+
true, // isCode
|
|
20
|
+
false, // includeCodeInputInHighlightFunc
|
|
21
|
+
plugins
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export default Prism;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webcoder49/code-input",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"description": "An editable <textarea> that supports *any* syntax highlighting algorithm, for code or something else. Also, added plugins.",
|
|
5
5
|
"browser": "code-input.js",
|
|
6
6
|
"exports": {
|
|
Binary file
|