-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: fix the UI/UX of ContextPanel and DOMInspectAgent
- stop click event propagation in the ContextPanel to avoid closing other popover components - darken the box-shadow color of ContextPanel - refactor the exports of inspect and fiber utils - fix the type-infer of InspectAgents in Inspector parameters
- Loading branch information
Showing
37 changed files
with
482 additions
and
284 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 |
---|---|---|
|
@@ -10,3 +10,4 @@ build | |
|
||
**/.stories/components/ | ||
**/components/logos/ | ||
**/components/icons/ |
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,2 +1,3 @@ | ||
.next | ||
next-env.d.ts | ||
/out |
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,2 @@ | ||
src/.stories/ | ||
src/**/*.stories.* |
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 @@ | ||
export * from './inspect-agent' |
45 changes: 45 additions & 0 deletions
45
packages/inspector/src/Inspector/services/inspect-agent.ts
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,45 @@ | ||
import type { | ||
InspectAgent, | ||
InspectChainGenerator, | ||
} from '../types' | ||
|
||
|
||
export function * elementsChainGenerator<Element = unknown>({ | ||
agent, | ||
agents, | ||
element, | ||
generateElement, | ||
}: { | ||
agent: InspectAgent<Element>; | ||
agents: InspectAgent<Element>[]; | ||
element: Element; | ||
generateElement: <Element = unknown>(agent: InspectAgent<Element>, element: Element) => InspectChainGenerator<Element>; | ||
}): InspectChainGenerator<Element> { | ||
const generator = generateElement(agent, element) | ||
while (true) { | ||
const next = generator.next() | ||
if (!next.done) { | ||
yield next.value | ||
continue | ||
} | ||
|
||
if (!next.value) { | ||
return | ||
} | ||
|
||
for (const agent of agents) { | ||
if (!agent.isAgentElement(next.value)) { | ||
continue | ||
} | ||
yield * elementsChainGenerator({ | ||
agent, | ||
agents, | ||
element: next.value, | ||
generateElement, | ||
}) | ||
return | ||
} | ||
|
||
return | ||
} | ||
} |
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.