Document page and visitor context in webframes#1230
Open
gregberge wants to merge 3 commits into
Open
Conversation
Add the site:page:context scope (and the previously undocumented site:visitor:claims) and document that webframes receive state.page ({ id, path, title }) and state.visitor through the postMessage state, in the interactivity guides and the ContentKit component reference.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
commit: |
Per review, the current page is exposed to webframes without a dedicated scope, so remove site:page:context from the scopes list and reword the interactivity and reference docs (page is always available; visitor claims still need site:visitor:claims). Also document the @webframe.navigate action for navigating to another page in the site. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The @webframe.navigate path is resolved relative to the site root, so it can target any section or space. Co-Authored-By: Claude Opus 4.8 <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.
What
Documents how integration webframes receive contextual data and can navigate, via the postMessage
state/ actions:state.page— the current page as{ id, path, title }. Always available (no scope).state.visitor— visitor claims, with the existingsite:visitor:claimsscope (previously undocumented).@webframe.navigate— navigate the reader to another page in the site.Why
Part of RND-11604. Frontend implementation: GitbookIO/gitbook#4362.
Changes
configurations.md: document the existingsite:visitor:claimsscope (no new scope added).contentkit/interactivity.md+guides/interactivity.md: new "Page and visitor context" and "Navigating to another page" sections.development/contentkit/reference.md: note the reservedstatekeys and the navigate action in thewebframereference.Docs-only; no changeset (docs are not a versioned package in this repo).
🤖 Generated with Claude Code