-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "feat(core): remove slate-children/slate-leaves/SlateChildren/…
…SlateLeaves"
- Loading branch information
1 parent
d884a25
commit e2cb948
Showing
10 changed files
with
77 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"slate-angular": patch | ||
--- | ||
|
||
Revert "feat(core): remove slate-children/slate-leaves/SlateChildren/SlateLeaves" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; | ||
import { Descendant } from 'slate'; | ||
import { SlateChildrenContext, SlateViewContext } from '../../view/context'; | ||
import { ViewContainer } from '../../view/container'; | ||
import { NgFor } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'slate-children', | ||
template: ``, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true | ||
}) | ||
export class SlateChildren extends ViewContainer<any> { | ||
@Input() children: Descendant[]; | ||
|
||
@Input() context: SlateChildrenContext; | ||
|
||
@Input() viewContext: SlateViewContext; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
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 | ||
standalone: true, | ||
imports: [SlateChildren] | ||
}) | ||
export class SlateDefaultElement extends BaseElementComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
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 | ||
standalone: true, | ||
imports: [SlateChildren] | ||
}) | ||
export class SlateElement extends BaseElementComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { | ||
AfterViewInit, | ||
ChangeDetectionStrategy, | ||
Component, | ||
Input, | ||
OnChanges, | ||
OnInit, | ||
QueryList, | ||
SimpleChanges, | ||
ViewChildren | ||
} from '@angular/core'; | ||
import { Text } from 'slate'; | ||
import { SlateLeafContext, SlateTextContext } from '../../view/context'; | ||
import { ViewContainer } from '../../view/container'; | ||
import { NgFor } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'slate-leaves', | ||
template: ``, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [NgFor] | ||
}) | ||
export class SlateLeaves extends ViewContainer<any> { | ||
initialized = false; | ||
leafContexts: SlateLeafContext[]; | ||
leaves: Text[]; | ||
|
||
@Input() context: SlateTextContext; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters