feat(core): add getStyledPassageElement for vanilla Bible HTML (YPE-5721) - #392
Closed
cameronapak wants to merge 4 commits into
Closed
feat(core): add getStyledPassageElement for vanilla Bible HTML (YPE-5721)#392cameronapak wants to merge 4 commits into
cameronapak wants to merge 4 commits into
Conversation
Co-authored-by: Cameron Pak <cameronandrewpak@gmail.com>
🦋 Changeset detectedLatest commit: 9bd7461 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Land the Fonts API stylesheet URL helper from PR 391 so partners can build CDN font stylesheet URLs from an app key and font id.
Return a detached styled Bible passage element for vanilla JS partners, injecting CDN bible.css and the Fonts API stylesheet once per document.
Narrow the sibling module surface so only the assemble path is imported by BibleClient; helpers stay unexported from the package entry.
Collaborator
Author
|
I've decided this isn't needed at this time. We can teach users how to import the CSS files manually. I'd rather not deploy another impure function |
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.
Closes YPE-5721.
Summary
Adds
BibleClient.getStyledPassageElement({ versionId, usfm, fontId? })so vanilla JS partners can append a styled Scripture DOM node without assembling Bible CSS, font stylesheet URLs, or copyright markup themselves.Also lands
getFontStylesheetUrlfrom closed (unmerged) PR #391 so this helper can reuse the Fonts API URL builder. That helper stays public.Status
getFontStylesheetUrl(from PR feat(core): add getFontStylesheetUrl helper #391) merged onto this branchgetStyledPassageElement+ tests + changeset (in progress)Behavior
getPassage(html + transform default) andgetVersiondata-yv-sdkanddata-slot="yv-bible-renderer"innerHTML; copyright viatextContent(""if missing)bible.css+ font stylesheet intodocument.headonce (deduped by href)appKey/apiHostfrom the existingApiClient; defaultfontIdis1documentis missingOut of scope
getFontStylesheetUrlAPI from PR feat(core): add getFontStylesheetUrl helper #391Test plan
documentthrows; refuse/API errors propagate; optionalfontIdchanges font href onlypnpm --filter @youversion/platform-core test@youversion/platform-core