@webcoder49/code-input 2.8.3 → 2.8.4
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/README.md +1 -1
- package/code-input.d.ts +1 -1
- package/docs/_index.md +1 -1
- package/esm/README.md +1 -1
- package/esm/code-input.d.mts +25 -2
- package/esm/plugins/auto-close-brackets.d.mts +3 -2
- package/esm/plugins/auto-close-brackets.mjs +1 -1
- package/esm/plugins/autocomplete.d.mts +3 -2
- package/esm/plugins/autocomplete.mjs +1 -1
- package/esm/plugins/autodetect.d.mts +3 -2
- package/esm/plugins/autodetect.mjs +1 -1
- package/esm/plugins/find-and-replace.d.mts +3 -2
- package/esm/plugins/find-and-replace.mjs +1 -1
- package/esm/plugins/go-to-line.d.mts +3 -2
- package/esm/plugins/go-to-line.mjs +1 -1
- package/esm/plugins/indent.d.mts +3 -2
- package/esm/plugins/indent.mjs +1 -1
- package/esm/plugins/select-token-callbacks.d.mts +8 -7
- package/esm/plugins/select-token-callbacks.mjs +1 -1
- package/esm/plugins/special-chars.d.mts +3 -2
- package/esm/plugins/special-chars.mjs +1 -1
- package/esm/plugins/test.d.mts +4 -3
- package/esm/plugins/test.mjs +1 -1
- package/esm/templates/hljs.d.mts +1 -1
- package/esm/templates/prism.d.mts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# code-input
|
|
1
|
+
# [code-input.js](https://v2.code-input-js.org/)
|
|
2
2
|
|
|
3
3
|
[](https://code-input-js.org)[](https://github.com/WebCoder49/code-input)[](https://codeberg.org/code-input-js/code-input-js)[](https://yarnpkg.com/package?name=@webcoder49/code-input)[](https://www.npmjs.com/package/@webcoder49/code-input)
|
|
4
4
|
|
package/code-input.d.ts
CHANGED
|
@@ -424,7 +424,7 @@ export class CodeInput extends HTMLTextAreaElement { // Tries to implement texta
|
|
|
424
424
|
/**
|
|
425
425
|
* When the code-input's template is registered, this contains its codeInput.Template object.
|
|
426
426
|
*/
|
|
427
|
-
templateObject?: readonly
|
|
427
|
+
/*readonly*/ templateObject?: Template // `readonly` commented for backwards compatibility
|
|
428
428
|
/**
|
|
429
429
|
* Exposed child textarea element for user to input code in; in this version of code-input you shouldn't need to access
|
|
430
430
|
* it because most textarea functionality is present on the code-input element itself.
|
package/docs/_index.md
CHANGED
|
@@ -8,7 +8,7 @@ title = 'Flexible Syntax Highlighted Editable Textareas'
|
|
|
8
8
|
|
|
9
9
|
## Download
|
|
10
10
|
|
|
11
|
-
*`code-input.js` is free, libre, open source software under the MIT (AKA Expat) license.* You have choices! **Download it from the Git repository on [GitHub](https://github.com/WebCoder49/code-input/tree/v2.8.
|
|
11
|
+
*`code-input.js` is free, libre, open source software under the MIT (AKA Expat) license.* You have choices! **Download it from the Git repository on [GitHub](https://github.com/WebCoder49/code-input/tree/v2.8.4) or [Codeberg](https://codeberg.org/code-input-js/code-input-js/), [in a ZIP archive](/release/code-input-js-v2.8.4.zip), [in a TAR.GZ archive](/release/code-input-js-v2.8.4.tar.gz), or from `@webcoder49/code-input` on the NPM registry ([Yarn](https://yarnpkg.com/package?name=@webcoder49/code-input), [NPM](https://npmjs.com/package/@webcoder49/code-input), etc.).**
|
|
12
12
|
|
|
13
13
|
[Want to contribute to the code? You're very welcome to! See here.](#contributing)
|
|
14
14
|
|
package/esm/README.md
CHANGED
|
@@ -7,7 +7,7 @@ If you are using Yarn, NPM, or a similar package manager, the files should have
|
|
|
7
7
|
Otherwise, after changing directory to the one containing this file:
|
|
8
8
|
|
|
9
9
|
- If you have Node.js installed, run `node generate.mjs`.
|
|
10
|
-
- If you don't have Node.js installed but are on a POSIX-like system with `bash`/`zsh`, run `sh ./generate.sh`.
|
|
10
|
+
- If you don't have Node.js installed but are on a POSIX-like system with `bash`/`zsh`, run `sh ./generate.sh`. (This uses features like `grep -o`, so won't work on *absolutely all* POSIX systems. It works on many computers though, so try it out first!) **Security-wise, we don't prevent JavaScript**
|
|
11
11
|
- If neither of the above are true, install Node.js or (slightly harder; look online) a POSIX/"Linux" compatible shell.
|
|
12
12
|
|
|
13
13
|
## Extra Information
|
package/esm/code-input.d.mts
CHANGED
|
@@ -109,7 +109,7 @@ export class CodeInput extends HTMLTextAreaElement { // Tries to implement texta
|
|
|
109
109
|
/**
|
|
110
110
|
* When the code-input's template is registered, this contains its codeInput.Template object.
|
|
111
111
|
*/
|
|
112
|
-
templateObject?: readonly
|
|
112
|
+
/*readonly*/ templateObject?: Template // `readonly` commented for backwards compatibility
|
|
113
113
|
/**
|
|
114
114
|
* Exposed child textarea element for user to input code in; in this version of code-input you shouldn't need to access
|
|
115
115
|
* it because most textarea functionality is present on the code-input element itself.
|
|
@@ -151,4 +151,27 @@ export class CodeInput extends HTMLTextAreaElement { // Tries to implement texta
|
|
|
151
151
|
* @param {Object} template - a Template object instance - see `codeInput.templates`
|
|
152
152
|
*/
|
|
153
153
|
export function registerTemplate(templateName: string, template: Template): void;
|
|
154
|
-
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
// Prepare the default export:
|
|
157
|
+
|
|
158
|
+
// Values under the default export
|
|
159
|
+
declare const _default: {
|
|
160
|
+
Plugin: typeof Plugin;
|
|
161
|
+
Template: typeof Template;
|
|
162
|
+
CodeInput: typeof CodeInput;
|
|
163
|
+
registerTemplate: typeof registerTemplate;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Type aliases to prevent ambiguous 'Plugin = Plugin'
|
|
167
|
+
declare type _Plugin = Plugin;
|
|
168
|
+
declare type _Template = Template;
|
|
169
|
+
declare type _CodeInput = CodeInput;
|
|
170
|
+
// Types under the default export
|
|
171
|
+
declare namespace _default {
|
|
172
|
+
export type Plugin = _Plugin;
|
|
173
|
+
export type Template = _Template;
|
|
174
|
+
export type CodeInput = _CodeInput;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export default _default;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
|
-
import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
3
|
+
import type { Plugin, CodeInput } from "../code-input.d.mts";
|
|
4
4
|
/**
|
|
5
5
|
* Automatically closes pairs of brackets/quotes/other syntaxes in code, but also lets you choose the brackets this
|
|
6
6
|
* is activated for.
|
|
7
7
|
* Files: auto-close-brackets.js
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
declare class AutoCloseBrackets extends Plugin {
|
|
10
10
|
/**
|
|
11
11
|
* Create an auto-close brackets plugin to pass into a template
|
|
12
12
|
* @param {Object} bracketPairs Opening brackets mapped to closing brackets, default and example {"(": ")", "[": "]", "{": "}", '"': '"'}. All brackets must only be one character.
|
|
13
13
|
*/
|
|
14
14
|
constructor(bracketPairs?: Object);
|
|
15
15
|
}
|
|
16
|
+
export default AutoCloseBrackets;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
3
|
import { Plugin } from "../code-input.mjs";
|
|
4
|
-
|
|
4
|
+
let plugins = {};
|
|
5
5
|
/**
|
|
6
6
|
* Automatically close pairs of brackets/quotes/other syntaxes in code, but also optionally choose the brackets this
|
|
7
7
|
* is activated for.
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
|
-
import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
3
|
+
import type { Plugin, CodeInput } from "../code-input.d.mts";
|
|
4
4
|
/**
|
|
5
5
|
* Display a popup under the caret using the text in the code-input element. This works well with autocomplete suggestions.
|
|
6
6
|
* Files: autocomplete.js / autocomplete.css
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare class Autocomplete extends Plugin {
|
|
9
9
|
/**
|
|
10
10
|
* Pass in a function to create a plugin that displays the popup that takes in (popup element, textarea, textarea.selectionEnd).
|
|
11
11
|
* @param {(popupElement: HTMLElement, textarea: HTMLTextAreaElement, selectionEnd: number, selectionStart?: number) => void} updatePopupCallback a function to display the popup that takes in (popup element, textarea, textarea.selectionEnd).
|
|
12
12
|
*/
|
|
13
13
|
constructor(updatePopupCallback: (popupElem: HTMLElement, textarea: HTMLTextAreaElement, selectionEnd: number, selectionStart?: number) => void);
|
|
14
14
|
}
|
|
15
|
+
export default Autocomplete;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
3
|
import { Plugin } from "../code-input.mjs";
|
|
4
|
-
|
|
4
|
+
let plugins = {};
|
|
5
5
|
/**
|
|
6
6
|
* Display a popup under the caret using the text in the code-input element. This works well with autocomplete suggestions.
|
|
7
7
|
* Files: autocomplete.js / autocomplete.css
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
|
-
import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
3
|
+
import type { Plugin, CodeInput } from "../code-input.d.mts";
|
|
4
4
|
/**
|
|
5
5
|
* Autodetect the language live and change the `lang` attribute using the syntax highlighter's
|
|
6
6
|
* autodetect capabilities. Works with highlight.js only.
|
|
7
7
|
* Files: autodetect.js
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
declare class Autodetect extends Plugin {
|
|
10
10
|
constructor();
|
|
11
11
|
}
|
|
12
|
+
export default Autodetect;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
3
|
import { Plugin } from "../code-input.mjs";
|
|
4
|
-
|
|
4
|
+
let plugins = {};
|
|
5
5
|
/**
|
|
6
6
|
* Autodetect the language live and change the `lang` attribute using the syntax highlighter's
|
|
7
7
|
* autodetect capabilities. Works with highlight.js only.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
|
-
import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
3
|
+
import type { Plugin, CodeInput } from "../code-input.d.mts";
|
|
4
4
|
/**
|
|
5
5
|
* Add Find-and-Replace (Ctrl/Cmd+F for find, Ctrl+H for replace by default) functionality to the code editor.
|
|
6
6
|
* Files: find-and-replace.js / find-and-replace.css
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare class FindAndReplace extends Plugin {
|
|
9
9
|
/**
|
|
10
10
|
* Create a find-and-replace command plugin to pass into a template. To ensure keyboard shortcuts remain intuitive, set the alwaysCtrl parameter to false.
|
|
11
11
|
* @param {boolean} useCtrlF Should Ctrl/Cmd+F be overridden for find-and-replace find functionality? Either way, you can also trigger it yourself using (instance of this plugin)`.showPrompt(code-input element, false)`.
|
|
@@ -43,3 +43,4 @@ import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
|
43
43
|
*/
|
|
44
44
|
showPrompt(codeInputElement: CodeInput, replacePartExpanded: boolean): void;
|
|
45
45
|
}
|
|
46
|
+
export default FindAndReplace;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
3
|
import { Plugin } from "../code-input.mjs";
|
|
4
|
-
|
|
4
|
+
let plugins = {};
|
|
5
5
|
/**
|
|
6
6
|
* Add Find-and-Replace (Ctrl/Cmd+F for find, Ctrl+H for replace by default) functionality to the code editor.
|
|
7
7
|
* Files: find-and-replace.js / find-and-replace.css
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
|
-
import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
3
|
+
import type { Plugin, CodeInput } from "../code-input.d.mts";
|
|
4
4
|
/**
|
|
5
5
|
* Add Go-To-Line (Ctrl/Cmd+G by default) functionality to the code editor.
|
|
6
6
|
* Files: go-to-line.js / go-to-line.css
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare class GoToLine extends Plugin {
|
|
9
9
|
/**
|
|
10
10
|
* Create a go-to-line command plugin to pass into a template.
|
|
11
11
|
* @param {boolean} useCtrlG Should Ctrl/Cmd+G be overridden for go-to-line functionality? Either way, you can trigger it yourself using (instance of this plugin)`.showPrompt(code-input element)`.
|
|
@@ -28,3 +28,4 @@ import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
|
28
28
|
*/
|
|
29
29
|
showPrompt(codeInput: CodeInput): void;
|
|
30
30
|
}
|
|
31
|
+
export default GoToLine;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
3
|
import { Plugin } from "../code-input.mjs";
|
|
4
|
-
|
|
4
|
+
let plugins = {};
|
|
5
5
|
/**
|
|
6
6
|
* Add Go-To-Line (Ctrl/Cmd+G by default) functionality to the code editor.
|
|
7
7
|
* Files: go-to-line.js / go-to-line.css
|
package/esm/plugins/indent.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
|
-
import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
3
|
+
import type { Plugin, CodeInput } from "../code-input.d.mts";
|
|
4
4
|
/**
|
|
5
5
|
* Adds indentation using the `Tab` key, and auto-indents after a newline, as well as making it
|
|
6
6
|
* possible to indent/unindent multiple lines using Tab/Shift+Tab
|
|
7
7
|
* Files: indent.js
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
declare class Indent extends Plugin {
|
|
10
10
|
/**
|
|
11
11
|
* Create an indentation plugin to pass into a template
|
|
12
12
|
* @param {boolean} defaultSpaces Should the Tab key enter spaces rather than tabs? Defaults to false.
|
|
@@ -20,3 +20,4 @@ import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
|
20
20
|
tabForNavigation?: string;
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
+
export default Indent;
|
package/esm/plugins/indent.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
3
|
import { Plugin } from "../code-input.mjs";
|
|
4
|
-
|
|
4
|
+
let plugins = {};
|
|
5
5
|
/**
|
|
6
6
|
* Add indentation using the `Tab` key, and auto-indents after a newline, as well as making it
|
|
7
7
|
* possible to indent/unindent multiple lines using Tab/Shift+Tab
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
|
-
import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
3
|
+
import type { Plugin, CodeInput } from "../code-input.d.mts";
|
|
4
4
|
/**
|
|
5
5
|
* Make tokens in the <pre><code> element that are included within the selected text of the <code-input>
|
|
6
|
-
* gain a CSS
|
|
6
|
+
* gain a CSS class while selected, or trigger JavaScript callbacks.
|
|
7
7
|
* Files: select-token-callbacks.js
|
|
8
8
|
*/
|
|
9
|
-
class SelectTokenCallbacks extends Plugin {
|
|
9
|
+
declare class SelectTokenCallbacks extends Plugin {
|
|
10
10
|
/**
|
|
11
11
|
* Set up the behaviour of tokens text-selected in the `<code-input>` element, and the exact definition of a token being text-selected.
|
|
12
12
|
*
|
|
13
13
|
* All parameters are optional. If you provide no arguments to the constructor, this will dynamically apply the "code-input_select-token-callbacks_selected" class to selected tokens only, for you to style via CSS.
|
|
14
14
|
*
|
|
15
|
-
* @param {
|
|
15
|
+
* @param {SelectTokenCallbacks.TokenSelectorCallbacks} tokenSelectorCallbacks What to do with text-selected tokens. See docstrings for the TokenSelectorCallbacks class.
|
|
16
16
|
* @param {boolean} onlyCaretNotSelection If true, tokens will only be marked as selected when no text is selected but rather the caret is inside them (start of selection == end of selection). Default false.
|
|
17
17
|
* @param {boolean} caretAtStartIsSelected Whether the caret or text selection's end being just before the first character of a token means said token is selected. Default true.
|
|
18
18
|
* @param {boolean} caretAtEndIsSelected Whether the caret or text selection's start being just after the last character of a token means said token is selected. Default true.
|
|
@@ -20,10 +20,10 @@ import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
|
20
20
|
* @param {boolean} partiallySelectedTokensAreSelected Whether tokens for which only some of their text is selected should be treated as selected. Default true.
|
|
21
21
|
* @param {boolean} parentTokensAreSelected Whether all parent tokens of selected tokens should be treated as selected. Default true.
|
|
22
22
|
*/
|
|
23
|
-
constructor(tokenSelectorCallbacks?:
|
|
23
|
+
constructor(tokenSelectorCallbacks?: SelectTokenCallbacks.TokenSelectorCallbacks, onlyCaretNotSelection?: boolean, caretAtStartIsSelected?: boolean, caretAtEndIsSelected?: boolean, createSubTokens?: boolean, partiallySelectedTokensAreSelected?: boolean, parentTokensAreSelected?: boolean);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
namespace SelectTokenCallbacks {
|
|
26
|
+
declare namespace SelectTokenCallbacks {
|
|
27
27
|
/**
|
|
28
28
|
* A data structure specifying what should be done with tokens when they are selected, and also allows for previously selected
|
|
29
29
|
* tokens to be dealt with each time the selection changes. See the constructor and the createClassSynchronisation static method.
|
|
@@ -46,6 +46,7 @@ import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
|
46
46
|
* @param {string} selectedClass The CSS class that will be present on tokens only when they are part of the selected text in the `<code-input>` element. Defaults to "code-input_select-token-callbacks_selected".
|
|
47
47
|
* @returns {TokenSelectorCallbacks} A new TokenSelectorCallbacks instance that encodes this behaviour.
|
|
48
48
|
*/
|
|
49
|
-
static createClassSynchronisation(selectedClass?: string):
|
|
49
|
+
static createClassSynchronisation(selectedClass?: string): SelectTokenCallbacks.TokenSelectorCallbacks;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
export default SelectTokenCallbacks;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
3
|
import { Plugin } from "../code-input.mjs";
|
|
4
|
-
|
|
4
|
+
let plugins = {};
|
|
5
5
|
/**
|
|
6
6
|
* Make tokens in the <pre><code> element that are included within the selected text of the <code-input>
|
|
7
7
|
* gain a CSS class while selected, or trigger JavaScript callbacks.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
|
-
import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
3
|
+
import type { Plugin, CodeInput } from "../code-input.d.mts";
|
|
4
4
|
/**
|
|
5
5
|
* Render special characters and control characters as a symbol with their hex code.
|
|
6
6
|
* Files: special-chars.js, special-chars.css
|
|
@@ -13,7 +13,7 @@ import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
|
13
13
|
*
|
|
14
14
|
* See https://github.com/WebCoder49/code-input/issues?q=is%3Aissue%20state%3Aopen%20specialchars
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
declare class SpecialChars extends Plugin {
|
|
17
17
|
/**
|
|
18
18
|
* Create a special characters plugin instance.
|
|
19
19
|
* Default = covers many non-renderable ASCII characters.
|
|
@@ -23,3 +23,4 @@ import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
|
23
23
|
*/
|
|
24
24
|
constructor(colorInSpecialChars?: boolean, inheritTextColor?: boolean, specialCharRegExp?: RegExp);
|
|
25
25
|
}
|
|
26
|
+
export default SpecialChars;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
3
|
import { Plugin } from "../code-input.mjs";
|
|
4
|
-
|
|
4
|
+
let plugins = {};
|
|
5
5
|
/**
|
|
6
6
|
* Render special characters and control characters as a symbol with their hex code.
|
|
7
7
|
* Files: special-chars.js, special-chars.css
|
package/esm/plugins/test.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
|
-
import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
3
|
+
import type { Plugin, CodeInput } from "../code-input.d.mts";
|
|
4
4
|
/**
|
|
5
5
|
* JavaScript example of a plugin, which brings extra,
|
|
6
6
|
* non-central optional functionality to code-input.
|
|
@@ -8,9 +8,10 @@ import { Plugin, CodeInput } from "../code-input.d.mts";
|
|
|
8
8
|
* to the `plugins` argument when registering a template,
|
|
9
9
|
* for example like this:
|
|
10
10
|
* ```javascript
|
|
11
|
-
* codeInput.registerTemplate("syntax-highlighted", codeInput.templates.hljs(hljs, [new
|
|
11
|
+
* codeInput.registerTemplate("syntax-highlighted", codeInput.templates.hljs(hljs, [new Test()]));
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
declare class Test extends Plugin {
|
|
15
15
|
constructor();
|
|
16
16
|
}
|
|
17
|
+
export default Test;
|
package/esm/plugins/test.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
3
|
import { Plugin } from "../code-input.mjs";
|
|
4
|
-
|
|
4
|
+
let plugins = {};
|
|
5
5
|
/**
|
|
6
6
|
* Copy this to create a plugin, which brings extra,
|
|
7
7
|
* non-central optional functionality to code-input.
|
package/esm/templates/hljs.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
|
-
import { Template, Plugin } from "../code-input.d.mts";
|
|
3
|
+
import type { Template, Plugin } from "../code-input.d.mts";
|
|
4
4
|
/**
|
|
5
5
|
* A template that uses highlight.js syntax highlighting (https://highlightjs.org/).
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// NOTICE: This code is @generated from code outside the esm directory. Please do not edit it to contribute!
|
|
2
2
|
|
|
3
|
-
import { Template, Plugin } from "../code-input.d.mts";
|
|
3
|
+
import type { Template, Plugin } from "../code-input.d.mts";
|
|
4
4
|
/**
|
|
5
5
|
* A template that uses Prism.js syntax highlighting (https://prismjs.com/).
|
|
6
6
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webcoder49/code-input",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.4",
|
|
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": {
|