feat: implement bridge-ui React hooks (Feature 8) - #4
Merged
Conversation
Add usePrimaryCta, useSecondaryCta, and useActionsMenu React hooks that wrap the app-bridge sendToParent() into a declarative API for apps embedded in the Assembly dashboard iframe. Entry point renamed from assembly-kit/react to assembly-kit/bridge-ui. Updated all docs, config, and README with schemas/app-bridge/bridge-ui usage examples. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add isAllowedOrigin helper that checks event.origin against DASHBOARD_DOMAINS or the provided portalUrl. Extract ensureHttps into a shared module for reuse. Destructure opts into primitives to avoid stale closure issues in useEffect dependencies. Clarify useActionsMenu JSDoc that onClick is a dashboard-handled string identifier, not a local callback. Disable oxc/no-barrel-file globally instead of per-file overrides. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
usePrimaryCta,useSecondaryCta, anduseActionsMenuReact hooks undersrc/bridge-ui/that wrapsendToParent()into a declarative API for iframe-embedded Assembly appsassembly-kit/reacttoassembly-kit/bridge-uiacross all config and docsreact >= 18as optional peer dependency,react+@types/reactas dev dependenciesDASHBOARD_DOMAINSorportalUrlto prevent cross-frame injectionensureHttpsand addisAllowedOriginas shared app-bridge utilitiesoxc/no-barrel-fileglobally instead of per-file overridesTest plan
bun run type-checkpassesbun run lintpasses (0 errors)bun run buildsucceeds — producesdist/bridge-ui/index.js+dist/bridge-ui/index.d.tsbun test— 127 tests pass, 0 failuresassembly-kit/bridge-uiresolves in a consuming project🤖 Generated with Claude Code