-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #663 from exadel-inc/bugfix/update-isolation-behav…
…iours fix: update isolation behavior and overall bugfixes
- Loading branch information
Showing
13 changed files
with
134 additions
and
37 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
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,39 @@ | ||
import {overrideEvent} from '@exadel/esl/modules/esl-utils/dom'; | ||
|
||
import type {UIPPlugin} from './plugin'; | ||
import type {UIPRoot} from './root'; | ||
import type {UIPStateModel} from './model'; | ||
|
||
export type UIPChangeInfo = { | ||
modifier: UIPPlugin | UIPRoot; | ||
type: 'html' | 'js'; | ||
}; | ||
|
||
export class UIPChangeEvent extends Event { | ||
public readonly target: UIPRoot; | ||
|
||
public constructor( | ||
type: string, | ||
target: UIPRoot, | ||
public readonly changes: UIPChangeInfo[] | ||
) { | ||
super(type, {bubbles: false, cancelable: false}); | ||
overrideEvent(this, 'target', target); | ||
} | ||
|
||
public get model(): UIPStateModel { | ||
return this.target.model; | ||
} | ||
|
||
public get jsChanges(): UIPChangeInfo[] { | ||
return this.changes.filter((change) => change.type === 'js'); | ||
} | ||
|
||
public get htmlChanges(): UIPChangeInfo[] { | ||
return this.changes.filter((change) => change.type === 'html'); | ||
} | ||
|
||
public isOnlyModifier(modifier: UIPPlugin | UIPRoot): boolean { | ||
return this.changes.every((change) => change.modifier === modifier); | ||
} | ||
} |
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
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
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
Oops, something went wrong.