-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): collect and recreate fragments
- Loading branch information
1 parent
327b525
commit 69db46e
Showing
16 changed files
with
397 additions
and
86 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
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,37 @@ | ||
import AwaitedPath from 'awaited-dom/base/AwaitedPath'; | ||
import { ISuperElement } from 'awaited-dom/base/interfaces/super'; | ||
import FrozenTab from './FrozenTab'; | ||
import { createInstanceWithNodePointer } from './SetupAwaitedHandler'; | ||
import { getState as getFrozenFrameState } from './FrozenFrameEnvironment'; | ||
import INodePointer from 'awaited-dom/base/INodePointer'; | ||
import StateMachine from 'awaited-dom/base/StateMachine'; | ||
import IAwaitedOptions from '../interfaces/IAwaitedOptions'; | ||
|
||
const awaitedPathState = StateMachine< | ||
any, | ||
{ awaitedPath: AwaitedPath; awaitedOptions: IAwaitedOptions; nodePointer?: INodePointer } | ||
>(); | ||
|
||
export default class Fragment { | ||
public element: ISuperElement; | ||
public name: string; | ||
|
||
readonly #nodePointer: INodePointer; | ||
readonly #frozenTab: FrozenTab; | ||
|
||
constructor(frozenTab: FrozenTab, name: string, nodePointer: INodePointer) { | ||
this.name = name; | ||
this.#frozenTab = frozenTab; | ||
this.#nodePointer = nodePointer; | ||
this.element = createInstanceWithNodePointer( | ||
awaitedPathState, | ||
new AwaitedPath(null), | ||
getFrozenFrameState(frozenTab.mainFrameEnvironment), | ||
nodePointer, | ||
); | ||
} | ||
|
||
public close(): Promise<void> { | ||
return this.#frozenTab.close(); | ||
} | ||
} |
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.