@webcoder49/code-input 2.6.0 → 2.6.2

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.
@@ -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.0",
3
+ "version": "2.6.2",
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