slate-angular 1.6.4 → 1.7.3
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/bundles/slate-angular.umd.js +145 -138
- package/bundles/slate-angular.umd.js.map +1 -1
- package/components/editable/editable.component.d.ts +7 -2
- package/components/leaf/default-leaf.component.d.ts +4 -1
- package/esm2015/components/editable/editable.component.js +68 -11
- package/esm2015/components/leaf/default-leaf.component.js +9 -1
- package/esm2015/plugins/with-angular.js +2 -98
- package/esm2015/types/feature.js +2 -0
- package/esm2015/types/index.js +2 -1
- package/esm2015/view/base.js +34 -2
- package/esm2015/view/container.js +39 -33
- package/fesm2015/slate-angular.js +145 -138
- package/fesm2015/slate-angular.js.map +1 -1
- package/package.json +7 -7
- package/styles/index.scss +18 -3
- package/types/feature.d.ts +4 -0
- package/types/index.d.ts +1 -0
- package/view/base.d.ts +3 -0
- package/view/container.d.ts +2 -1
|
@@ -1587,102 +1587,6 @@
|
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
1589
|
};
|
|
1590
|
-
// override slate layer logic
|
|
1591
|
-
e.normalizeNode = function (entry) {
|
|
1592
|
-
var _a = __read(entry, 2), node = _a[0], path = _a[1];
|
|
1593
|
-
// There are no core normalizations for text nodes.
|
|
1594
|
-
if (slate.Text.isText(node)) {
|
|
1595
|
-
return;
|
|
1596
|
-
}
|
|
1597
|
-
// Ensure that block and inline nodes have at least one text child.
|
|
1598
|
-
if (slate.Element.isElement(node) && node.children.length === 0) {
|
|
1599
|
-
var child = { text: '' };
|
|
1600
|
-
slate.Transforms.insertNodes(editor, child, {
|
|
1601
|
-
at: path.concat(0),
|
|
1602
|
-
voids: true,
|
|
1603
|
-
});
|
|
1604
|
-
return;
|
|
1605
|
-
}
|
|
1606
|
-
// Determine whether the node should have block or inline children.
|
|
1607
|
-
var shouldHaveInlines = slate.Editor.isEditor(node)
|
|
1608
|
-
? false
|
|
1609
|
-
: slate.Element.isElement(node) &&
|
|
1610
|
-
(editor.isInline(node) ||
|
|
1611
|
-
node.children.length === 0 ||
|
|
1612
|
-
slate.Text.isText(node.children[0]) ||
|
|
1613
|
-
editor.isInline(node.children[0]));
|
|
1614
|
-
// Since we'll be applying operations while iterating, keep track of an
|
|
1615
|
-
// index that accounts for any added/removed nodes.
|
|
1616
|
-
var n = 0;
|
|
1617
|
-
for (var i = 0; i < node.children.length; i++, n++) {
|
|
1618
|
-
var child = node.children[i];
|
|
1619
|
-
var prev = node.children[i - 1];
|
|
1620
|
-
var isLast = i === node.children.length - 1;
|
|
1621
|
-
var isInlineOrText = slate.Text.isText(child) ||
|
|
1622
|
-
(slate.Element.isElement(child) && editor.isInline(child));
|
|
1623
|
-
// Only allow block nodes in the top-level children and parent blocks
|
|
1624
|
-
// that only contain block nodes. Similarly, only allow inline nodes in
|
|
1625
|
-
// other inline nodes, or parent blocks that only contain inlines and
|
|
1626
|
-
// text.
|
|
1627
|
-
if (isInlineOrText !== shouldHaveInlines) {
|
|
1628
|
-
slate.Transforms.removeNodes(editor, { at: path.concat(n), voids: true });
|
|
1629
|
-
n--;
|
|
1630
|
-
}
|
|
1631
|
-
else if (slate.Element.isElement(child)) {
|
|
1632
|
-
// Ensure that inline nodes are surrounded by text nodes.
|
|
1633
|
-
if (editor.isInline(child)) {
|
|
1634
|
-
if (prev == null || !slate.Text.isText(prev)) {
|
|
1635
|
-
var newChild = { text: '' };
|
|
1636
|
-
slate.Transforms.insertNodes(editor, newChild, {
|
|
1637
|
-
at: path.concat(n),
|
|
1638
|
-
voids: true,
|
|
1639
|
-
});
|
|
1640
|
-
n++;
|
|
1641
|
-
}
|
|
1642
|
-
else if (isLast) {
|
|
1643
|
-
var newChild = { text: '' };
|
|
1644
|
-
slate.Transforms.insertNodes(editor, newChild, {
|
|
1645
|
-
at: path.concat(n + 1),
|
|
1646
|
-
voids: true,
|
|
1647
|
-
});
|
|
1648
|
-
n++;
|
|
1649
|
-
}
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
else {
|
|
1653
|
-
// Merge adjacent text nodes that are empty or match.
|
|
1654
|
-
if (prev != null && slate.Text.isText(prev)) {
|
|
1655
|
-
// adjust logic: first remove empty text to avoid merge empty text #WIK-3805
|
|
1656
|
-
if (prev.text === '') {
|
|
1657
|
-
// adjust logic: adjust cursor location when empty text is first child of node #WIK-3631
|
|
1658
|
-
// ensure current selection in the text #WIK-3762
|
|
1659
|
-
var prevFocused = editor.selection &&
|
|
1660
|
-
slate.Range.isCollapsed(editor.selection) &&
|
|
1661
|
-
slate.Path.equals(editor.selection.anchor.path, path.concat(n - 1));
|
|
1662
|
-
if (prev === node.children[0] && prevFocused) {
|
|
1663
|
-
slate.Transforms.select(editor, slate.Editor.start(editor, path.concat(n)));
|
|
1664
|
-
}
|
|
1665
|
-
slate.Transforms.removeNodes(editor, {
|
|
1666
|
-
at: path.concat(n - 1),
|
|
1667
|
-
voids: true,
|
|
1668
|
-
});
|
|
1669
|
-
n--;
|
|
1670
|
-
}
|
|
1671
|
-
else if (slate.Text.equals(child, prev, { loose: true })) {
|
|
1672
|
-
slate.Transforms.mergeNodes(editor, { at: path.concat(n), voids: true });
|
|
1673
|
-
n--;
|
|
1674
|
-
}
|
|
1675
|
-
else if (isLast && child.text === '') {
|
|
1676
|
-
slate.Transforms.removeNodes(editor, {
|
|
1677
|
-
at: path.concat(n),
|
|
1678
|
-
voids: true,
|
|
1679
|
-
});
|
|
1680
|
-
n--;
|
|
1681
|
-
}
|
|
1682
|
-
}
|
|
1683
|
-
}
|
|
1684
|
-
}
|
|
1685
|
-
};
|
|
1686
1590
|
e.onKeydown = function () { };
|
|
1687
1591
|
e.onClick = function () { };
|
|
1688
1592
|
e.isBlockCard = function (element) { return false; };
|
|
@@ -2273,6 +2177,38 @@
|
|
|
2273
2177
|
}
|
|
2274
2178
|
this.cdr.markForCheck();
|
|
2275
2179
|
};
|
|
2180
|
+
BaseLeafComponent.prototype.renderPlaceholder = function () {
|
|
2181
|
+
var _a, _b, _c;
|
|
2182
|
+
// issue-1: IME input was interrupted
|
|
2183
|
+
// issue-2: IME input focus jumping
|
|
2184
|
+
// Issue occurs when the placeholder node is removed (in leaf span)
|
|
2185
|
+
// So add a placeholder span to the block element root node
|
|
2186
|
+
if (this.context.leaf['placeholder']) {
|
|
2187
|
+
if (!this.placeholderElement) {
|
|
2188
|
+
this.placeholderElement = document.createElement('span');
|
|
2189
|
+
this.placeholderElement.innerText = this.context.leaf['placeholder'];
|
|
2190
|
+
this.placeholderElement.contentEditable = 'false';
|
|
2191
|
+
this.placeholderElement.setAttribute('data-slate-placeholder', 'true');
|
|
2192
|
+
(_a = this.nativeElement.closest('[data-slate-node="element"]')) === null || _a === void 0 ? void 0 : _a.classList.add('element-placeholder');
|
|
2193
|
+
(_b = this.nativeElement.closest('[data-slate-node="element"]')) === null || _b === void 0 ? void 0 : _b.appendChild(this.placeholderElement);
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
else {
|
|
2197
|
+
if (this.placeholderElement) {
|
|
2198
|
+
this.placeholderElement.remove();
|
|
2199
|
+
this.placeholderElement = null;
|
|
2200
|
+
(_c = this.nativeElement.closest('[data-slate-node="element"]')) === null || _c === void 0 ? void 0 : _c.classList.remove('element-placeholder');
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
};
|
|
2204
|
+
BaseLeafComponent.prototype.destroyPlaceholder = function () {
|
|
2205
|
+
var _a, _b;
|
|
2206
|
+
if (this.placeholderElement) {
|
|
2207
|
+
this.placeholderElement.remove();
|
|
2208
|
+
this.placeholderElement = null;
|
|
2209
|
+
(_b = (_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.closest('[data-slate-node="element"]')) === null || _b === void 0 ? void 0 : _b.classList.remove('element-placeholder');
|
|
2210
|
+
}
|
|
2211
|
+
};
|
|
2276
2212
|
return BaseLeafComponent;
|
|
2277
2213
|
}(BaseComponent));
|
|
2278
2214
|
BaseLeafComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: BaseLeafComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
@@ -2391,7 +2327,7 @@
|
|
|
2391
2327
|
}
|
|
2392
2328
|
Object.defineProperty(BaseTextComponent.prototype, "text", {
|
|
2393
2329
|
get: function () {
|
|
2394
|
-
return this._context.text;
|
|
2330
|
+
return this._context && this._context.text;
|
|
2395
2331
|
},
|
|
2396
2332
|
enumerable: false,
|
|
2397
2333
|
configurable: true
|
|
@@ -2442,7 +2378,6 @@
|
|
|
2442
2378
|
// first diff
|
|
2443
2379
|
differ.diff(this.childrenComponent);
|
|
2444
2380
|
var parentElement = this.elementRef.nativeElement.parentElement;
|
|
2445
|
-
var firstChildComponent = this.childrenComponent.first;
|
|
2446
2381
|
if (this.childrenComponent.length > 0) {
|
|
2447
2382
|
parentElement.insertBefore(this.createFragment(), this.elementRef.nativeElement);
|
|
2448
2383
|
this.elementRef.nativeElement.remove();
|
|
@@ -2450,41 +2385,15 @@
|
|
|
2450
2385
|
this.childrenComponent.changes.subscribe(function (value) {
|
|
2451
2386
|
var iterableChanges = differ.diff(_this.childrenComponent);
|
|
2452
2387
|
if (iterableChanges) {
|
|
2453
|
-
iterableChanges.
|
|
2454
|
-
//
|
|
2455
|
-
if (
|
|
2456
|
-
var fragment = document.createDocumentFragment();
|
|
2457
|
-
fragment.append.apply(fragment, __spreadArray([], __read(record.item.rootNodes)));
|
|
2458
|
-
parentElement.insertBefore(fragment, _this.elementRef.nativeElement);
|
|
2459
|
-
_this.elementRef.nativeElement.remove();
|
|
2388
|
+
iterableChanges.forEachOperation(function (record, previousIndex, currentIndex) {
|
|
2389
|
+
// removed
|
|
2390
|
+
if (currentIndex === null) {
|
|
2460
2391
|
return;
|
|
2461
2392
|
}
|
|
2462
|
-
//
|
|
2463
|
-
|
|
2464
|
-
var fragment = document.createDocumentFragment();
|
|
2465
|
-
fragment.append.apply(fragment, __spreadArray([], __read(record.item.rootNodes)));
|
|
2466
|
-
parentElement.prepend(fragment);
|
|
2467
|
-
}
|
|
2468
|
-
else {
|
|
2469
|
-
// insert afterend of previous component end
|
|
2470
|
-
var previousRootNode_1 = _this.getPreviousRootNode(record.currentIndex);
|
|
2471
|
-
if (previousRootNode_1) {
|
|
2472
|
-
record.item.rootNodes.forEach(function (rootNode) {
|
|
2473
|
-
previousRootNode_1.insertAdjacentElement('afterend', rootNode);
|
|
2474
|
-
previousRootNode_1 = rootNode;
|
|
2475
|
-
});
|
|
2476
|
-
}
|
|
2477
|
-
else {
|
|
2478
|
-
_this.viewContext.editor.onError({
|
|
2479
|
-
code: exports.SlateErrorCode.NotFoundPreviousRootNodeError,
|
|
2480
|
-
name: 'not found previous rootNode',
|
|
2481
|
-
nativeError: null
|
|
2482
|
-
});
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2393
|
+
// added or moved
|
|
2394
|
+
_this.handleContainerItemChange(record, parentElement);
|
|
2485
2395
|
});
|
|
2486
2396
|
}
|
|
2487
|
-
firstChildComponent = _this.childrenComponent.first;
|
|
2488
2397
|
});
|
|
2489
2398
|
};
|
|
2490
2399
|
ViewContainer.prototype.getPreviousRootNode = function (currentIndex) {
|
|
@@ -2507,6 +2416,39 @@
|
|
|
2507
2416
|
});
|
|
2508
2417
|
return fragment;
|
|
2509
2418
|
};
|
|
2419
|
+
ViewContainer.prototype.handleContainerItemChange = function (record, parentElement) {
|
|
2420
|
+
// first insert
|
|
2421
|
+
if (this.elementRef.nativeElement.parentElement && this.elementRef.nativeElement.parentElement === parentElement) {
|
|
2422
|
+
var fragment = document.createDocumentFragment();
|
|
2423
|
+
fragment.append.apply(fragment, __spreadArray([], __read(record.item.rootNodes)));
|
|
2424
|
+
parentElement.insertBefore(fragment, this.elementRef.nativeElement);
|
|
2425
|
+
this.elementRef.nativeElement.remove();
|
|
2426
|
+
return;
|
|
2427
|
+
}
|
|
2428
|
+
// insert at start location
|
|
2429
|
+
if (record.currentIndex === 0) {
|
|
2430
|
+
var fragment = document.createDocumentFragment();
|
|
2431
|
+
fragment.append.apply(fragment, __spreadArray([], __read(record.item.rootNodes)));
|
|
2432
|
+
parentElement.prepend(fragment);
|
|
2433
|
+
}
|
|
2434
|
+
else {
|
|
2435
|
+
// insert afterend of previous component end
|
|
2436
|
+
var previousRootNode_1 = this.getPreviousRootNode(record.currentIndex);
|
|
2437
|
+
if (previousRootNode_1) {
|
|
2438
|
+
record.item.rootNodes.forEach(function (rootNode) {
|
|
2439
|
+
previousRootNode_1.insertAdjacentElement('afterend', rootNode);
|
|
2440
|
+
previousRootNode_1 = rootNode;
|
|
2441
|
+
});
|
|
2442
|
+
}
|
|
2443
|
+
else {
|
|
2444
|
+
this.viewContext.editor.onError({
|
|
2445
|
+
code: exports.SlateErrorCode.NotFoundPreviousRootNodeError,
|
|
2446
|
+
name: 'not found previous rootNode',
|
|
2447
|
+
nativeError: null
|
|
2448
|
+
});
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
};
|
|
2510
2452
|
return ViewContainer;
|
|
2511
2453
|
}());
|
|
2512
2454
|
ViewContainer.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ViewContainer, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.IterableDiffers }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
@@ -2593,6 +2535,14 @@
|
|
|
2593
2535
|
function SlateDefaultLeafComponent() {
|
|
2594
2536
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
2595
2537
|
}
|
|
2538
|
+
SlateDefaultLeafComponent.prototype.onContextChange = function () {
|
|
2539
|
+
_super.prototype.onContextChange.call(this);
|
|
2540
|
+
this.renderPlaceholder();
|
|
2541
|
+
};
|
|
2542
|
+
SlateDefaultLeafComponent.prototype.ngOnDestroy = function () {
|
|
2543
|
+
// Because the placeholder span is not in the current component, it is destroyed along with the current component
|
|
2544
|
+
this.destroyPlaceholder();
|
|
2545
|
+
};
|
|
2596
2546
|
return SlateDefaultLeafComponent;
|
|
2597
2547
|
}(BaseLeafComponent));
|
|
2598
2548
|
SlateDefaultLeafComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: SlateDefaultLeafComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
@@ -3118,6 +3068,7 @@
|
|
|
3118
3068
|
});
|
|
3119
3069
|
this.editor.children = normalize(value);
|
|
3120
3070
|
}
|
|
3071
|
+
this.initializeContext();
|
|
3121
3072
|
this.cdr.markForCheck();
|
|
3122
3073
|
}
|
|
3123
3074
|
};
|
|
@@ -3236,7 +3187,7 @@
|
|
|
3236
3187
|
// need exec after this.cdr.detectChanges() to render HTML
|
|
3237
3188
|
// need exec before this.toNativeSelection() to correct native selection
|
|
3238
3189
|
if (this.isComposing) {
|
|
3239
|
-
//
|
|
3190
|
+
// Composition input text be not rendered when user composition input with selection is expanded
|
|
3240
3191
|
// At this time, the following matching conditions are met, assign isComposing to false, and the status is wrong
|
|
3241
3192
|
// this time condition is true and isComposiing is assigned false
|
|
3242
3193
|
// Therefore, need to wait for the composition input text to be rendered before performing condition matching
|
|
@@ -3269,7 +3220,7 @@
|
|
|
3269
3220
|
this.context = {
|
|
3270
3221
|
parent: this.editor,
|
|
3271
3222
|
selection: this.editor.selection,
|
|
3272
|
-
decorations: this.
|
|
3223
|
+
decorations: this.generateDecorations(),
|
|
3273
3224
|
decorate: this.decorate,
|
|
3274
3225
|
readonly: this.readonly
|
|
3275
3226
|
};
|
|
@@ -3286,20 +3237,49 @@
|
|
|
3286
3237
|
};
|
|
3287
3238
|
};
|
|
3288
3239
|
SlateEditableComponent.prototype.detectContext = function () {
|
|
3240
|
+
var decorations = this.generateDecorations();
|
|
3289
3241
|
if (this.context.selection !== this.editor.selection ||
|
|
3290
3242
|
this.context.decorate !== this.decorate ||
|
|
3291
|
-
this.context.readonly !== this.readonly
|
|
3292
|
-
|
|
3293
|
-
var isSameDecorations = isDecoratorRangeListEqual(this.context.decorations, decorations);
|
|
3243
|
+
this.context.readonly !== this.readonly ||
|
|
3244
|
+
!isDecoratorRangeListEqual(this.context.decorations, decorations)) {
|
|
3294
3245
|
this.context = {
|
|
3295
3246
|
parent: this.editor,
|
|
3296
3247
|
selection: this.editor.selection,
|
|
3297
|
-
decorations:
|
|
3248
|
+
decorations: decorations,
|
|
3298
3249
|
decorate: this.decorate,
|
|
3299
3250
|
readonly: this.readonly
|
|
3300
3251
|
};
|
|
3301
3252
|
}
|
|
3302
3253
|
};
|
|
3254
|
+
SlateEditableComponent.prototype.composePlaceholderDecorate = function (editor) {
|
|
3255
|
+
if (this.placeholderDecorate) {
|
|
3256
|
+
return this.placeholderDecorate(editor) || [];
|
|
3257
|
+
}
|
|
3258
|
+
if (this.placeholder &&
|
|
3259
|
+
editor.children.length === 1 &&
|
|
3260
|
+
Array.from(slate.Node.texts(editor)).length === 1 &&
|
|
3261
|
+
slate.Node.string(editor) === '') {
|
|
3262
|
+
var start = slate.Editor.start(editor, []);
|
|
3263
|
+
return [
|
|
3264
|
+
{
|
|
3265
|
+
placeholder: this.placeholder,
|
|
3266
|
+
anchor: start,
|
|
3267
|
+
focus: start,
|
|
3268
|
+
},
|
|
3269
|
+
];
|
|
3270
|
+
}
|
|
3271
|
+
else {
|
|
3272
|
+
return [];
|
|
3273
|
+
}
|
|
3274
|
+
};
|
|
3275
|
+
SlateEditableComponent.prototype.generateDecorations = function () {
|
|
3276
|
+
var decorations = this.decorate([this.editor, []]);
|
|
3277
|
+
var placeholderDecorations = this.isComposing
|
|
3278
|
+
? []
|
|
3279
|
+
: this.composePlaceholderDecorate(this.editor);
|
|
3280
|
+
decorations.push.apply(decorations, __spreadArray([], __read(placeholderDecorations)));
|
|
3281
|
+
return decorations;
|
|
3282
|
+
};
|
|
3303
3283
|
//#region event proxy
|
|
3304
3284
|
SlateEditableComponent.prototype.addEventListener = function (eventName, listener, target) {
|
|
3305
3285
|
var _this = this;
|
|
@@ -3520,6 +3500,8 @@
|
|
|
3520
3500
|
// so we need avoid repeat isnertText by isComposing === true,
|
|
3521
3501
|
this.isComposing = false;
|
|
3522
3502
|
}
|
|
3503
|
+
this.detectContext();
|
|
3504
|
+
this.cdr.detectChanges();
|
|
3523
3505
|
};
|
|
3524
3506
|
SlateEditableComponent.prototype.onDOMCompositionStart = function (event) {
|
|
3525
3507
|
var selection = this.editor.selection;
|
|
@@ -3533,6 +3515,8 @@
|
|
|
3533
3515
|
if (hasEditableTarget(this.editor, event.target) && !this.isDOMEventHandled(event, this.compositionStart)) {
|
|
3534
3516
|
this.isComposing = true;
|
|
3535
3517
|
}
|
|
3518
|
+
this.detectContext();
|
|
3519
|
+
this.cdr.detectChanges();
|
|
3536
3520
|
};
|
|
3537
3521
|
SlateEditableComponent.prototype.onDOMCopy = function (event) {
|
|
3538
3522
|
var window = AngularEditor.getWindow(this.editor);
|
|
@@ -3802,6 +3786,25 @@
|
|
|
3802
3786
|
return;
|
|
3803
3787
|
}
|
|
3804
3788
|
}
|
|
3789
|
+
else {
|
|
3790
|
+
if (IS_CHROME || IS_SAFARI) {
|
|
3791
|
+
// COMPAT: Chrome and Safari support `beforeinput` event but do not fire
|
|
3792
|
+
// an event when deleting backwards in a selected void inline node
|
|
3793
|
+
if (selection &&
|
|
3794
|
+
(hotkeys.isDeleteBackward(nativeEvent) ||
|
|
3795
|
+
hotkeys.isDeleteForward(nativeEvent)) &&
|
|
3796
|
+
slate.Range.isCollapsed(selection)) {
|
|
3797
|
+
var currentNode = slate.Node.parent(editor, selection.anchor.path);
|
|
3798
|
+
if (slate.Element.isElement(currentNode) &&
|
|
3799
|
+
slate.Editor.isVoid(editor, currentNode) &&
|
|
3800
|
+
slate.Editor.isInline(editor, currentNode)) {
|
|
3801
|
+
event.preventDefault();
|
|
3802
|
+
slate.Editor.deleteBackward(editor, { unit: 'block' });
|
|
3803
|
+
return;
|
|
3804
|
+
}
|
|
3805
|
+
}
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3805
3808
|
}
|
|
3806
3809
|
catch (error) {
|
|
3807
3810
|
this.editor.onError({ code: exports.SlateErrorCode.OnDOMKeydownError, nativeError: error });
|
|
@@ -3836,7 +3839,7 @@
|
|
|
3836
3839
|
if (!slate.Range.isCollapsed(this.editor.selection)) {
|
|
3837
3840
|
slate.Editor.deleteFragment(this.editor);
|
|
3838
3841
|
}
|
|
3839
|
-
// just handle Non-IME input
|
|
3842
|
+
// just handle Non-IME input
|
|
3840
3843
|
if (!this.isComposing) {
|
|
3841
3844
|
slate.Editor.insertText(this.editor, text);
|
|
3842
3845
|
}
|
|
@@ -3865,11 +3868,11 @@
|
|
|
3865
3868
|
return SlateEditableComponent;
|
|
3866
3869
|
}());
|
|
3867
3870
|
SlateEditableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: SlateEditableComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.Renderer2 }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3868
|
-
SlateEditableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: SlateEditableComponent, selector: "slate-editable", inputs: { editor: "editor", renderElement: "renderElement", renderLeaf: "renderLeaf", renderText: "renderText", decorate: "decorate", isStrictDecorate: "isStrictDecorate", trackBy: "trackBy", readonly: "readonly", beforeInput: "beforeInput", blur: "blur", click: "click", compositionEnd: "compositionEnd", 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: [{
|
|
3871
|
+
SlateEditableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: SlateEditableComponent, selector: "slate-editable", inputs: { editor: "editor", renderElement: "renderElement", renderLeaf: "renderLeaf", renderText: "renderText", decorate: "decorate", placeholderDecorate: "placeholderDecorate", isStrictDecorate: "isStrictDecorate", trackBy: "trackBy", readonly: "readonly", placeholder: "placeholder", beforeInput: "beforeInput", blur: "blur", click: "click", compositionEnd: "compositionEnd", 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: [{
|
|
3869
3872
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
3870
3873
|
useExisting: i0.forwardRef(function () { return SlateEditableComponent; }),
|
|
3871
3874
|
multi: true
|
|
3872
|
-
}], viewQueries: [{ propertyName: "templateComponent", first: true, predicate: ["templateComponent"], descendants: true, static: true }, { propertyName: "templateElementRef", first: true, predicate: ["templateComponent"], descendants: true, read: i0.ElementRef, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<slate-children [children]=\"editor.children\" [context]=\"context\" [viewContext]=\"viewContext\"
|
|
3875
|
+
}], viewQueries: [{ propertyName: "templateComponent", first: true, predicate: ["templateComponent"], descendants: true, static: true }, { propertyName: "templateElementRef", first: true, predicate: ["templateComponent"], descendants: true, read: i0.ElementRef, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<slate-children [children]=\"editor.children\" [context]=\"context\" [viewContext]=\"viewContext\"></slate-children>\n<slate-string-template #templateComponent></slate-string-template>", components: [{ type: SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: SlateStringTemplateComponent, selector: "slate-string-template" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
3873
3876
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: SlateEditableComponent, decorators: [{
|
|
3874
3877
|
type: i0.Component,
|
|
3875
3878
|
args: [{
|
|
@@ -3900,12 +3903,16 @@
|
|
|
3900
3903
|
type: i0.Input
|
|
3901
3904
|
}], decorate: [{
|
|
3902
3905
|
type: i0.Input
|
|
3906
|
+
}], placeholderDecorate: [{
|
|
3907
|
+
type: i0.Input
|
|
3903
3908
|
}], isStrictDecorate: [{
|
|
3904
3909
|
type: i0.Input
|
|
3905
3910
|
}], trackBy: [{
|
|
3906
3911
|
type: i0.Input
|
|
3907
3912
|
}], readonly: [{
|
|
3908
3913
|
type: i0.Input
|
|
3914
|
+
}], placeholder: [{
|
|
3915
|
+
type: i0.Input
|
|
3909
3916
|
}], beforeInput: [{
|
|
3910
3917
|
type: i0.Input
|
|
3911
3918
|
}], blur: [{
|