@rcarls/rc-textarea 0.4.2 → 0.6.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/CHANGELOG.md +28 -0
- package/README.md +2 -3
- package/dist/custom-elements.json +26 -78
- package/dist/{line-actions-controller-TP6g5HYk.js → line-actions-controller-BcsnmSPS.js} +118 -149
- package/dist/line-actions-controller-BcsnmSPS.js.map +1 -0
- package/dist/rc-textarea-define.js +2 -2
- package/dist/rc-textarea.js +1 -1
- package/dist/types/packages/rc-textarea/src/blots.d.ts +1 -1
- package/dist/types/packages/rc-textarea/src/decoration.d.ts +2 -2
- package/dist/types/packages/rc-textarea/src/document.d.ts +1 -1
- package/dist/types/packages/rc-textarea/src/index.d.ts +7 -7
- package/dist/types/packages/rc-textarea/src/line-actions-controller.d.ts +1 -1
- package/dist/types/packages/rc-textarea/src/line-decorator.d.ts +1 -1
- package/dist/types/packages/rc-textarea/src/pattern-matcher.d.ts +1 -1
- package/dist/types/packages/rc-textarea/src/rc-textarea.d.ts +6 -25
- package/dist/types/packages/rc-textarea/src/types.d.ts +0 -4
- package/package.json +2 -2
- package/dist/line-actions-controller-TP6g5HYk.js.map +0 -1
- package/dist/types/packages/rc-textarea/src/decoration.test.d.ts +0 -1
- package/dist/types/packages/rc-textarea/src/line-decorator.test.d.ts +0 -1
- package/dist/types/packages/rc-textarea/src/pattern-matcher.test.d.ts +0 -1
- package/dist/types/packages/rc-textarea/src/rc-textarea.test.d.ts +0 -0
- package/dist/types/packages/rc-textarea/src/test-helpers.d.ts +0 -20
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Decoration, MarkDecoration, LineDecoration, DecorationInput } from './types.
|
|
2
|
-
export { generateId } from './types.
|
|
1
|
+
import { Decoration, MarkDecoration, LineDecoration, DecorationInput } from './types.js';
|
|
2
|
+
export { generateId } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* The minimal description of a single contiguous edit:
|
|
5
5
|
* a deletion of `removed` characters at `start`, followed by an insertion of
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { RCTextarea } from './rc-textarea.
|
|
2
|
-
export type { Decoration, DecorationInput, MarkDecoration, MarkDecorationStyle, LineDecoration, WidgetDecoration, RCTextareaPlugin, RCTextareaPluginAPI, TextPattern, LineDecoratorPlugin, Token, } from './types.
|
|
3
|
-
export { matchPatternResults } from './pattern-matcher.
|
|
4
|
-
export { createLineDecoratorPlugin } from './line-decorator.
|
|
5
|
-
export type { LineDecoratorPluginOptions } from './line-decorator.
|
|
6
|
-
export { LineActionsController } from './line-actions-controller.
|
|
7
|
-
export type { LineAction, LineActionsOptions } from './line-actions-controller.
|
|
1
|
+
export { RCTextarea } from './rc-textarea.js';
|
|
2
|
+
export type { Decoration, DecorationInput, MarkDecoration, MarkDecorationStyle, LineDecoration, WidgetDecoration, RCTextareaPlugin, RCTextareaPluginAPI, TextPattern, LineDecoratorPlugin, Token, } from './types.js';
|
|
3
|
+
export { matchPatternResults } from './pattern-matcher.js';
|
|
4
|
+
export { createLineDecoratorPlugin } from './line-decorator.js';
|
|
5
|
+
export type { LineDecoratorPluginOptions } from './line-decorator.js';
|
|
6
|
+
export { LineActionsController } from './line-actions-controller.js';
|
|
7
|
+
export type { LineAction, LineActionsOptions } from './line-actions-controller.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DecorationInput, LineDecoratorPlugin, RCTextareaPlugin } from './types.
|
|
1
|
+
import { DecorationInput, LineDecoratorPlugin, RCTextareaPlugin } from './types.js';
|
|
2
2
|
export interface LineDecoratorPluginOptions {
|
|
3
3
|
/**
|
|
4
4
|
* An array of subscriber setup functions for (e.g., reactive
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LitElement, CSSResultGroup } from 'lit';
|
|
2
2
|
import { NativeChildController } from '@rcarls/rc-common';
|
|
3
|
-
import { RCDocument } from './document.
|
|
4
|
-
import { SavedSelection } from './selection.
|
|
5
|
-
import { Decoration, DecorationInput, RCTextareaPlugin, RCTextareaPluginAPI, TextPattern } from './types.
|
|
3
|
+
import { RCDocument } from './document.js';
|
|
4
|
+
import { SavedSelection } from './selection.js';
|
|
5
|
+
import { Decoration, DecorationInput, RCTextareaPlugin, RCTextareaPluginAPI, TextPattern } from './types.js';
|
|
6
6
|
declare global {
|
|
7
7
|
interface HTMLElementTagNameMap {
|
|
8
8
|
'rc-textarea': RCTextarea;
|
|
@@ -41,7 +41,9 @@ interface UndoEntry {
|
|
|
41
41
|
* @slot - Accepts a native `<textarea>` element for form wiring.
|
|
42
42
|
*
|
|
43
43
|
* @fires rc-textarea-change - Fired when the field value changes
|
|
44
|
+
* @fires rc-textarea-focus - Fired when the field gains focus
|
|
44
45
|
* @fires rc-textarea-blur - Fired when the field loses focus
|
|
46
|
+
* @fires rc-textarea-select - Fired when the selection changes while the editor is focused
|
|
45
47
|
*
|
|
46
48
|
* @csspart root - The outer flex container wrapping the gutter and editor area.
|
|
47
49
|
* @csspart gutter - The gutter column container.
|
|
@@ -50,12 +52,10 @@ interface UndoEntry {
|
|
|
50
52
|
* @csspart editor - The contenteditable field surface.
|
|
51
53
|
*
|
|
52
54
|
* @attr line-numbers - Show sequential line numbers in the gutter. Enables the gutter implicitly.
|
|
53
|
-
* @attr list-numbers - Deprecated alias for sparse line numbering; removed before v1.0.
|
|
54
55
|
* @attr gutter - Enable the gutter column without any built-in content.
|
|
55
56
|
* @attr word-wrap - Wrap long lines within the field to prevent horizontal overflow.
|
|
56
57
|
* @attr auto-grow - Allow the field to grow vertically with content to prevent vertical overflow.
|
|
57
58
|
* @attr read-only - Disable editing. The field renders as a styled read-only display.
|
|
58
|
-
* @attr label - Deprecated accessible-name override; removed before v1.0.
|
|
59
59
|
* @attr value - Current field value.
|
|
60
60
|
* @attr default-value - Initial uncontrolled value.
|
|
61
61
|
*
|
|
@@ -88,15 +88,6 @@ export declare class RCTextarea extends LitElement {
|
|
|
88
88
|
};
|
|
89
89
|
/** Show sequential line numbers in the gutter. Enables the gutter implicitly. */
|
|
90
90
|
lineNumbers: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Legacy alias for sparse (non-blank-line) list-style numbering.
|
|
93
|
-
*
|
|
94
|
-
* @deprecated Use a plugin with `LineDecoration.gutterContent` to implement
|
|
95
|
-
* sparse line numbering. This property will be removed before v1.0.
|
|
96
|
-
*/
|
|
97
|
-
get listNumbers(): boolean;
|
|
98
|
-
set listNumbers(value: boolean);
|
|
99
|
-
private _listNumbers;
|
|
100
91
|
/**
|
|
101
92
|
* Enable the gutter column without any built-in content.
|
|
102
93
|
*
|
|
@@ -110,16 +101,6 @@ export declare class RCTextarea extends LitElement {
|
|
|
110
101
|
autoGrow: boolean;
|
|
111
102
|
/** Disable editing. The field renders as a styled read-only display. */
|
|
112
103
|
readOnly: boolean;
|
|
113
|
-
/**
|
|
114
|
-
* Accessible-name override, applied to the editor's `aria-label`.
|
|
115
|
-
*
|
|
116
|
-
* @deprecated Set `aria-label` on the slotted `<textarea>` instead, or
|
|
117
|
-
* associate a `<label>` element via its `for`/`id` pair. This property
|
|
118
|
-
* will be removed before v1.0.
|
|
119
|
-
*/
|
|
120
|
-
get label(): string | null;
|
|
121
|
-
set label(value: string | null);
|
|
122
|
-
private _label;
|
|
123
104
|
/** Declarative plugin hook for framework integrations. */
|
|
124
105
|
get plugin(): RCTextareaPlugin | null;
|
|
125
106
|
/** Declarative plugin hook for framework integrations. */
|
|
@@ -265,7 +246,7 @@ export declare class RCTextarea extends LitElement {
|
|
|
265
246
|
protected _performRender(): Promise<void>;
|
|
266
247
|
/**
|
|
267
248
|
* Compute the label string for each gutter cell based on the current gutter
|
|
268
|
-
* mode (`lineNumbers`, `
|
|
249
|
+
* mode (`lineNumbers`, `gutter`) and any
|
|
269
250
|
* `LineDecoration.gutterContent` overrides in `allDecorations`.
|
|
270
251
|
*
|
|
271
252
|
* Returns one entry per line (same length as `value.split('\n')`):
|
|
@@ -255,10 +255,6 @@ export interface RCTextareaPluginAPI {
|
|
|
255
255
|
* ```
|
|
256
256
|
*/
|
|
257
257
|
parseDecorationsFromHtml(html: string): Omit<MarkDecoration, 'id'>[];
|
|
258
|
-
/**
|
|
259
|
-
* @deprecated Use `parseDecorationsFromHtml` instead.
|
|
260
|
-
*/
|
|
261
|
-
decorationsFromHtml(html: string): Omit<MarkDecoration, 'id'>[];
|
|
262
258
|
/**
|
|
263
259
|
* Convert a flat token array from an external tokenizer (lezer, tree-sitter, shiki, moo, etc.)
|
|
264
260
|
* into `DecorationInput` objects using a theme map keyed by `token.type`.
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.6.0",
|
|
7
7
|
"description": "Textarea wrapper with line decorations, gutter rendering, inline widgets, and plugin hooks.",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"test:browser:firefox": "vitest --run --project=firefox"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@rcarls/rc-common": "0.
|
|
48
|
+
"@rcarls/rc-common": "0.6.0",
|
|
49
49
|
"parchment": "^3.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|