slate-angular 13.0.4 → 13.0.7
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/esm2020/components/editable/editable.component.mjs +6 -4
- package/esm2020/view/base.mjs +4 -1
- package/fesm2015/slate-angular.mjs +8 -3
- package/fesm2015/slate-angular.mjs.map +1 -1
- package/fesm2020/slate-angular.mjs +8 -3
- package/fesm2020/slate-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/view/base.d.ts +1 -0
|
@@ -1866,6 +1866,9 @@ class BaseElementComponent extends BaseComponent {
|
|
|
1866
1866
|
get isCollapsed() {
|
|
1867
1867
|
return this.selection && Range.isCollapsed(this.editor.selection);
|
|
1868
1868
|
}
|
|
1869
|
+
get isCollapsedAndNonReadonly() {
|
|
1870
|
+
return this.selection && Range.isCollapsed(this.editor.selection) && !this.readonly;
|
|
1871
|
+
}
|
|
1869
1872
|
get readonly() {
|
|
1870
1873
|
return this._context && this._context.readonly;
|
|
1871
1874
|
}
|
|
@@ -2833,7 +2836,7 @@ class SlateEditableComponent {
|
|
|
2833
2836
|
}));
|
|
2834
2837
|
}
|
|
2835
2838
|
toSlateSelection() {
|
|
2836
|
-
if (!this.isComposing && !this.isUpdatingSelection && !this.isDraggingInternally) {
|
|
2839
|
+
if (!this.readonly && !this.isComposing && !this.isUpdatingSelection && !this.isDraggingInternally) {
|
|
2837
2840
|
try {
|
|
2838
2841
|
const root = AngularEditor.findDocumentOrShadowRoot(this.editor);
|
|
2839
2842
|
const { activeElement } = root;
|
|
@@ -2873,7 +2876,9 @@ class SlateEditableComponent {
|
|
|
2873
2876
|
}
|
|
2874
2877
|
onDOMBeforeInput(event) {
|
|
2875
2878
|
const editor = this.editor;
|
|
2876
|
-
|
|
2879
|
+
const root = AngularEditor.findDocumentOrShadowRoot(this.editor);
|
|
2880
|
+
const { activeElement } = root;
|
|
2881
|
+
if (!this.readonly && hasEditableTarget(editor, event.target) && !isTargetInsideVoid(editor, activeElement) && !this.isDOMEventHandled(event, this.beforeInput)) {
|
|
2877
2882
|
try {
|
|
2878
2883
|
const { selection } = editor;
|
|
2879
2884
|
const { inputType: type } = event;
|
|
@@ -3064,7 +3069,7 @@ class SlateEditableComponent {
|
|
|
3064
3069
|
onDOMCopy(event) {
|
|
3065
3070
|
const window = AngularEditor.getWindow(this.editor);
|
|
3066
3071
|
const isOutsideSlate = !hasStringTarget(window.getSelection()) && isTargetInsideVoid(this.editor, event.target);
|
|
3067
|
-
if (!isOutsideSlate && hasTarget(this.editor, event.target) && !this.isDOMEventHandled(event, this.copy)) {
|
|
3072
|
+
if (!isOutsideSlate && hasTarget(this.editor, event.target) && !this.readonly && !this.isDOMEventHandled(event, this.copy)) {
|
|
3068
3073
|
event.preventDefault();
|
|
3069
3074
|
AngularEditor.setFragmentData(this.editor, event.clipboardData, 'copy');
|
|
3070
3075
|
}
|