Skip to content

Commit

Permalink
feat(core): remove slate-children/slate-leaves/SlateChildren/SlateLeaves
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the code segment using slate-children/slate-leaves/SlateChildren/SlateLeaves need been removed
  • Loading branch information
pubuzhixing8 committed May 28, 2024
1 parent b80023a commit 5ea935f
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 72 deletions.
7 changes: 7 additions & 0 deletions .changeset/happy-knives-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"slate-angular": minor
---

remove slate-children/slate-leaves/SlateChildren/SlateLeaves

BREAKING CHANGE: the code segment using slate-children/slate-leaves/SlateChildren/SlateLeaves need been removed
19 changes: 0 additions & 19 deletions packages/src/components/children/children.component.ts

This file was deleted.

5 changes: 2 additions & 3 deletions packages/src/components/editable/editable.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { SlateChildrenContext, SlateViewContext } from '../../view/context';
import { ComponentType, ViewType } from '../../types/view';
import { HistoryEditor } from 'slate-history';
import { isDecoratorRangeListEqual, check, normalize } from '../../utils';
import { isDecoratorRangeListEqual } from '../../utils';
import { SlatePlaceholder } from '../../types/feature';
import { restoreDom } from '../../utils/restore-dom';
import { SlateChildren } from '../children/children.component';
import { SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN } from '../element/default-element.component.token';
import { SLATE_DEFAULT_TEXT_COMPONENT_TOKEN, SLATE_DEFAULT_VOID_TEXT_COMPONENT_TOKEN } from '../text/token';
import { SlateVoidText } from '../text/void-text.component';
Expand Down Expand Up @@ -109,7 +108,7 @@ const forceOnDOMPaste = IS_SAFARI;
}
],
standalone: true,
imports: [SlateChildren, SlateStringTemplate]
imports: [SlateStringTemplate]
})
export class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewChecked, DoCheck {
viewContext: SlateViewContext;
Expand Down
4 changes: 1 addition & 3 deletions packages/src/components/element/default-element.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { BaseElementComponent } from '../../view/base';
import { SlateChildren } from '../children/children.component';

@Component({
selector: 'div[slateDefaultElement]',
template: ``,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [SlateChildren]
standalone: true
})
export class SlateDefaultElement extends BaseElementComponent {}
4 changes: 1 addition & 3 deletions packages/src/components/element/element.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { BaseElementComponent } from '../../view/base';
import { SlateChildren } from '../children/children.component';

@Component({
selector: '[slateElement]',
template: '<ng-content></ng-content>',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [SlateChildren]
standalone: true
})
export class SlateElement extends BaseElementComponent {}
30 changes: 0 additions & 30 deletions packages/src/components/leaves/leaves.component.ts

This file was deleted.

4 changes: 1 addition & 3 deletions packages/src/components/text/default-text.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { BaseTextComponent } from '../../view/base';
import { SlateLeaves } from '../leaves/leaves.component';

@Component({
selector: 'span[slateDefaultText]',
Expand All @@ -9,7 +8,6 @@ import { SlateLeaves } from '../leaves/leaves.component';
host: {
'data-slate-node': 'text'
},
standalone: true,
imports: [SlateLeaves]
standalone: true
})
export class SlateDefaultText extends BaseTextComponent {}
5 changes: 1 addition & 4 deletions packages/src/components/text/void-text.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Component, ChangeDetectionStrategy, OnInit, OnChanges } from '@angular/core';
import { BaseTextComponent } from '../../view/base';
import { AngularEditor } from '../../plugins/angular-editor';
import { SlateLeaves } from '../leaves/leaves.component';

@Component({
selector: 'span[slateVoidText]',
Expand All @@ -12,8 +10,7 @@ import { SlateLeaves } from '../leaves/leaves.component';
class: 'slate-spacer',
'data-slate-node': 'text'
},
standalone: true,
imports: [SlateLeaves]
standalone: true
})
export class SlateVoidText extends BaseTextComponent implements OnInit, OnChanges {
ngOnInit() {
Expand Down
6 changes: 1 addition & 5 deletions packages/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import { SlateElement } from './components/element/element.component';
import { SlateDefaultElement } from './components/element/default-element.component';
import { SlateString } from './components/string/string.component';
import { SlateStringTemplate } from './components/string/template.component';
import { SlateChildren } from './components/children/children.component';
import { SlateChildrenOutlet } from './components/children/children-outlet.component';
import { SlateBlockCard } from './components/block-card/block-card.component';
import { SlateDefaultLeaf } from './components/leaf/default-leaf.component';
import { SlateLeaves } from './components/leaves/leaves.component';
import { SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN } from './components/element/default-element.component.token';
import { SlateDefaultString } from './components/string/default-string.component';

Expand All @@ -25,14 +23,12 @@ import { SlateDefaultString } from './components/string/default-string.component
SlateDefaultText,
SlateString,
SlateStringTemplate,
SlateChildren,
SlateBlockCard,
SlateLeaves,
SlateDefaultLeaf,
SlateDefaultString,
SlateChildrenOutlet
],
exports: [SlateEditable, SlateChildren, SlateChildrenOutlet, SlateElement, SlateLeaves, SlateString, SlateDefaultString],
exports: [SlateEditable, SlateChildrenOutlet, SlateElement, SlateString, SlateDefaultString],
providers: [
{
provide: SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN,
Expand Down
2 changes: 0 additions & 2 deletions packages/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ export * from './components/editable/editable.component';
export * from './components/element/element.component';
export * from './components/string/string.component';
export * from './components/string/default-string.component';
export * from './components/children/children.component';
export * from './components/children/children-outlet.component';
export * from './components/leaves/leaves.component';
export * from './module';
export * from './types/error';
export * from './view/base';
Expand Down

0 comments on commit 5ea935f

Please sign in to comment.