Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: integrate an InspectContextPanel to show element hierarchy triggered by right-click on inspecting #174

Merged
merged 23 commits into from
Jul 6, 2024

Conversation

zthxxx
Copy link
Owner

@zthxxx zthxxx commented Jul 6, 2024

Note

Beta version in v2.1.0-beta.9, try with Showcase or:

npm i -D react-dev-inspector@v2.1.0-beta.9
# and also upgrade any `@react-dev-inspector/*` packages you used like:
npm i -D @react-dev-inspector/middleware@v2.1.0-beta.9

Resolves #158, resolves #160, resolves #166, resolves #173

Preview

inspect-context-panel.png

inspector.mp4

Features

  • Added an InspectContextPanel triggered by right-click inspection.
  • Enabled setting custom InspectAgent to work alongside the default DOMInspectAgent.
  • Added @react-dev-inspector/web-components package:
    • Exported Overlay (inspector UI), supporting custom boxSizing and bounding.
    • Exported InspectContextPanel component, a draggable and resizable floating context menu.
  • Exported utilities for accessing React fiber (fiberUtils) and assisting with inspection (inspectUtils), useful for custom InspectAgent.

Refactor

  • Refactored Inspector implementation to DOMInspectAgent, supporting custom InspectAgent.
  • Rewrote Overlay as WebComponents using solidjs.
  • Used @floating-ui/core for OverlayTip to compute positions.
  • Added @react-dev-inspector/launch-editor-endpoint, separating endpoint and types from middleware package:
    • Replaced react-dev-utils with launch-editor for middleware.
    • Changed middleware endpoint from /__open-stack-frame-in-editor to /__inspect-open-in-editor.
  • Moved v1 compatible plugins in package.json from dependencies to peerDependencies and marked as optional.
  • Added exports field to package.json.

- make ContextPanel draggable and resizable
…brary

- completely compile tailwindcss and embed it in solidjs web-components
- refactor the rollup config file to typescript
…nent

- add `@react-dev-inspector/launch-editor-endpoint`, split endpoint and types from middleware
- replace `react-dev-utils` with `launch-editor`
- replace middleware endpoint from `/__open-stack-frame-in-editor` to `/__inspect-open-in-editor`
- theme dark mode support media query with prefers-color-scheme
- add chosen editor params to Inspector callbacks
- add hover indication of floating layers in ContextPanel
- 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
Copy link

vercel bot commented Jul 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-dev-inspector ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 6, 2024 8:56am

Copy link
Owner Author

zthxxx commented Jul 6, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @zthxxx and the rest of your teammates on Graphite Graphite

@zthxxx zthxxx changed the title docs: replace demo preview gif to video feat: integrate an InspectContextPanel to show elements trigger by right-click inspect Jul 6, 2024
@zthxxx zthxxx changed the title feat: integrate an InspectContextPanel to show elements trigger by right-click inspect feat: integrate an InspectContextPanel to show elements heirarcy trigger by right-click inspect Jul 6, 2024
@zthxxx zthxxx changed the title feat: integrate an InspectContextPanel to show elements heirarcy trigger by right-click inspect feat: integrate an InspectContextPanel to show elements heirarchy trigger by right-click inspect Jul 6, 2024
@zthxxx zthxxx changed the title feat: integrate an InspectContextPanel to show elements heirarchy trigger by right-click inspect feat: integrate an InspectContextPanel to show elements herarchy trigger by right-click inspect Jul 6, 2024
@zthxxx zthxxx changed the title feat: integrate an InspectContextPanel to show elements herarchy trigger by right-click inspect feat: integrate an InspectContextPanel to show elements hierarchy trigger by right-click inspect Jul 6, 2024
@zthxxx zthxxx changed the title feat: integrate an InspectContextPanel to show elements hierarchy trigger by right-click inspect feat: integrate an InspectContextPanel to show element hierarchy trigger by right-click on inspecting Jul 6, 2024
@zthxxx zthxxx changed the title feat: integrate an InspectContextPanel to show element hierarchy trigger by right-click on inspecting feat: integrate an InspectContextPanel to show element hierarchy triggered by right-click on inspecting Jul 6, 2024
@zthxxx zthxxx added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 6, 2024 — with Graphite App
@zthxxx zthxxx marked this pull request as ready for review July 6, 2024 08:12
@zthxxx zthxxx force-pushed the pr/elements-chain branch from c623d30 to a20f0fe Compare July 6, 2024 08:19
@zthxxx zthxxx force-pushed the pr/elements-chain branch from a20f0fe to 0a99ef2 Compare July 6, 2024 08:32
@zthxxx zthxxx force-pushed the pr/elements-chain branch from 0a99ef2 to f7e44cb Compare July 6, 2024 08:48
@zthxxx zthxxx merged commit 5b27419 into dev Jul 6, 2024
4 checks passed
@zthxxx zthxxx deleted the pr/elements-chain branch July 6, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment