slate-angular 20.2.23 → 21.0.0-next.1
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/fesm2022/slate-angular.mjs +19 -38
- package/fesm2022/slate-angular.mjs.map +1 -1
- package/index.d.ts +49 -58
- package/package.json +1 -1
|
@@ -2,11 +2,11 @@ import { Editor, Range, Element, Transforms, Text as Text$1, Node, Path } from '
|
|
|
2
2
|
import { EDITOR_TO_ELEMENT, NODE_TO_ELEMENT, DOMEditor, normalizeDOMPoint, isDOMSelection, IS_CHROME as IS_CHROME$1, hasShadowRoot, isDOMElement, NODE_TO_PARENT, NODE_TO_INDEX, isDOMNode, IS_FOCUSED, withDOM, NODE_TO_KEY, ELEMENT_TO_NODE, getDefaultView, EDITOR_TO_WINDOW, IS_READ_ONLY, EDITOR_TO_ON_CHANGE, TRIPLE_CLICK, isPlainTextOnlyPaste } from 'slate-dom';
|
|
3
3
|
import { isKeyHotkey } from 'is-hotkey';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { TemplateRef, ComponentRef, IterableDiffers, inject, ViewContainerRef, forwardRef, HostBinding, Input, ChangeDetectionStrategy, Component, NgModule,
|
|
5
|
+
import { TemplateRef, ComponentRef, IterableDiffers, inject, ViewContainerRef, ElementRef, Renderer2, ChangeDetectorRef, NgZone, Injector, forwardRef, HostBinding, Input, ChangeDetectionStrategy, Component, NgModule, Directive, ViewChild } from '@angular/core';
|
|
6
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
7
|
import { direction } from 'direction';
|
|
7
|
-
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
8
8
|
import { Subject, tap, debounceTime, filter } from 'rxjs';
|
|
9
|
-
import
|
|
9
|
+
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
10
10
|
import { HistoryEditor } from 'slate-history';
|
|
11
11
|
import { CommonModule } from '@angular/common';
|
|
12
12
|
|
|
@@ -3386,12 +3386,7 @@ class SlateEditable {
|
|
|
3386
3386
|
get hasBeforeInputSupport() {
|
|
3387
3387
|
return HAS_BEFORE_INPUT_SUPPORT;
|
|
3388
3388
|
}
|
|
3389
|
-
constructor(
|
|
3390
|
-
this.elementRef = elementRef;
|
|
3391
|
-
this.renderer2 = renderer2;
|
|
3392
|
-
this.cdr = cdr;
|
|
3393
|
-
this.ngZone = ngZone;
|
|
3394
|
-
this.injector = injector;
|
|
3389
|
+
constructor() {
|
|
3395
3390
|
this.destroy$ = new Subject();
|
|
3396
3391
|
this.isComposing = false;
|
|
3397
3392
|
this.isDraggingInternally = false;
|
|
@@ -3436,6 +3431,11 @@ class SlateEditable {
|
|
|
3436
3431
|
this.keyHeightMap = new Map();
|
|
3437
3432
|
this.indicsOfNeedRemeasured$ = new Subject();
|
|
3438
3433
|
this.virtualScrollInitialized = false;
|
|
3434
|
+
this.elementRef = inject(ElementRef);
|
|
3435
|
+
this.renderer2 = inject(Renderer2);
|
|
3436
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
3437
|
+
this.ngZone = inject(NgZone);
|
|
3438
|
+
this.injector = inject(Injector);
|
|
3439
3439
|
}
|
|
3440
3440
|
ngOnInit() {
|
|
3441
3441
|
this.editor.injector = this.injector;
|
|
@@ -5004,7 +5004,7 @@ class SlateEditable {
|
|
|
5004
5004
|
this.destroy$.complete();
|
|
5005
5005
|
EDITOR_TO_ON_CHANGE.delete(this.editor);
|
|
5006
5006
|
}
|
|
5007
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SlateEditable, deps: [
|
|
5007
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SlateEditable, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5008
5008
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.12", type: SlateEditable, isStandalone: true, selector: "slate-editable", inputs: { editor: "editor", renderElement: "renderElement", renderLeaf: "renderLeaf", renderText: "renderText", decorate: "decorate", placeholderDecorate: "placeholderDecorate", scrollSelectionIntoView: "scrollSelectionIntoView", isStrictDecorate: "isStrictDecorate", trackBy: "trackBy", readonly: "readonly", placeholder: "placeholder", virtualScroll: "virtualScroll", beforeInput: "beforeInput", blur: "blur", click: "click", compositionEnd: "compositionEnd", compositionUpdate: "compositionUpdate", compositionStart: "compositionStart", copy: "copy", cut: "cut", dragOver: "dragOver", dragStart: "dragStart", dragEnd: "dragEnd", drop: "drop", focus: "focus", keydown: "keydown", paste: "paste", spellCheck: "spellCheck", autoCorrect: "autoCorrect", autoCapitalize: "autoCapitalize" }, host: { properties: { "attr.contenteditable": "readonly ? undefined : true", "attr.role": "readonly ? undefined : 'textbox'", "attr.spellCheck": "!hasBeforeInputSupport ? false : spellCheck", "attr.autoCorrect": "!hasBeforeInputSupport ? 'false' : autoCorrect", "attr.autoCapitalize": "!hasBeforeInputSupport ? 'false' : autoCapitalize", "attr.data-slate-editor": "this.dataSlateEditor", "attr.data-slate-node": "this.dataSlateNode", "attr.data-gramm": "this.dataGramm" }, classAttribute: "slate-editable-container" }, providers: [
|
|
5009
5009
|
{
|
|
5010
5010
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -5036,7 +5036,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
5036
5036
|
],
|
|
5037
5037
|
imports: []
|
|
5038
5038
|
}]
|
|
5039
|
-
}], ctorParameters: () => [
|
|
5039
|
+
}], ctorParameters: () => [], propDecorators: { editor: [{
|
|
5040
5040
|
type: Input
|
|
5041
5041
|
}], renderElement: [{
|
|
5042
5042
|
type: Input
|
|
@@ -5174,13 +5174,13 @@ const preventInsertFromComposition = (event, editor) => {
|
|
|
5174
5174
|
};
|
|
5175
5175
|
|
|
5176
5176
|
class SlateChildrenOutlet {
|
|
5177
|
-
constructor(
|
|
5178
|
-
this.elementRef =
|
|
5177
|
+
constructor() {
|
|
5178
|
+
this.elementRef = inject((ElementRef));
|
|
5179
5179
|
}
|
|
5180
5180
|
getNativeElement() {
|
|
5181
5181
|
return this.elementRef.nativeElement;
|
|
5182
5182
|
}
|
|
5183
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SlateChildrenOutlet, deps: [
|
|
5183
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SlateChildrenOutlet, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5184
5184
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.12", type: SlateChildrenOutlet, isStandalone: true, selector: "slate-children-outlet", ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5185
5185
|
}
|
|
5186
5186
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SlateChildrenOutlet, decorators: [{
|
|
@@ -5191,37 +5191,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
5191
5191
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5192
5192
|
standalone: true
|
|
5193
5193
|
}]
|
|
5194
|
-
}]
|
|
5195
|
-
|
|
5196
|
-
class SlateString {
|
|
5197
|
-
ngOnInit() { }
|
|
5198
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SlateString, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5199
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.12", type: SlateString, isStandalone: true, selector: "span[slateString]", inputs: { context: "context", viewContext: "viewContext" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5200
|
-
}
|
|
5201
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SlateString, decorators: [{
|
|
5202
|
-
type: Component,
|
|
5203
|
-
args: [{
|
|
5204
|
-
selector: 'span[slateString]',
|
|
5205
|
-
template: '',
|
|
5206
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5207
|
-
standalone: true
|
|
5208
|
-
}]
|
|
5209
|
-
}], propDecorators: { context: [{
|
|
5210
|
-
type: Input
|
|
5211
|
-
}], viewContext: [{
|
|
5212
|
-
type: Input
|
|
5213
|
-
}] } });
|
|
5194
|
+
}] });
|
|
5214
5195
|
|
|
5215
5196
|
class SlateModule {
|
|
5216
5197
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SlateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
5217
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: SlateModule, imports: [CommonModule, SlateEditable, SlateChildrenOutlet
|
|
5198
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: SlateModule, imports: [CommonModule, SlateEditable, SlateChildrenOutlet], exports: [SlateEditable, SlateChildrenOutlet] }); }
|
|
5218
5199
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SlateModule, imports: [CommonModule] }); }
|
|
5219
5200
|
}
|
|
5220
5201
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SlateModule, decorators: [{
|
|
5221
5202
|
type: NgModule,
|
|
5222
5203
|
args: [{
|
|
5223
|
-
imports: [CommonModule, SlateEditable, SlateChildrenOutlet
|
|
5224
|
-
exports: [SlateEditable, SlateChildrenOutlet
|
|
5204
|
+
imports: [CommonModule, SlateEditable, SlateChildrenOutlet],
|
|
5205
|
+
exports: [SlateEditable, SlateChildrenOutlet],
|
|
5225
5206
|
providers: []
|
|
5226
5207
|
}]
|
|
5227
5208
|
}] });
|
|
@@ -5530,5 +5511,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
5530
5511
|
* Generated bundle index. Do not edit.
|
|
5531
5512
|
*/
|
|
5532
5513
|
|
|
5533
|
-
export { AngularEditor, BaseComponent, BaseElementComponent, BaseElementFlavour, BaseFlavour, BaseLeafComponent, BaseLeafFlavour, BaseTextComponent, BaseTextFlavour, BlockCardRef, DEFAULT_ELEMENT_HEIGHT, DefaultTextFlavour, EDITOR_TO_AFTER_VIEW_INIT_QUEUE, EDITOR_TO_BUSINESS_TOP, EDITOR_TO_IS_FROM_SCROLL_TO, EDITOR_TO_ROOT_NODE_WIDTH, EDITOR_TO_VIEWPORT_HEIGHT, EDITOR_TO_VIRTUAL_SCROLL_CONFIG, EDITOR_TO_VIRTUAL_SCROLL_SELECTION, ELEMENT_KEY_TO_HEIGHTS, ELEMENT_TO_COMPONENT, FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, FlavourRef, HAS_BEFORE_INPUT_SUPPORT, IS_ANDROID, IS_APPLE, IS_CHROME, IS_CHROME_LEGACY, IS_EDGE_LEGACY, IS_FIREFOX, IS_FIREFOX_LEGACY, IS_IOS, IS_QQBROWSER, IS_SAFARI, IS_UC_MOBILE, IS_WECHATBROWSER, PLACEHOLDER_SYMBOL, SLATE_BLOCK_CARD_CLASS_NAME, SLATE_DEBUG_KEY, SLATE_DEBUG_KEY_SCROLL_TOP, SLATE_DEBUG_KEY_UPDATE, SlateBlockCard, SlateChildrenOutlet, SlateEditable, SlateErrorCode, SlateFragmentAttributeKey, SlateModule,
|
|
5514
|
+
export { AngularEditor, BaseComponent, BaseElementComponent, BaseElementFlavour, BaseFlavour, BaseLeafComponent, BaseLeafFlavour, BaseTextComponent, BaseTextFlavour, BlockCardRef, DEFAULT_ELEMENT_HEIGHT, DefaultTextFlavour, EDITOR_TO_AFTER_VIEW_INIT_QUEUE, EDITOR_TO_BUSINESS_TOP, EDITOR_TO_IS_FROM_SCROLL_TO, EDITOR_TO_ROOT_NODE_WIDTH, EDITOR_TO_VIEWPORT_HEIGHT, EDITOR_TO_VIRTUAL_SCROLL_CONFIG, EDITOR_TO_VIRTUAL_SCROLL_SELECTION, ELEMENT_KEY_TO_HEIGHTS, ELEMENT_TO_COMPONENT, FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, FlavourRef, HAS_BEFORE_INPUT_SUPPORT, IS_ANDROID, IS_APPLE, IS_CHROME, IS_CHROME_LEGACY, IS_EDGE_LEGACY, IS_FIREFOX, IS_FIREFOX_LEGACY, IS_IOS, IS_QQBROWSER, IS_SAFARI, IS_UC_MOBILE, IS_WECHATBROWSER, PLACEHOLDER_SYMBOL, SLATE_BLOCK_CARD_CLASS_NAME, SLATE_DEBUG_KEY, SLATE_DEBUG_KEY_SCROLL_TOP, SLATE_DEBUG_KEY_UPDATE, SlateBlockCard, SlateChildrenOutlet, SlateEditable, SlateErrorCode, SlateFragmentAttributeKey, SlateModule, VIRTUAL_BOTTOM_HEIGHT_CLASS_NAME, VIRTUAL_CENTER_OUTLET_CLASS_NAME, VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT, VIRTUAL_TOP_HEIGHT_CLASS_NAME, VoidTextFlavour, blobAsString, buildHTMLText, buildHeightsAndAccumulatedHeights, cacheHeightByElement, calcBusinessTop, calcHeightByElement, calculateAccumulatedTopHeight, check, clearMinHeightByElement, completeTable, createClipboardData, createText, createThrottleRAF, debugLog, defaultScrollSelectionIntoView, fallbackCopyText, getBlockCardByNativeElement, getBusinessTop, getCachedHeightByElement, getCardTargetAttribute, getClipboardData, getClipboardFromHTMLText, getContentHeight, getDataTransferClipboard, getDataTransferClipboardText, getNavigatorClipboard, getPlainText, getScrollContainer, getSelection, getSlateFragmentAttribute, getViewportHeight, getZeroTextNode, hasAfterContextChange, hasBeforeContextChange, hasBlockCard, hasBlockCardWithNode, hotkeys, isCardCenterByTargetAttr, isCardLeft, isCardLeftByTargetAttr, isCardRightByTargetAttr, isClipboardFile, isClipboardReadSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isComponentType, isDOMText, isDebug, isDebugScrollTop, isDebugUpdate, isDecoratorRangeListEqual, isFlavourType, isInvalidTable, isSelectionInsideVoid, isTemplateRef, isValid, isValidNumber, measureHeightByIndics, normalize, roundTo, scrollToElement, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setMinHeightByElement, setNavigatorClipboard, shallowCompare, stripHtml, withAngular };
|
|
5534
5515
|
//# sourceMappingURL=slate-angular.mjs.map
|