@stackch/angular-richtext-editor 1.1.0 → 1.2.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/index.d.ts CHANGED
@@ -17,6 +17,10 @@ declare class StackchRichtextEditorConfig {
17
17
  showRemoveFormat: boolean;
18
18
  i18n?: Partial<StackchRichtextEditorI18n>;
19
19
  }
20
+ interface StackchRichtextMetrics {
21
+ htmlLength: number;
22
+ textLength: number;
23
+ }
20
24
  declare class StackchRichtextEditorI18n {
21
25
  placeholder: string;
22
26
  undoTitle: string;
@@ -70,6 +74,7 @@ declare class StackchRichtextEditor implements ControlValueAccessor {
70
74
  get disabled(): boolean;
71
75
  private _disabled;
72
76
  valueChange: EventEmitter<string>;
77
+ metricsChange: EventEmitter<StackchRichtextMetrics>;
73
78
  editorRef: ElementRef<HTMLDivElement>;
74
79
  constructor(cdr: ChangeDetectorRef);
75
80
  config?: Partial<StackchRichtextEditorConfig> | null;
@@ -131,6 +136,7 @@ declare class StackchRichtextEditor implements ControlValueAccessor {
131
136
  onKeyup(_evt: KeyboardEvent): void;
132
137
  onPaste(evt: ClipboardEvent): void;
133
138
  private emitValue;
139
+ private emitMetrics;
134
140
  private cleanupEmptyStylesAndSpans;
135
141
  get canUndo(): boolean;
136
142
  get canRedo(): boolean;
@@ -147,22 +153,13 @@ declare class StackchRichtextEditor implements ControlValueAccessor {
147
153
  private focusEditor;
148
154
  private applyInlineStyle;
149
155
  private applyInlineStyleSmart;
150
- private getIntersectingBlocks;
151
- private wrapSelectionInline;
152
- private isBoldCarrier;
153
- private boldAncestorContainingRange;
154
- private ancestorContainingRange;
155
- private splitCarrierAroundSelection;
156
- private deselectBoldBySplitting;
157
- private deselectItalicBySplitting;
158
- private deselectUnderlineBySplitting;
159
- private cleanupEmptyItalicSpans;
160
- private cleanupEmptyUnderlineSpans;
161
- private stripBoldWithin;
162
- private liftOutOfBoldAncestors;
163
- private splitOutOfAncestor;
164
- private cleanupEmptyBoldSpans;
165
- private maybeUnwrapNormalSpan;
156
+ private applySelectionStyles;
157
+ private collectTextSegments;
158
+ private intersectsRange;
159
+ private applyStylesToSegment;
160
+ private toCssProperty;
161
+ private mergeAdjacentStyledSpans;
162
+ private saveSelectionFromRange;
166
163
  private wrapSelectionWith;
167
164
  private insertTextAtSelection;
168
165
  private updateInlineStates;
@@ -172,12 +169,14 @@ declare class StackchRichtextEditor implements ControlValueAccessor {
172
169
  private isNodeBold;
173
170
  private isNodeItalic;
174
171
  private isNodeUnderline;
175
- private isItalicCarrier;
176
- private isUnderlineCarrier;
177
- private computeBoldActiveForRange;
178
- private computeItalicActiveForRange;
179
- private computeUnderlineActiveForRange;
180
172
  private removeInlineStyleInRange;
173
+ private pruneDanglingStyleCarriers;
174
+ private elementHasVisibleContent;
175
+ private isolateRangeFromStyleCarriers;
176
+ private selectionHasStyle;
177
+ private findCarrierContainingRange;
178
+ private isStyleCarrier;
179
+ private splitCarrierAroundSelection;
181
180
  toggleBold(): void;
182
181
  toggleItalic(): void;
183
182
  toggleUnderline(): void;
@@ -191,7 +190,7 @@ declare class StackchRichtextEditor implements ControlValueAccessor {
191
190
  private normalizeSpacingSpans;
192
191
  private setHeading;
193
192
  static ɵfac: i0.ɵɵFactoryDeclaration<StackchRichtextEditor, never>;
194
- static ɵcmp: i0.ɵɵComponentDeclaration<StackchRichtextEditor, "stackch-richtext-editor", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "showToolbar": { "alias": "showToolbar"; "required": false; }; "fonts": { "alias": "fonts"; "required": false; }; "fontSizes": { "alias": "fontSizes"; "required": false; }; "height": { "alias": "height"; "required": false; }; "minHeight": { "alias": "minHeight"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
193
+ static ɵcmp: i0.ɵɵComponentDeclaration<StackchRichtextEditor, "stackch-richtext-editor", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "showToolbar": { "alias": "showToolbar"; "required": false; }; "fonts": { "alias": "fonts"; "required": false; }; "fontSizes": { "alias": "fontSizes"; "required": false; }; "height": { "alias": "height"; "required": false; }; "minHeight": { "alias": "minHeight"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "valueChange": "valueChange"; "metricsChange": "metricsChange"; }, never, never, true, never>;
195
194
  }
196
195
 
197
196
  declare class StackchRichtextEditorToolbar {
@@ -246,3 +245,4 @@ declare class StackchRichtextEditorToolbar {
246
245
  }
247
246
 
248
247
  export { STACKCH_RTE_I18N_DE, STACKCH_RTE_I18N_FR, STACKCH_RTE_I18N_IT, StackchRichtextEditor, StackchRichtextEditorConfig, StackchRichtextEditorI18n, StackchRichtextEditorToolbar };
248
+ export type { StackchRichtextMetrics };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackch/angular-richtext-editor",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Lightweight Angular rich text editor (standalone) with a reusable toolbar: fonts, sizes, colors, lists, alignment, links.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^20.3.4",